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 |
|---|---|---|---|---|---|---|
55,649 | How to choose symbols to replace for this left-most derivation? | <p>I have a context free grammar such as the following:</p>

<p>$E→E+T | T$<br>
$T→T×F | F$<br>
$F→(E) | a$</p>

<p>Using the left-most derivation, the following can be derived:</p>

<p>$E⇒E+T⇒T+T⇒F+T⇒a+T$<br>
 $⇒a+F⇒a+(E)⇒a+(T)$<br>
 $⇒a+(T×F)⇒a+(F×F)$<br>
 $⇒a+(a×F)=a... | context free formal grammars | 1 | How to choose symbols to replace for this left-most derivation? -- (context free formal grammars)
<p>I have a context free grammar such as the following:</p>

<p>$E→E+T | T$<br>
$T→T×F | F$<br>
$F→(E) | a$</p>

<p>Using the left-most derivation, the following can be derived:</p>

<p>$E⇒E... | habedi/stack-exchange-dataset |
55,653 | Are there color conventions in CS? | <p>I don't remember seeing any color conventions in Computer Science used to represent some abstract information or to simplify diagrams.</p>

<p>For instance, chemists have the <a href="https://en.wikipedia.org/wiki/CPK_coloring" rel="nofollow">CPK coloring</a> which associates elements to colors.</p>

... | education notation | 1 | Are there color conventions in CS? -- (education notation)
<p>I don't remember seeing any color conventions in Computer Science used to represent some abstract information or to simplify diagrams.</p>

<p>For instance, chemists have the <a href="https://en.wikipedia.org/wiki/CPK_coloring" rel="nofollow">CPK col... | habedi/stack-exchange-dataset |
55,677 | Is this a proof that SET COVER is not an NP-hard problem? | <p>In this <a href="http://grid.cs.gsu.edu/~cscazz/CS8550/dense.pdf" rel="nofollow">paper</a>, Karpinski and Zelikovsky introduce the SET COVER and the $\epsilon$-DENSE SET COVER problems as follows:</p>

<blockquote>
 <p><strong>Set Cover Problem</strong>. Let $X = \{x_1, \ldots, x_k\}$ be a finite set an... | complexity theory graphs np hard approximation set cover | 1 | Is this a proof that SET COVER is not an NP-hard problem? -- (complexity theory graphs np hard approximation set cover)
<p>In this <a href="http://grid.cs.gsu.edu/~cscazz/CS8550/dense.pdf" rel="nofollow">paper</a>, Karpinski and Zelikovsky introduce the SET COVER and the $\epsilon$-DENSE SET COVER problems as follows:<... | habedi/stack-exchange-dataset |
55,679 | Need for an augmented grammar | <p>The question is under the concept of LR parser. 
Suppose the original grammar is<br>
S->AA<br>
A->aA|b</p>

<p>Is it necessary to add an additional rule S'->S to make it as augmented grammar?
In short, I want to know the use of augmented grammar.</p>
 | formal grammars parsers lr k | 1 | Need for an augmented grammar -- (formal grammars parsers lr k)
<p>The question is under the concept of LR parser. 
Suppose the original grammar is<br>
S->AA<br>
A->aA|b</p>

<p>Is it necessary to add an additional rule S'->S to make it as augmented grammar?
In short, I want to know the use of a... | habedi/stack-exchange-dataset |
55,683 | How many number of different binary trees are possible for a given postorder (or preorder) traversal | <p>I came across the problem: </p>

<blockquote>
 <p>What is the number of binary trees with 3 nodes which when traversed in postorder give the sequence A,B,C?</p>
</blockquote>

<p>Now 3 being small number I was quick to draw all possible binary trees and come at the conclusion that there can ... | graphs combinatorics trees binary trees graph traversal | 1 | How many number of different binary trees are possible for a given postorder (or preorder) traversal -- (graphs combinatorics trees binary trees graph traversal)
<p>I came across the problem: </p>

<blockquote>
 <p>What is the number of binary trees with 3 nodes which when traversed in postorder give the s... | habedi/stack-exchange-dataset |
55,688 | representing set of non-overlaping string in formal notation | <p>I want to represent a set of any substrings which come from an original string with constraint that all substrings should not be overlapped. To be more clear please consider the example below:</p>

<p>e.g.</p>

<pre><code>orignal_string = "ABCDEFG" // this can be any characters.
substring = ... | formal languages strings notation | 1 | representing set of non-overlaping string in formal notation -- (formal languages strings notation)
<p>I want to represent a set of any substrings which come from an original string with constraint that all substrings should not be overlapped. To be more clear please consider the example below:</p>

<p>e.g.</p>... | habedi/stack-exchange-dataset |
55,697 | Indexing a dependent type on a value? | <p>If i'm recalling from Robert Harper's lectures <a href="http://www.cs.cmu.edu/~rwh/courses/hott/" rel="nofollow">Homotopy type theory</a> A dependent type is a family of type index by a type. If we allow index to be just a value can we gain something instead of allowing to be a type ? </p>

<p>Is that the sa... | type theory dependent types | 1 | Indexing a dependent type on a value? -- (type theory dependent types)
<p>If i'm recalling from Robert Harper's lectures <a href="http://www.cs.cmu.edu/~rwh/courses/hott/" rel="nofollow">Homotopy type theory</a> A dependent type is a family of type index by a type. If we allow index to be just a value can we gain somet... | habedi/stack-exchange-dataset |
55,700 | Implication of Berman and Hartmanis conjecture | <p>I am reading "Complexity and Cryptography" by Talbolt and Welsh. The book mentions the <a href="https://en.wikipedia.org/wiki/Berman%E2%80%93Hartmanis_conjecture">Berman and Hartmanis conjecture</a> :</p>

<blockquote>
 <p>All $NP$-Complete languages are $p$-isomorphic.</p>
</blockquote>

<p... | complexity theory time complexity np complete np | 1 | Implication of Berman and Hartmanis conjecture -- (complexity theory time complexity np complete np)
<p>I am reading "Complexity and Cryptography" by Talbolt and Welsh. The book mentions the <a href="https://en.wikipedia.org/wiki/Berman%E2%80%93Hartmanis_conjecture">Berman and Hartmanis conjecture</a> :</p>

<b... | habedi/stack-exchange-dataset |
55,701 | Size of instance after reduction | <p>A decision problem $C$ is $NP$-complete if $C$ is in $NP$, and every problem in $NP$ is reducible to $C$ in polynomial time.</p>

<p>Reduction means transforming an instance of one problem $A$ to an instance of another problem $B$, and by using an algorithm that solves $B$ we can obtain the solution to $A$ f... | complexity theory time complexity np complete reductions | 1 | Size of instance after reduction -- (complexity theory time complexity np complete reductions)
<p>A decision problem $C$ is $NP$-complete if $C$ is in $NP$, and every problem in $NP$ is reducible to $C$ in polynomial time.</p>

<p>Reduction means transforming an instance of one problem $A$ to an instance of ano... | habedi/stack-exchange-dataset |
55,703 | Data structure for efficient searching, when insertions and removals are only one-sided | <p>I need a data structure for storing a number $n$ of elements, each of whom is associated with some different time $t_i$. $n$ varies and while it has a theoretical upper limit, this is many orders of magnitude larger than what is typically used.</p>

<p>Through my application I can ensure that:</p>

<... | data structures search trees algorithm design | 1 | Data structure for efficient searching, when insertions and removals are only one-sided -- (data structures search trees algorithm design)
<p>I need a data structure for storing a number $n$ of elements, each of whom is associated with some different time $t_i$. $n$ varies and while it has a theoretical upper limit, th... | habedi/stack-exchange-dataset |
55,708 | Summation of a Random Variable | <p>I'm having trouble grokking Cormen's <em>Algorithms</em> book on pg. 120. The context is the <a href="https://en.wikipedia.org/wiki/Secretary_problem" rel="nofollow">hiring problem</a> (as it is called in the book). Here is the part that is tripping me up:</p>

<blockquote>
 <p>"Let X be the random var... | algorithm analysis probability theory | 1 | Summation of a Random Variable -- (algorithm analysis probability theory)
<p>I'm having trouble grokking Cormen's <em>Algorithms</em> book on pg. 120. The context is the <a href="https://en.wikipedia.org/wiki/Secretary_problem" rel="nofollow">hiring problem</a> (as it is called in the book). Here is the part that is t... | habedi/stack-exchange-dataset |
55,714 | How does CPU actually retrieve data from memory when you call a variable in a programming language? | <p>As I have understood from all the internet sources I can get to, when you declare and initialize a variable in java, you are allocating this data, say an 8-byte float, in a particular memory cell in the RAM, with the address specified as the row and column number. Now, suppose I want to access this memory location a... | computer architecture memory access | 1 | How does CPU actually retrieve data from memory when you call a variable in a programming language? -- (computer architecture memory access)
<p>As I have understood from all the internet sources I can get to, when you declare and initialize a variable in java, you are allocating this data, say an 8-byte float, in a par... | habedi/stack-exchange-dataset |
55,717 | Why do we need double-rotations to rebalance AVL trees? | <p>I was reading about AVL tree rebalancing from Behrouz Forouzan's book. The book first defines Left High and Right High tree:</p>

