instruction
stringlengths
0
29.8k
⌀
null
My understanding is an "Enumerator" is a Turing Machine that: instead of taking an input string, then going through a series of transitions and "halting" or "not halting" on it, it does not accept any input string and it starts with a blank string and builds the final string according to the rules of the language Fo...
Is Enumerator a variant of Turing machine that starts with empty string and builds according to the description of language
|turing-machines|recursively-enumerable|
I have a graph of vertices and connected edges as shown in the image below. I have a function that iterates from every single vertex and finds closed loops in order to find all polygons in the graph. Here is an example of my graph which has found all the polygons in the graph: [![enter image description here]...
I am having a problem understanding the following: This is the background of the lemma: > To prove the lower bounds, we use the classical lower bound construction from [5, 9]. We have an input instance L with three regions of items. In the first region, there are items of size close to 1/6, in the second region...
null
null
null
It is not possible to describe the subset of functions that represent the running time of valid Turing machines in terms of pure mathematics, without reference to the concept of a Turing machine. This is because the concept of a Turing machine is fundamental to the definition of this subset of functions. A Turing ma...
Your idea of "an enumerator" is pretty good. In fact, you have recovered the origin of the term "recursively enumerable" as explained in the textbook *Introduction to the Theory of Computation* by Michael Sipser. > **ENUMERATORS** > >As we mentioned earlier, some people use the term recursively enumerable lan...
null
Can we prove that any set of finite strings without substrings is finite?
null
I want to prove (or disprove) the following conjecture: > Let $\Sigma$ be a finite alphabet, and let $L \subseteq \Sigma^*$ > satisfy that there are no $v, w \in L$ such that $v$ is a proper > substring of $w$. Then $L$ is finite. I have the intuition that this is true, haven't been able to find a counter examp...
> I have a graph ... I read that as "a _planar_ graph". You didn't describe your analysis data structures, so I will make some assumptions. Let U be the initial undirected graph, and G the corresponding digraph where each edge becomes a pair of edges, forward + backward. Now we have suitable input for a pyth...
> I have a graph ... I read that as "a _planar_ graph". You didn't describe your analysis data structures, so I will make some assumptions. Let U be the initial undirected graph, and G the corresponding digraph where each edge becomes a pair of edges, forward + backward. Now we have suitable input for a pyth...
> I have a graph ... I read that as "a _planar_ graph". You didn't describe your analysis data structures, so I will make some assumptions. Let U be the initial undirected graph, and G the corresponding digraph where each edge becomes a pair of edges, forward + backward. Now we have suitable input for a pyth...
> I have a graph ... I read that as "a _planar_ graph". You didn't describe your analysis data structures, so I will make some assumptions. Let U be the initial undirected graph, and G the corresponding digraph where each edge becomes a pair of edges, forward + backward. Now we have suitable input for a pyth...
> I have a graph ... I read that as "a _planar_ graph". You didn't describe your analysis data structures, so I will make some assumptions. Let U be the initial undirected graph, and G the corresponding digraph where each edge becomes a pair of edges, forward + backward. Now we have suitable input for a pyth...
null
There are several strategies for handling writes, most common are "write-thru" vs. "write-back" and "allocate on write" vs "non alloocate on write". - When a write access hits the cache, either only the cache is updated, this is "write back", or the write operation is forwarded to main memory, this is "write thru". ...
{"Voters":[{"Id":755,"DisplayName":"D.W."}],"SiteSpecificCloseReasonIds":[]}
### Can we just use the median of medians of these arrays? One strategy is to find the median of medians of these arrays, name it $x$. At least $T/4$ elements are less than $x$, and at least $T/4$ elements are greater than $x$, where $T$ is the number of all elements. Assume $k<T/2$. Then we can delete those $T/4$ ...
null
This is an old question, but I don't think any of the other answers quite explain what the text is saying. A word is typically smaller than a cache line; a system might, for example, have words that are 8 bytes in size, but L1 cache lines that are 64 bytes in size. A write of a word means overwriting some portion of...
null
"DeepMind has predicted the structure of almost every protein so far catalogued by science, cracking one of the grand challenges of biology in just 18 months thanks to an artificial intelligence called AlphaFold", reads [newscientist.com](https://www.newscientist.com/article/2330866-deepminds-protein-folding-ai-cracks-...
Protein folding, P vs. NP, and DeepMind with AlphaFold
|algorithm-analysis|np-complete|artificial-intelligence|
Let's say we have a NFA as follows: [![enter image description here][1]][1] It has 3 states, q1 - q2 - q3 and can make transition from q1 to q2 on 0 or epsilon and from q2 to q3 on 1 or epsilon My question is do we take epsilon transition before reading input or after reading input and after reading the input,...
Confusing regarding "epsilon" transition in NFAs
|automata|finite-automata|nondeterminism|
It happens both before *and* after. Remember this is a *non-deterministic* automaton. Any time there is an epsilon transition, the automaton can either take that transition, or not take it -- it's a free choice. The automaton has the choice to do so before reading anything, and after, and in between reading every ...
OpenAI's Chat-GPT told me: There is no known exact algorithm for finding the largest bipartite subgraph in a graph in polynomial time. This problem is generally believed to be NP-hard, which means that there is no known polynomial-time algorithm for solving it. Is this correct?
Searching for the largest bipartite subgraph
|graphs|np-hard|bipartite-graph|
Garey and Johnson (Computers and intractability) states that the [subgraph isomorphism problem](https://en.wikipedia.org/wiki/Subgraph_isomorphism_problem) is $\mathsf{NP}$-complete, and contains several special cases, like Clique, Complete bipartite, Hamiltonian cycle or Hamiltonian path. If you could find the larg...
null
Not sure why you would go straight to CFGs to resolve this when most flowcharts can be represented as rational functions, AKA finite-state transducers. These can be expressed as regular patterns: considering your diagram, it would be expressed as ``` ((1, print['1']) | (2, print['2']) | (3, end)) ``` Looping const...
null
null
null
You can observe that $L$ is accepted by this infinite DFA $\mathcal{A}$[![$\mathcal{A}$][1]][1] <sub>(source: [jep at www.liafa.univ-paris-diderot.fr](https://www.liafa.univ-paris-diderot.fr/~jep/StackExchange/Images/NonRegularNerode.jpg))</sub> . This might help you to separate the words $0^i$, as suggested by Yuv...
null
You can observe that $L$ is accepted by this infinite DFA $\mathcal{A}$[![$\mathcal{A}$][1]][1] <sub>(source: [jep at www.irif.fr/](https://www.irif.fr/~jep/StackExchange/Images/NonRegularNerode.jpg))</sub> This might help you to separate the words $0^i$, as suggested by Yuval Filmus. By the way, this will a...
Confusion regarding "epsilon" transition in NFAs, whether taking epsilon before or after reading the input affects the final states
null
Trying to solve an ILP optimization problem with a number of potential boolean variables and then express constraints on these variables based on those boolean results. Let's say I am doing 5 coin flips and allowing people to choose heads or tails for each coin flip. They are able to choose one or two specific flips...
Boolean Integer Linear Optimization/Programming
|optimization|linear-programming|boolean-algebra|integer-programming|
Trying to solve an ILP optimization problem with a number of potential boolean variables and then express constraints on these variables based on those boolean results. Let's say I am doing 5 coin flips and allowing people to choose heads or tails for each coin flip. They are able to choose one or more specific flip...
null
When I want to judge whether two regular forms represent the same language, I have learned the next method: 1. create the (non-deterministic) finite-state automaton which accepts the language the given regular form represents for two regular forms respectively. 2. convert the two NFA into DFAs. 3. Judge whethe...
Automaton: Are there algorithms to judge whether two automatons are isomorphic?
|automata|finite-automata|graph-isomorphism|
I am reading Michael Sipser's "Introduction to theory of computation" 3rd edition, page 55 - 56, the topic "equivalence of DFAs and NFAs" 1) ***Case 0:*** Michael Sipser asks us to handle the transition function of "non epsilon NFAs" as follows: δ'( R, a ) = $\bigcup_{_{r \epsilon R}}^{}δ(r, a)$ 2) ***Case 1:*** ...
Conversion of epsilon NFA to DFA, handling epsilon transitions
|automata|finite-automata|nondeterminism|
null
I stumbled across this game in Simon Tatham's puzzle app. It's called cube. The description according to the game is: > You have a grid of 16 squares, six of which are blue; on one square rests a cube. Your move is to use the arrow keys to roll the cube through 90 degrees so that it moves to an adjacent square. If y...
Paint a Cube by rolling it (Puzzle Algorithm)
|algorithms|board-games|group-theory|
I am reading Michael Sipser's "Introduction to theory of computation" 3rd edition, page 55 - 56, the topic "equivalence of DFAs and NFAs" 1) ***Case 0:*** Michael Sipser asks us to handle the transition function of "non epsilon NFAs" as follows: δ'( R, a ) = $\bigcup_{_{r \epsilon R}}^{}δ(r, a)$ 2) ***Case 1:*** ...
I think your confusion is with Sipser's comment that you can convert an NFA with $\varepsilon$ to a DFA by either reading an input first then you compute the epsilon closure or by computing the epsilon closure first before reading an input. To clarify that, yes you can do both. However, Sipser might have not mentioned ...
I think your confusion is with Sipser's comment that you can convert an NFA with $\varepsilon$ to a DFA by either reading an input first then you compute the epsilon closure or by computing the epsilon closure first before reading an input. To clarify that, yes you can do both. However, Sipser might have not mentioned ...
The problem of finding a largest bipartite subgraph of a graph is equivalent to the [maximum cut](https://en.wikipedia.org/wiki/Maximum_cut) problem. [Karp](https://en.wikipedia.org/wiki/Karp%27s_21_NP-complete_problems) proved NP-completeness of this problem. That is, this problem is proven NP-hard, not "believed t...
I am reading Michael Sipser's "Introduction to theory of computation" 3rd edition, page 55 - 56, the topic "equivalence of DFAs and NFAs" 1) ***Case 0:*** Michael Sipser asks us to handle the transition function of "non epsilon NFAs" as follows: δ'( R, a ) = $\bigcup_{_{r \epsilon R}}^{}δ(r, a)$ 2) ***Case 1:*** ...
Garey and Johnson (Computers and intractability) states that the [subgraph isomorphism problem](https://en.wikipedia.org/wiki/Subgraph_isomorphism_problem) is $\mathsf{NP}$-complete, and contains several special cases, like Clique, Complete bipartite, Hamiltonian cycle or Hamiltonian path. If you could find the larg...
null
Garey and Johnson (Computers and intractability) states that the [subgraph isomorphism problem](https://en.wikipedia.org/wiki/Subgraph_isomorphism_problem) is $\mathsf{NP}$-complete, and contains several special cases, like Clique, Complete bipartite, Hamiltonian cycle or Hamiltonian path. If you could find the larg...
null
As the title states, I am asked to prove that a directed graph $G=(V,E)$ is strongly connected iff for all non-empty subsets $\emptyset \neq S \subset V$, the cut $\delta(S)=\{(u,v)\in E \ |\ u\in S, v\in V/S\}\neq\emptyset$. I've shown that if $G$ is strongly connected, there has to be atleast 1 (possibly 2) edges ...
A graph is strongly connected iff every non-trivial cut contains an edge
|minimum-cuts|connected-components|
You can prove the existence of a path between any $u$ and $v$ vertices using the following process: - set $S = \{u\}$; - while $S \neq V$ do - for each $(x, y)\in \delta(S)$, add $y$ to $S$ The property "all vertices in $S$ are reachable from $u$" is a loop invariant for the while loop. If you suppose th...
null
The subtlety lies in where the distinction between language and meta-language is made. As [René Magritte](http://en.wikipedia.org/wiki/Ren%C3%A9_Magritte) put it: [![Ceci n'est pas une pipe.](https://upload.wikimedia.org/wikipedia/en/b/b9/MagrittePipe.jpg)](http://en.wikipedia.org/wiki/The_Treachery_of_Images) $(...
null
### Can we just use the median of medians of these arrays? One strategy is to find the median of medians of these arrays, name it $x$. At least $T/4$ elements are less than $x$, and at least $T/4$ elements are greater than $x$, where $T$ is the number of all elements. If $k<T/2$, we can delete those $T/4$ elements ...
null
I'm reading https://ilyasergey.net/CS4212/_static/lectures/PLDI-Week-07-more-parsing.pdf On page 11, there's the definition of Sum Grammar: ``` S -> E + S | E E -> number | (S) ``` Just wondering if this grammar same as follows: ``` S -> number | (S+S) ```
Is S->E+S|E, E->number|(S) same as S->number|(S+S)?
|compilers|
I'm interested in analyzing the randomness of strings using relative count for 1-, 2-, etc tuples. E.g. for a long string `"abbccba.."` with an alphabet `["a", "b", "c"]` , the quantities `["a", "b", "c"], ["aa", "ab", "ba", "bb", "ac", "ca", "cc", "bc", "cb"]` etc should be approximately equal for every kind of tu...
Correct way to encode strings
|strings|randomness|encoding-scheme|
In modified grammar: 1) We cannot generate $number + number + number....+ number$, as every operation will have a parenthesis associated with it. 2) Redundant parenthesis: $number + number$, we will have to describe it as $(number + number)$ here the parenthesis are redundant. If you modify the grammar to: ...
null
null
Given a sequence $(a_1,a_2, \dots, a_n) $ and natural numbers n and k. We want to calculate the longest increasing subsequence which can be achieved from the creation of sequences $(b_1,b_2, \dots, b_n) $ for which exists an interval of pointers $[l, r]$ and a number x, $−K ≤ x ≤ K$, such that $b_i = a_i + x$, fo...
Longest increasing subsequence adding a number
|algorithms|dynamic-programming|longest-common-substring|
As the title states, I am asked to prove that a directed graph $G=(V,E)$ is strongly connected iff for all non-empty subsets $\emptyset \neq S \subset V$, the cut $\delta(S) \neq\emptyset$, where $$\delta(S)= \left\{ (u,v)\in E \mid u \in S,\; v\in V \setminus S \right\}.$$ I've shown that if $G$ is strongly conne...
For the sake of a contradiction, assume the graph is not strongly connected. If a graph is not strongly connected, then there is a pair $u$ and $v$ such that there is no path from $u$ to $v$. Let $R(u)$ be the _reachability set_ of $u$, i.e. the vertices reachable from $u$. Now, since $v \notin R(u)$, it means t...
L1* L2* contains among many others any string in L1 concatenated with 0 strings from L2, and 0 strings from L1 concatenated with any string of L2. That’s it.
Star closure of $L_1$ is $$L_1^*=L_1^0 \cup L_1^1\cup L_1^3\cup\dots\;\;.$$ Also star closure of $L_2$ is as follow $$L_2^*=L_2^0\cup L_2^1\cup L_2^2\cup L_2^3\dots\;\;.$$ Obviously, concatenation of $$ L_1^*L_2^*=\{L_1^0 \cup L_1^1\cup L_1^3\cup\dots\}\{L_2^0\cup L_2^1\cup L_2^2\cup L_2^3\dots \} $$ has langu...
null
Given doubly linked list $L$ that contains $n$ elements of numbers. Between QuickSort, and MergeSort and InsertionSort, which algorithm preferred to sorting $L$ by just swapping links of $L$? I think the InsertionSort is better option but I have no any idea to show that that minimize number of changing pointers. An...
I am learning markov algorithms and came across the following paper [1]. I am trying to understand the following example (well, any of the examples in the paper). Example 3: Multiplication. MA3 = $\{\Sigma, P, P_0\}$ $\Sigma = \{a, A, B, C, @\}$ [used `@` instead of `#`] Productions in P: $$p1: Ba \to aB$$ ...