instruction
stringlengths
0
29.8k
⌀
Can a two-stack PDA accept language $L=${$a^nb^mc^nd^m \mid n \geq m$}, which has no context-free grammar?
|context-free|pushdown-automata|
For the first part, as the comments suggest - observe that there are $k!^n$ possible permutations for the inputs - indeed, every array has $k!$ permutations, and there are $n$ arrays, so you have $k!$ options for the first array, $k!$ for the second, and so on. So the height of a decision tree is $$\log (k!^n)=n\l...
A two-stack PDA is equivalent in computing power to a Turing machine. Since a Turing machine can accept that language (stated without proof), a two-stack PDA can as well. The actual definition of such a machine is left as an exercise :)
A quick literature review suggests that the fastest algorithm for deciding whether a dense bipartite graph has a perfect matching is still the matrix algorithm, which runs in time $O(|V|^\omega)$. You can reduce the space of the algorithm, see [Isolation, Matching and Counting][1] by Allender, Reinhardt and Zhou. [A re...
Given $n$ arrays of size $k$ each, we want to show that at least $\Omega(nk \log k)$ comparisons are needed to sort all arrays (indepentent of each other). My proof is a simple modification of the decision tree argument used to obtain the lower bound for comparison-based sorting of one array. More specifically, I a...
null
I am reading Computer Architecture & Organization by William Stallings to understand I/O operations. Stallings pretty well explains why Programmed I/O (CPU keeps checking the I/O module register status) & Interrupt I/O (CPU still has to over look data transfer between I/O module & memory) are not efficient & introduces...
How DMA improves I/O operation efficiency ?
|computer-architecture|
Is there any decider for the empty language? could someone describe the machine?
Can a turing machine decide an empty language?
|turing-machines|
Recall that Turing Machines are often defined to output only a yes/no answer. Transducers are used to extend this to a general output, which is sometimes more appropriate for a certain task (e.g. defining mapping-reductions). When we use transducers, we can also analyze their runtime, and in this case they compute f...
Is there any decider for the empty language? Could someone describe the machine?
Can a Turing machine decide the empty language?
A = {[M] | M is a turing machine and L(M)=null}; Given the language A, we want to write a turing machine R that Decides(I don't mean Recognizes) the language A.
Let $A = \{\langle M\rangle | M $ is a Turing Machine and $L(M)=\emptyset\}$ . We want to write a Turing machine R that Decides(I don't mean Recognizes) the language A.
You don't even need to know about the equivalence to a Turing Machine to decide this language and if it was the intention of this exercise to come up with the equivalence, the language is (IMHO) to easy to motivate this. A simple two-stack PDA for this language works like this: 1. Put $n$ on both counters, while...
I have $n\times k$ matrix with $k<n$ and I would like to find all its $n\choose k$ submatrices which are $k\times k$ matrices that are the concatinations of all possible $k$ rows. Actually I tried to do it with matlab but it takes too long time specially when $n>20$ and I couldn't find a way how to generate in parallel...
how to enumerate combinations in parallel
|algorithms|combinatorics|
The DMA engine doesn't grab the bus for the duration of the whole transfer, only while specific data is being transferred. Yes, that means CPU acces to memory is hampered, but not shut off completely. The CPU can also work with data from its cache in the meantime.
I have this problem that I need help with. **Input:** An undirected graph $G(V,E)$. $F$ where $F$ is a subset of $V$. The edges are not weighted, or if you prefer, all edges have a weight of $1$. The runtime should be $O(|V| + |E|)$. **Question:** How do you find a node $v$ of $V$ such that the dis...
This problem for DFAs should be polynomial time equivalent to (the complement of) the universality problem for NFAs, which is PSPACE-complete (according to this answer: http://mathoverflow.net/questions/24343/emptiness-and-determinization-of-nfas/24422#24422). The problem here for regular expressions or NFAs might be e...
Earlier I asked the question: <a href="http://cs.stackexchange.com/questions/10848/can-a-turing-machine-decide-if-an-nfa-accepts-a-string-of-prime-length">Can a Turing Machine decide if an NFA accepts a string of prime length?</a>. The answer introduced me to Parikh's theorem, which I've been reading about. The concept...
Can a Turing Machine decide if a regular expression matches all strings of exactly some length $l \geq 1$?
Starting with $i=0$ and going up, for every $f \in F$ consider a subset of $V$ containing points at the exact distance of $i$ from $f$. Look at intersection of all of those subsets. If you're lucky, as $i$ grows, you'll find this intersection non empty - those will be the solutions. For the actual implementation, I'...
Since you just need to select $k$ rows, this becomes the same as choosing $k$ elements of a given set of $n$ elements. You can generate $n \choose k$ combinations in lexicographic order, with the next one depending only on the previous one (I believe you can find plenty on the web for this). The fact that the ord...
Since you just need to select $k$ rows, this becomes the same as choosing $k$ elements of a given set of $n$ elements, say $\{1,2,\dots,n\}$. You can generate $n \choose k$ combinations in lexicographic order (i.e. starting with $\{1,2,3, \dots, k\}$ and ending with $\{n, n-1,..,n-k+1\}$), with the next one dependin...
Since you just need to select $k$ rows, this becomes the same as choosing $k$ elements of a given set of $n$ elements, say $\{1,2,\dots,n\}$. You can generate $n \choose k$ combinations in lexicographic order (i.e. starting with $\{1,2,3, \dots, k\}$ and ending with $\{n, n-1,..,n-k+1\}$), with the next one dependin...
While the algorithm above is fine, it may use exponential space, while this problem for DFAs should be polynomial time equivalent to (the complement of) the universality problem for NFAs. This makes it PSPACE-complete (according to this answer: http://mathoverflow.net/questions/24343/emptiness-and-determinization-of-nf...
While the algorithm above is fine, it may use exponential space, while this problem for DFAs should be polynomial time equivalent to (the complement of) the universality problem for NFAs. This makes it PSPACE-complete (according to this answer: http://mathoverflow.net/questions/24343/emptiness-and-determinization-of-nf...
null
Let $$L_\emptyset = \{\langle M\rangle \mid M \text{ is a Turing Machine and }L(M)=\emptyset\}.$$ Is there a Turing machine R that Decides(I don't mean Recognizes) the language $L_\emptyset$?
Can a Turing machine decide the language $L_\emptyset$ of machines with empty language?
|turing-machines|undecidability|
Do you know of any kind of decomposition of a graph that involves centers, especially in the context of parametrized complexity? If not, do you see any reason (other than the potentially large size of centers) why such a notion isn't fruitful (e.g. subsumed by other notion)? I'm looking for something similar to this...
Decomposition of a graphs that uses centers
|complexity-theory|graphs|parameterized-complexity|
Do you know of any kind of decomposition of graphs that involves centers, especially in the context of parametrized complexity? If not, do you see any reason (other than the potentially large size of centers) why such a notion isn't fruitful (e.g. subsumed by other notion)? I'm looking for something similar to this:...
Decomposition of graphs that uses centers
You don't even need to know about the equivalence to a Turing Machine to decide this language and if it was the intention of this exercise to come up with the equivalence, the language is (IMHO) to easy to motivate this. A simple two-stack PDA for this language works like this: 1. Put $n$ on both counters, while...
null
null
Here is the problem: we are given vectors $v_1, \ldots, v_k$ lying in $\mathbb{R}^n$ which are orthogonal. We assume that the entries of $v_i$ are rational, with numerator and denominator taking $K$ bits to describe. We would like to find vectors $v_{k+1}, \ldots, v_n$ such that $v_1, \ldots, v_n$ is an orthogonal basi...
Can you complete a basis in polynomial time?
|algorithms|linear-algebra|
null
Let $V$ be a matrix whose rows are $v_1,\ldots,v_\ell$. Convert $V$ to row echelon form, say $PVP^{-1} = [I|A]$, using the [Bareiss algorithm][1]. Continue from there. (There are other alternatives using the same general idea.) If you used Gaussian elimination instead, then intermediate entries could have exponentia...
Another hint: Try reducing the halting problem to $L_\emptyset$. (The original hint is to use Rice's theorem, but in this case a direct proof is also pretty simple.)
In the strict formal sense, no. Non-determinism in the theory/mathematical sense allows a machine to choose a computation path based on whether it eventually leads to an accepting state or not *without looking any further ahead in the input*. So in this strict sense it's a property that's only suitable for theoretical ...
Assuming I haven't made a mistake, I get $(0^{+}10^{\ast}1)^{\ast}10^{\ast}(0^{+}1)^{\ast}10^{\ast}$ via one application of the DFA to regular expression conversion algorithm, however there are up to $5!$ possible answers as there are $5$ states to eliminate. I would assume some of these give the same answer of course....
Starting with $i=0$ and going up, for every $f \in F$ consider a subset of $V$ containing points at the exact distance of $i$ from $f$. Look at intersection of all of those subsets. If you're lucky, as $i$ grows, you'll find this intersection non empty - those will be the solutions. For the actual implementation, I'...
We can write a decider for the language E={[A]| A is a DFA and L(A)=empty} by marking method. Why we cannot use the same method to write a decider for the language with TM as follows? A = {[M]| M is a TM and L(M)=empty}
Undecidability of the language with its elements(TM) having empty language
|turing-machines|
We can write a decider for the language: $E=\{A\; |\; A \mbox{ is a DFA and } L(A)=\emptyset\}$ by marking method.<br> Why we cannot use the same method to write a decider for the language with TM as follows? $A = \{ M \;|\; M \mbox{ is a TM and } L(M)=\emptyset\}$
By marking, you probably mean reachability analysis - looking for a path from the initial state to an accepting state. Indeed, the language of a DFA is empty iff there is no such path. Let's start with an example as to why this fails in TMs. Consider a TM that, in $q_0$, ignores it's input, but writes $a$ on it's ta...
null
$A$ is undecidable because of [Rice's Theorem][1], which states non trivial properties of partial functions are not decidable. 1. There is a TM which doesn't accept any language. (Which directly goes to the reject state). 2. There is a TM which accepts every language. (Which directly goes to the accept state). ...
$A$ is undecidable because of [Rice's Theorem][1], which states non trivial properties of partial functions are not decidable. 1. There is a TM which doesn't accept any language. (Which directly goes to the reject state). 2. There is a TM which accepts every language. (Which directly goes to the accept state). ...
$A$ is undecidable because of [Rice's Theorem][1], which states non trivial properties of partial functions are not decidable. 1. There is a TM which doesn't accept any language. (Which directly goes to the reject state). 2. There is a TM which accepts every language. (Which directly goes to the accept state). ...
Let $V$ be a matrix whose rows are $v_1,\ldots,v_\ell$. Convert $V$ to row echelon form, say $PVP^{-1} = [I|A]$, using the [Bareiss algorithm][1]. Continue from there. (There are other alternatives using the same general idea.) If you used Gaussian elimination instead, then intermediate entries could have exponentia...
I see only two applications of using an NFA (or rather its power automaton without writing it down) instead of a minimized DFA: 1. [Homoiconic languages][1], where you may want to modify your lexer frequently 2. Strange syntax that may blow up your DFA like identifier := [a-z][a-z0-9_]* indice...
null
I am reading Computer Architecture & Organization by William Stallings to understand I/O operations. Stallings pretty well explains why Programmed I/O (CPU keeps checking the I/O module register status) & Interrupt I/O (CPU still has to over look data transfer between I/O module & memory) are not efficient & introduces...
How DMA improves I/O operation efficiency?
I've been reading a bit about [Hierarchical Temporal Memory][1] and [Memory Prediction][2]. I found a great paper: [How the brain might work: A hierarchical and temporal model for learning and recognition][3], [Dileep George's][4] dissertation for his PhD at Stanford. I was searching google, to see if such a big ne...
I am reading Computer Architecture & Organization by William Stallings to understand I/O operations. Stallings pretty well explains why Programmed I/O (CPU keeps checking the I/O module register status) & Interrupt I/O (CPU still has to over look data transfer between I/O module & memory) are not efficient & introduces...
null
In the case of LBAs(Linear Bounded Automaton), in writing a decider for the language: A={[M,w]| M is an LBA that accepts string w} we reject the input after a specific number(number of possible different configurations) of computations. We say that the machine must be looping after this many number of computation. ...
Recognizing Loops in computation on TM!
|turing-machines|
Because the TM, as it has an infinite tape, can get into a loop that runs off into infinity and the configuration doesn't repeat. For a minimal example, just make it move right on blank, and rewrite with 0. Start it on a blank tape, and watch it ride into the sunset.
If I understand the question correctly, you are asking why are we bounding the number of configurations, rather than checking for a repeating configuration? Well, clearly these are equivalent in the sense that in both ways you will detect a repeating configuration. In the first method, we use the pigeonhole princ...
The A* algorithm is a non exhaustive search algorithm, it does not check all the possibilities, but rests on the hypothesis that the heuristic will consistently provide accurate estimates of the cost of reaching the goal node from a given node in the graph. The algorithm will skip certain possibilities because of their...
Edit: This answer doesn't address the requirement of orthogonality. Perhaps the Bareiss algorithm still helps. Let $V$ be a matrix whose rows are $v_1,\ldots,v_\ell$. Convert $V$ to row echelon form, say $PVP^{-1} = [I|A]$, using the [Bareiss algorithm][2]. Continue from there. (There are other alternatives using th...
null
The result of the Gram-Schmidt can be expressed in determinantal form, [see Wikipedia][1]. This shows that the output of the Gram-Schmidt process is polynomial size. This suggests that if you run the classical Gram-Schmidt process, then all intermediate entries are also polynomial size (even in LLL, all intermediate en...
null
null
Yes! See the Wikipedia page for Turing Machine. A Turing Machine is a state machine with a pointer that can move left or right on an "infinite" tape (representing memory.) There is a picture on the Wikipedia page of a Turing machine implemented with Lego. The foundation of Computability Theory is the Church-Turing ...
I'm not sure why the answer of Karolis doesn't satisfy you. Let me chew it a bit more for you. First, let's recall what the pumping lemma says (taken form the credible source of Wikipedia): >If a language L is context-free, then there exists some integer p ≥ 1 such that any string s in L with |s| ≥ p (where p is a ...
I'm not sure why the answer of Karolis doesn't satisfy you. Let me chew it a bit more for you. First, let's recall what the pumping lemma says (taken form the credible source of Wikipedia): >If a language L is context-free, then there exists some integer p ≥ 1 such that any string s in L with |s| ≥ p (where p is a ...
null
This question is on the GRE Computer Science test booklet (not homework). I tried applying closure properties of regular languages but no success. Suppose *L* is a regular language over $\Sigma = \{0, 1\}$. Show that the language {*w* $\in$ *L* | length of *w* is even} is also regular. What I find surprising is t...
Proof that if L is regular over {0, 1}, then {w in L | length(w) is even} is also regular
|untagged|
null
My problem with CFG is, I am to generally create ones that dont have requirements such as: a^m b^n; m<=n<=2M I have no clue where to begin, and how to approach it. I was wondering if you can provide some hints for such daunting problems, along with how to solve that problem. This is NOT HW, this is merel me t...
Context free grammar construction
|untagged|
We need to show that $\{w ∈ L |$ length of w is even$\}$ is regular. In order to show that, it is enough to construct an NFA/DFA for that. You can construct an NFA for this like ![enter image description here][1] [1]: https://i.stack.imgur.com/4KheS.png
My problem with CFG is, I am to generally create ones that dont have requirements such as: $a^m b^n$; $m \le n \le 2M $ I have no clue where to begin, and how to approach it. I was wondering if you can provide some hints for such daunting problems, along with how to solve that problem. This is NOT HW, this is ...
|context-free|
null
I'm not sure why the answer of Karolis doesn't satisfy you. Let me chew it a bit more for you. First, let's recall what the pumping lemma says (taken form the credible source of Wikipedia): >If a language L is context-free, then there exists some integer p ≥ 1 such that any string s in L with |s| ≥ p (where p is a ...
|regular-languages|
This question is on the GRE Computer Science test booklet (not homework). I tried applying closure properties of regular languages but no success. Suppose $L$ is a regular language over $\Sigma = \{0, 1\}$. Show that the language $\{w \in L \mid \text{ length of }w\text{ is even}\}$ is also regular. What I find s...