<blockquote>
 <ul>
 <li><strong>Left High (LH) tree</strong> is a tree tree with the height of the left subtree more than that of right subtree.</li>
 <li><strong>R... | data structures search trees balanced search trees | 1 | Why do we need double-rotations to rebalance AVL trees? -- (data structures search trees balanced search trees)
<p>I was reading about AVL tree rebalancing from Behrouz Forouzan's book. The book first defines Left High and Right High tree:</p>

<blockquote>
 <ul>
 <li><strong>Left High (LH) tree</stro... | habedi/stack-exchange-dataset |
55,728 | Running time analysis for algorithm that merges $k$ sorted arrays to one sorted array | <blockquote>
<p>Given <span class="math-container">$k$</span> sorted arrays, the size of each array is <span class="math-container">$n$</span> and we want to sort them to one sorted array. assume that <span class="math-container">$k=2^p$</span> i.e <span class="math-container">$k\in\{ 2^1,2^2,2^3,2^4,\dots\}$</span... | algorithm analysis runtime analysis | 1 | Running time analysis for algorithm that merges $k$ sorted arrays to one sorted array -- (algorithm analysis runtime analysis)
<blockquote>
<p>Given <span class="math-container">$k$</span> sorted arrays, the size of each array is <span class="math-container">$n$</span> and we want to sort them to one sorted array. ... | habedi/stack-exchange-dataset |
55,729 | Markov Chain Mixing Time of the Complete Graph | <p>I'm having a hard time understanding mixing time for Markov Chains on Complete Graphs (Kn).</p>

