id int64 1 141k | title stringlengths 15 150 | body stringlengths 45 28.5k | tags stringlengths 1 102 | label int64 1 1 | text stringlengths 128 28.6k | source stringclasses 1
value |
|---|---|---|---|---|---|---|
110,397 | Connection between non determinism and LL(1) conflicts | <p>I am trying to understand connection between non determinism of grammar and LL(1) conflicts introduced by it.</p>

<p>As per my understanding non deterministic context free grammar is a context free grammar in which at some point in time during parsing, multiple actions are allowed. Also I believe non determ... | automata context free formal grammars compilers parsers | 1 | Connection between non determinism and LL(1) conflicts -- (automata context free formal grammars compilers parsers)
<p>I am trying to understand connection between non determinism of grammar and LL(1) conflicts introduced by it.</p>

<p>As per my understanding non deterministic context free grammar is a context... | habedi/stack-exchange-dataset |
110,398 | How to put elements in allowed bags? | <p>Let's say I have a list of "Items"</p>

<p>I also have a list of "Bags". Each bag is a set of "Items" which gives what item can be placed in that bag. But only one item can go in each bag.</p>

<p>I want to place all items in a bag. It's okay if there are empty bags left over.</p>

<p>Does th... | algorithms terminology knapsack problems constraint satisfaction | 1 | How to put elements in allowed bags? -- (algorithms terminology knapsack problems constraint satisfaction)
<p>Let's say I have a list of "Items"</p>

<p>I also have a list of "Bags". Each bag is a set of "Items" which gives what item can be placed in that bag. But only one item can go in each bag.</p>

... | habedi/stack-exchange-dataset |
110,400 | Unambiguousness and determinism of CFGs for them to be LR | <p>I came across this statement:</p>

<blockquote>
 <p>Note that there are unambiguous grammars for which every LR parser construction method will produce a parsing action table with parsing action conflicts. </p>
</blockquote>

<p>I was guessing what could be the characteristics of such gramma... | formal languages automata context free compilers parsers | 1 | Unambiguousness and determinism of CFGs for them to be LR -- (formal languages automata context free compilers parsers)
<p>I came across this statement:</p>

<blockquote>
 <p>Note that there are unambiguous grammars for which every LR parser construction method will produce a parsing action table with pars... | habedi/stack-exchange-dataset |
110,402 | Why are ambiguous grammars bad? | <p>I understand that if there exist 2 or more left or right derivation trees, then the grammar is ambiguous, but I am unable to understand why it is so bad that everyone wants to get rid of it.</p>
 | compilers ambiguity | 1 | Why are ambiguous grammars bad? -- (compilers ambiguity)
<p>I understand that if there exist 2 or more left or right derivation trees, then the grammar is ambiguous, but I am unable to understand why it is so bad that everyone wants to get rid of it.</p>
 | habedi/stack-exchange-dataset |
110,403 | Can Earley parser work in parallel? | <p>Since Earley parser finds all possible application variants for a token, can it parse text in parallel, unlike the usual parser like stack-based, etc. 
You just need to modify the start of each parallel chunk of tokens, then while going backwards while constructing a table you combine and validate the found rule... | parsers | 1 | Can Earley parser work in parallel? -- (parsers)
<p>Since Earley parser finds all possible application variants for a token, can it parse text in parallel, unlike the usual parser like stack-based, etc. 
You just need to modify the start of each parallel chunk of tokens, then while going backwards while constructin... | habedi/stack-exchange-dataset |
110,414 | Can I simplify successive XOR operations? | <p>I'm doing an online programming challenge where successive XOR operations are used (from <a href="https://www.codewars.com/kata/become-immortal" rel="nofollow noreferrer">codewars.com</a>, if you don't want to create an account, <a href="https://pastebin.com/vkZpZTMP" rel="nofollow noreferrer">here are the instructi... | algorithms complexity theory time complexity bit manipulation xor | 1 | Can I simplify successive XOR operations? -- (algorithms complexity theory time complexity bit manipulation xor)
<p>I'm doing an online programming challenge where successive XOR operations are used (from <a href="https://www.codewars.com/kata/become-immortal" rel="nofollow noreferrer">codewars.com</a>, if you don't wa... | habedi/stack-exchange-dataset |
110,417 | Does a Minimum-Spanning-Tree always give a lower bound for the weight of any Hamiltonian cycle of the graph? | <p>A minimum-spanning-tree (MST) path is always <span class="math-container">$V-1$</span> edges and a Hamiltonian Cycle (HC) is always <span class="math-container">$V$</span> edges.</p>

<p>Because the HC has an extra edge we could say that in general, the weight of every Hamiltonian cycle of a connected graph ... | complexity theory graphs | 1 | Does a Minimum-Spanning-Tree always give a lower bound for the weight of any Hamiltonian cycle of the graph? -- (complexity theory graphs)
<p>A minimum-spanning-tree (MST) path is always <span class="math-container">$V-1$</span> edges and a Hamiltonian Cycle (HC) is always <span class="math-container">$V$</span> edges.... | habedi/stack-exchange-dataset |
110,430 | Can these two languages be reduced to one another? | <p>Given:</p>

<p><span class="math-container">$L_1=\left\{ \left\langle M\right\rangle :L\left(M\right)\ni w_{0}\right\}$</span></p>

<p><span class="math-container">$L_2=\left\{ \left\langle M\right\rangle :L\left(M\right)=\left\{ w_{0}\right\} \right\}$</span></p>

<p>I believe I've managed t... | turing machines computability reductions | 1 | Can these two languages be reduced to one another? -- (turing machines computability reductions)
<p>Given:</p>

<p><span class="math-container">$L_1=\left\{ \left\langle M\right\rangle :L\left(M\right)\ni w_{0}\right\}$</span></p>

