instruction
stringlengths
0
29.8k
⌀
Let us assume that NP $\neq$ Co-NP, and let's focus on the graph 3-colorability problem. Since NP $\neq$ Co-NP: 1. There is no algorithm that can recognize any 3-colorable graph in polynomial time. 2. There are no polynomial certificates in general for certifying non-3-colorability. However, we know that fo...
Categories form a (large) category whose objects are the (small) categories and whose morphisms are functors between small categories. In this sense functors in category theory are "higher size morphisms". ML functors are not functors in the categorical sense of the word. But they are "higher size functions" in a ty...
In terms of comparing data structures, is a relational database just a >1 dimensional array? I'm just asking because I don't know much about databases, but I know a bit about data structures. I am trying to make this clear in my mind.
Is a relational database just a $ \geq 2$-dimensional array?
I have the following question on an assignment, and despite asking my prof, I can't get a grasp on it.. >Let $L_1, L_2$ be languages in ${\sf NP}$. Using the definition of ${\sf NP}$ via relations and quantifiers (not the non-deterministic Turing machines) prove that the following language is in ${\sf NP}$: $L=\{ x...
"Definition of NP via relations and quantifiers; not via NTMs"
|np|
There is some basic similarity between relational DB and large array (table~multidimensional array). Relational DB is based on [**relational algebra**][1] which makes it powerful. By using relational operators, information could be retrieved, updated, inserted, deleted etc... in DB efficiently. Considering array...
I have the following question on an assignment, and despite asking my prof, I can't get a grasp on it.. >Let $L_1, L_2$ be languages in ${\sf NP}$. Using the definition of ${\sf NP}$ via relations and quantifiers (not the non-deterministic Turing machines) prove that the following language is in ${\sf NP}$: $L=\{ x...
this is a very complex topic and there are many great books on the subject. computer languages have evolved over many decades, but believe it or not there are two original programming languages which show that mathematics and computer science are intimately intertwined: - Turing's 1936 paper on the [halting problem]...
Your minimization is incorrect. I can't see the graphics, so I'm going by the table. It would have been easier if you listed the set of states in step 3 which correspond to each state in the minimization. So I can only point out the obvious errors: first, there is no state `F`; second, both the inputs `ba` and `ab` ...
this is a very complex topic and there are many great books on the subject. computer languages have evolved over many decades, but believe it or not there are two original programming languages which show that mathematics and computer science are intimately intertwined: - Turing's 1936 paper on the [halting problem]...
Your minimization is incorrect. I can't see the graphics, so I'm going by the table. It would have been easier if you listed the set of states in step 3 which correspond to each state in the minimization. So I can only point out the obvious errors: first, there is no state `F`; second, both the inputs `ba` and `ab` ...
|programming-languages|history|type-theory|category-theory|
this is a very complex topic and there are many great books on the subject, a recent one is called [Turings Cathedral, origins of the digital universe](http://www.amazon.com/Turings-Cathedral-Origins-Digital-Universe/dp/1400075998/) and also [Engines of logic, mathematicians and the origins of the computer](http://www....
I have a simple problem of making a DFA which accepts all inputs starting with double letters (aa, bb) or ending with double letters (aa, bb), given $\Sigma =\{a, b\}$ is the alphabet set of the given language. I tried to solve it in a roundabout way by: 1. Generating a regular expression 2. Making its correspon...
I have a simple problem of making a DFA which accepts all inputs starting with double letters (aa, bb) or ending with double letters (aa, bb), given $\Sigma =\{a, b\}$ is the alphabet set of the given language. I tried to solve it in a roundabout way by: 1. Generating a regular expression 2. Making its correspon...
null
There is, to the best of my knowledge, no formal relation between *functors* in category theory and *functors* in ML (SML or OCaml, they're close enough for our purpose here). In category theory, functors are functions that operate on objects. They are one level above morphisms, which are often functions that operat...
I'm wondering this based on several places online that call $\sf NP=$ co-$\sf NP$ a major open problem... but I can't find any indication as to whether or not this is the same as $\sf P=NP$ problem...
Is the open question NP=co-NP the same as P=NP?
|complexity-theory|
I can't believe I didn't see this before — but yes, with an oracle for $L$ you can solve the halting problem. Obviously an oracle for $L$ gives us 'recursively' all non-Busy Beaver halting machines, so the question is 'can we figure out recursively in $L$ what the busy beavers are?'. Define $\Sigma_2(n)$ as the...
|complexity-theory|closure-properties|
I think I just realized, after finding a similar problem online, that this is asking to simply show that ${\sf NP}$ is closed under union. Can anybody give any insight into whether or not this is a proper solution, or if I'm missing anything? I mostly understand my answer, but I feel like I'm BSing a bit just to make i...
I think I just realized, after finding a similar problem online, that this is asking to simply show that ${\sf NP}$ is closed under union. Can anybody give any insight into whether or not this is a proper solution, or if I'm missing anything? I mostly understand my answer, but I don't really know what I'm doing with th...
No. It is another open problem and certainly related, but different. The complexity class [co-$\mathsf{NP}$][1] is the set of languages whose complements are in $\mathsf{NP}$; that is, the set of decision problems for which a "no" answer has a deterministic polynomial-time verifier. So for example, the question "Is thi...
One good way to answer this question is to use Polynomial Hierarchy (PH) (It's good to have a look at [polynomial hierarchy][1]). Polynomial hierarchy is a hierarchy of complexity classes that generalizes the classes P, NP and co-NP to oracle machines and use as a **scale** to measure complexity of problems. It is ...
One good way to answer this question is to use Polynomial Hierarchy (PH) (It's good to have a look at [polynomial hierarchy][1]). [Polynomial hierarchy][2] is a hierarchy of complexity classes that generalizes the classes P, NP and co-NP to oracle machines and use as a **scale** to measure complexity of problems. I...
{"Voters":null}
I struggle with few definitions in knowledge representation and seek credible help to distinguish between them. I have been searching on wikipedia and many websites for the difference between ontologies and semantic networks (not to be confused with semantic web). While the [wikipedia][1] page on semantic network never...
Are semantic networks ontologies?
|knowledge-representation|
Reading this question "[Natural RE undecidable problems but not Turing-complete][1]" the following language came to my mind: If $\Sigma(\cdot)$ is the busy beaver function (maximum attainable score among all halting 2-symbol n-state Turing machines of the above-described type, when started on a blank tape), define t...
|computability|turing-machines|
|complexity-theory|terminology|randomized-algorithms|complexity-classes|
|terminology|knowledge-representation|ontologies|
I struggle with few definitions in knowledge representation and seek credible help to distinguish between them. I have been searching on wikipedia and many websites for the difference between ontologies and semantic networks (not to be confused with semantic web). While the [wikipedia][1] page on semantic network never...
|complexity-theory|complexity-classes|p-vs-np|
|formal-languages|regular-languages|sets|
|formal-languages|regular-languages|
Reading this question "[Natural RE undecidable problems but not Turing-complete][1]" the following language came to my mind: If $\Sigma(\cdot)$ is the busy beaver function (maximum attainable score among all halting 2-symbol n-state Turing machines of the above-described type, when started on a blank tape), define t...
This is a reworked version of Steven's good answer, with an explicit reduction from the Halting problem. Given $\langle M \rangle, w$ build $M'$ that runs $M$ on $w$ and if it halts goes to the right of the tape, writes a 0 and halt. If $M'$ halts, $BB(M')=0$ (because there is an equivalent TM of the same size th...
This is a reworked version of Steven's good answer, with an explicit reduction from the Halting problem. Given $\langle M \rangle, w$ build $M'$ that runs $M$ on $w$ and if it halts goes to the right of the tape, writes a 0 and halt. If $M'$ halts, $BB(M')=0$ because there is an equivalent TM of the same size tha...
null
One good way to answer this question is to use the [polynomial hierarchy (PH)][1] (see also [here][2]). The polynomial hierarchy is a hierarchy of complexity classes that generalizes the classes ${\sf P}$, ${\sf NP}$ and ${\sf co-NP}$ to oracle machines and use as a **scale** to measure complexity of problems. It i...
I am interested if there exists a following version of the travelling salesman problem: > INSTANCE: A finite set $C={c_{1},...c_{k}}$ of cities, a distance $\delta(c_{i},c_{j})\in Z$ for each pair of cities, a denture $d$ and a bound $B\in Z$ (Z is a positive int) >QUESTION: Is there a tour around all cities in $...
Travelling salesman problem
|np-hard|
I am interested if there exists a following version of the travelling salesman problem: > INSTANCE: A finite set $C={c_{1},...c_{k}}$ of cities, a distance $\delta(c_{i},c_{j})\in Z$ for each pair of cities, a denture $d$ and a bound $B\in Z$ (Z is a positive int) >QUESTION: Is there a tour around all cities in $...
|complexity-theory|graphs|np-hard|decision-problem|
Travelling salesman problem with detours
someone can help with this L={a^ib^j∣i,j>=0; i≠2j} I'm trying to write a grammar for this language? i dontknow how to do this. i try S->aaAb|aA A->aA|a|
Context Free Grammar for language L={a^ib^j∣i,j>=0; i≠2j}
|regular-languages|context-free|formal-grammars|finite-automata|pushdown-automata|
Can someone help with this: $L=\{a^ib^j \mid i,j \ge 0 \text{ and } i \ne 2j\}$ I'm trying to write a grammar for this language? I don't know how to do this. I tried this: $S \rightarrow aaAb \mid aA \\ A \rightarrow aA \mid a$
Context Free Grammar for language $L=\{a^ib^j \mid i,j \ge 0; i \ne 2j\}$
Start with a grammar for $\{a^i b^{2 i} : i \ge 0\}$: $$ S \rightarrow a S bb \mid \epsilon $$ Now hack it so that there are more $a$ than $bb$: $$ \begin{align*} S &\rightarrow a S bb \mid A \\ A &\rightarrow a A \mid a \end{align*} $$ The modificaton to force more $b$ is similar, and left to you. It adds a...
I have as an assignment question to show that $QuadSat=\{\langle\phi\rangle\mid\phi$ is a satisfiable 3CNF formula with at least 4 satisfying assignments$\}$ is $\sf NP$-Complete. My solution is as follows, which is pretty much copied almost 100% from a textbook example with only an extra requirement for satisfiabli...
How do I explain that a polynomial time reduction is in fact polynomial time?
|complexity-theory|np-complete|reductions|
It depends on what part of your question you put the emphasis. If it is specifically the property of being anonymous for anonymous functions, then indeed the only answer is that they are unbound values. If you are talking about functions in general, annonymous functions are probably the most visible manifestation of t...
It depends on what part of your question you put the emphasis. If it is specifically the property of being anonymous for anonymous functions, then indeed the only answer is that they are unbound values. If you are talking about functions in general, annonymous functions are probably the most visible manifestation of t...
## Ogden's Lemma ## > **Lemma (Ogden).** Let $L$ be a context-free language. Then there is a constant $N$ such that for every $z\in L$ and any way of *marking* $N$ or more positions (symbols) of $z$ as "distinguished positions", then $z$ can be written as $z=uvwxy$, such that > > 1. $vx$ has at least one distinguis...
null
null
It depends on what part of your question you put the emphasis. If it is specifically the property of being anonymous for anonymous functions, then indeed the only answer is that they are unbound values. If you are talking about functions in general, anonymous functions are probably the most visible manifestation of th...
null
null
This is not really a research-level question. Still: If you use the pumping lemma on the word $w=0^{p^2} 1^{p^3}$, consider the partition $w=xyzuv$, where $|yzu|\le n$ and $|yu|>0$ ($n$ being the length of $w$). It is easy to prove that from all the cases, the only non-trivial case is when $y=0^i$ and $u=1^j$, in wh...
This is a homework problem I have spent several hours on. A "hint" is given that we may use this fact: If $n,j,k \in \mathbb{N}$ satisfy $ n \geq 2$ and $1 \leq j+k \leq n$, then $n^2+j$ does not evenly divide $n^3+k$. I cannot find any way to apply this fact. It leads me to believe I should use the string $0^{p^2}1...
Prove that $\{0^n 1^{n\cdot m} : n,m \in \mathbb{N}\}$ is not context-free
|untagged|
null
Given a 0-1 (binary) integer program of the form: min f(x) subject to: A$\vec{x}$ = $\vec{b}$, where $x_i \ge 0$ and $x_i\in\{0,1\}$ $\forall i$. Note: the size of A is not fixed in either dimension. I believe this problem has been shown to be hard to approximate (strongly NP-Complete) [Garey & Johnson][1]....
Hardness of Approximating 0-1 Integer Programs
|untagged|
null
Let us assume that $\mathsf{NP} \neq \mathsf{coNP}$. Consider the graph 3-colorability problem. Since $\mathsf{NP} \neq \mathsf{coNP}$ implies $\mathsf{P} \neq \mathsf{NP}$ and 3-coloribility is $\mathsf{NP}$-complete and its complement is $\mathsf{coNP}$-complete , we have: 1. 3-coloribility is not in $\mathsf{...
Consider the two languages: $L_1 = \{a^ib^j \mid i, j \ge 0 \text{ and } i > 2j\}$ $L_2 = \{a^ib^j \mid i, j \ge 0 \text{ and } i < 2j\}$ Convince yourself that $L = L_1 \cup L_2$. In $L_1$, the number of $a$'s are _more_ than double of $b$'s, so there has to be atleast one $a$ (when there are no $b$'s). Al...
Your reduction indeed shows that $QuadSAT\in NP$, since you showed a reduction **to** a problem in NP. Perhaps an easier way to have done this, is to simply show that there is a "short witness" for the membership of a formula in $QuadSAT$. In order to show NP-hardness, you must show a reduction **from** an NP-hard pr...
null
Are there NP Complete problems which have proven sub-exponential algos for the general case. I am not talking about tractable special cases here.
sub - exponential NP complete problems
|np|
|complexity-theory|np|
Let us assume that $\mathsf{NP} \neq \mathsf{coNP}$. Consider the graph 3-colorability problem. Since $\mathsf{NP} \neq \mathsf{coNP}$ implies $\mathsf{P} \neq \mathsf{NP}$ and 3-coloribility is $\mathsf{NP}$-complete and its complement is $\mathsf{coNP}$-complete , we have: 1. 3-coloribility is not in $\mathsf{...
Can we make a problem harder than NP and coNP if they are not equal?
Depends on what you exactly mean by subexponential. If you mean time $2^{n^{\epsilon}}$ for $\epsilon<1$ where $n$ is the size of the input then the answer is no. In fact there is a conjecture called [Exponential Time Hypothesis][1] that says no $\mathsf{NP}$-complete problem can be solved in subexpoential-time. ...
{"Voters":[{"Id":41,"DisplayName":"Kaveh"}]}
Depends on what you mean by subexponential. If by subexponential you mean $2^{O(n^\epsilon)}$ for some $\epsilon>0$ then the answer is yes, there are provably such problems. Take an $\mathsf{NP}$-complete problem like SAT. It has a brute-force algorithm that runs in time $2^{O(n)}$. Now consider the padded ver...
{"Voters":[{"Id":41,"DisplayName":"Kaveh"}]}
**Note:** this answer was posted for [the original post][1]. >Given a graph G: is there an algorithm, bounded by a polynomial of order k, that can determine if G is 3-colorable-or-non-3-colorable and provide a certificate? If you fix the graph then the problem is trivial. There is always an algorithm that answers...
Are there $\mathsf{NP}$-complete problems which have proven subexponential-time algorithms? I am asking for the general case inputes, I am not talking about tractable special cases here.
Are there subexponential-time algorithms for NP-complete problems?
I am interested if there exists a following version of the travelling salesman problem: > INSTANCE: A finite set $C = \{1,2,\dots,k\}$ of cities, a positive integer distance $\delta(i,j)$ for each pair of cities, and two positive integers $d$ and $B$. >QUESTION: Is there a tour that visits every city in $C$, incl...
Consider the two languages: $L_1 = \{a^ib^j \mid i, j \ge 0 \text{ and } i > 2j\}$ $L_2 = \{a^ib^j \mid i, j \ge 0 \text{ and } i < 2j\}$ Convince yourself that $L = L_1 \cup L_2$. In $L_1$, the number of $a$'s are _more_ than double of $b$'s, so there has to be atleast one $a$ (when there are no $b$'s). Al...
|formal-languages|context-free|pumping-lemma|
|complexity-theory|np-complete|approximation|linear-programming|
If you use the pumping lemma on the word $w=0^{p^2} 1^{p^3}$, consider the partition $w=xyzuv$, where $|yzu|\le n$ and $|yu|>0$ ($n$ being the length of $w$). It is easy to prove that from all the cases (that is, from all the possibilities for $y$ and $u$), the only non-trivial case is when $y=0^i$ and $u=1^j$, in wh...