<p>We can define the probability matrix for Kn where Pi,j=probability of going from i to j (technically 1/degree(vi). This is assuming the edges have no weights and there are no self-loops.</p>

<p>Also, ... | graphs probability theory markov chains | 1 | Markov Chain Mixing Time of the Complete Graph -- (graphs probability theory markov chains)
<p>I'm having a hard time understanding mixing time for Markov Chains on Complete Graphs (Kn).</p>

<p>We can define the probability matrix for Kn where Pi,j=probability of going from i to j (technically 1/degree(vi). Th... | habedi/stack-exchange-dataset |
55,736 | Can minimum or maximum height of the binary search tree be constrained by the position of some elements | <p>I came across one problem, which read as follows:</p>

<blockquote>
 <p>We want to place the 13 letters A, B, C, D, E, F, G, H, I, J, K, L, M in a binary search tree with the minimum number of levels: 4. Because there are fewer than 15 elements, we have some flexibility as to the structure of the tree. ... | graphs trees binary trees search trees | 1 | Can minimum or maximum height of the binary search tree be constrained by the position of some elements -- (graphs trees binary trees search trees)
<p>I came across one problem, which read as follows:</p>

<blockquote>
 <p>We want to place the 13 letters A, B, C, D, E, F, G, H, I, J, K, L, M in a binary se... | habedi/stack-exchange-dataset |
55,741 | How to find time complexity for functions in lazy functional languages? | <p>So far, I have looked around the internet for information how to find the time complexity for functions in lazy functional languages, but most of the resources on time complexity focus on strict imperative languages, and there seems to be very little about finding time complexity in lazy functional languages.</p>&#x... | algorithm analysis runtime analysis functional programming | 1 | How to find time complexity for functions in lazy functional languages? -- (algorithm analysis runtime analysis functional programming)
<p>So far, I have looked around the internet for information how to find the time complexity for functions in lazy functional languages, but most of the resources on time complexity fo... | habedi/stack-exchange-dataset |
55,744 | What Does The Notation of Union Over K represent? | <p>I am currently studying about polynomial time in Comp Theory. The definition for polynomial time given in my textbook as follows:
$$P= \bigcup_{k}TIME(n^k)$$
I have not seen the <strong>Union over k</strong> notation before. K is a constant. A quick introduction to the meaning of this notation would be enorm... | notation mathematical foundations | 1 | What Does The Notation of Union Over K represent? -- (notation mathematical foundations)
<p>I am currently studying about polynomial time in Comp Theory. The definition for polynomial time given in my textbook as follows:
$$P= \bigcup_{k}TIME(n^k)$$
I have not seen the <strong>Union over k</strong> notation bef... | habedi/stack-exchange-dataset |
55,749 | Multiple matching in Maximum Flow problem? | <p>I'm sorry if this has already been asked before, but I couldn't find any similar questions. The situation is as such:</p>

<p>Assume there are x restaurants, each with a capacity q, and y people, each of which can only eat from one restaurant. The x restaurants can only serve the people within radius r of it... | optimization bipartite matching max flow ford fulkerson | 1 | Multiple matching in Maximum Flow problem? -- (optimization bipartite matching max flow ford fulkerson)
<p>I'm sorry if this has already been asked before, but I couldn't find any similar questions. The situation is as such:</p>

<p>Assume there are x restaurants, each with a capacity q, and y people, each of w... | habedi/stack-exchange-dataset |
55,765 | Need help in a question regarding polynomial oracle reductions | <p>Prove the following: </p>

<p>If there is a polynomial oracle reduction from $S1$ to $S2$:</p>

<p>a. If $S2\in\ P$ so $S1\in\ P$</p>

<p>b. If $S2\notin\ P$ so $S1\notin\ P$</p>

<p>The way I see it - If there is a polynomial oracle reduction from $S1$ to $S2$, you can solve $S1$ wit... | complexity theory reductions oracle machines | 1 | Need help in a question regarding polynomial oracle reductions -- (complexity theory reductions oracle machines)
<p>Prove the following: </p>

<p>If there is a polynomial oracle reduction from $S1$ to $S2$:</p>

<p>a. If $S2\in\ P$ so $S1\in\ P$</p>

<p>b. If $S2\notin\ P$ so $S1\notin\ P$</p>&#... | habedi/stack-exchange-dataset |
55,781 | The importance of the language semantics for code generation and frameworks for code generation in model-driven development | <p>I am implementing worflow where the code in industrial programming languages (JavaScript and Java) should be generated from the formal (formally verified) expressions (from ontologies as objects and rule formulas as behaviors). What is the best pratice for such code generation? Are some frameworks available for this... | programming languages semantics model checking code generation | 1 | The importance of the language semantics for code generation and frameworks for code generation in model-driven development -- (programming languages semantics model checking code generation)
<p>I am implementing worflow where the code in industrial programming languages (JavaScript and Java) should be generated from t... | habedi/stack-exchange-dataset |
55,796 | How does the OS Scheduler give/take control of HW? | <p>Imagine a uniprocessor system with a simple operating system with non-threaded processes and basic virtual memory (paging, no segmentation, no replacement to disk, etc).</p>

<p>Now assume a simple preemptive scheduler, round-robin, for example.</p>

<p>Because it is a uniprocessor, the scheduler <st... | operating systems memory hardware process scheduling | 1 | How does the OS Scheduler give/take control of HW? -- (operating systems memory hardware process scheduling)
<p>Imagine a uniprocessor system with a simple operating system with non-threaded processes and basic virtual memory (paging, no segmentation, no replacement to disk, etc).</p>

<p>Now assume a simple pr... | habedi/stack-exchange-dataset |
55,802 | Costs of updating arrays to contain only zeroes | <p>To initialize an array of length $n$ has complexity $O(n)$, as far as I understand. If I set every element to zero (with one code line), does that have time complexity $O(n)$ also? </p>

<p>And in that case, setting an $n$-array to zero inside a loop with $n$ iterations should be $O(n^2)$, right? I am asking... | algorithm analysis runtime analysis arrays loops | 1 | Costs of updating arrays to contain only zeroes -- (algorithm analysis runtime analysis arrays loops)
<p>To initialize an array of length $n$ has complexity $O(n)$, as far as I understand. If I set every element to zero (with one code line), does that have time complexity $O(n)$ also? </p>

<p>And in that case,... | habedi/stack-exchange-dataset |
55,807 | Bijective algorithm(s) that can shuffle a range of numbers back and forth | <p>I've spent the last hours trying to come up with an algorithm that shuffles an ordered set of numbers (i.e a simple range of numbers) in a way that I can retrieve from a shuffled value the original value that was on that position without the need to store all relationships between shuffled values and their counterpa... | algorithms cryptography | 1 | Bijective algorithm(s) that can shuffle a range of numbers back and forth -- (algorithms cryptography)
<p>I've spent the last hours trying to come up with an algorithm that shuffles an ordered set of numbers (i.e a simple range of numbers) in a way that I can retrieve from a shuffled value the original value that was o... | habedi/stack-exchange-dataset |
55,819 | Probabilities, Unigram and Bigram | <p>Assume that we have these bigram and unigram data:( Note: not a real data)<br>
<strong>bigram:</strong></p>

<p>#a(start with a) =21<br>
bc= 42<br>
cf= 32<br>
de= 64<br>
e#= 23 </p>

<p><strong>unigram:</strong></p>

<p># 43</p>

<p>a= 84</p>

<p>b=123<... | formal languages probability theory | 1 | Probabilities, Unigram and Bigram -- (formal languages probability theory)
<p>Assume that we have these bigram and unigram data:( Note: not a real data)<br>
<strong>bigram:</strong></p>

<p>#a(start with a) =21<br>
bc= 42<br>
cf= 32<br>
de= 64<br>
e#= 23 </p>

<p><strong>unigram:... | habedi/stack-exchange-dataset |
55,823 | How is the complexity of recursive algorithms calculated and do they admit better complexity than non-recursive algorithms? | <p>How are asymptotical time complexities calculated for recursive algorithms? </p>

<p>Recursive algorithms call themselves and therefore take up more space compared to non-recursive algorithms. But are they better taking time complexity into account? If they are better than non-recursive algorithms, then how ... | algorithm analysis runtime analysis recursion | 1 | How is the complexity of recursive algorithms calculated and do they admit better complexity than non-recursive algorithms? -- (algorithm analysis runtime analysis recursion)
<p>How are asymptotical time complexities calculated for recursive algorithms? </p>

<p>Recursive algorithms call themselves and therefor... | habedi/stack-exchange-dataset |
55,824 | Dynamic Shortest Path with Linear Programming | <p>Consider a grid with $x=5$ columns, $y=5$ rows, and $T$ timesteps. </p>

<p><a href="https://i.stack.imgur.com/HsEZq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HsEZq.jpg" alt="grid"></a></p>

<p>There are $N=2$ agents in this grid, which can move vertically or horizontally. Th... | algorithms optimization shortest path linear programming modelling | 1 | Dynamic Shortest Path with Linear Programming -- (algorithms optimization shortest path linear programming modelling)
<p>Consider a grid with $x=5$ columns, $y=5$ rows, and $T$ timesteps. </p>

<p><a href="https://i.stack.imgur.com/HsEZq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HsEZq.j... | habedi/stack-exchange-dataset |
55,837 | Why do we have different algorithm for MST when graphs are directed? | <p>What was the reason to come up with <a href="https://en.wikipedia.org/wiki/Edmonds%27_algorithm" rel="noreferrer">Chu–Liu/Edmonds' algorithm</a> when the input graph is directed instead of using the Prim's or Krushkal's method for finding Minimum spanning tree ?
What cases are not covered in using Prim's algo fo... | algorithms weighted graphs minimum spanning tree | 1 | Why do we have different algorithm for MST when graphs are directed? -- (algorithms weighted graphs minimum spanning tree)
<p>What was the reason to come up with <a href="https://en.wikipedia.org/wiki/Edmonds%27_algorithm" rel="noreferrer">Chu–Liu/Edmonds' algorithm</a> when the input graph is directed instead of using... | habedi/stack-exchange-dataset |
55,841 | Is it possible that the halting problem is solvable for all input except the machine's code? | <p>This question occurred to me about the halting problem and I couldn't find a good answer online, wondering if someone can help.</p>

<p>Is it possible that the halting problem is decidable for any TM on any input so long as the input is not the TM itself? Basically:</p>

<pre><code>Halts(TM, I)
 ... | computability undecidability halting problem | 1 | Is it possible that the halting problem is solvable for all input except the machine's code? -- (computability undecidability halting problem)
<p>This question occurred to me about the halting problem and I couldn't find a good answer online, wondering if someone can help.</p>

<p>Is it possible that the haltin... | habedi/stack-exchange-dataset |
55,846 | Express semantic duplicates of records formally | <p>I'm working on a paper about record linkage and duplicate detection and want to visualize my definitions of "hard" and "semantic" duplicates.
Hard ones are a 100% match; where's only true or false-
Semantic ones have different variations but still are representing the same thing.</p>

<p>Now I'd like... | sets notation | 1 | Express semantic duplicates of records formally -- (sets notation)
<p>I'm working on a paper about record linkage and duplicate detection and want to visualize my definitions of "hard" and "semantic" duplicates.
Hard ones are a 100% match; where's only true or false-
Semantic ones have different variations but ... | habedi/stack-exchange-dataset |
55,847 | Why do I need a base case for n=3 when solving a d&c recurrence? | <p>I was reading CLRS' book on how to use the substitution method to solve recurrences, where they have the following example:</p>

<p>$T(n) = 2T(\lfloor{\frac{n}{2}}\rfloor) + n$ where
$T(1) = 1$</p>

<p>They assume that $T(n) = O(n \log n)$ and go on to prove it by using induction. </p>

... | recurrence relation induction | 1 | Why do I need a base case for n=3 when solving a d&c recurrence? -- (recurrence relation induction)
<p>I was reading CLRS' book on how to use the substitution method to solve recurrences, where they have the following example:</p>

<p>$T(n) = 2T(\lfloor{\frac{n}{2}}\rfloor) + n$ where
$T(1) = 1$</p>
&#... | habedi/stack-exchange-dataset |
55,851 | Is there a non-recursive and uncountable language L? | <p>Does there exist a non-recursive language, L, such that the cardinality of L is uncountable?</p>

<p>I would really like an explanation as to why this question is true or false because at the moment, I have no idea. 
My understanding is that all recursive languages have to be countable since the set of a... | formal languages uncountability | 1 | Is there a non-recursive and uncountable language L? -- (formal languages uncountability)
<p>Does there exist a non-recursive language, L, such that the cardinality of L is uncountable?</p>

<p>I would really like an explanation as to why this question is true or false because at the moment, I have no idea. &#x... | habedi/stack-exchange-dataset |
55,852 | Two definitions of universal hash functions | <p>I have seen two definitions of universal hash functions in the literature.</p>

<p>For any $i \geqslant 2$ let $[i]=\{1,\ldots,i\}$.</p>

<p>Definition 1: </p>

<blockquote>
 <p>A family $\mathcal H$
 of hash functions from $[n]$ to $[m]$ is a
 <em>$k$-universal family of hash ... | probability theory hash hashing | 1 | Two definitions of universal hash functions -- (probability theory hash hashing)
<p>I have seen two definitions of universal hash functions in the literature.</p>

<p>For any $i \geqslant 2$ let $[i]=\{1,\ldots,i\}$.</p>

<p>Definition 1: </p>

<blockquote>
 <p>A family $\mathcal H$
 o... | habedi/stack-exchange-dataset |
55,867 | Turing Machines: decidability and bounds checking | <p>I am wanting to show that it is decidable that a Turing machine M, on input w, ever attempts to move its head past the right end of the input string w.</p>

<p>I'm assuming I construct a TM which shifts the input on the tape on cell to the left, write the cell at the right-hand end with a new symbol (like "!... | turing machines strings | 1 | Turing Machines: decidability and bounds checking -- (turing machines strings)
<p>I am wanting to show that it is decidable that a Turing machine M, on input w, ever attempts to move its head past the right end of the input string w.</p>

<p>I'm assuming I construct a TM which shifts the input on the tape on ce... | habedi/stack-exchange-dataset |
55,875 | Removing $\epsilon$ transitions in a NPDA | <p>NPDA's and general NFA's may not halt for finite inputs like DFA's do because of their $\epsilon$ transitions.</p>

<p>However, NFA's with $\epsilon$ transitions could be converted to those without any $\epsilon$ transitions and hence they can be made to halt.</p>

<p>I was wondering if this is possi... | finite automata pushdown automata nondeterminism halting problem | 1 | Removing $\epsilon$ transitions in a NPDA -- (finite automata pushdown automata nondeterminism halting problem)
<p>NPDA's and general NFA's may not halt for finite inputs like DFA's do because of their $\epsilon$ transitions.</p>

<p>However, NFA's with $\epsilon$ transitions could be converted to those without... | habedi/stack-exchange-dataset |
55,893 | Typical file structure | <h1>Short version</h1>

<p>The question & answers relate to the following topics:</p>

<ul>
<li>File as a collection of records vs. file as a stream of bytes</li>
<li>Sequential File</li>
<li>Distinction between file data and metadata</li>
<li>Transfer of metadata along with the file... | filesystems | 1 | Typical file structure -- (filesystems)
<h1>Short version</h1>

<p>The question & answers relate to the following topics:</p>

<ul>
<li>File as a collection of records vs. file as a stream of bytes</li>
<li>Sequential File</li>
<li>Distinction between file data and metadata</li>
<li>... | habedi/stack-exchange-dataset |
55,907 | Why do we study closure properties of formal languages? | <p>In automata theory we study formal languages like Regular, CF, CS and etc. and each of them have their own closure properties under union, intersection, star and etc. . I like to know, why it is important to study such properties?</p>
 | formal languages automata closure properties | 1 | Why do we study closure properties of formal languages? -- (formal languages automata closure properties)
<p>In automata theory we study formal languages like Regular, CF, CS and etc. and each of them have their own closure properties under union, intersection, star and etc. . I like to know, why it is important to stu... | habedi/stack-exchange-dataset |
55,909 | Short certificate analogy of PH? | <p>We know that for problems in NP if the problem is an yes version then there is a short certificate and for coNP if the problem is a no version then there is a short certificate.</p>

<p>Is there a short certficate analogy for higher levels in Polynomial Hierarchy?</p>
 | complexity theory complexity classes | 1 | Short certificate analogy of PH? -- (complexity theory complexity classes)
<p>We know that for problems in NP if the problem is an yes version then there is a short certificate and for coNP if the problem is a no version then there is a short certificate.</p>

<p>Is there a short certficate analogy for higher l... | habedi/stack-exchange-dataset |
55,917 | What does the "Lambda" in "Lambda calculus" stand for? | <p>I've been reading about Lambda calculus recently but strangely I can't find an explanation for why it is called "Lambda" or where the expression comes from.</p>

<p>Can anyone explain the origins of the term?</p>
 | terminology computation models lambda calculus history | 1 | What does the "Lambda" in "Lambda calculus" stand for? -- (terminology computation models lambda calculus history)
<p>I've been reading about Lambda calculus recently but strangely I can't find an explanation for why it is called "Lambda" or where the expression comes from.</p>

<p>Can anyone explain the origin... | habedi/stack-exchange-dataset |
55,929 | PDA for all non-palindromic strings of even length | <p>I had a homework assignment where I had to build a PDA over the alphabet $\{a,b\}^*$, accepting $L = \{x \mid x \text{ is even but not a palindrome}\}$.</p>

<p>I already turned it in, but I know I had it wrong and it's driving me insane that I can't figure out this construction. </p>

<p>I tried a C... | finite automata pushdown automata nondeterminism | 1 | PDA for all non-palindromic strings of even length -- (finite automata pushdown automata nondeterminism)
<p>I had a homework assignment where I had to build a PDA over the alphabet $\{a,b\}^*$, accepting $L = \{x \mid x \text{ is even but not a palindrome}\}$.</p>

<p>I already turned it in, but I know I had it... | habedi/stack-exchange-dataset |
55,944 | Why closedness of complement of randomized classes imply containment of complement of contained classes? | <p>Suppose if class $\mathcal C$ is in $PP$ or $BPP$ does it mean complement also belongs to $PP$ or $BPP$ respectively? Does it immediately follow from $PP=coPP$?</p>
 | complexity theory | 1 | Why closedness of complement of randomized classes imply containment of complement of contained classes? -- (complexity theory)
<p>Suppose if class $\mathcal C$ is in $PP$ or $BPP$ does it mean complement also belongs to $PP$ or $BPP$ respectively? Does it immediately follow from $PP=coPP$?</p>
 | habedi/stack-exchange-dataset |
55,954 | Is it admited to give the complexity of a function regarding the resulting data structure? | <p>Assume that we have a data structure which uses $O(\log n)$ space to store an integer $n$ and has a function $f$ which replaces the integer $n$ stored by $2^n$, i.e. $n=2^n$. </p>

<p>The time complexity of $f$ is $O(n_{_{old}})$ = $O(\log\ n_{_{new}})$, 
is it admited to say that $f$ is a $O(\log n)$ fu... | complexity theory data structures | 1 | Is it admited to give the complexity of a function regarding the resulting data structure? -- (complexity theory data structures)
<p>Assume that we have a data structure which uses $O(\log n)$ space to store an integer $n$ and has a function $f$ which replaces the integer $n$ stored by $2^n$, i.e. $n=2^n$. </p>
&#x... | habedi/stack-exchange-dataset |
55,961 | Terminology for trees | <p>In a tree, I want to refer to a particular child of a node, the child of this child, the child of this child of this child, and then the child of this child of this child of this child. For instance, in a binary tree, I would like to refer to the right sibling of the node, the right child of this one, etc..</p>
... | graphs data structures terminology trees | 1 | Terminology for trees -- (graphs data structures terminology trees)
<p>In a tree, I want to refer to a particular child of a node, the child of this child, the child of this child of this child, and then the child of this child of this child of this child. For instance, in a binary tree, I would like to refer to the ri... | habedi/stack-exchange-dataset |
55,964 | A question about halt (or stop) of Turing machine | <p>I try to understand something:<br>
At Turing machine we have two stats: $q_{accept}$ and $q_{reject}$. </p>

<p>Now, if machine $M$ runs on word $w$ (I hope I write it right...) and the final configuration is: $C(w,q_t,\varepsilon )$,<br>
 and $q_t =Q-\{q_{accept},q_{reject}\}$.</p>

<p>Of c... | turing machines halting problem | 1 | A question about halt (or stop) of Turing machine -- (turing machines halting problem)
<p>I try to understand something:<br>
At Turing machine we have two stats: $q_{accept}$ and $q_{reject}$. </p>

<p>Now, if machine $M$ runs on word $w$ (I hope I write it right...) and the final configuration is: $C(w,q_... | habedi/stack-exchange-dataset |
55,969 | Check Cycles- On adding an edge in DAG | <p>Given a DAG N, if an edge $(U \rightarrow V)$ is added between any existing nodes U and V. Then, by performing DFS from the node $U$ and checking whether there is a cycle or a not, should be sufficient to conclude that this addition of edge didn't violate the acyclic property of the given DAG. Is it correct?</p>
... | graphs | 1 | Check Cycles- On adding an edge in DAG -- (graphs)
<p>Given a DAG N, if an edge $(U \rightarrow V)$ is added between any existing nodes U and V. Then, by performing DFS from the node $U$ and checking whether there is a cycle or a not, should be sufficient to conclude that this addition of edge didn't violate the acycli... | habedi/stack-exchange-dataset |
55,980 | If $A$ is m-complete for $\Sigma_n$, is $\overline{A}$ m-complete for $\Pi_n$? | <p>If we have a set $A$ that is m-complete for $\Sigma_n$, then is it's complement $\overline{A}$ m-complete for $\Pi_n$?</p>

<p>I know that $\overline{A} \in \Pi_n$, but does it inherit the completeness?</p>

<p>I think this makes sense but I can't seem to think of any formal reasons why.</p>
 | computability | 1 | If $A$ is m-complete for $\Sigma_n$, is $\overline{A}$ m-complete for $\Pi_n$? -- (computability)
<p>If we have a set $A$ that is m-complete for $\Sigma_n$, then is it's complement $\overline{A}$ m-complete for $\Pi_n$?</p>

<p>I know that $\overline{A} \in \Pi_n$, but does it inherit the completeness?</p>
... | habedi/stack-exchange-dataset |
55,994 | Algorithm for simplifying ANF or polynomials? | <p>I have some digital logic circuits in <a href="https://en.wikipedia.org/wiki/Algebraic_normal_form" rel="nofollow" title="Algebraic Normal Form">Algebraic Normal Form</a>, and am limited to using XOR and AND logic gates.</p>

<p>For instance:</p>

<p>$B_{out} = B_1 B_2 \oplus B_1 B_3$</p>

<p... | boolean algebra digital circuits | 1 | Algorithm for simplifying ANF or polynomials? -- (boolean algebra digital circuits)
<p>I have some digital logic circuits in <a href="https://en.wikipedia.org/wiki/Algebraic_normal_form" rel="nofollow" title="Algebraic Normal Form">Algebraic Normal Form</a>, and am limited to using XOR and AND logic gates.</p>

... | habedi/stack-exchange-dataset |
55,998 | Complexity of finding factors of a number | <p>I have come up with two simple methods for finding all the factors of a number $n$. The first is trial division:</p>

<ol>
<li>For every integer up to $\sqrt{n}$, try to divide by $d$, and if the remainder is $0$ then add $d$ and $n/d$ to the factor list. Assuming division and appending to a list are $O(... | complexity theory time complexity factoring primes | 1 | Complexity of finding factors of a number -- (complexity theory time complexity factoring primes)
<p>I have come up with two simple methods for finding all the factors of a number $n$. The first is trial division:</p>

<ol>
<li>For every integer up to $\sqrt{n}$, try to divide by $d$, and if the remainder i... | habedi/stack-exchange-dataset |
55,999 | What is the complexity of a bracketed search using mediants? | <p>I'm trying to estimate the complexity of an algorithm I've written for the <a href="https://github.com/uxmal/reko/blob/master/src/Decompiler/Analysis/ConstDivisionImplementedByMultiplication.cs" rel="nofollow">Reko decompiler</a>, where I'm trying to "undo" the tranformation done by a compiler to an integer division... | algorithm analysis runtime analysis numerical algorithms | 1 | What is the complexity of a bracketed search using mediants? -- (algorithm analysis runtime analysis numerical algorithms)
<p>I'm trying to estimate the complexity of an algorithm I've written for the <a href="https://github.com/uxmal/reko/blob/master/src/Decompiler/Analysis/ConstDivisionImplementedByMultiplication.cs"... | habedi/stack-exchange-dataset |
56,000 | How to prove that $n$ sets have maximum of $2^n-1$ disjoint subsets when you have operations $\cup , \cap , \setminus$? | <p>I just found out that you can have $2^{2^n-1}$ different subsets, made from $n$ sets, using operations $\cup , \cap , \setminus$.</p>

<p>That is because when $n=2$, for example, you have 3 disjoint subsets: $A\setminus B, B\setminus A,A\cap B$ and then you can union those things together in $2^3-1$ differen... | sets | 1 | How to prove that $n$ sets have maximum of $2^n-1$ disjoint subsets when you have operations $\cup , \cap , \setminus$? -- (sets)
<p>I just found out that you can have $2^{2^n-1}$ different subsets, made from $n$ sets, using operations $\cup , \cap , \setminus$.</p>

<p>That is because when $n=2$, for example, ... | habedi/stack-exchange-dataset |
56,012 | Partial path known in Single source shortest path problem | <p>I'm using the A* algorithm with a consistent heuristic on a graph to determine the shortest path. </p>

<p>If the algorithm is exploring a node $p_1$ for which there is a existing knowledge about the optimal $k$ ($p_q,p_r,p_t,p_5$) successive nodes, then can we store $p_5$ directly into the open list? Or do ... | algorithms graphs shortest path graph traversal weighted graphs | 1 | Partial path known in Single source shortest path problem -- (algorithms graphs shortest path graph traversal weighted graphs)
<p>I'm using the A* algorithm with a consistent heuristic on a graph to determine the shortest path. </p>

<p>If the algorithm is exploring a node $p_1$ for which there is a existing kn... | habedi/stack-exchange-dataset |
56,018 | Push relabel why return back to source | <p>In push relabel algorithm, at the end excess at any nodes is pushed back to source by raising height of those nodes above the height of source. Why is this done? In CLRS it's mentioned:</p>

<blockquote>
 <p>To make the preflow
 a “legal” flow, the algorithm then sends the excess collected in the r... | algorithms graphs max flow | 1 | Push relabel why return back to source -- (algorithms graphs max flow)
<p>In push relabel algorithm, at the end excess at any nodes is pushed back to source by raising height of those nodes above the height of source. Why is this done? In CLRS it's mentioned:</p>

<blockquote>
 <p>To make the preflow
 ... | habedi/stack-exchange-dataset |
56,020 | Design an NFA to accept a, ad, abc, abd, but not e, abcd? | <p>I've made the following diagram to accept a, ad, abc, abd but I don't it to accept e, abcd, how can I limit that?</p>

<p><a href="https://i.stack.imgur.com/3cqOW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3cqOW.png" alt="State Diagram"></a></p>

<p><strong>Updated</strong>&#x... | automata finite automata nondeterminism | 1 | Design an NFA to accept a, ad, abc, abd, but not e, abcd? -- (automata finite automata nondeterminism)
<p>I've made the following diagram to accept a, ad, abc, abd but I don't it to accept e, abcd, how can I limit that?</p>

<p><a href="https://i.stack.imgur.com/3cqOW.png" rel="nofollow noreferrer"><img src="ht... | habedi/stack-exchange-dataset |
56,032 | Find all possible subset pairs in an array having equal average | <p>Given an positive integer array with distinct elements, find all possible subset pairs having equal average. How to do this ?</p>

<p>Example: arr={5,10,6,7} Ans: {7},{5,6,10}</p>

<p>Exp: average of first subset=7 average of second subset=(5+6+7)/3=21/3=7</p>

<p>(two subsets for the array w... | algorithms arrays enumeration | 1 | Find all possible subset pairs in an array having equal average -- (algorithms arrays enumeration)
<p>Given an positive integer array with distinct elements, find all possible subset pairs having equal average. How to do this ?</p>

<p>Example: arr={5,10,6,7} Ans: {7},{5,6,10}</p>

<p>Exp: average of fi... | habedi/stack-exchange-dataset |
56,045 | Getting maximum number of pairs in a set | <p>I'm sorry if the title is unclear, I didn't know how to name this question. </p>

<p>I have a problem where I have an array of numbers with positive integer values. For a pair of these integers to be considered valid, they should follow the format a^2 + b^2 = x^2, where a and b are the integers, and x is any... | algorithms optimization | 1 | Getting maximum number of pairs in a set -- (algorithms optimization)
<p>I'm sorry if the title is unclear, I didn't know how to name this question. </p>

<p>I have a problem where I have an array of numbers with positive integer values. For a pair of these integers to be considered valid, they should follow th... | habedi/stack-exchange-dataset |
56,046 | Closest pair of points in a Plane | <p>I want to write an algorithm to find the closest pair of points among n points in an XY-plane. I have the following approach in my mind:</p>

<ol>
<li>Find the minimum x co-ordinate(minX) and minimum y(minY) co-ordinate.</li>
<li>Name the point origin= (minX,minY)</li>
<li>Find the distance of al... | algorithms computational geometry | 1 | Closest pair of points in a Plane -- (algorithms computational geometry)
<p>I want to write an algorithm to find the closest pair of points among n points in an XY-plane. I have the following approach in my mind:</p>

<ol>
<li>Find the minimum x co-ordinate(minX) and minimum y(minY) co-ordinate.</li>
<l... | habedi/stack-exchange-dataset |
56,063 | How to prove LTL-formulas true for all paths? | <p>I'm quoting a question from my homework which I don't understand its wording.</p>

<p>Also, I'm not looking for an answer for my problem, I just want to be pointed at some articles/tutorials/reading/tips to solve them. </p>

<pre><code>Gp ⇒ (p U q) U p
(p U q) ∧ (q U p) ⇔ p ∧ q
Fp ⇔ F(Xp)
... | model checking linear temporal logic | 1 | How to prove LTL-formulas true for all paths? -- (model checking linear temporal logic)
<p>I'm quoting a question from my homework which I don't understand its wording.</p>

<p>Also, I'm not looking for an answer for my problem, I just want to be pointed at some articles/tutorials/reading/tips to solve them. </... | habedi/stack-exchange-dataset |
56,081 | What are the applications of Rose trees? | <p>I recently found out about the Rose tree data structure, but just going off of a Haskell <code>data</code> definition and the tiny <a href="https://en.wikipedia.org/wiki/Rose_tree" rel="nofollow noreferrer">Wikipedia description</a> of it, I've got some trouble understanding what applications a Rose tree might have.... | trees | 1 | What are the applications of Rose trees? -- (trees)
<p>I recently found out about the Rose tree data structure, but just going off of a Haskell <code>data</code> definition and the tiny <a href="https://en.wikipedia.org/wiki/Rose_tree" rel="nofollow noreferrer">Wikipedia description</a> of it, I've got some trouble und... | habedi/stack-exchange-dataset |
56,088 | construct a dfa that accepts odd consecutive number of 0's and 1's | <p>this dfa should accept only consecutive odd number of both 0's and 1's.
example: 10001,1110001,10,01,011101.</p>

<p>How can I draw its diagram?</p>
 | finite automata | 1 | construct a dfa that accepts odd consecutive number of 0's and 1's -- (finite automata)
<p>this dfa should accept only consecutive odd number of both 0's and 1's.
example: 10001,1110001,10,01,011101.</p>

<p>How can I draw its diagram?</p>
 | habedi/stack-exchange-dataset |
56,093 | Is there any merging procedure for multiple scenes taking from RGB-D to avoid noise? | <p>To avoid the noise as much as possible, I'm planning to take multiple scenes from RGB-D then try to merge them ....</p>

<p>so is there any research papers , thoughts , ideas , algorithms or anything to help</p>
 | computer vision | 1 | Is there any merging procedure for multiple scenes taking from RGB-D to avoid noise? -- (computer vision)
<p>To avoid the noise as much as possible, I'm planning to take multiple scenes from RGB-D then try to merge them ....</p>

<p>so is there any research papers , thoughts , ideas , algorithms or anything to ... | habedi/stack-exchange-dataset |
56,100 | Hill Climbing Search | <p>With the hill-climbing search algorithm, I do not quite understand how the algorithm can get stuck at "plateaus/ridges." Moving one step back, what exactly denotes a "maximum" or "minimum" in a problem? For instance, in the 8-queens problem, it is said that it hits a local minima 86% of the time. Can someone please ... | algorithms optimization search algorithms numerical algorithms | 1 | Hill Climbing Search -- (algorithms optimization search algorithms numerical algorithms)
<p>With the hill-climbing search algorithm, I do not quite understand how the algorithm can get stuck at "plateaus/ridges." Moving one step back, what exactly denotes a "maximum" or "minimum" in a problem? For instance, in the 8-qu... | habedi/stack-exchange-dataset |
56,107 | Membership problem for context sensitive languages PSPACE-complete | <p>I have read that the membership problem for CSL is PSPACE-complete but I couldn't find the proof anywhere. So I tried it myself.</p>

<p>Let's mark the membership problem for CSL as MEM.
First I have to proof that $ MEM \in PSPACE $.
This should be easy, just take Turing Machine that generate words f... | complexity theory space complexity context sensitive | 1 | Membership problem for context sensitive languages PSPACE-complete -- (complexity theory space complexity context sensitive)
<p>I have read that the membership problem for CSL is PSPACE-complete but I couldn't find the proof anywhere. So I tried it myself.</p>

<p>Let's mark the membership problem for CSL as ME... | habedi/stack-exchange-dataset |
56,108 | What is the difference between finite automata and Büchi automata? | <p>as the title suggests, I was struggling to define the differences between finite and Büchi automata and how they are represented. </p>

<p><a href="https://i.stack.imgur.com/CqO2k.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/CqO2k.jpg" alt=""></a></p>

<p>From an assignment I'm working o... | automata finite automata buchi automata | 1 | What is the difference between finite automata and Büchi automata? -- (automata finite automata buchi automata)
<p>as the title suggests, I was struggling to define the differences between finite and Büchi automata and how they are represented. </p>

<p><a href="https://i.stack.imgur.com/CqO2k.jpg" rel="norefer... | habedi/stack-exchange-dataset |
56,116 | What are the steps/tricks/tips to construct a Büchi automaton from a given language? | <p>Let's say I have this language: $(a + bc)^∗((b + c)a^ω + (abb^∗)^ω)$</p>

<p>It seems pretty complicated, where should I begin with if I were to construct a Büchi automaton? </p>

<p>I've been doing it the following way with smaller language sets: </p>

<ul>
<li>a $^*$ operator is usually... | automata buchi automata | 1 | What are the steps/tricks/tips to construct a Büchi automaton from a given language? -- (automata buchi automata)
<p>Let's say I have this language: $(a + bc)^∗((b + c)a^ω + (abb^∗)^ω)$</p>

<p>It seems pretty complicated, where should I begin with if I were to construct a Büchi automaton? </p>

<p>I've... | habedi/stack-exchange-dataset |
56,129 | Why does 9 qubit Shor code have distance 3? | <p>Distance of a Stabilizer code($S$) is defined by minimum weight of an element in $N(S)-S$ .</p>

<p>Why 9 qubit Shor code has distance 3?</p>

<p>Is there a way to directly see $N(S)-S$ from $S$? </p>
 | quantum computing | 1 | Why does 9 qubit Shor code have distance 3? -- (quantum computing)
<p>Distance of a Stabilizer code($S$) is defined by minimum weight of an element in $N(S)-S$ .</p>

<p>Why 9 qubit Shor code has distance 3?</p>

<p>Is there a way to directly see $N(S)-S$ from $S$? </p>
 | habedi/stack-exchange-dataset |
56,159 | Find all non-isomorphic graphs with a particular degree sequence | <p>I have a degree sequence and I want to generate all non-isomorphic graphs with that degree sequence, as fast as possible.</p>

<p>The only way I found is generating the first graph using the Havel-Hakimi algorithm and then get other graphs by permuting all pairs of edges and trying to use an edge switching o... | algorithms graphs | 1 | Find all non-isomorphic graphs with a particular degree sequence -- (algorithms graphs)
<p>I have a degree sequence and I want to generate all non-isomorphic graphs with that degree sequence, as fast as possible.</p>

<p>The only way I found is generating the first graph using the Havel-Hakimi algorithm and the... | habedi/stack-exchange-dataset |
56,162 | Count in relational algebra using Ω = { π, σ, ⋈, ⋉, β, x, ∪, ∩ , - } | <pre><code>schema(author)={name, newspaper}
</code></pre>

<p>The table contains a list of authors. Each author works for a newspaper. So a single newspaper may employ multiple authors. How can I get the names of the newspapers that have at least two authors working for them? My algebra consists of:</p>
... | database theory relational algebra | 1 | Count in relational algebra using Ω = { π, σ, ⋈, ⋉, β, x, ∪, ∩ , - } -- (database theory relational algebra)
<pre><code>schema(author)={name, newspaper}
</code></pre>

<p>The table contains a list of authors. Each author works for a newspaper. So a single newspaper may employ multiple authors. How can I get... | habedi/stack-exchange-dataset |
56,176 | A* graph search time-complexity | <p>Some confusion about time-complexity and A*.</p>

<p>According to 
<a href="https://en.wikipedia.org/wiki/A*_search_algorithm/" rel="noreferrer" title="A*">A* Wiki</a> the time-complexity is exponential in the depth of the solution (shortest path):</p>

<blockquote>
 <p>The time complexity o... | algorithms algorithm analysis graphs runtime analysis shortest path | 1 | A* graph search time-complexity -- (algorithms algorithm analysis graphs runtime analysis shortest path)
<p>Some confusion about time-complexity and A*.</p>

<p>According to 
<a href="https://en.wikipedia.org/wiki/A*_search_algorithm/" rel="noreferrer" title="A*">A* Wiki</a> the time-complexity is exponenti... | habedi/stack-exchange-dataset |
56,186 | Examples of context sensitive syntactic constructs (statements) | <p>So, I am implementing a context sensitive syntactic analyzator. It's kind of an experimantal thing and one of the things I need are usable syntactical contructs to test it on.</p>

<p>For example, the following example isn't possible to parse using standard CFG (context free grammar). Basically it allows to ... | programming languages context sensitive language design syntax | 1 | Examples of context sensitive syntactic constructs (statements) -- (programming languages context sensitive language design syntax)
<p>So, I am implementing a context sensitive syntactic analyzator. It's kind of an experimantal thing and one of the things I need are usable syntactical contructs to test it on.</p>
&... | habedi/stack-exchange-dataset |
56,191 | How correct was Justin Trudeau's explanation of Quantum Computing? | <p>Recently, Canada's Prime Minister - Justin Trudeau - <a href="http://www.abc.net.au/news/2016-04-17/justin-trudeau-explains-quantum-computing/7332904" rel="nofollow noreferrer">gave an impromptu explanation of Quantum Computing</a>, much to the crowd's astonishment. I certainly thought that I "got" Quantum Computing... | quantum computing | 1 | How correct was Justin Trudeau's explanation of Quantum Computing? -- (quantum computing)
<p>Recently, Canada's Prime Minister - Justin Trudeau - <a href="http://www.abc.net.au/news/2016-04-17/justin-trudeau-explains-quantum-computing/7332904" rel="nofollow noreferrer">gave an impromptu explanation of Quantum Computing... | habedi/stack-exchange-dataset |
56,195 | How to Convert a Directed Graph to an Undirected Graph (Adjacency Matrix) | <p>Given an adjacency matrix, what is an algorithm/pseudo-code to convert a directed graph to an undirected graph without adding additional vertices (does not have to be reversable)?</p>

<p>similar question <a href="https://cs.stackexchange.com/questions/19744/converting-a-digraph-to-an-undirected-graph-in-a-r... | algorithms graphs adjacency matrix | 1 | How to Convert a Directed Graph to an Undirected Graph (Adjacency Matrix) -- (algorithms graphs adjacency matrix)
<p>Given an adjacency matrix, what is an algorithm/pseudo-code to convert a directed graph to an undirected graph without adding additional vertices (does not have to be reversable)?</p>

<p>similar... | habedi/stack-exchange-dataset |
56,200 | Would incrementing the min cut edges by 1 increase the max flow by 1 as well? | <p>Given the theorem that max flow <= min cut,
Would incrementing the min cut edges by 1 increase the max flow by 1 as well?</p>
 | algorithms graphs max flow | 1 | Would incrementing the min cut edges by 1 increase the max flow by 1 as well? -- (algorithms graphs max flow)
<p>Given the theorem that max flow <= min cut,
Would incrementing the min cut edges by 1 increase the max flow by 1 as well?</p>
 | habedi/stack-exchange-dataset |
56,211 | How similar are two DFAs? -not just binary equivalence- | <p>Are there any measures to compute similarity (or distance) between two DFAs?</p>

<p>If yes, which are the main references?</p>

<p>I need a measure of similarity, not only a (binary) equivalence test.</p>

<p>"Similarity" is an intuitive concept. There are different ways to formalize it; i'm... | regular languages automata reference request finite automata | 1 | How similar are two DFAs? -not just binary equivalence- -- (regular languages automata reference request finite automata)
<p>Are there any measures to compute similarity (or distance) between two DFAs?</p>

<p>If yes, which are the main references?</p>

<p>I need a measure of similarity, not only a (bin... | habedi/stack-exchange-dataset |
56,229 | Cyclic Redundancy Check Codewords Finding the Original Message | <p>So I have the received transmitted message in polynomial form as 
$$T'(X) = X^{15}+X^{13}+X^8+X^7+X^4+X^3$$ 
and the error polynomial as 
$$E(X) = X^{16}+X^{13}+X^3$$
 and the generator polynomial as 
$$G(X) = X^4+X^3+X+1.$$ </p>

<p>I am trying to find $T$ before it is transmitted. It is... | hamming code crc | 1 | Cyclic Redundancy Check Codewords Finding the Original Message -- (hamming code crc)
<p>So I have the received transmitted message in polynomial form as 
$$T'(X) = X^{15}+X^{13}+X^8+X^7+X^4+X^3$$ 
and the error polynomial as 
$$E(X) = X^{16}+X^{13}+X^3$$
 and the generator polynomial as 
$$G(X) = X^... | habedi/stack-exchange-dataset |
56,235 | How to find the element of the Digit Sum sequence efficiently? | <p>Just out of interest I tried to solve a problem from "Recent" category of Project Euler ( <a href="https://projecteuler.net/problem=551" rel="nofollow noreferrer">Digit Sum sequence</a> ). But I am unable to think of a way to solve the problem efficiently. The problem is as follows ( in the original question sequen... | time complexity number theory | 1 | How to find the element of the Digit Sum sequence efficiently? -- (time complexity number theory)
<p>Just out of interest I tried to solve a problem from "Recent" category of Project Euler ( <a href="https://projecteuler.net/problem=551" rel="nofollow noreferrer">Digit Sum sequence</a> ). But I am unable to think of a... | habedi/stack-exchange-dataset |
56,237 | Does concatenating two empty strings result in an empty string? | <p>I have a question on the multiplication of sets of words as it is defined in Cohen's Intro To Computer Theory. He gives the definition: if S and T are sets of strings of letters, the product of the sets, ST = {All combinations of string from S concatenated with strings from T}.</p>

<p>The definition is easy... | regular expressions | 1 | Does concatenating two empty strings result in an empty string? -- (regular expressions)
<p>I have a question on the multiplication of sets of words as it is defined in Cohen's Intro To Computer Theory. He gives the definition: if S and T are sets of strings of letters, the product of the sets, ST = {All combinations o... | habedi/stack-exchange-dataset |
56,261 | Computing Von Neumann Entropy Efficiently | <p>The <a href="https://en.wikipedia.org/wiki/Von_Neumann_entropy" rel="nofollow">Von Neumann entropy</a> $S$ of a <a href="https://en.wikipedia.org/wiki/Density_matrix" rel="nofollow">density matrix</a> $\rho$ is defined to be $S(\rho)= -\text{tr}(\rho \lg \rho)$. Equivalently, $S$ is the classical entropy of the eige... | quantum computing linear algebra entropy numerical algorithms | 1 | Computing Von Neumann Entropy Efficiently -- (quantum computing linear algebra entropy numerical algorithms)
<p>The <a href="https://en.wikipedia.org/wiki/Von_Neumann_entropy" rel="nofollow">Von Neumann entropy</a> $S$ of a <a href="https://en.wikipedia.org/wiki/Density_matrix" rel="nofollow">density matrix</a> $\rho$ ... | habedi/stack-exchange-dataset |
56,264 | What does Cellular Automata Pre-image problem actually means? | <p>I am reading about Cellular Automata and Computational Complexity and i found a related paper by F. Green, <a href="http://www.complex-systems.com/pdf/01-3-4.pdf" rel="nofollow">NP-Complete Problems in Cellular Automata</a>. </p>

<p>In the 2nd page he lists three NP-Complete problems related to CA, the firs... | finite automata np complete cellular automata | 1 | What does Cellular Automata Pre-image problem actually means? -- (finite automata np complete cellular automata)
<p>I am reading about Cellular Automata and Computational Complexity and i found a related paper by F. Green, <a href="http://www.complex-systems.com/pdf/01-3-4.pdf" rel="nofollow">NP-Complete Problems in Ce... | habedi/stack-exchange-dataset |
56,269 | Standardizing Data for Neural Networks | <p>Let's say we have a data set with following features 
<code>[age, sex, country, city, annual income]
[35, male, USA, New York, 73000]</code>.</p>

<p>I came across the <a href="https://visualstudiomagazine.com/articles/2014/01/01/how-to-standardize-data-for-neural-networks.aspx" rel="nofollow">articl... | machine learning data mining | 1 | Standardizing Data for Neural Networks -- (machine learning data mining)
<p>Let's say we have a data set with following features 
<code>[age, sex, country, city, annual income]
[35, male, USA, New York, 73000]</code>.</p>

<p>I came across the <a href="https://visualstudiomagazine.com/articles/2014/01/0... | habedi/stack-exchange-dataset |
56,271 | finding maximum virtual and physical memory | <p>If the following is given:</p>

<ol>
<li><p>CPU uses a four-level hierarchical page table, each level can contain 512 entries</p></li>
<li><p>the page size is 4KB.</p></li>
<li><p>virtual address is 48 bits </p></li>
</ol>

<p>How do i get the size of the virtual memory (in terms of... | operating systems virtual memory | 1 | finding maximum virtual and physical memory -- (operating systems virtual memory)
<p>If the following is given:</p>

<ol>
<li><p>CPU uses a four-level hierarchical page table, each level can contain 512 entries</p></li>
<li><p>the page size is 4KB.</p></li>
<li><p>virtual address is 48 bits </p></... | habedi/stack-exchange-dataset |
56,283 | Examples of Dependent Types | <p>I'm gathering examples from everything that I've read about <em>Dependent Type Theory</em> mainly from <a href="http://www.cse.chalmers.se/~peterd/papers/DependentTypesAtWork.pdf" rel="nofollow">Dependent types at Work</a> paper. </p>

<p>This is my list so far of some dependent types (with abbreviations of... | dependent types | 1 | Examples of Dependent Types -- (dependent types)
<p>I'm gathering examples from everything that I've read about <em>Dependent Type Theory</em> mainly from <a href="http://www.cse.chalmers.se/~peterd/papers/DependentTypesAtWork.pdf" rel="nofollow">Dependent types at Work</a> paper. </p>

<p>This is my list so f... | habedi/stack-exchange-dataset |
56,288 | Maximize function over a set with a transitive and antisymmetric relation | <p>Let $\mathcal{R}$ be a transitive and antisymmetric relation defined over a finite set $X$.</p>

<p>For any set $S\subseteq X$ define $\Gamma(S)=\left\{y\in S \mid \not \exists x\in S . (x,y)\in\mathcal{R}\right\}$. (Thus, $y \in \Gamma(S)$ if it belongs to $S$ and no other element in $S$ "dominates" it.) ... | algorithms optimization np complete np hard polynomial time | 1 | Maximize function over a set with a transitive and antisymmetric relation -- (algorithms optimization np complete np hard polynomial time)
<p>Let $\mathcal{R}$ be a transitive and antisymmetric relation defined over a finite set $X$.</p>

<p>For any set $S\subseteq X$ define $\Gamma(S)=\left\{y\in S \mid \not ... | habedi/stack-exchange-dataset |
56,292 | Meta-grammar for context-free grammars | <p><a href="https://en.wikipedia.org/wiki/Formal_grammar" rel="nofollow">Formal grammars</a> like <a href="https://en.wikipedia.org/wiki/Regular_expression" rel="nofollow">regular expressions</a> (REs) or <a href="https://en.wikipedia.org/wiki/Context-free_grammar" rel="nofollow">context-free
grammars</a> (CFGs) sp... | formal languages context free reference request formal grammars parsers | 1 | Meta-grammar for context-free grammars -- (formal languages context free reference request formal grammars parsers)
<p><a href="https://en.wikipedia.org/wiki/Formal_grammar" rel="nofollow">Formal grammars</a> like <a href="https://en.wikipedia.org/wiki/Regular_expression" rel="nofollow">regular expressions</a> (REs) or... | habedi/stack-exchange-dataset |
56,299 | Find a weighted median for unsorted array in linear time | <p>For days, I'm trying to figure out, whether it is possible to find an item in array which would be kind of <em>weighted median</em> in linear time.</p>
<p>It is very simple to do that in exponential time.</p>
<p>So let's say that we have an array, each item <span class="math-container">$x$</span> of this arr... | algorithms time complexity arrays | 1 | Find a weighted median for unsorted array in linear time -- (algorithms time complexity arrays)
<p>For days, I'm trying to figure out, whether it is possible to find an item in array which would be kind of <em>weighted median</em> in linear time.</p>
<p>It is very simple to do that in exponential time.</p>
<p>S... | habedi/stack-exchange-dataset |
56,318 | Why does the square root of n! grow exponentially faster than exponential functions? | <p>I am going through <a href="http://www.cs.tau.ac.il/~amnon/Papers/HRT.stoc00.pdf" rel="nofollow">Normal Subgroup Reconstruction and Quantum Computation Using Group Representations</a> by Hallgren et al. </p>

<p>In the proof of the theorem $6$ of the paper on page 632, the authors go on proving the differenc... | asymptotics landau notation | 1 | Why does the square root of n! grow exponentially faster than exponential functions? -- (asymptotics landau notation)
<p>I am going through <a href="http://www.cs.tau.ac.il/~amnon/Papers/HRT.stoc00.pdf" rel="nofollow">Normal Subgroup Reconstruction and Quantum Computation Using Group Representations</a> by Hallgren et ... | habedi/stack-exchange-dataset |
56,323 | Why is NP in EXPTIME? | <p>Is there an easy way to see why NP is in EXPTIME? It seems to me a priori conceivable that there could be a problem which requires super-exponential time to solve, but whose solution could be verified in polynomial time.</p>
 | complexity theory complexity classes | 1 | Why is NP in EXPTIME? -- (complexity theory complexity classes)
<p>Is there an easy way to see why NP is in EXPTIME? It seems to me a priori conceivable that there could be a problem which requires super-exponential time to solve, but whose solution could be verified in polynomial time.</p>
 | habedi/stack-exchange-dataset |
56,335 | 3-SUM hardness vs lower bounds on the complexity | <p>I've recently encountered a new (for me) notion from computational complexity theory called 3-SUM hardness which is based on the conjecture that 3-SUM problem can not be solved in $O\left(n^{2-\varepsilon}\right)$ time where $n$ is the number of reals among which we should check whether three of them sum to zero. By... | complexity theory computational geometry | 1 | 3-SUM hardness vs lower bounds on the complexity -- (complexity theory computational geometry)
<p>I've recently encountered a new (for me) notion from computational complexity theory called 3-SUM hardness which is based on the conjecture that 3-SUM problem can not be solved in $O\left(n^{2-\varepsilon}\right)$ time whe... | habedi/stack-exchange-dataset |
56,337 | What is the difference between a R-tree and a BVH? | <p>I've just read about <a href="https://en.wikipedia.org/wiki/R-tree#R-tree_idea" rel="noreferrer">R-Trees</a>:</p>

<blockquote>
 <p>The key idea of the data structure is to group nearby objects and represent them with their minimum bounding rectangle in the next higher level of the tree; the "R" in R-tr... | data structures trees databases graphics | 1 | What is the difference between a R-tree and a BVH? -- (data structures trees databases graphics)
<p>I've just read about <a href="https://en.wikipedia.org/wiki/R-tree#R-tree_idea" rel="noreferrer">R-Trees</a>:</p>

<blockquote>
 <p>The key idea of the data structure is to group nearby objects and represent... | habedi/stack-exchange-dataset |
56,343 | Computing MOD_4 function using MOD_2, OR, AND, NOT gates | <p>Define the $\newcommand{\MOD}{\text{MOD}}\MOD_q$ function from $\{0,1\}^n \rightarrow \{0,1\}$ as follows:</p>

<p>Let $x_1,\cdots,x_n$ be the input. Then $\MOD_q(x_1,\cdots,x_n)=0$ if the number of 1's in $x_1,\dots,x_n$ is divisible by $q$; $\MOD_q(x_1,\cdots,x_n)=1$ otherwise.</p>

<p>I want to c... | complexity theory modular arithmetic | 1 | Computing MOD_4 function using MOD_2, OR, AND, NOT gates -- (complexity theory modular arithmetic)
<p>Define the $\newcommand{\MOD}{\text{MOD}}\MOD_q$ function from $\{0,1\}^n \rightarrow \{0,1\}$ as follows:</p>

<p>Let $x_1,\cdots,x_n$ be the input. Then $\MOD_q(x_1,\cdots,x_n)=0$ if the number of 1's in $x_... | habedi/stack-exchange-dataset |
56,349 | User recognition through keystroke pattern | <p>Hello thank you for taking time looking at this question. Is it possible to determine the keystroke patterns for a certain user?</p>

<p>My idea is that, when the user enters their username & password it must contain a specific keystroke pattern that when analyzed it could probably predict the actual use... | security user interface authentication | 1 | User recognition through keystroke pattern -- (security user interface authentication)
<p>Hello thank you for taking time looking at this question. Is it possible to determine the keystroke patterns for a certain user?</p>

<p>My idea is that, when the user enters their username & password it must contain a... | habedi/stack-exchange-dataset |
56,352 | Restricting capabilities of admin role in database schema | <p>Suppose I have to design database for learning management system. Which will going to have user having roles such as admin, teacher, tutor, student etc. In a system student can submit solution for an assignment in a course and teacher or tutor can provide the grade for it. </p>

<p>Now while implementing is ... | database theory databases | 1 | Restricting capabilities of admin role in database schema -- (database theory databases)
<p>Suppose I have to design database for learning management system. Which will going to have user having roles such as admin, teacher, tutor, student etc. In a system student can submit solution for an assignment in a course and t... | habedi/stack-exchange-dataset |
56,367 | What are positive and negative circles in weighted digraph? | <p>I am going through Warshall and Floyd algorithms and I read that Floyd's algorithm does not hold if a graph has negative circle. I have not been able to fully figure out what negative circle means. Therefore, I would like to know more about positive and negative circles. </p>
 | graphs | 1 | What are positive and negative circles in weighted digraph? -- (graphs)
<p>I am going through Warshall and Floyd algorithms and I read that Floyd's algorithm does not hold if a graph has negative circle. I have not been able to fully figure out what negative circle means. Therefore, I would like to know more about po... | habedi/stack-exchange-dataset |
56,368 | Let a > 0 be a constant. Find a simplified, asymptotically tight bound for the recurrence T(n) = aT(n-2) + C | <p>So I have read the posts on this site involving recurrence relations, however this problem is a little different, because of the constant a involved with the recursive portion. I'm trying to solve this recurrence relation by expanding it out and here is what I have so far:</p>

<p><a href="https://i.stack.im... | algorithm analysis asymptotics recurrence relation | 1 | Let a > 0 be a constant. Find a simplified, asymptotically tight bound for the recurrence T(n) = aT(n-2) + C -- (algorithm analysis asymptotics recurrence relation)
<p>So I have read the posts on this site involving recurrence relations, however this problem is a little different, because of the constant a involved wit... | habedi/stack-exchange-dataset |
56,384 | Is there an alternative to full factorization for testing the Polya conjecture? | <p>The <a href="https://en.wikipedia.org/wiki/P%C3%B3lya_conjecture" rel="nofollow">Polya conjecture</a> is a disproved conjecture that states over half the numbers less than any number has an odd number of prime factors. It first fails at $n = 906,150,257$, thus being a good example that testing very many cases is not... | algorithms time complexity factoring | 1 | Is there an alternative to full factorization for testing the Polya conjecture? -- (algorithms time complexity factoring)
<p>The <a href="https://en.wikipedia.org/wiki/P%C3%B3lya_conjecture" rel="nofollow">Polya conjecture</a> is a disproved conjecture that states over half the numbers less than any number has an odd n... | habedi/stack-exchange-dataset |
56,388 | Depth of a pipeline in a CPU's architecture | <p>I follow a course on CPU architectures and I'm making exercises at the moment. Now I encountered the word "depth of a pipeline" in one of the exercises, but I don't know what's meant by the depth of a pipeline. Is it the number of stages of the pipeline or something else? I can't find it anywhere in the syllabus. </... | computer architecture cpu pipelines cpu | 1 | Depth of a pipeline in a CPU's architecture -- (computer architecture cpu pipelines cpu)
<p>I follow a course on CPU architectures and I'm making exercises at the moment. Now I encountered the word "depth of a pipeline" in one of the exercises, but I don't know what's meant by the depth of a pipeline. Is it the number ... | habedi/stack-exchange-dataset |
56,394 | What does it mean to have a continuous action space w.r.t. to reinforcement learning? | <p>Last time I posted this question I got criticised for not being specific enough, hence this is my second attempt at trying to understand what it means to have a continuous action space.</p>

<p><a href="https://spiral.imperial.ac.uk/bitstream/10044/1/12051/4/2300000021-Deisenroth-Vol2-ROB-021_published.pdf" ... | machine learning reinforcement learning | 1 | What does it mean to have a continuous action space w.r.t. to reinforcement learning? -- (machine learning reinforcement learning)
<p>Last time I posted this question I got criticised for not being specific enough, hence this is my second attempt at trying to understand what it means to have a continuous action space.<... | habedi/stack-exchange-dataset |
56,397 | Design the grammar for the following | <p>Design the grammar for the following:
L = (a^n)<em>w</em>(w^r)<em>(b^n) where n>=0 and w={a,b}</em></p>
 | finite automata | 1 | Design the grammar for the following -- (finite automata)
<p>Design the grammar for the following:
L = (a^n)<em>w</em>(w^r)<em>(b^n) where n>=0 and w={a,b}</em></p>
 | habedi/stack-exchange-dataset |
56,399 | Difference between algorithm and procedure | <p>I came to know that the important difference between algorithm and procedure is that the algorithm halts and procedure doesn't halts(stops). But i am not able to understand the concept. Please can any one explain with the example?</p>
 | algorithms | 1 | Difference between algorithm and procedure -- (algorithms)
<p>I came to know that the important difference between algorithm and procedure is that the algorithm halts and procedure doesn't halts(stops). But i am not able to understand the concept. Please can any one explain with the example?</p>
 | habedi/stack-exchange-dataset |
56,405 | What is the time complexity of this algorithm? | <p>In my class my teacher calculated the time complexity for this algorithm, relative to the number of sum operations executed: </p>

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

<p>... | algorithm analysis runtime analysis loops | 1 | What is the time complexity of this algorithm? -- (algorithm analysis runtime analysis loops)
<p>In my class my teacher calculated the time complexity for this algorithm, relative to the number of sum operations executed: </p>

<p><a href="https://i.stack.imgur.com/H7JoI.png" rel="nofollow noreferrer"><img src=... | habedi/stack-exchange-dataset |
56,415 | About the Identity function in Agda | <p>I've defined the identity function in <code>Agda</code> as follows:</p>

<pre><code>idd : (∀ {ℓ} {A: Set ℓ}) → A → A
idd a = a
</code></pre>

<p>I want to ask you if the following reasonings are correct: </p>

<ul>
<li>The type of this function is <code>A -> A</code>.</li>
... | dependent types | 1 | About the Identity function in Agda -- (dependent types)
<p>I've defined the identity function in <code>Agda</code> as follows:</p>

<pre><code>idd : (∀ {ℓ} {A: Set ℓ}) → A → A
idd a = a
</code></pre>

<p>I want to ask you if the following reasonings are correct: </p>

<ul>
<li>The t... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.