<p><span class="math-container">$L_2=\left\{ \left\langle M\right\rangle... | habedi/stack-exchange-dataset |
110,435 | NL-Hardness of Target | <p>When revising for an upcoming exam in complexity theory, I came across this problem on the final part of a question, which I was unable to solve:</p>

<p><span class="math-container">$ TARGET = \{<G, t> : t\ is\ reachable\ from\ every\ other\ node\ in\ G\}$</span></p>

<p>Now we are allowed to ... | complexity theory reductions complexity classes space complexity | 1 | NL-Hardness of Target -- (complexity theory reductions complexity classes space complexity)
<p>When revising for an upcoming exam in complexity theory, I came across this problem on the final part of a question, which I was unable to solve:</p>

<p><span class="math-container">$ TARGET = \{<G, t> : t\ is\... | habedi/stack-exchange-dataset |
110,451 | Proving a language comprised of 2 languages is regular | <p>So glad to find this place. I have been struggling for quite a while with this given question and i am not sure how to fully address it.</p>

<p>The question:
<span class="math-container">$L_1$</span> and <span class="math-container">$L_2$</span> are regular languages over the same <span class="math-cont... | computability automata regular languages finite automata | 1 | Proving a language comprised of 2 languages is regular -- (computability automata regular languages finite automata)
<p>So glad to find this place. I have been struggling for quite a while with this given question and i am not sure how to fully address it.</p>

<p>The question:
<span class="math-container">... | habedi/stack-exchange-dataset |
110,454 | How to construct an ordinary matching from a fractional matching? | <p>Given a graph <span class="math-container">$G=(V,E)$</span>. A fractional matching, say <span class="math-container">$f$</span>, assigns every edge <span class="math-container">$e \in E$</span> to a fraction <span class="math-container">$f(e) \in [0,1]$</span>, with the constraint: for <span class="math-container">... | graphs matching | 1 | How to construct an ordinary matching from a fractional matching? -- (graphs matching)
<p>Given a graph <span class="math-container">$G=(V,E)$</span>. A fractional matching, say <span class="math-container">$f$</span>, assigns every edge <span class="math-container">$e \in E$</span> to a fraction <span class="math-con... | habedi/stack-exchange-dataset |
110,458 | Advantages of Lambda calculus over Turing machine and vice versa | <p>What kind of advantages does Lambda calculus have over Turing machine, and vice versa?</p>
 | turing machines computability lambda calculus | 1 | Advantages of Lambda calculus over Turing machine and vice versa -- (turing machines computability lambda calculus)
<p>What kind of advantages does Lambda calculus have over Turing machine, and vice versa?</p>
 | habedi/stack-exchange-dataset |
110,482 | Does Google's PageRank count as a sorting algorithm? | <p>Is it correct to assume that PageRank is a sorting algorithm or does it fall in any other category?</p>
 | algorithms sorting | 1 | Does Google's PageRank count as a sorting algorithm? -- (algorithms sorting)
<p>Is it correct to assume that PageRank is a sorting algorithm or does it fall in any other category?</p>
 | habedi/stack-exchange-dataset |
110,486 | Conditions for a binary tree being balanced | <blockquote>
<p>Prove or disprove for each of the following two properties, whether a family of trees that satisfy the property is balanced.</p>
<p>If you disprove, the counterexample should consist of an infinite sequence of trees in the family rather than just a single tree, because the property is asymptotic... | trees combinatorics | 1 | Conditions for a binary tree being balanced -- (trees combinatorics)
<blockquote>
<p>Prove or disprove for each of the following two properties, whether a family of trees that satisfy the property is balanced.</p>
<p>If you disprove, the counterexample should consist of an infinite sequence of trees in the fami... | habedi/stack-exchange-dataset |
110,491 | Why do we simulate the universal TM to simulate another TM M instead of simulating M directly? | <p>In the proof of the time hierarchy theorem given on page 69 of Arora-Barak, we define a TM D as follows: </p>

<p>"On input <span class="math-container">$x$</span>, run for <span class="math-container">$|x|^{1.4}$</span> steps the Universal TM <span class="math-container">$\ \mathcal{U}$</span> of Theorem 1.... | turing machines simulation | 1 | Why do we simulate the universal TM to simulate another TM M instead of simulating M directly? -- (turing machines simulation)
<p>In the proof of the time hierarchy theorem given on page 69 of Arora-Barak, we define a TM D as follows: </p>

<p>"On input <span class="math-container">$x$</span>, run for <span cla... | habedi/stack-exchange-dataset |
110,497 | Non-Deterministic Turing machine vs Probabilistic Turing Machine vs Deterministic Turing Machine | <p>What is the difference between a Non-Deterministic Turing machine, Probabilistic Turing Machine and a Deterministic Turing Machine ?</p>
 | complexity theory turing machines | 1 | Non-Deterministic Turing machine vs Probabilistic Turing Machine vs Deterministic Turing Machine -- (complexity theory turing machines)
<p>What is the difference between a Non-Deterministic Turing machine, Probabilistic Turing Machine and a Deterministic Turing Machine ?</p>
 | habedi/stack-exchange-dataset |
110,498 | Recognizably turing machine question (reject / loop) | <p>The definition of proving recognizability using dove tailing is below. However I'm wondering if we can also prove loop or reject in the same way?</p>

<p>Give a deterministic TM D that recognizes L such that if <span class="math-container">$w \in L$</span> then D accepts w. Or if <span class="math-container"... | turing machines semi decidability | 1 | Recognizably turing machine question (reject / loop) -- (turing machines semi decidability)
<p>The definition of proving recognizability using dove tailing is below. However I'm wondering if we can also prove loop or reject in the same way?</p>

<p>Give a deterministic TM D that recognizes L such that if <span ... | habedi/stack-exchange-dataset |
110,499 | Minimize sequence storage by overlapping prefixes | <p>I bumped into this problem today, and after a bit of pondering, I <em>think</em> I have a solution in <span class="math-container">$O(n^3)$</span>, which is better than no solution or an <span class="math-container">$O(n!)$</span> solution, but my answer still isn't great. Can you beat my best answer?</p>

... | time complexity graph traversal subsequences | 1 | Minimize sequence storage by overlapping prefixes -- (time complexity graph traversal subsequences)
<p>I bumped into this problem today, and after a bit of pondering, I <em>think</em> I have a solution in <span class="math-container">$O(n^3)$</span>, which is better than no solution or an <span class="math-container">$... | habedi/stack-exchange-dataset |
110,505 | Speed Up Access to Fractal-Like Array | <p>I'm trying to speed up the following function in c++: </p>

<pre><code>void num_to_xy(int num, int *x, int *y):
 *x = (cl & 0x03) | ((cl & 0x10) >> 2) | ((cl & 0x40) >> 3) | ((cl & 0x100) >> 4) | ((cl & 0x400) >> 5) | ((cl & 0x1000) >> 6) | ((cl &... | algorithms | 1 | Speed Up Access to Fractal-Like Array -- (algorithms)
<p>I'm trying to speed up the following function in c++: </p>

<pre><code>void num_to_xy(int num, int *x, int *y):
 *x = (cl & 0x03) | ((cl & 0x10) >> 2) | ((cl & 0x40) >> 3) | ((cl & 0x100) >> 4) | ((cl & 0x400)... | habedi/stack-exchange-dataset |
110,507 | Construct a DFA from the regular expression (a)*+(aab)* | <p>I've broken down the expression into two simpler DFAs but right now I'm stuck.</p>

<p><a href="https://i.stack.imgur.com/fGnh3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fGnh3.jpg" alt="enter image description here"></a></p>

<p>I don't know what to do with the expression a*,... | automata regular languages finite automata | 1 | Construct a DFA from the regular expression (a)*+(aab)* -- (automata regular languages finite automata)
<p>I've broken down the expression into two simpler DFAs but right now I'm stuck.</p>

<p><a href="https://i.stack.imgur.com/fGnh3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fGnh3.jpg"... | habedi/stack-exchange-dataset |
110,508 | Polynomial-time Compute the Number of States resulting from the NFA to DFA (greedy) conversion? | <p>The canonical NFA to DFA conversion, starting with an NFA with <span class="math-container">$n$</span> states, can result in a DFA with <span class="math-container">$2^n$</span> states. However, in many cases, there are states that are "unnecessary," such as when minimizing the resulting DFA. The most common case is... | finite automata | 1 | Polynomial-time Compute the Number of States resulting from the NFA to DFA (greedy) conversion? -- (finite automata)
<p>The canonical NFA to DFA conversion, starting with an NFA with <span class="math-container">$n$</span> states, can result in a DFA with <span class="math-container">$2^n$</span> states. However, in ma... | habedi/stack-exchange-dataset |
110,512 | how to find total paths in a graph which have only one vertex common with a given path | <p>Assume I have a undirected graph <span class="math-container">$G$</span> without cycles (i.e., a forest) and I am provided with pair of nodes <span class="math-container">$a$</span> and <span class="math-container">$b$</span>.</p>

<p>How can I find the total number of paths in the graph that do not share an... | algorithms graphs trees | 1 | how to find total paths in a graph which have only one vertex common with a given path -- (algorithms graphs trees)
<p>Assume I have a undirected graph <span class="math-container">$G$</span> without cycles (i.e., a forest) and I am provided with pair of nodes <span class="math-container">$a$</span> and <span class="ma... | habedi/stack-exchange-dataset |
110,515 | What is the height of a tree with recursion formula: $T(n) = T(n - \sqrt{n})$ | <p>I know if the time complexity of an algorithm is given with the above formula, then the algorithm works in constant time but my question is that what will be the height of the recursion tree for this formula?</p>
 | time complexity trees recursion | 1 | What is the height of a tree with recursion formula: $T(n) = T(n - \sqrt{n})$ -- (time complexity trees recursion)
<p>I know if the time complexity of an algorithm is given with the above formula, then the algorithm works in constant time but my question is that what will be the height of the recursion tree for this fo... | habedi/stack-exchange-dataset |
110,518 | NL problem? $CONN$= {$〈G,k〉$ ∶$G$ is undirected graph with at least k connected components} | <p>Consider the following decision problems: </p>

<p><span class="math-container">$CONN$</span>= {<span class="math-container">$〈G,k〉$</span> ∶ <span class="math-container">$G$</span> is undirected graph with at least <span class="math-container">$k$</span> connected components}
<br>
<span class="math-... | complexity theory graphs nondeterminism | 1 | NL problem? $CONN$= {$〈G,k〉$ ∶$G$ is undirected graph with at least k connected components} -- (complexity theory graphs nondeterminism)
<p>Consider the following decision problems: </p>

<p><span class="math-container">$CONN$</span>= {<span class="math-container">$〈G,k〉$</span> ∶ <span class="math-container">$... | habedi/stack-exchange-dataset |
110,527 | Using pumping lemma to prove irregularity of regular language - what is my error? | <p>I have a vital misunderstanding of the pumping lemma. In the following example I show an example of using it on a regular language to come to incorrect conclusions. What am I doing wrong?</p>

<p>L={ab}, assume the language is regular so by the pumping lemma there exists some n, and σ = αβγ and σ' = αβ^kγ ∈ ... | regular languages pumping lemma | 1 | Using pumping lemma to prove irregularity of regular language - what is my error? -- (regular languages pumping lemma)
<p>I have a vital misunderstanding of the pumping lemma. In the following example I show an example of using it on a regular language to come to incorrect conclusions. What am I doing wrong?</p>
&#... | habedi/stack-exchange-dataset |
110,537 | Showing Maximum Independent Set is $NP-hard$ | <p>I've read about Maximum Independent Set problem being both <span class="math-container">$NP-hard$</span> and <span class="math-container">$CoNP-hard$</span>. 
I know this can be shown using reduction from the corresponding Max-Clique problem, But I'm wondering - Is that the most straight forward reduction? Is it... | complexity theory graphs reductions | 1 | Showing Maximum Independent Set is $NP-hard$ -- (complexity theory graphs reductions)
<p>I've read about Maximum Independent Set problem being both <span class="math-container">$NP-hard$</span> and <span class="math-container">$CoNP-hard$</span>. 
I know this can be shown using reduction from the corresponding Max-... | habedi/stack-exchange-dataset |
110,540 | Is time complexity more important than space complexity? | <p>I've noticed quite a few cryptographic algorithms speak mainly of the time complexity of an algorithm. For example, with a hashing function h, find x given y = h(x). We normally speak on how long it will take. Or the time to find the discrete log for a public key.</p>

<p>Edit:</p>

<p>While writing ... | algorithms time complexity cryptography | 1 | Is time complexity more important than space complexity? -- (algorithms time complexity cryptography)
<p>I've noticed quite a few cryptographic algorithms speak mainly of the time complexity of an algorithm. For example, with a hashing function h, find x given y = h(x). We normally speak on how long it will take. Or th... | habedi/stack-exchange-dataset |
110,547 | How is functional property guaranteed in type theory when function type is defined? | <p>I understand that functions are not defined in type theory the same way they are defined in set theory, hence functional property is not directly defined when defining function type in type theory. But I want to know which part of function type definition in type theory guarantees functional property even if it is d... | type theory homotopy type theory | 1 | How is functional property guaranteed in type theory when function type is defined? -- (type theory homotopy type theory)
<p>I understand that functions are not defined in type theory the same way they are defined in set theory, hence functional property is not directly defined when defining function type in type theor... | habedi/stack-exchange-dataset |
110,582 | Can every Turing Machine be translated into a SAT formula? | <p>For the proof of "Cook-Levin Theorem", for a Turing Machine <span class="math-container">$M$</span> that accepts a language <span class="math-container">$L \in NP$</span> and input <span class="math-container">$x \in \{0,1\}^*$</span>, we can create a SAT Formula, that is satisfiable if and only if <span class="mat... | satisfiability halting problem | 1 | Can every Turing Machine be translated into a SAT formula? -- (satisfiability halting problem)
<p>For the proof of "Cook-Levin Theorem", for a Turing Machine <span class="math-container">$M$</span> that accepts a language <span class="math-container">$L \in NP$</span> and input <span class="math-container">$x \in \{0,1... | habedi/stack-exchange-dataset |
110,585 | How can the length of a string be $O(\log n)$? | <p>I have just started learning about time complexities and am currently reading Logarithmic Complexity. Here's an example of a piece of code which is <span class="math-container">$O(\log n)$</span>:</p>

<pre><code>def intToStr(i):
 '''Assumes i is a nonnegative int Returns the string representation of ... | time complexity python | 1 | How can the length of a string be $O(\log n)$? -- (time complexity python)
<p>I have just started learning about time complexities and am currently reading Logarithmic Complexity. Here's an example of a piece of code which is <span class="math-container">$O(\log n)$</span>:</p>

<pre><code>def intToStr(i):
... | habedi/stack-exchange-dataset |
110,588 | Searching a Treasure | <p>I was selected for a UG interview and the following was one of the questions asked:</p>
<blockquote>
<p>"Suppose we have an <span class="math-container">$8 \times 8$</span> grid. Under one of the blocks, I (the
interviewer) have hidden a treasure which you have to find by asking
questions to me.... | algorithms complexity theory time complexity search algorithms | 1 | Searching a Treasure -- (algorithms complexity theory time complexity search algorithms)
<p>I was selected for a UG interview and the following was one of the questions asked:</p>
<blockquote>
<p>"Suppose we have an <span class="math-container">$8 \times 8$</span> grid. Under one of the blocks, I (the
... | habedi/stack-exchange-dataset |
110,600 | Shortest path in a incomplete graph | <p>I know the Dijkstra algorithm to solve the "single source shortest path" problem in a graph. And I've seen people discuss solutions in a dynamic graph where edge/vertices are subject to change. <a href="https://cs.stackexchange.com/questions/7250/retrieving-the-shortest-path-of-a-dynamic-graph">Retrieving the shorte... | algorithms graphs data structures shortest path efficiency | 1 | Shortest path in a incomplete graph -- (algorithms graphs data structures shortest path efficiency)
<p>I know the Dijkstra algorithm to solve the "single source shortest path" problem in a graph. And I've seen people discuss solutions in a dynamic graph where edge/vertices are subject to change. <a href="https://cs.sta... | habedi/stack-exchange-dataset |
110,605 | Complexity of a Turing Machine when changing its alphabet to binary | <p>I found in 'Computational Complexity: A Modern approach' Book the following statement that i dont quite understand its proof:</p>

<blockquote>
 <p>For every f : {0, 1}∗ → {0, 1} and time-constructible T : N → N, if f is computable in time T(n) by a TM M using alphabet A, then it is computable in time 4... | turing machines time complexity | 1 | Complexity of a Turing Machine when changing its alphabet to binary -- (turing machines time complexity)
<p>I found in 'Computational Complexity: A Modern approach' Book the following statement that i dont quite understand its proof:</p>

<blockquote>
 <p>For every f : {0, 1}∗ → {0, 1} and time-constructib... | habedi/stack-exchange-dataset |
110,606 | Is the language L = {(a,b)* | #a * #b is an odd number} regular? | <p>Is the following language regular? <span class="math-container">$$\{ w \in \{a, b\}^* |\ \text{the product of the number of $a$'s and the number of $b$'s is an odd number}\} $$</span> </p>

<p>If i'm not mistaken the condition is the same as having an odd number of <span class="math-container">$a$</span>'s a... | automata regular languages finite automata | 1 | Is the language L = {(a,b)* | #a * #b is an odd number} regular? -- (automata regular languages finite automata)
<p>Is the following language regular? <span class="math-container">$$\{ w \in \{a, b\}^* |\ \text{the product of the number of $a$'s and the number of $b$'s is an odd number}\} $$</span> </p>

<p>If ... | habedi/stack-exchange-dataset |
110,612 | Turing machine loop and reject example | <p>I'm getting confused on these both. Reject the string does a stop while loop the machine goes on and on.</p>

<p>My textbook has one example on a reject state and no physical one for loop:</p>

<p>Assume that no reject state was given. And I input a string</p>

<p><span class="math-container"... | turing machines | 1 | Turing machine loop and reject example -- (turing machines)
<p>I'm getting confused on these both. Reject the string does a stop while loop the machine goes on and on.</p>

<p>My textbook has one example on a reject state and no physical one for loop:</p>

<p>Assume that no reject state was given. And I... | habedi/stack-exchange-dataset |
110,616 | Algorithm for generating random incrementing numbers up to a limit | <p>I'm trying to write a code to generate incremental sequences of numbers such as:</p>

<pre><code>0 + 1 + 3 + 5 + 1 = 9 
0 + 5 + 1 + 1 + 1 = 8 
0 + 1 + 1 + 2 + 1 = 5
</code></pre>

<p>I have 3 constraints: </p>

<p>1) I need to have limited number of addends (here it is <code>=5</c... | algorithms | 1 | Algorithm for generating random incrementing numbers up to a limit -- (algorithms)
<p>I'm trying to write a code to generate incremental sequences of numbers such as:</p>

<pre><code>0 + 1 + 3 + 5 + 1 = 9 
0 + 5 + 1 + 1 + 1 = 8 
0 + 1 + 1 + 2 + 1 = 5
</code></pre>

<p>I have 3 constraints: <... | habedi/stack-exchange-dataset |
110,628 | Is computer science really a branch or sub-branch of physics? | <p>Given that a computer is basically an electronic machine, is computer science really a branch of electronics, which is in turn a branch of physics?</p>
 | physics | 1 | Is computer science really a branch or sub-branch of physics? -- (physics)
<p>Given that a computer is basically an electronic machine, is computer science really a branch of electronics, which is in turn a branch of physics?</p>
 | habedi/stack-exchange-dataset |
110,635 | Question on the paper ``Self-Testing/Correcting for Polynomials and for Approximate Functions'' | <p>I am having some trouble really getting to a precise understanding of some of <a href="http://people.csail.mit.edu/ronitt/papers/glrsw.pdf" rel="nofollow noreferrer">Self-Testing/Correcting for Polynomials and for Approximate Functions</a> and would greatly appreciate help. Here is my understanding of section 3, <st... | polynomials testing | 1 | Question on the paper ``Self-Testing/Correcting for Polynomials and for Approximate Functions'' -- (polynomials testing)
<p>I am having some trouble really getting to a precise understanding of some of <a href="http://people.csail.mit.edu/ronitt/papers/glrsw.pdf" rel="nofollow noreferrer">Self-Testing/Correcting for Po... | habedi/stack-exchange-dataset |
110,640 | Proving a problem as NP-complete | <p>According to <a href="https://www.geeksforgeeks.org/np-completeness-set-1/" rel="nofollow noreferrer">this</a> article, 
A problem X can be proved to be NP-complete if an already existing NP-complete problem (say Y) can be polynomial-time reduced to current problem X. The problem also needs to be NP. Now my ques... | np complete np | 1 | Proving a problem as NP-complete -- (np complete np)
<p>According to <a href="https://www.geeksforgeeks.org/np-completeness-set-1/" rel="nofollow noreferrer">this</a> article, 
A problem X can be proved to be NP-complete if an already existing NP-complete problem (say Y) can be polynomial-time reduced to current pr... | habedi/stack-exchange-dataset |
110,643 | How to calculate Big O of $T(n) = aT(n^b) + f(n)$? | <p>I'm a student studying Big O. I know that we can solve <span class="math-container">$T(n) = aT(\frac{n}{b}) + f(n)$</span> by compering <span class="math-container">$n^{\log_b{a}}$</span> to <span class="math-container">$f(n)$</span> or </p>

<blockquote>
 <p><span class="math-container">$O(n^{\log_b{a}... | complexity theory time complexity big o notation | 1 | How to calculate Big O of $T(n) = aT(n^b) + f(n)$? -- (complexity theory time complexity big o notation)
<p>I'm a student studying Big O. I know that we can solve <span class="math-container">$T(n) = aT(\frac{n}{b}) + f(n)$</span> by compering <span class="math-container">$n^{\log_b{a}}$</span> to <span class="math-con... | habedi/stack-exchange-dataset |
110,644 | How does a Turing machine with one tape read its input? | <p>It's often implicitly assumed that we don't have to pay much attention to the difference between the program (which specifies the function being computed) and the input (the value on which that function is evaluated) when reasoning about Turing machines. In particular, people are often happy to assume that the progr... | turing machines computability | 1 | How does a Turing machine with one tape read its input? -- (turing machines computability)
<p>It's often implicitly assumed that we don't have to pay much attention to the difference between the program (which specifies the function being computed) and the input (the value on which that function is evaluated) when reas... | habedi/stack-exchange-dataset |
110,647 | Prove Subset-Sum is NP-complete - Alternative reduction? | <p>It is well known the Subset-Sum problem is NP-complete. This can be shown using a reduction from the 3SAT problem. I am wondering: is there any other NP-Complete problem that could be reduced to the Subset-Sum problem?</p>
 | complexity theory np complete subset sum | 1 | Prove Subset-Sum is NP-complete - Alternative reduction? -- (complexity theory np complete subset sum)
<p>It is well known the Subset-Sum problem is NP-complete. This can be shown using a reduction from the 3SAT problem. I am wondering: is there any other NP-Complete problem that could be reduced to the Subset-Sum prob... | habedi/stack-exchange-dataset |
110,674 | Is "Query Equivalence" decidable? | <p>I have studied in my Computability course that it is impossible to design an algorithm <span class="math-container">$A(x,y)$</span> which decides, for every couple of programs (<span class="math-container">$P_1$</span>, <span class="math-container">$P_2$</span>), whether they are equivalent (e.g. <span class="math-c... | computability database theory | 1 | Is "Query Equivalence" decidable? -- (computability database theory)
<p>I have studied in my Computability course that it is impossible to design an algorithm <span class="math-container">$A(x,y)$</span> which decides, for every couple of programs (<span class="math-container">$P_1$</span>, <span class="math-container"... | habedi/stack-exchange-dataset |
110,677 | String matching and bioinformatics | <p>I'm interestd in string-matching, I would like to know recent open problems in string-matching in field of bioinformatics.</p>
 | reference request bioinformatics string matching | 1 | String matching and bioinformatics -- (reference request bioinformatics string matching)
<p>I'm interestd in string-matching, I would like to know recent open problems in string-matching in field of bioinformatics.</p>
 | habedi/stack-exchange-dataset |
110,678 | Complexity of "half cycle" | <p>I'm working on the following problem:</p>
<p><em>HALFCYCLE (HALFC):</em></p>
<p><strong>Input:</strong></p>
<p>A directed graph <span class="math-container">$G = (V,E)$</span>.</p>
<p><strong>Output:</strong></p>
<p>Whether the longest cycle in <span class="math-container">$G$</span> has length <... | complexity theory np complete | 1 | Complexity of "half cycle" -- (complexity theory np complete)
<p>I'm working on the following problem:</p>
<p><em>HALFCYCLE (HALFC):</em></p>
<p><strong>Input:</strong></p>
<p>A directed graph <span class="math-container">$G = (V,E)$</span>.</p>
<p><strong>Output:</strong></p>
<p>Whether the longest... | habedi/stack-exchange-dataset |
110,680 | What is the graphic TSP? | <p>I'm not sure if I understand the following definition of the (well-known apparently) <em>Graphic TSP</em>, also known as <em>graph-TSP</em> :</p>

<blockquote>
 <p>...graph-TSP, that is, the traveling salesman problem where distances between cities are given by any graphic metric, i. e., the distance be... | graphs weighted graphs traveling salesman | 1 | What is the graphic TSP? -- (graphs weighted graphs traveling salesman)
<p>I'm not sure if I understand the following definition of the (well-known apparently) <em>Graphic TSP</em>, also known as <em>graph-TSP</em> :</p>

<blockquote>
 <p>...graph-TSP, that is, the traveling salesman problem where distance... | habedi/stack-exchange-dataset |
110,681 | Can the difference of a non-regular and a regular language be regular? | <p>I have some trouble understanding some exercises related to operations on regular languages.I tried to apply their closure properties, but I am not sure how to do the following exercises:</p>

<ol>
<li>If <span class="math-container">$L_2,L_3$</span> are regular and <span class="math-container">$L_1 \set... | automata regular languages | 1 | Can the difference of a non-regular and a regular language be regular? -- (automata regular languages)
<p>I have some trouble understanding some exercises related to operations on regular languages.I tried to apply their closure properties, but I am not sure how to do the following exercises:</p>

<ol>
<li>... | habedi/stack-exchange-dataset |
110,699 | calculating a shortest path in a table structure that changes in real time | <p>I have a table that looks like this</p>

<p><a href="https://i.stack.imgur.com/k6UJa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k6UJa.png" alt="enter image description here"></a></p>

<p>In table NPC - are AI like characters that move from one point to another. Player - a char... | shortest path | 1 | calculating a shortest path in a table structure that changes in real time -- (shortest path)
<p>I have a table that looks like this</p>

<p><a href="https://i.stack.imgur.com/k6UJa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k6UJa.png" alt="enter image description here"></a></p>

... | habedi/stack-exchange-dataset |
110,712 | Complexity and hardness of undirected path | <p>Let <span class="math-container">$PATH = \{(G,s,t) \mid \exists \text{path from}~s\text{ to }t\text{ in }G\}$</span>, where <span class="math-container">$G$</span> is a directed graph. We know that <span class="math-container">$PATH$</span> is <span class="math-container">$NL$</span> complete. I am wondering what th... | complexity theory space complexity | 1 | Complexity and hardness of undirected path -- (complexity theory space complexity)
<p>Let <span class="math-container">$PATH = \{(G,s,t) \mid \exists \text{path from}~s\text{ to }t\text{ in }G\}$</span>, where <span class="math-container">$G$</span> is a directed graph. We know that <span class="math-container">$PATH$<... | habedi/stack-exchange-dataset |
110,715 | Showing that a language is NP Complete (advice) | <p>I am currently getting ready for my final exam in computational models. I know that there aren't any rules or rule of thumb to show that a language is NP-complete and each problem has its own tricks, but I am really struggling with questions where they give me a language and showing that the language is NP-complete ... | complexity theory | 1 | Showing that a language is NP Complete (advice) -- (complexity theory)
<p>I am currently getting ready for my final exam in computational models. I know that there aren't any rules or rule of thumb to show that a language is NP-complete and each problem has its own tricks, but I am really struggling with questions wher... | habedi/stack-exchange-dataset |
110,718 | Number of equivalence classes in $P$ | <p>I am currently taking a course which involves computational complexity. I was told that polynomial equivalence (polynomial time reduction) divides P into exactly 3 equivalent classes, namely <span class="math-container">$\phi$</span> , <span class="math-container">$\Sigma^*$</span> and <span class="math-container">$... | complexity theory time complexity polynomial time | 1 | Number of equivalence classes in $P$ -- (complexity theory time complexity polynomial time)
<p>I am currently taking a course which involves computational complexity. I was told that polynomial equivalence (polynomial time reduction) divides P into exactly 3 equivalent classes, namely <span class="math-container">$\phi... | habedi/stack-exchange-dataset |
110,721 | Is $ L = \{ a^n\ |\ a^n \not\in L_n \} $ Turing recognizable (recursively enumerable)? | <blockquote>
 <p>Say <span class="math-container">$ \Sigma = \{a\} $</span>, <span class="math-container">$M_1, M_2, ... $</span> is an enumeration of all TMs that recognize languages over <span class="math-container">$\Sigma$</span> and <span class="math-container">$L_1, L_2, ... $</span> are respectively the lan... | turing machines undecidability semi decidability | 1 | Is $ L = \{ a^n\ |\ a^n \not\in L_n \} $ Turing recognizable (recursively enumerable)? -- (turing machines undecidability semi decidability)
<blockquote>
 <p>Say <span class="math-container">$ \Sigma = \{a\} $</span>, <span class="math-container">$M_1, M_2, ... $</span> is an enumeration of all TMs that recognize ... | habedi/stack-exchange-dataset |
110,731 | Universal hashing function probability | <p>Can somebody explain the following:</p>

<p><img src="https://scontent.fmuc2-1.fna.fbcdn.net/v/t1.15752-9/64433962_260132621514424_3576346785511112704_n.png?_nc_cat=108&_nc_oc=AQmCT-Vzb712Si5utFR_5EVpD1W5xFW_cOseawFkh9Aj82srwFt7rX-ummj5WbfLBrI&_nc_ht=scontent.fmuc2-1.fna&oh=962acd87872541bbb3436c... | hash | 1 | Universal hashing function probability -- (hash)
<p>Can somebody explain the following:</p>

<p><img src="https://scontent.fmuc2-1.fna.fbcdn.net/v/t1.15752-9/64433962_260132621514424_3576346785511112704_n.png?_nc_cat=108&_nc_oc=AQmCT-Vzb712Si5utFR_5EVpD1W5xFW_cOseawFkh9Aj82srwFt7rX-ummj5WbfLBrI&_nc_ht=s... | habedi/stack-exchange-dataset |
110,734 | Selecting items from two arrays without duplicate indices to get maximum sum | <p>Given two arrays both of length n, you have to choose exactly <em>k</em> values from the array 1 and <em>n-k</em> values from the other array, such that the sum of these values is maximum, with constraint that if you choose a value from some index of any of the array you cannot choose from same index of second array... | dynamic programming greedy algorithms | 1 | Selecting items from two arrays without duplicate indices to get maximum sum -- (dynamic programming greedy algorithms)
<p>Given two arrays both of length n, you have to choose exactly <em>k</em> values from the array 1 and <em>n-k</em> values from the other array, such that the sum of these values is maximum, with con... | habedi/stack-exchange-dataset |
110,737 | Superset of another language and recognizability of turing machines | <p><span class="math-container">$L_1$</span> = <span class="math-container">$\{\langle M \rangle \mid M$</span> is a turing machine and <span class="math-container">$M$</span> halts on some string<span class="math-container">$\}$</span></p>

<p><span class="math-container">$L_2$</span> = <span class="math-conta... | turing machines | 1 | Superset of another language and recognizability of turing machines -- (turing machines)
<p><span class="math-container">$L_1$</span> = <span class="math-container">$\{\langle M \rangle \mid M$</span> is a turing machine and <span class="math-container">$M$</span> halts on some string<span class="math-container">$\}$</... | habedi/stack-exchange-dataset |
110,738 | Can the pre-order traversal of two different trees be the same even though they are different? | <p><a href="https://cs.stackexchange.com/questions/96497/why-cant-we-just-use-preorder-traversal-to-check-if-a-tree-is-subtree-of-binary">This</a> question pretty much explains that they can, but does not show any examples of there being two different trees with the same pre-order traversal. </p>

<p>It is also... | trees binary trees graph traversal search trees | 1 | Can the pre-order traversal of two different trees be the same even though they are different? -- (trees binary trees graph traversal search trees)
<p><a href="https://cs.stackexchange.com/questions/96497/why-cant-we-just-use-preorder-traversal-to-check-if-a-tree-is-subtree-of-binary">This</a> question pretty much expl... | habedi/stack-exchange-dataset |
110,744 | Help: Context Free Grammar | <p>Construct the CFG given the following language:</p>

<p><span class="math-container">$$\{a^i \; b^j \; c^k \;|\; i = j \; or \; j = k \}$$</span></p>
 | context free | 1 | Help: Context Free Grammar -- (context free)
<p>Construct the CFG given the following language:</p>

<p><span class="math-container">$$\{a^i \; b^j \; c^k \;|\; i = j \; or \; j = k \}$$</span></p>
 | habedi/stack-exchange-dataset |
110,749 | Log-Space Reduction $USTCON\le_L CO-2Col$ | <p>I want to show that <span class="math-container">$USTCON\le_L CO-2Col$</span> (Log-Space reduction)</p>

<p><span class="math-container">$USTCON$</span> 
The <span class="math-container">$s-t$</span> connectivity problem for <strong>undirected</strong> graphs is
called <span class="math-container">$U... | complexity theory graphs reductions | 1 | Log-Space Reduction $USTCON\le_L CO-2Col$ -- (complexity theory graphs reductions)
<p>I want to show that <span class="math-container">$USTCON\le_L CO-2Col$</span> (Log-Space reduction)</p>

<p><span class="math-container">$USTCON$</span> 
The <span class="math-container">$s-t$</span> connectivity problem f... | habedi/stack-exchange-dataset |
110,750 | Can such a Turing-recognizable language exist? | <p>Suppose <span class="math-container">$\Sigma = \{a,b\}$</span>. Is the following claim correct?</p>

<blockquote>
 <p>There exists a Turing-recognizable language <span class="math-container">$L \subseteq \Sigma^*$</span> such as its complement is not Turing-recognizable, and for all <span class="math-co... | turing machines | 1 | Can such a Turing-recognizable language exist? -- (turing machines)
<p>Suppose <span class="math-container">$\Sigma = \{a,b\}$</span>. Is the following claim correct?</p>

<blockquote>
 <p>There exists a Turing-recognizable language <span class="math-container">$L \subseteq \Sigma^*$</span> such as its com... | habedi/stack-exchange-dataset |
110,753 | Is $\bigcup_{c \ge 1} \mathsf{DTime}(2^{cn})$ closed under polynomial reduction? | <p>It's well known <span class="math-container">$EXP$</span> is closed under polynomial reduction. It means 
<span class="math-container">$\bigcup_{c \ge 1} \mathsf{DTime}(2^{c^{n}})$</span> is closed under polynomial reduction. But what about <span class="math-container">$\bigcup_{c \ge 1} \mathsf{DTime}(2^{cn})$<... | complexity theory reductions | 1 | Is $\bigcup_{c \ge 1} \mathsf{DTime}(2^{cn})$ closed under polynomial reduction? -- (complexity theory reductions)
<p>It's well known <span class="math-container">$EXP$</span> is closed under polynomial reduction. It means 
<span class="math-container">$\bigcup_{c \ge 1} \mathsf{DTime}(2^{c^{n}})$</span> is closed ... | habedi/stack-exchange-dataset |
110,756 | When and what must be present on the left-hand side of the turnstile in metalogics? | <p>Let me show the problem on an example...</p>
<p>An actual task from one of the former exams:</p>
<blockquote>
<p>Consider a simple functional language:</p>
<p><span class="math-container">$$e::= x|n|e_1e_2|\lambda x.e$$</span></p>
<p>With typing rules:</p>
<p><span class="math-container">$$\t... | formal languages notation derivation | 1 | When and what must be present on the left-hand side of the turnstile in metalogics? -- (formal languages notation derivation)
<p>Let me show the problem on an example...</p>
<p>An actual task from one of the former exams:</p>
<blockquote>
<p>Consider a simple functional language:</p>
<p><span class="mat... | habedi/stack-exchange-dataset |
110,761 | How to find Maximum perimeter of rectangle in a grid with obstacles? (Dynamic Programming) | <p>Can someone tell me what am I doing wrong?</p>
<blockquote>
<p>Problem: <a href="https://codeforces.com/contest/22/problem/B" rel="nofollow noreferrer">https://codeforces.com/contest/22/problem/B</a></p>
<p>Editorial: <a href="https://codeforces.com/blog/entry/507" rel="nofollow noreferrer">https://codef... | algorithms algorithm analysis dynamic programming | 1 | How to find Maximum perimeter of rectangle in a grid with obstacles? (Dynamic Programming) -- (algorithms algorithm analysis dynamic programming)
<p>Can someone tell me what am I doing wrong?</p>
<blockquote>
<p>Problem: <a href="https://codeforces.com/contest/22/problem/B" rel="nofollow noreferrer">https://cod... | habedi/stack-exchange-dataset |
110,773 | Turing machine and boolean circuits | <p>As an example of languages that are in P/poly is the UHALT Problem :</p>

<blockquote>
 <p>UHALT = { 1^n: n's binary expansion encodes a pair such that M halts on input x}</p>
</blockquote>

<p>We can create a boolean circuit of just AND gates. 
However, we can create it only for a fixe... | turing machines circuits | 1 | Turing machine and boolean circuits -- (turing machines circuits)
<p>As an example of languages that are in P/poly is the UHALT Problem :</p>

<blockquote>
 <p>UHALT = { 1^n: n's binary expansion encodes a pair such that M halts on input x}</p>
</blockquote>

<p>We can create a boolean circuit... | habedi/stack-exchange-dataset |
110,775 | Is there a LL(K) Grammar which is not LALR(K) Grammar? | <p>It is easy to know that there are LALR(K) grammars which are not LL(K) because any grammar with left recursion which is LALR(K), is not LL(K) because all LL(K) grammar must be left recursion free. And the opposite? Is there a LL(K) Grammar which is not LALR(K) Grammar? Do you have an example?</p>

<p>Related... | formal languages formal grammars parsers lr k ll k | 1 | Is there a LL(K) Grammar which is not LALR(K) Grammar? -- (formal languages formal grammars parsers lr k ll k)
<p>It is easy to know that there are LALR(K) grammars which are not LL(K) because any grammar with left recursion which is LALR(K), is not LL(K) because all LL(K) grammar must be left recursion free. And the o... | habedi/stack-exchange-dataset |
110,784 | Is the sum $f+g$ of two one-way-functions a one-way-function? | <p>Since there exists a bijection of sets from <span class="math-container">$\{0,1\}^*$</span> to <span class="math-container">$\mathbb{N_0}$</span>, we might view one-way-functions as functions <span class="math-container">$f :\mathbb{N_0} \rightarrow \mathbb{N_0}$</span>. My question is, suppose <span class="math-con... | one way functions | 1 | Is the sum $f+g$ of two one-way-functions a one-way-function? -- (one way functions)
<p>Since there exists a bijection of sets from <span class="math-container">$\{0,1\}^*$</span> to <span class="math-container">$\mathbb{N_0}$</span>, we might view one-way-functions as functions <span class="math-container">$f :\mathbb... | habedi/stack-exchange-dataset |
110,788 | How to understand the CRC Algorithm from the CAN specification? | <p>I am trying to understand how the cyclic redundancy check (CRC) algorithm from <a href="http://esd.cs.ucr.edu/webres/can20.pdf" rel="nofollow noreferrer">the Controller Area Network (CAN) specification</a> works. Here is the pseudocode.</p>

<p><code>CRC_RG = 0; // initialize shift re... | crc | 1 | How to understand the CRC Algorithm from the CAN specification? -- (crc)
<p>I am trying to understand how the cyclic redundancy check (CRC) algorithm from <a href="http://esd.cs.ucr.edu/webres/can20.pdf" rel="nofollow noreferrer">the Controller Area Network (CAN) specification</a> works. Here is the pseudocode.</p>
... | habedi/stack-exchange-dataset |
110,798 | numerically stable log1pexp calculation | <p>What are good approximations for computing <code>log1pexp</code> for single precision and double precision floating point numbers?</p>

<p><strong>Note:</strong> <code>log1pexp(x)</code> is <code>log(1 + exp(x))</code></p>

<p>I have found few implementations of <code>log1pexp</code> for double preci... | floating point numerical algorithms numerical analysis c++ | 1 | numerically stable log1pexp calculation -- (floating point numerical algorithms numerical analysis c++)
<p>What are good approximations for computing <code>log1pexp</code> for single precision and double precision floating point numbers?</p>

<p><strong>Note:</strong> <code>log1pexp(x)</code> is <code>log(1 + e... | habedi/stack-exchange-dataset |
110,817 | What is the space complexity of Dijkstra Algorithm? | <p>As per my understanding. The space complexity will be O(V). An array of V nodes will be created which in turn be used to create the Min heap.</p>

<p>But <a href="http://igraph.wikidot.com/algorithm-space-time-complexity" rel="nofollow noreferrer">this</a> link is stating that It is O(V^2)? I don't understa... | algorithms | 1 | What is the space complexity of Dijkstra Algorithm? -- (algorithms)
<p>As per my understanding. The space complexity will be O(V). An array of V nodes will be created which in turn be used to create the Min heap.</p>

<p>But <a href="http://igraph.wikidot.com/algorithm-space-time-complexity" rel="nofollow nore... | habedi/stack-exchange-dataset |
110,833 | Derandomize MAX-CUT problem using $\log n$ bits | <p>Consider the MAX-CUT problem. We can flip <span class="math-container">$n$</span> coins to generate a random cut, and by linearity of expectation we get that with "good probability" our cut we'll be bigger then <span class="math-container">$\frac{n}{2}$</span>.</p>

<p>Using pseudo random generators (XOR fo... | randomness max cut | 1 | Derandomize MAX-CUT problem using $\log n$ bits -- (randomness max cut)
<p>Consider the MAX-CUT problem. We can flip <span class="math-container">$n$</span> coins to generate a random cut, and by linearity of expectation we get that with "good probability" our cut we'll be bigger then <span class="math-container">$\fr... | habedi/stack-exchange-dataset |
110,845 | Wikipedia says this grammar is LR(0), but Grammophone says it is not; is it? | <pre><code> E -> E * B .
 E -> E + B .
 E -> B .
 B -> 0 .
 B -> 1 .
</code></pre>
<p>I am confused because <a href="https://en.wikipedia.org/wiki/LR_parser#Additional_example_1+1" rel="nofollow noreferrer">Wikipedia cites this grammar as an example of an LR(0) grammar</a> an... | context free formal grammars parsers lr k | 1 | Wikipedia says this grammar is LR(0), but Grammophone says it is not; is it? -- (context free formal grammars parsers lr k)
<pre><code> E -> E * B .
 E -> E + B .
 E -> B .
 B -> 0 .
 B -> 1 .
</code></pre>
<p>I am confused because <a href="https://en.wikipedia.org/wiki/LR_pa... | habedi/stack-exchange-dataset |
110,851 | Is $L(G) \subseteq L(R)$ decidable? | <p>Is the following problem decidable?</p>

<blockquote>
 <p>Given a context-free grammar <span class="math-container">$G$</span> and a regular expression <span class="math-container">$R$</span>, is <span class="math-container">$L(G) \subseteq L(R)$</span>?</p>
</blockquote>

<p>It is given tha... | regular languages context free undecidability | 1 | Is $L(G) \subseteq L(R)$ decidable? -- (regular languages context free undecidability)
<p>Is the following problem decidable?</p>

<blockquote>
 <p>Given a context-free grammar <span class="math-container">$G$</span> and a regular expression <span class="math-container">$R$</span>, is <span class="math-con... | habedi/stack-exchange-dataset |
110,880 | Why does coNP⊆NP∖P imply that the polynomial hierarchy collapses? | <p>I was looking for some information on 1-in-3 SAT and came across <a href="https://arxiv.org/abs/1808.02821" rel="nofollow noreferrer">this paper</a>, last updated 9 days ago, which claims that the Polynomial Time Hierarchy collapses "to the level above P=NP". That's quite exciting if you ask me, although I don't hav... | complexity theory time complexity np | 1 | Why does coNP⊆NP∖P imply that the polynomial hierarchy collapses? -- (complexity theory time complexity np)
<p>I was looking for some information on 1-in-3 SAT and came across <a href="https://arxiv.org/abs/1808.02821" rel="nofollow noreferrer">this paper</a>, last updated 9 days ago, which claims that the Polynomial T... | habedi/stack-exchange-dataset |
110,882 | Matrix Inversion in the complexity class $P$ seen as a decision problem | <p>If the set <span class="math-container">$P$</span> is defined as the set of decision problems that can be solved by a deterministic Turing Machine in polynomial time, and matrix inversion using Gaussian elimination is <span class="math-container">$O (n^3)$</span>, then how can I relate these two concepts to conclude... | complexity theory | 1 | Matrix Inversion in the complexity class $P$ seen as a decision problem -- (complexity theory)
<p>If the set <span class="math-container">$P$</span> is defined as the set of decision problems that can be solved by a deterministic Turing Machine in polynomial time, and matrix inversion using Gaussian elimination is <spa... | habedi/stack-exchange-dataset |
110,888 | Master theorem: When a $f(n)$ is smaller or larger than $n^{\log_b a}$by less than a polynomial factor | <p>I was trying to solve the following question while reviewing <a href="https://brilliant.org/wiki/master-theorem/" rel="nofollow noreferrer">master theorem</a>.</p>

<p>Which of the following asymptotically grows faster.</p>

<p>(a) <span class="math-container">$ T(n) = 4T(n/2) + 10n $</span></p>
... | asymptotics master theorem | 1 | Master theorem: When a $f(n)$ is smaller or larger than $n^{\log_b a}$by less than a polynomial factor -- (asymptotics master theorem)
<p>I was trying to solve the following question while reviewing <a href="https://brilliant.org/wiki/master-theorem/" rel="nofollow noreferrer">master theorem</a>.</p>

<p>Which ... | habedi/stack-exchange-dataset |
110,894 | In a Turing machine, what is the difference between the instruction table and the algorithm? | <p>In a Turing machine, what is the difference between the instruction table and the algorithm?</p>

<p>The instruction table seems to be an algorithm for completing the task no?</p>
 | algorithms turing machines computability | 1 | In a Turing machine, what is the difference between the instruction table and the algorithm? -- (algorithms turing machines computability)
<p>In a Turing machine, what is the difference between the instruction table and the algorithm?</p>

<p>The instruction table seems to be an algorithm for completing the tas... | habedi/stack-exchange-dataset |
110,897 | Why sum of two binary numbers cannot be determined in $NC^0$ but in $AC^0$? | <p>Why sum of two binary numbers cannot be determined in <span class="math-container">$NC^0$</span> but it can be determined in <span class="math-container">$AC^0$</span>?</p>
 | complexity theory circuits nc | 1 | Why sum of two binary numbers cannot be determined in $NC^0$ but in $AC^0$? -- (complexity theory circuits nc)
<p>Why sum of two binary numbers cannot be determined in <span class="math-container">$NC^0$</span> but it can be determined in <span class="math-container">$AC^0$</span>?</p>
 | habedi/stack-exchange-dataset |
110,899 | Multiway Cut question | <p>I am trying to understand Multiway Cut, and basically how the Multiway Cut works. I am searching google many hours to find a good example to understand. A good example that I am trying to understand is this:</p>

<p><a href="http://crab.rutgers.edu/~rajivg/studentTalks/multiwayCut.pdf" rel="nofollow noreferr... | algorithms | 1 | Multiway Cut question -- (algorithms)
<p>I am trying to understand Multiway Cut, and basically how the Multiway Cut works. I am searching google many hours to find a good example to understand. A good example that I am trying to understand is this:</p>

<p><a href="http://crab.rutgers.edu/~rajivg/studentTalks/m... | habedi/stack-exchange-dataset |
110,903 | A deterministic FA for $0^*1^*$ is required | <p>A <strong>deterministic finite automaton without <span class="math-container">$\epsilon$</span> steps</strong> for the language <span class="math-container">$0^*1^*$</span> is <strong>required</strong>.
Any nice picture ? I have created a NFA for this language which has 2 states <span class="math-container">$Q_1... | formal languages regular languages finite automata regular expressions | 1 | A deterministic FA for $0^*1^*$ is required -- (formal languages regular languages finite automata regular expressions)
<p>A <strong>deterministic finite automaton without <span class="math-container">$\epsilon$</span> steps</strong> for the language <span class="math-container">$0^*1^*$</span> is <strong>required</str... | habedi/stack-exchange-dataset |
110,905 | Binary search uneven split number of queries? | <p>For even split binary search (repeated halving) number of queries is log with base 2. According to Skiena's Algorithm Design Manual, if the split in binary search is by ratio 1/3:2/3 instead of 1/2:1/2, then number of queries is log with base 3/2. Why is this so? Would someone please help me get an intuitive underst... | algorithms binary search | 1 | Binary search uneven split number of queries? -- (algorithms binary search)
<p>For even split binary search (repeated halving) number of queries is log with base 2. According to Skiena's Algorithm Design Manual, if the split in binary search is by ratio 1/3:2/3 instead of 1/2:1/2, then number of queries is log with bas... | habedi/stack-exchange-dataset |
110,907 | DSPACE(f(n)) closed under complement | <p>I think you can create the complementary language that is an element of <strong>DSPACE</strong>(<span class="math-container">$f(n)$</span>), where <span class="math-container">$f(n) \geq \log(n)$</span> by adding a step to the algorithm that reverses the answer. By that the function <span class="math-container">$f(n... | complexity theory complexity classes closure properties | 1 | DSPACE(f(n)) closed under complement -- (complexity theory complexity classes closure properties)
<p>I think you can create the complementary language that is an element of <strong>DSPACE</strong>(<span class="math-container">$f(n)$</span>), where <span class="math-container">$f(n) \geq \log(n)$</span> by adding a step... | habedi/stack-exchange-dataset |
110,913 | Questions about Turing Machine | <p>Below I will list a concrete example and the confusion it causes.</p>

<p>Let's first say we have a decision problem, which is:</p>

<p>"Is X <= 400?"</p>

<p>We define the alphabet as the set of natural numbers.</p>

<p>The language formed by this problem is <span class="math-cont... | turing machines | 1 | Questions about Turing Machine -- (turing machines)
<p>Below I will list a concrete example and the confusion it causes.</p>

<p>Let's first say we have a decision problem, which is:</p>

<p>"Is X <= 400?"</p>

<p>We define the alphabet as the set of natural numbers.</p>

<p>The langu... | habedi/stack-exchange-dataset |
110,915 | Linear programing, objective function. variable depending on the sign of another variable | <p>I have the variable Si. How to express a variable Di in LP that satisfies:</p>

<ul>
<li><code>Di=100*Si</code> if <code>Si>=0</code> </li>
<li><code>Di=-200*Si</code> if <code>Si<0</code></li>
</ul>

<p>The objective function would be <code>Min{Sum(Di)}</code></p>
 | linear programming | 1 | Linear programing, objective function. variable depending on the sign of another variable -- (linear programming)
<p>I have the variable Si. How to express a variable Di in LP that satisfies:</p>

<ul>
<li><code>Di=100*Si</code> if <code>Si>=0</code> </li>
<li><code>Di=-200*Si</code> if <code>Si<... | habedi/stack-exchange-dataset |
110,921 | How do I prove no algorithm exists for a given problem? | <p>Is there a general framework for showing that a problem has no algorithm? For example, to show that two problems are equally as hard to each other, we use reduction.</p>

<p>One example of where this was done, is Hilbert's 10th problem</p>
 | complexity theory | 1 | How do I prove no algorithm exists for a given problem? -- (complexity theory)
<p>Is there a general framework for showing that a problem has no algorithm? For example, to show that two problems are equally as hard to each other, we use reduction.</p>

<p>One example of where this was done, is Hilbert's 10th pr... | habedi/stack-exchange-dataset |
110,923 | Can any NP-Complete Problem be solved using at most polynomial space (but while using exponential time?) | <p>I read about <a href="https://en.wikipedia.org/wiki/NP-completeness" rel="noreferrer">NPC</a> and its relationship to <a href="https://en.wikipedia.org/wiki/PSPACE" rel="noreferrer">PSPACE</a> and I wish to know whether NPC problems can be deterministicly solved using an algorithm with worst case polynomial space re... | complexity theory np complete np | 1 | Can any NP-Complete Problem be solved using at most polynomial space (but while using exponential time?) -- (complexity theory np complete np)
<p>I read about <a href="https://en.wikipedia.org/wiki/NP-completeness" rel="noreferrer">NPC</a> and its relationship to <a href="https://en.wikipedia.org/wiki/PSPACE" rel="nore... | habedi/stack-exchange-dataset |
110,934 | Is there any relationship between time complexity and space complexity of an algorithm? | <p>For example:</p>

<p>If algorithm A takes an input of size n, and has a time complexity of O(a^n) and a space complexity of O(1)</p>

<p>Is there a way to increase the space complexity to something like O(n^2) that would guarantee that the time complexity would decrease?</p>
 | complexity theory turing machines | 1 | Is there any relationship between time complexity and space complexity of an algorithm? -- (complexity theory turing machines)
<p>For example:</p>

<p>If algorithm A takes an input of size n, and has a time complexity of O(a^n) and a space complexity of O(1)</p>

<p>Is there a way to increase the space ... | habedi/stack-exchange-dataset |
110,935 | Why do we use worse-case when categorising problems? | <p>Maybe I am wrong, but I read that when we categorise problems in their respective complexity classes, we use worse-case analysis.</p>

<p>Why don't we use the average case?</p>

<p>I imagine we could have a problem in NP when we look at it's worse-case, but when we look at it's average-case we could ... | complexity theory complexity classes | 1 | Why do we use worse-case when categorising problems? -- (complexity theory complexity classes)
<p>Maybe I am wrong, but I read that when we categorise problems in their respective complexity classes, we use worse-case analysis.</p>

<p>Why don't we use the average case?</p>

<p>I imagine we could have a... | habedi/stack-exchange-dataset |
110,938 | Given a randomised algorithm for a problem, is there a corresponding deterministic algorithm? | <p>Does every randomised algorithm have a corresponding deterministic algorithm solving the same problem?</p>

<p>I'm going to guess that the deterministic algorithm will take more time, while the randomised algorithm although it has errors will generally be faster. This is from what I have seen of them so far.... | complexity theory | 1 | Given a randomised algorithm for a problem, is there a corresponding deterministic algorithm? -- (complexity theory)
<p>Does every randomised algorithm have a corresponding deterministic algorithm solving the same problem?</p>

<p>I'm going to guess that the deterministic algorithm will take more time, while th... | habedi/stack-exchange-dataset |
110,951 | How to calculate point in 3D space from multiple perspective | <p>I have multiple camera in different points.</p>

<p>I have their position and rotation as <span class="math-container">$(x,y,z)$</span> , <span class="math-container">$(\alpha,\beta,\gamma)$</span> or <span class="math-container">$( roll, pitch, yaw)$</span> .</p>

<p>And I have output like this :</... | computational geometry computer vision | 1 | How to calculate point in 3D space from multiple perspective -- (computational geometry computer vision)
<p>I have multiple camera in different points.</p>

<p>I have their position and rotation as <span class="math-container">$(x,y,z)$</span> , <span class="math-container">$(\alpha,\beta,\gamma)$</span> or <sp... | habedi/stack-exchange-dataset |
110,955 | Does a Non-Deterministic Turing Machine solve all problems in P in constant time? | <p>If a non-deterministic Turing machine can just "guess" the correct answer to a problem, does it do this in constant time/immediately? Also, does this also apply to problems in NP too?</p>
 | complexity theory turing machines | 1 | Does a Non-Deterministic Turing Machine solve all problems in P in constant time? -- (complexity theory turing machines)
<p>If a non-deterministic Turing machine can just "guess" the correct answer to a problem, does it do this in constant time/immediately? Also, does this also apply to problems in NP too?</p>
 | habedi/stack-exchange-dataset |
110,959 | Prove that the language L = {w1, w1w2, w1w2w3, ..} is regular, provided wi is in a regular language | <p>Let's assume that we're working over a finite alphabet <span class="math-container">$\Sigma=\{a, b\}$</span>. How can one prove that <span class="math-container">$$L_2=\{w_1w_2...w_m| m ∈ \mathbb{N}, ∀i(w_i ∈ L)\}$$</span> is a regular language, provided that L is regular? By the way, L is a fixed language in the pr... | formal languages automata | 1 | Prove that the language L = {w1, w1w2, w1w2w3, ..} is regular, provided wi is in a regular language -- (formal languages automata)
<p>Let's assume that we're working over a finite alphabet <span class="math-container">$\Sigma=\{a, b\}$</span>. How can one prove that <span class="math-container">$$L_2=\{w_1w_2...w_m| m ... | habedi/stack-exchange-dataset |
110,962 | Given price and number of pages of each book, What is the maximum number of pages you can buy? | <p>You are in a book shop which sells n different books. You know the price and number of pages of each book.</p>

<p>You have decided that the total price of your purchases will be at most x. What is the maximum number of pages you can buy? You can buy each book at most once.</p>

<p>Example:</p>
&... | dynamic programming recursion | 1 | Given price and number of pages of each book, What is the maximum number of pages you can buy? -- (dynamic programming recursion)
<p>You are in a book shop which sells n different books. You know the price and number of pages of each book.</p>

<p>You have decided that the total price of your purchases will be ... | habedi/stack-exchange-dataset |
110,965 | $NL^2 = NDSPACE(\log^2n)$ is closed under complement | <ul>
<li>From Savitch's theorem we have <span class="math-container">$NL^2 \subseteq L^4$</span>, which is deterministic and thus closed under complement.</li>
<li>From Immerman–Szelepcsényi theorem we have <span class="math-container">$NL = coNL$</span>.</li>
</ul>

<p>Why then <span class="math-co... | complexity theory space complexity | 1 | $NL^2 = NDSPACE(\log^2n)$ is closed under complement -- (complexity theory space complexity)
<ul>
<li>From Savitch's theorem we have <span class="math-container">$NL^2 \subseteq L^4$</span>, which is deterministic and thus closed under complement.</li>
<li>From Immerman–Szelepcsényi theorem we have <span class=... | habedi/stack-exchange-dataset |
110,969 | Logical characterization of $NC^1$ | <p>Morioka in his 2005 dissertation <a href="https://link.springer.com/article/10.1007/s00153-005-0282-2" rel="nofollow noreferrer">[1]</a> referenced <a href="https://www.sciencedirect.com/science/article/pii/002200009090022D" rel="nofollow noreferrer">"On Uniformity within <span class="math-container">$NC^1$</span>"<... | complexity theory circuits first order logic | 1 | Logical characterization of $NC^1$ -- (complexity theory circuits first order logic)
<p>Morioka in his 2005 dissertation <a href="https://link.springer.com/article/10.1007/s00153-005-0282-2" rel="nofollow noreferrer">[1]</a> referenced <a href="https://www.sciencedirect.com/science/article/pii/002200009090022D" rel="no... | habedi/stack-exchange-dataset |
110,984 | Are the languages recognized by deterministic one-counter machines equivalent to deterministic context free language? | <p>In <em>Introduction to Automata Theory, Languages, and Computation</em>, John Hopcroft mentioned[1]</p>

<blockquote>
 <p>In fact the languages of one counter machines are accepted by deterministic PDA's although the proof is surprisingly complex.</p>
</blockquote>

<p>How to prove that?</p>... | formal languages automata context free pushdown automata | 1 | Are the languages recognized by deterministic one-counter machines equivalent to deterministic context free language? -- (formal languages automata context free pushdown automata)
<p>In <em>Introduction to Automata Theory, Languages, and Computation</em>, John Hopcroft mentioned[1]</p>

<blockquote>
 <p>In... | habedi/stack-exchange-dataset |
110,991 | Mistake in a proof of termination phase of Simplex algorithm in CLRS? | <p>There is a pseudo-code for Simplex algorithm in CLRS:</p>
<p><a href="https://i.stack.imgur.com/vvoV8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vvoV8.png" alt="enter image description here" /></a></p>
<p>The proof consists from three-part loop invariant:</p>
<blockquote>
<p>P... | algorithms linear programming correctness proof | 1 | Mistake in a proof of termination phase of Simplex algorithm in CLRS? -- (algorithms linear programming correctness proof)
<p>There is a pseudo-code for Simplex algorithm in CLRS:</p>
<p><a href="https://i.stack.imgur.com/vvoV8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vvoV8.png" alt="enter... | habedi/stack-exchange-dataset |
110,992 | Forcing an edge to be in S-T min-cut | <p>Given a flow-network <span class="math-container">$N=(G,c,s,t)$</span> and an edge <span class="math-container">$e=(u,v)$</span>, I am trying to build an algorithm that finds a minimum <span class="math-container">$(S,T)$</span> cut in the given network, that includes e.</p>

<p>So, I tried couple of steps, ... | algorithms graphs network flow minimum cuts | 1 | Forcing an edge to be in S-T min-cut -- (algorithms graphs network flow minimum cuts)
<p>Given a flow-network <span class="math-container">$N=(G,c,s,t)$</span> and an edge <span class="math-container">$e=(u,v)$</span>, I am trying to build an algorithm that finds a minimum <span class="math-container">$(S,T)$</span> cu... | habedi/stack-exchange-dataset |
110,994 | Upper bound $T(n) = 9T(\sqrt[3]{n}) + O(1)$ | <p>The problem is this: Use the recursion-tree method to give a good asymptotic upper bound on <span class="math-container">$$ T(n) = 9T(\sqrt[3]n) + \Theta(1). $$</span> I am able to get the tree started and find a pattern with the sub-problems, but I am having difficulty finding the total cost of the running times th... | recurrence relation | 1 | Upper bound $T(n) = 9T(\sqrt[3]{n}) + O(1)$ -- (recurrence relation)
<p>The problem is this: Use the recursion-tree method to give a good asymptotic upper bound on <span class="math-container">$$ T(n) = 9T(\sqrt[3]n) + \Theta(1). $$</span> I am able to get the tree started and find a pattern with the sub-problems, but ... | habedi/stack-exchange-dataset |
110,997 | Thorup : What is the meaning of super distance? | <p>While reading Thorup's Algorithm to solve SSSP problem, I have one point that I can't understand: super distance.</p>

<p>It says: "For each vertex we have a super distance <span class="math-container">$D(v)\geq d(v)$</span>"</p>

<p><span class="math-container">$d(v)$</span> must refer the shortest ... | algorithms graphs shortest path | 1 | Thorup : What is the meaning of super distance? -- (algorithms graphs shortest path)
<p>While reading Thorup's Algorithm to solve SSSP problem, I have one point that I can't understand: super distance.</p>

<p>It says: "For each vertex we have a super distance <span class="math-container">$D(v)\geq d(v)$</span>... | habedi/stack-exchange-dataset |
110,999 | Church Turing thesis | <p>What is the exact statement of the Church Turing thesis?</p>

<p>Is it fair to say anything computable in the physical world can be computed by a Turing machine? If so, how does a Turing machine handle continuous variable computations (for example, computing solutions to differential equations or storing/com... | computability | 1 | Church Turing thesis -- (computability)
<p>What is the exact statement of the Church Turing thesis?</p>

<p>Is it fair to say anything computable in the physical world can be computed by a Turing machine? If so, how does a Turing machine handle continuous variable computations (for example, computing solutions ... | habedi/stack-exchange-dataset |
111,006 | Why are four context sensitive grammar (CSG) rules needed to represent AB -> CD? | <p>In <a href="https://en.wikipedia.org/wiki/Kuroda_normal_form" rel="nofollow noreferrer">Wikipedia</a> of Kuroda normal form, it says</p>

<blockquote>
 <p>A straightforward technique attributed to György Révész transforms a grammar in Kuroda's form to Chomsky's CSG: AB → CD is replaced by four context-s... | formal grammars context sensitive | 1 | Why are four context sensitive grammar (CSG) rules needed to represent AB -> CD? -- (formal grammars context sensitive)
<p>In <a href="https://en.wikipedia.org/wiki/Kuroda_normal_form" rel="nofollow noreferrer">Wikipedia</a> of Kuroda normal form, it says</p>

<blockquote>
 <p>A straightforward technique a... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.