instruction stringlengths 0 29.8k ⌀ |
|---|
Text books everywhere assume that the **Bounded** Post Correspondence Problem is NP-complete (no more than $N$ indexes allowed with repetitions). However, nowhere is one shown a simple (as in, something that an undergrad can understand) polynomial time reduction to another NP-complete problem.
However every reductio... |
A polynomial reduction from bounded PCP to another NP-complete problem |
|complexity-theory|np-complete| |
At my current project I had a network problem come up for which I could not find a solution. In a peer-to-peer network I needed to send an action to all peers, and each peer was to act on it only if it could verify that all other peers would also act on it.
That is, given a network of peers $P = { P_1, ..., P_n }$. ... |
Message receipt verification in a cluster |
|algorithms|computer-networks| |
|complexity-theory|graphs|np-complete| |
|complexity-theory|terminology|np-complete| |
**Short answer.**<br>
If we formulate an appropriate *decision problem* version of the Discrete Logarithm problem, we can show that it belongs to the intersection of the complexity classes [**NP**](http://en.wikipedia.org/wiki/NP_(complexity)), [**coNP**](http://en.wikipedia.org/wiki/CoNP), and [**BQP**](http://en.wik... |
The book "Neural Networks and Learning Machines" have many computer experiments to which many exercises are related. But there seems no data of these experiments available online. Where can I find them? |
Where can I find the data of the computer experiments in the book "Neural Networks and Learning Machines"? |
|soft-question| |
|complexity-theory|turing-machines|machine-models| |
You write in the [comments](http://cs.stackexchange.com/questions/2666/prove-that-a-boolean-function-computable-in-tn-by-a-ram-machine-is-in-dtimet#comment7242_2666):
> Since the address should be written in the tape by a $T(n)$-time Turing Machine, the size (i.e. string length) of the address can not exceed $O(T(n)... |
|reference-request|data-structures|time-complexity|concurrency|search-trees| |
I've been reading a bit of the literature lately, and have found some rather interesting data-structures.
I have researched various different methods of getting update times down to $\mathcal{O}(1)$ worst-case update time [1-6].
Recently I begun looking into lock-free data-structures, to support efficient concurr... |
Yes, it's still NP-hard. 3-COL is still NP-complete for planar degree 4 graphs [1].
---
1. Dailey, D. P. (1980), ["Uniqueness of colorability and colorability of planar 4-regular graphs are NP-complete"](http://www.sciencedirect.com/science/article/pii/0012365X80902368), Discrete Mathematics 30 (3): 289–293, DOI:... |
Luke [illustrates](http://cs.stackexchange.com/a/2700/98) one point of confusion; let me point out another one.
Algorithm $A$ for problem $P \in \mathsf{NP}$ uses algorithm $B$ for problem $Q \in \mathsf{PSPACE}\text{-complete}$. Is it possible that $A$ is "fast", that is it is not slower than $\mathsf{NP}$ allows f... |
Given a directed graph $G$ and two nodes $s,t$, decide whether there is some node $s'$ such that $s'$ is reachable from $s$ while $t$ is *not* reachable from $s'$.
I am wondering whether this problem is in [NL](https://en.wikipedia.org/wiki/NL_%28complexity%29). |
Is finding dead-end nodes in NL? |
|complexity-theory|reductions|check-my-proof| |
if I have a grammar having a production that contains both left recursion and left factoring like
$\qquad \displaystyle F \to FBa \mid cDS \mid c$
which one has priority, left recursion or left factoring? |
|formal-languages|formal-grammars|parsers| |
Left recursion and left factoring -- which one goes first? |
null |
Transformations such as left factoring or removing left recursion do not have precedence rules. Obviously, the resulting grammars may be different but they will recognize the same language.
The question's example grammar is more difficult than the typical undergrad homework problem. So showing our work will be usefu... |
I was going through the discussion on the question http://cs.stackexchange.com/questions/125/how-to-define-quantum-turing-machines/ and I feel that quantum TM and *nondetermistic* TM are one and the same. The answers to the other questions to not touch on that. Are these two models one and the same?
If no,
1. Wh... |
What is the difference between quantum TM and nondetermistic TM? |
|reference-request|data-sets| |
### On the meaning of nondeterminism
There are two different meanings of 'nondeterminism' at issue here. Quantum mechanics is usually described as being "not deterministic", but the word "nondeterministic" is used in a specialized way in theoretical computer science.
1. One meaning, which applies to quantum mec... |
>Let $L_1$ be regular, $L_1 \cap L_2$ regular, $L_2$ not regular. Show that $L_1 \cup L_2$ is not regular or give a counterexample.
I tried this: Look at $L_1 \backslash (L_2 \cap L_1)$. This one is regular. I can construct a finite automata for this ($L_1$ is regular, $L_2 \cap L_1$ is regular, so remove all the pa... |
null |
I think that you can prove that BPCP is NP-complete by using a reduction similar to the one used to prove its undecidability. We will directly prove that BPCP is NP-complete by showing how to reduce any problem in NP to it in polynomial time.
The standard reduction used to prove that PCP is NP-complete ([sketched o... |
In computer science, we have often have to solve [recurrence relations](https://en.wikipedia.org/wiki/Recurrence_relation), that is find a closed form for a recursively defined sequence of numbers. When considering runtimes, we are often interested mainly in the sequence's [asymptotic growth](https://en.wikipedia.org/w... |
How to solve recurrence relations? |
|proof-techniques|asymptotics|recurrence-relation| |
Sedgewick and Flajolet have done extensive work in [analytic combinatorics][1], which allows recurrences to be solved asymptotically using a combination of generating functions and complex analysis. Their work allows many recurrences to be solved automatically, and has been implemented in some computer algebra systems... |
I think that you can prove that BPCP is NP-complete by using a reduction similar to the one used to prove its undecidability. We will directly prove that BPCP is NP-complete by showing how to reduce any problem in NP to it in polynomial time.
The standard reduction used to prove that PCP is undecidable ([sketched o... |
In computer science, we have often have to solve [recurrence relations](http://en.wikipedia.org/wiki/Recurrence_relation), that is find a **closed form** for a recursively defined sequence of numbers. When considering runtimes, we are often interested mainly in the sequence's [**asymptotic** growth](http://en.wikipedia... |
Solving or approximating recurrence relations for sequences of numbers |
|complexity-theory|combinatorics|proof-techniques|asymptotics|recurrence-relation| |
According to [the Wikipedia article][1], the L in $LR(k)$ means "left-to-right scan", and the "R" means "rightmost derivation." However, in [Knuth's original paper on $LR(k)$ grammars][2], he defines $LR(k)$ (on page 610) as a language that is "translatable from left to right with bound $k$."
I am guessing that thi... |
When did $LR(k)$ acquire the meaning "left-to-right scan, rightmost derivation?" |
|terminology|formal-grammars|lr| |
This is actually not very complicated. I'll assume that epsilon productions have already been eliminated from the language, because that will only obscure the key concept of "left corner".
Form a graph G where the vertices are all the non-terminals of the grammar. Now draw a directed edge from A to B if there is a... |
I have recently implemented the standard algorithm for removing Left Recursion from Context-Free Grammars.
According to the [document][1], the efficiency of the algorithm crucially depends on the ordering of the nonterminals. The textbook discussions of the algorithm, are silent on this issue.
It is described as ... |
Removing Left Recursion from Context-Free Grammars - Ordering of nonterminals |
|untagged| |
I have the grammar:
S -> S == P
S -> S != P
S -> P
P -> NUM
This grammar suffers from left recursion.
To eliminate left recursion, I got:
S -> PS'
S' -> == PS' | -> != PS' | e
P -> NUM
However when constructing the parsing table, it turns out the grammar is ambi... |
Is this grammar ambiguous? |
|untagged| |
Trick: A language is not **Context free language** if it has same Comaprision more then one times For Instance :**L = {a^nb^c^n|n>0}** as you know this is not context free why:? as you can see number of b shuld be same as the number of a "This is first Comarision" and after that again number of c shuld be same of the n... |
There is a question which i cannot solve. If you give a tip i will be very glad.
proove that following language is not context free.
L= {a^n,b^m | gcd(n,m)=1}
Solution comes by using pumping lemma but how? |
A context free grammar proof |
|formal-languages| |
|formal-grammars| |
|formal-grammars|ambiguity| |
null |
> As a result, I can say that every NFA that can be constructed is decidable. Is this true?
Yes. An NFA can be converted to a deterministic finite automaton, and that can simply be run to decide the output.
> However, is it possible to find a Turing Machine that can accept w whose length is composite number?
Y... |
I cannot understand decidability really well. I have been reading from books and internet, but I am little bit confused.
According to the book (as I understood), we can decide on decidability of a problem by constructing Turing Machines. Let us say that we want to decide whether an NFA is a decidable language. First,... |
Decidability of Machines |
|turing-machines| |
## Guess & Prove ##
Or how I like to call it, the "$\dots$ technique". It can be applied to all kinds of identities. The idea is simple:
> Guess the solution and prove its correctness.
This is a popular method, arguably because it usually requires some creativity and/or experience (good for showing off) but fe... |
I've been looking into Recurrent Neural Networks, but I don't understand what the architecture of a neural network would look like when the output length is not necessarily fixed.
It seems like most networks I've read descriptions of require the output length to be equal to the input length or at least a fixed size... |
Your suspicion is correct: under these conditions, there is no way to guarantee a solution. Yours is a [consensus](http://en.wikipedia.org/wiki/Consensus_%28computer_science%29) problem, and there is a general result that states the **impossibility of consensus** in an asynchronous network with failures. This result is... |
|algorithms|computer-networks|distributed-systems| |
How would you prove that the following language is not context-free?
$$ L= \{a^n b^m |\, gcd(n,m)=1 \}$$
I suspect the solution uses the pumping lemma, but I'm not sure how to apply it. |
Proof that a language involving $gcd$ is not context-free |
null |
Converting Full History to Limited History
--
This is a first step in solving recurrences where the value at any integer depends on the values at _all_ smaller integers. Consider, for example, the recurrence
$$
T(n) = n + \frac{1}{n}\sum_{k=1}^n \big(T(k-1) + T(n-k)\big)
$$
which arises in the analysis of [ran... |
Text books everywhere assume that the **Bounded** Post Correspondence Problem is NP-complete (no more than $N$ indexes allowed with repetitions). However, nowhere is one shown a simple (as in, something that an undergrad can understand) polynomial time reduction from another NP-complete problem.
However every reduct... |
|reference-request|terminology|formal-grammars|lr| |
According to [the Wikipedia article][1], the L in $LR(k)$ means "left-to-right scan", and the "R" means "rightmost derivation." However, in [Knuth's original paper on $LR(k)$ grammars][2], he defines $LR(k)$ (on page 610) as a language that is "translatable from left to right with bound $k$."
I am guessing that thi... |
|reference-request|terminology|formal-grammars|parsers|history| |
|computability|automata|finite-automata|turing-machines| |
|formal-languages|formal-grammars| |
|formal-languages|reference-request|terminology|formal-grammars|parsers| |
**Edit:** Jeffe makes a good point in his comment above. You should probably read "correct vs incorrect" in the following answer as "convenient/consistent vs inconsistent".
It seems to be that your second calculation is incorrect.
Let the height of a subtree with a single node (i.e. a leaf) be 0. Then the height of... |
I have recently implemented the standard algorithm for removing Left Recursion from Context-Free Grammars.
According to the [document][1], the efficiency of the algorithm crucially depends on the ordering of the nonterminals. The textbook discussions of the algorithm, are silent on this issue.
It is described as ... |
|formal-grammars|context-free| |
I have the grammar:
$\qquad \begin{align}
S &\to S = P \mid S \neq P \mid P \\
P &\to NUM
\end{align}$
This grammar suffers from left recursion. To eliminate left recursion, I got:
$\qquad \begin{align}
S &\to PS' \\
S' &\to\, = PS' \mid\, \neq PS' \mid \varepsilon \\
P &\to NUM
\end{align}$
... |
|formal-grammars|parsers|ambiguity| |
null |
I have the grammar:
$\qquad \begin{align}
S &\to S = P \mid S \neq P \mid P \\
P &\to NUM
\end{align}$
This grammar suffers from left recursion. To eliminate left recursion, I got:
$\qquad \begin{align}
S &\to PS' \\
S' &\to\, = PS' \mid\, \neq PS' \mid \varepsilon \\
P &\to NUM
\end{align}$
... |
We can consider $NUM$ and therewith $P$ a terminal symbol. Furthermore, $S$ does only occur once in every derivation. Therefore, if there is any ambiguity, it has to stem from
$\qquad \displaystyle S' \to\, = PS' \mid\, \neq PS' \mid \varepsilon$
Now, that fragment is a [right-regular](https://en.wikipedia.org/wi... |
I have recently implemented the standard algorithm for removing Left Recursion from Context-Free Grammars.
According to the [document][1], the efficiency of the algorithm crucially depends on the ordering of the nonterminals. The textbook discussions of the algorithm, are silent on this issue.
It is described as ... |
I have recently implemented the Paull's algorithm for removing left-recursion from context-free grammars:
> Assign an ordering $A_1, \dots, A_n$ to the nonterminals of the grammar.
>
> for $i := 1$ to $n$ do begin
> $\quad$ for $j:=1$ to $i-1$ do begin
> $\quad\quad$ for each production of the form $A_i \to... |
|algorithms|formal-grammars|context-free|efficiency| |
There are two possible ways to define a non-boolean algebra.
1. Stick with $\mathbb{F}_2 = \{0,1\}$ but choose base operations other than $\{\land, \lor, \lnot\}$.
2. Change the base set entirely.
For the whole concept of simplification to word similarly to boolean algebra, we need two binary operations with a... |
If I have a Type 3 Grammar, it can be represented on a pushdown automaton (without doing any operation on the stack) so I can represent regular expressions by using context free languages. But can I know if a type 3 grammar is $LR(1)$, $LL(1)$, $SLR(1)$, etc. without constructing any parse tables? |
|formal-languages|regular-languages|formal-grammars|parsers|regular-expressions| |
|algorithms|optimization|combinatorics|integers| |
Let $\sf{Bubble Sort}$ be defined as the following:
for (j = A.length; j > 1; j--)
for (i = 0; j < j - 1; i++)
if (A[i] > A[i + 1])
swap(i, i + 1, A)
Given some permutation $x_1, \cdots, x_n$, an *inversion* is said to have occurred if $x_j < x_i$ for some $i < j.$ We se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.