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 |
|---|---|---|---|---|---|---|
12,546 | Closure of Star-Free Languages under Substitution | <p>Let $L$ be a star-free language over finite alphabet $\Sigma$. A <em>substitution</em> will be a map $\sigma : \Sigma \to \mathcal{P}(\Sigma^*)$. It seems obvious that if $\sigma(a)$ is star-free for every $a \in \Sigma$, then $\sigma(L)$ will be star-free.<br>
($\sigma(L) = \{ w_1 ... w_n | w_i \in \sigma(a_i... | formal languages regular languages closure properties | 1 | Closure of Star-Free Languages under Substitution -- (formal languages regular languages closure properties)
<p>Let $L$ be a star-free language over finite alphabet $\Sigma$. A <em>substitution</em> will be a map $\sigma : \Sigma \to \mathcal{P}(\Sigma^*)$. It seems obvious that if $\sigma(a)$ is star-free for every ... | habedi/stack-exchange-dataset |
12,554 | Proving that CFLs are closed under even-ness using grammars | <p>This is a question from <a href="http://cs.anu.edu.au/courses/COMP3630/comp3630exams.pdf" rel="nofollow">a 2007 exam paper for a course I'm studying</a>, question 2 on page 2.</p>

<blockquote>
 <p>Theorem: Let $L$ be a context-free language. Let $L_{even}$ be the subset of $L$ consisting of all the str... | formal languages context free formal grammars closure properties | 1 | Proving that CFLs are closed under even-ness using grammars -- (formal languages context free formal grammars closure properties)
<p>This is a question from <a href="http://cs.anu.edu.au/courses/COMP3630/comp3630exams.pdf" rel="nofollow">a 2007 exam paper for a course I'm studying</a>, question 2 on page 2.</p>
&#x... | habedi/stack-exchange-dataset |
12,556 | Hierarchical Paging | <p>Suppose I have a system with 32-bit logical and 16-bit physical address spaces, and the page size is 512 bytes. For simplicity, ignore the valid/invalid bits in the page table.</p>

<p>How many sections will the logical address be divided and how many bits will each section have? The logical address will be ... | operating systems memory management paging | 1 | Hierarchical Paging -- (operating systems memory management paging)
<p>Suppose I have a system with 32-bit logical and 16-bit physical address spaces, and the page size is 512 bytes. For simplicity, ignore the valid/invalid bits in the page table.</p>

<p>How many sections will the logical address be divided an... | habedi/stack-exchange-dataset |
12,558 | For Djikstra's algorithm, why are we surely done if we update all edges $|V|-1$ times? | <p>Apparently, if we use Djikstra's algorithm to find the shortest path between the root node and all other nodes in a weighted graph with no negative cycles, we are done after updating the distance of each node $|V| - 1$ times.</p>

<p>This puzzles me because I think that a single round of breadth first search... | algorithms graphs shortest path correctness proof | 1 | For Djikstra's algorithm, why are we surely done if we update all edges $|V|-1$ times? -- (algorithms graphs shortest path correctness proof)
<p>Apparently, if we use Djikstra's algorithm to find the shortest path between the root node and all other nodes in a weighted graph with no negative cycles, we are done after u... | habedi/stack-exchange-dataset |
12,559 | Why is the node with the greatest DFS post-order number not necessarily a sink? | <p>A sink in a directed graph is a node with no outgoing edges. If I perform a depth first search, why is it that the node with the least post-order number (and thus the highest pre-order number) not necessarily a sink - isn't this node found last?</p>

<p>Also, intuitively, the node with the greatest post-orde... | graphs graph traversal | 1 | Why is the node with the greatest DFS post-order number not necessarily a sink? -- (graphs graph traversal)
<p>A sink in a directed graph is a node with no outgoing edges. If I perform a depth first search, why is it that the node with the least post-order number (and thus the highest pre-order number) not necessarily ... | habedi/stack-exchange-dataset |
12,560 | Use minimum number of swaps so each bin contains balls of the same color | <p>There are $n$ bins, the $i$th bin contain $a_i$ balls. The balls has $n$ colors, there are $a_i$ balls of color $i$. Let $m=\sum_{i=1}^n a_i$.</p>

<p>A swap is take a ball from one bin and swap with a ball from another bin. We want minimum number of swaps such that each bin only contain balls with the same ... | algorithms complexity theory balls and bins | 1 | Use minimum number of swaps so each bin contains balls of the same color -- (algorithms complexity theory balls and bins)
<p>There are $n$ bins, the $i$th bin contain $a_i$ balls. The balls has $n$ colors, there are $a_i$ balls of color $i$. Let $m=\sum_{i=1}^n a_i$.</p>

<p>A swap is take a ball from one bin a... | habedi/stack-exchange-dataset |
12,562 | Retrieving data from hash table ordered by insertion time | <p>By default, a hash table is unordered. I have a simple question on the retrieval of elements in a hash table</p>

<blockquote>
 <p>Can we retrieve elements from a hash table in the same order as they are put inside?</p>
</blockquote>
 | algorithms data structures hash hash tables | 1 | Retrieving data from hash table ordered by insertion time -- (algorithms data structures hash hash tables)
<p>By default, a hash table is unordered. I have a simple question on the retrieval of elements in a hash table</p>

<blockquote>
 <p>Can we retrieve elements from a hash table in the same order as t... | habedi/stack-exchange-dataset |
12,574 | serial number of combination | <p>How can I find the serial number of an n-choose-k combination?</p>

<p>I would like a function that gets as input:</p>

<ul>
<li>$n$,</li>
<li>$k$, </li>
<li>a set of $k$ elements out of the set ${0, 1, ... n-1}$.</li>
</ul>

<p>The output should be a number in the range $[0, ... | combinatorics | 1 | serial number of combination -- (combinatorics)
<p>How can I find the serial number of an n-choose-k combination?</p>

<p>I would like a function that gets as input:</p>

<ul>
<li>$n$,</li>
<li>$k$, </li>
<li>a set of $k$ elements out of the set ${0, 1, ... n-1}$.</li>
</ul>

<p>... | habedi/stack-exchange-dataset |
12,587 | In a DFA, does every state have a transition on every symbol of the alphabet? | <p>If not, then what does it mean when for some state $q$ and some symbol $a$, $\delta(q, a)$ does not exist?</p>
 | terminology automata finite automata | 1 | In a DFA, does every state have a transition on every symbol of the alphabet? -- (terminology automata finite automata)
<p>If not, then what does it mean when for some state $q$ and some symbol $a$, $\delta(q, a)$ does not exist?</p>
 | habedi/stack-exchange-dataset |
12,593 | Where can i find literature about the $\frac{4}{3}$-conjecture for approximation of the Metric TSP? | <p>In Graph-Theory there are many ways for efficient approximation-algorithms to solve the Metric TSP. The best solution seems to be the Christofides Heuristic with a factor of 1.5 to the optimal solution. My Teacher said, there would be the so called $\frac{4}{3}$-conjecture, which states: there might be a approximati... | complexity theory reference request np complete approximation traveling salesman | 1 | Where can i find literature about the $\frac{4}{3}$-conjecture for approximation of the Metric TSP? -- (complexity theory reference request np complete approximation traveling salesman)
<p>In Graph-Theory there are many ways for efficient approximation-algorithms to solve the Metric TSP. The best solution seems to be t... | habedi/stack-exchange-dataset |
12,598 | Name of an Exact Cover by 3 sets variant | <p>Exact cover by 3-sets is $\sf{NP}$-complete:</p>

<blockquote>
<b>Instance</b>: Given a finite set $X = \{ x_1,x_2,...,x_{3n}\}$ of $3n$ elements and a collection $C = \{ ( x_{i_1}, x_{i_2}, x_{i_3}) \} $ of $m$ 3-elements subsets of $X$;<br>
<b>Question</b>: Find a subcollection $C'$ of $C$ such th... | terminology | 1 | Name of an Exact Cover by 3 sets variant -- (terminology)
<p>Exact cover by 3-sets is $\sf{NP}$-complete:</p>

<blockquote>
<b>Instance</b>: Given a finite set $X = \{ x_1,x_2,...,x_{3n}\}$ of $3n$ elements and a collection $C = \{ ( x_{i_1}, x_{i_2}, x_{i_3}) \} $ of $m$ 3-elements subsets of $X$;<br>
... | habedi/stack-exchange-dataset |
12,606 | What are flops and how are they benchmarked? | <p>Apple has just proudly stated that their new mac pro will be able to give up to 7 teraflops of computing power. Flops stands for Floating Point Operations Per Second. How exactly is this benchmarked though? Certain floating point operations are much heavier than others, so how exactly would a FLOP be a benchmark for... | computer architecture efficiency benchmarking | 1 | What are flops and how are they benchmarked? -- (computer architecture efficiency benchmarking)
<p>Apple has just proudly stated that their new mac pro will be able to give up to 7 teraflops of computing power. Flops stands for Floating Point Operations Per Second. How exactly is this benchmarked though? Certain floati... | habedi/stack-exchange-dataset |
12,610 | Question about the formal proof of the inorder traversing | <p>In Don Knuth's famous series of books, <em>The Art of Computer Programming</em>, section 2.3.1, he describes an algorithm to traverse binary tree in inorder, making use of an auxiliary stack:</p>
<blockquote>
<p><strong>T1</strong> [Initialize.] Set stack <span class="math-container">$\rm A$</span> empty and... | algorithms correctness proof graph traversal hoare logic | 1 | Question about the formal proof of the inorder traversing -- (algorithms correctness proof graph traversal hoare logic)
<p>In Don Knuth's famous series of books, <em>The Art of Computer Programming</em>, section 2.3.1, he describes an algorithm to traverse binary tree in inorder, making use of an auxiliary stack:</p>&#... | habedi/stack-exchange-dataset |
12,613 | Broadcast with Limited Spreading | <p>Let consider well-known problem in distributed computing <a href="http://en.wikipedia.org/wiki/Broadcasting_%28networking%29" rel="nofollow">Broadcast Problem</a> in network with stopping crashes.</p>

<p>The most appropriate solution to the broadcast problem is <a href="http://en.wikipedia.org/wiki/Flooding... | distributed systems | 1 | Broadcast with Limited Spreading -- (distributed systems)
<p>Let consider well-known problem in distributed computing <a href="http://en.wikipedia.org/wiki/Broadcasting_%28networking%29" rel="nofollow">Broadcast Problem</a> in network with stopping crashes.</p>

<p>The most appropriate solution to the broadcast... | habedi/stack-exchange-dataset |
12,620 | Is this formal grammar context-free (CFG) but not context-sensitive (CSG)? | <p>I have the following formal grammar: $$G= (\{S,A,B\},\{a,b\},R,S)$$ $$R=\{S \rightarrow A\ |B, A \rightarrow \varepsilon\ | aA\ |bA, B \rightarrow \varepsilon\ |Bb\ | b\}$$</p>

<p>Now, we see, the production rules $A \rightarrow \varepsilon$ and $B \rightarrow \varepsilon$ implies that this grammar is not ... | formal languages formal grammars | 1 | Is this formal grammar context-free (CFG) but not context-sensitive (CSG)? -- (formal languages formal grammars)
<p>I have the following formal grammar: $$G= (\{S,A,B\},\{a,b\},R,S)$$ $$R=\{S \rightarrow A\ |B, A \rightarrow \varepsilon\ | aA\ |bA, B \rightarrow \varepsilon\ |Bb\ | b\}$$</p>

<p>Now, we see, th... | habedi/stack-exchange-dataset |
12,624 | Is there a way to test if two NFAs accept the same language? | <p>Or at least generate a set of strings that one NFA accepts, so I can feed it into the other NFA. If I do a search through every path of the NFA, will that work? Although that will take a long time.</p>
 | algorithms regular languages finite automata | 1 | Is there a way to test if two NFAs accept the same language? -- (algorithms regular languages finite automata)
<p>Or at least generate a set of strings that one NFA accepts, so I can feed it into the other NFA. If I do a search through every path of the NFA, will that work? Although that will take a long time.</p>&#x... | habedi/stack-exchange-dataset |
12,636 | Count number of special onto functions | <p>We define an <strong>onto</strong> function from $[n] \times [n]$ to $[n-2] \cup \{0\}$ as follows, where $[n] = \{1,2,3,\ldots ,n\}$,</p>

<p>$$f : [n] \times [n] \rightarrow [n-2] \cup \{0\}.$$</p>

<p>1) $f(x,x) = 0$.</p>

<p>2) $f(x,y) = f(y,x) > 0$, for $y ≠ x$.</p>

<p>3) $f(... | combinatorics permutations | 1 | Count number of special onto functions -- (combinatorics permutations)
<p>We define an <strong>onto</strong> function from $[n] \times [n]$ to $[n-2] \cup \{0\}$ as follows, where $[n] = \{1,2,3,\ldots ,n\}$,</p>

<p>$$f : [n] \times [n] \rightarrow [n-2] \cup \{0\}.$$</p>

<p>1) $f(x,x) = 0$.</p>
&... | habedi/stack-exchange-dataset |
12,643 | Myhill-Nerode style characterization of CFL? | <p>Define the <em>Nerode equivalence</em> over a language $L \subseteq \Sigma^{*}$ as $u \sim_L v$ iff $uw \in L \Leftrightarrow vw \in L$ for every $w \in \Sigma^{*}$.</p>

<p>The Nerode equivalence ${\sim}_L$ has finitely many equivalence classes precisely when $L$ can be recognized by a finite-state automato... | formal languages context free pushdown automata | 1 | Myhill-Nerode style characterization of CFL? -- (formal languages context free pushdown automata)
<p>Define the <em>Nerode equivalence</em> over a language $L \subseteq \Sigma^{*}$ as $u \sim_L v$ iff $uw \in L \Leftrightarrow vw \in L$ for every $w \in \Sigma^{*}$.</p>

<p>The Nerode equivalence ${\sim}_L$ has... | habedi/stack-exchange-dataset |
12,652 | Is there a formal CS definition of VCS and file versions? | <p>I don't know whether it was a joke, but once I read what was referred to as a formal definition of a file in a versioning system such as git, hg or svn. It was something like a mathematical object like a homeomorphism. Was that a joke or is there really computer science theory about versioning systems and the mathem... | terminology reference request | 1 | Is there a formal CS definition of VCS and file versions? -- (terminology reference request)
<p>I don't know whether it was a joke, but once I read what was referred to as a formal definition of a file in a versioning system such as git, hg or svn. It was something like a mathematical object like a homeomorphism. Was t... | habedi/stack-exchange-dataset |
12,654 | How this expression leads to the given sequence | <p>Here given is a sequence from <a href="http://oeis.org/A008826" rel="nofollow">OEIS</a>.</p>

<p>The sequence is triangle of coefficients from fractional iteration of e^x - 1. Few terms are:<br>
1, 1, 3, 1, 13, 18, 1, 50, 205, 180, 1, 201, 1865, 4245, 2700, 1, 875, 16674</p>

<p>The expression of... | discrete mathematics | 1 | How this expression leads to the given sequence -- (discrete mathematics)
<p>Here given is a sequence from <a href="http://oeis.org/A008826" rel="nofollow">OEIS</a>.</p>

<p>The sequence is triangle of coefficients from fractional iteration of e^x - 1. Few terms are:<br>
1, 1, 3, 1, 13, 18, 1, 50, 205, 180,... | habedi/stack-exchange-dataset |
12,664 | Where am I wrong?: "countability" and "recursive enumerability" | <p>I have a a few fundamental doubts in recursive enumerability and countability and below, I have written what I understand them to be with proofs. But there are contradictions at the end. What is wrong with the statements/proofs i have made?</p>

<p>Countability (C=Countable): A set $X$ is C when a bijection ... | computability turing machines uncountability | 1 | Where am I wrong?: "countability" and "recursive enumerability" -- (computability turing machines uncountability)
<p>I have a a few fundamental doubts in recursive enumerability and countability and below, I have written what I understand them to be with proofs. But there are contradictions at the end. What is wrong wi... | habedi/stack-exchange-dataset |
12,670 | Does PETSc really give speedup? | <p>I searched linear solver library and found out PETSc library which considered to be powerful and useful library. PETSc consists implementations of various iterative methods with preconditioners and sparse matrix storing methods. All methods are realized sequentially and in parallel using MPI.</p>

<p>I was v... | parallel computing linear algebra | 1 | Does PETSc really give speedup? -- (parallel computing linear algebra)
<p>I searched linear solver library and found out PETSc library which considered to be powerful and useful library. PETSc consists implementations of various iterative methods with preconditioners and sparse matrix storing methods. All methods are r... | habedi/stack-exchange-dataset |
12,672 | Quantum computing roadmap | <p>I have to create a roadmap for the quantum computing technology. Looking around I found the <a href="http://en.wikipedia.org/wiki/Timeline_of_quantum_computing" rel="nofollow">timeline</a> on wikipedia that is pretty wide but does not highlight the key events in quantum computing research neither sets the possible f... | reference request quantum computing | 1 | Quantum computing roadmap -- (reference request quantum computing)
<p>I have to create a roadmap for the quantum computing technology. Looking around I found the <a href="http://en.wikipedia.org/wiki/Timeline_of_quantum_computing" rel="nofollow">timeline</a> on wikipedia that is pretty wide but does not highlight the k... | habedi/stack-exchange-dataset |
12,678 | Is the following langauge in $P$ or $NPC$ | <p>Assuming $P \neq NP$ Is the following langauge in $P$ or $NPC$:<br>
$L=\{\langle\phi\rangle\mid\phi$ is a 3CNF formula with an assignment satisfying at least half of the clauses$\}$</p>

<p>The first thing I tried to do is to find a 3CNF formula $\phi$ such that $\phi \notin L$ and I haven't managed to ... | complexity theory time complexity np complete satisfiability 3 sat | 1 | Is the following langauge in $P$ or $NPC$ -- (complexity theory time complexity np complete satisfiability 3 sat)
<p>Assuming $P \neq NP$ Is the following langauge in $P$ or $NPC$:<br>
$L=\{\langle\phi\rangle\mid\phi$ is a 3CNF formula with an assignment satisfying at least half of the clauses$\}$</p>

<p>T... | habedi/stack-exchange-dataset |
12,685 | Behavior of different multiplied and added time complexities | <p>Θ - Tightly bound</p>

<p>O - Upper bound</p>

<p>Ω - Lower bound</p>

<p>I understand that for addition, the max asymptotic value is taken, for example...</p>

<p>if ƒ1(n) = O(n) and ƒ2(n) = O(n log n), then ƒ1 + ƒ2 = O(max(ƒ1, ƒ2) = O(n log n)</p>

<p>and for multiplication,... | time complexity asymptotics | 1 | Behavior of different multiplied and added time complexities -- (time complexity asymptotics)
<p>Θ - Tightly bound</p>

<p>O - Upper bound</p>

<p>Ω - Lower bound</p>

<p>I understand that for addition, the max asymptotic value is taken, for example...</p>

<p>if ƒ1(n) = O(n) and ƒ2(n) =... | habedi/stack-exchange-dataset |
12,691 | What makes type inference for dependent types undecidable? | <p>I have seen it mentioned that dependent type systems are not inferable, but are checkable. I was wondering if there is a simple explanation of why that is so, and whether or not there is there a limit of "dependency" where types can be indexed by values, below which type inference is possible and above which it is n... | undecidability type theory type inference dependent types | 1 | What makes type inference for dependent types undecidable? -- (undecidability type theory type inference dependent types)
<p>I have seen it mentioned that dependent type systems are not inferable, but are checkable. I was wondering if there is a simple explanation of why that is so, and whether or not there is there a ... | habedi/stack-exchange-dataset |
12,702 | Space(n) not closed under Karp reductions - what about NTime(n)? | <p>In the book on complexity by Arora and Barak, there is an exercise to show $Space(n)\neq NP$, the proof of which goes by showing that $NP$ is closed under Karp reductions, while $Space(n)$ isn't.</p>

<p>To show that $Space(n)$ isn't closed under Karp reductions, the suggested technique (both in the solution... | complexity theory reductions closure properties | 1 | Space(n) not closed under Karp reductions - what about NTime(n)? -- (complexity theory reductions closure properties)
<p>In the book on complexity by Arora and Barak, there is an exercise to show $Space(n)\neq NP$, the proof of which goes by showing that $NP$ is closed under Karp reductions, while $Space(n)$ isn't.</p>... | habedi/stack-exchange-dataset |
12,713 | Find the number of topological sorts in a tree | <p>Find the number of topological sorts in a tree that has nodes that hold the size of their sub-tree including itself.</p>

<p>I've tried thinking what would be the best for m to define it but couldn't get anything specific. </p>

<p>Maybe $\mbox{Number of sorts =}\prod\limits_{x\in \mbox{children}}\mb... | graphs algorithm analysis trees | 1 | Find the number of topological sorts in a tree -- (graphs algorithm analysis trees)
<p>Find the number of topological sorts in a tree that has nodes that hold the size of their sub-tree including itself.</p>

<p>I've tried thinking what would be the best for m to define it but couldn't get anything specific. </... | habedi/stack-exchange-dataset |
12,714 | What's better for an algorithm complexity, O(log n) or amortized O(log n)? | <p><strong>Some context:</strong> I'm to write a program that sorts the lines of a file in C for Linux. Since I have to read all lines of the file (<code>fgets()</code> for example) I'm thinking about inserting them in a tree like structure in a sorted manner using the so called tree sort algorithm.</p>

<p>Loo... | time complexity sorting | 1 | What's better for an algorithm complexity, O(log n) or amortized O(log n)? -- (time complexity sorting)
<p><strong>Some context:</strong> I'm to write a program that sorts the lines of a file in C for Linux. Since I have to read all lines of the file (<code>fgets()</code> for example) I'm thinking about inserting them ... | habedi/stack-exchange-dataset |
12,718 | Is it decidable if a language described by number of occurences is regular? | <p>It is known that the language of words containing equal number of 0 and 1 is not regular, while the language of words containing equal number of 001 and 100 is regular (<a href="https://cs.stackexchange.com/questions/12139/is-the-language-of-words-containing-equal-number-of-001-and-100-regular">see here</a>).</p>&#x... | regular languages undecidability | 1 | Is it decidable if a language described by number of occurences is regular? -- (regular languages undecidability)
<p>It is known that the language of words containing equal number of 0 and 1 is not regular, while the language of words containing equal number of 001 and 100 is regular (<a href="https://cs.stackexchange.... | habedi/stack-exchange-dataset |
12,728 | How to perform alphabetically ordered DFS? | <p>I've been working on this graph and just completely botching it. I mean to say that my solution may be the worst possible other than if a monkey had thrown darts at the graph to decide the next path. Anyhow, I'm lost and really trying to get a grasp of where my conclusion and the proper conclusion diverged dramatic... | graphs search algorithms | 1 | How to perform alphabetically ordered DFS? -- (graphs search algorithms)
<p>I've been working on this graph and just completely botching it. I mean to say that my solution may be the worst possible other than if a monkey had thrown darts at the graph to decide the next path. Anyhow, I'm lost and really trying to get a... | habedi/stack-exchange-dataset |
12,740 | How to decide the scope of the following lambda expression? | <p>I am having a difficulty in deciding the scope of the left-most lambda in the following expression. </p>

<pre><code>λx.x(λuv.v)(λab.a)(λcd.c)
</code></pre>

<p>I have learnt that we should put brackets in such a way that the scope of lambda will be maximum. So arrived at candidate- answer 1, bel... | lambda calculus | 1 | How to decide the scope of the following lambda expression? -- (lambda calculus)
<p>I am having a difficulty in deciding the scope of the left-most lambda in the following expression. </p>

<pre><code>λx.x(λuv.v)(λab.a)(λcd.c)
</code></pre>

<p>I have learnt that we should put brackets in such a way... | habedi/stack-exchange-dataset |
12,742 | Time complexity of mutually recursive functions | <p>Suppose I have two mutually recursive functions like this:</p>

<pre><code>f1(x)
{
 .//some code
 .
 .
 f1(x-1)+g1(x-1); 

}

g1(y)
{
 .
 .//some code
 g1(y-1)+f1(y-1);
 ..


}
</code></pre>

<p>How can I calculate... | time complexity recursion | 1 | Time complexity of mutually recursive functions -- (time complexity recursion)
<p>Suppose I have two mutually recursive functions like this:</p>

<pre><code>f1(x)
{
 .//some code
 .
 .
 f1(x-1)+g1(x-1); 

}

g1(y)
{
 .
 .//some code
 g1(y-1)+f1(y... | habedi/stack-exchange-dataset |
12,745 | Regarding to the speed of supercomputer | <p>There seems to be a sense of competition in creating the fastest computer in the world, and I feel like technically you just have to continue increasing the core number to gain more flops, which is exactly what some countries are doing, so how would you really bench mark the technological level of a supercomputer</p... | performance | 1 | Regarding to the speed of supercomputer -- (performance)
<p>There seems to be a sense of competition in creating the fastest computer in the world, and I feel like technically you just have to continue increasing the core number to gain more flops, which is exactly what some countries are doing, so how would you really... | habedi/stack-exchange-dataset |
12,746 | Removing identical variables in CFG Unit Productions | <p>Productions of the form A-> A are removed immediately, but what if the production is of the form A -> AA? </p>

<p>example: 
A -> AA | a</p>
 | formal languages context free | 1 | Removing identical variables in CFG Unit Productions -- (formal languages context free)
<p>Productions of the form A-> A are removed immediately, but what if the production is of the form A -> AA? </p>

<p>example: 
A -> AA | a</p>
 | habedi/stack-exchange-dataset |
12,747 | Relationship between Undecidable Problems and Recursively Enumerable languages | <p>I have read the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Recursively_enumerable_language#Example" rel="noreferrer">Recursively Enumerable languages</a>. The article suggests that the halting problem is recursively enumerable but undecidable. My idea till today was that the halting problem belongs t... | computability undecidability halting problem | 1 | Relationship between Undecidable Problems and Recursively Enumerable languages -- (computability undecidability halting problem)
<p>I have read the Wikipedia article on <a href="http://en.wikipedia.org/wiki/Recursively_enumerable_language#Example" rel="noreferrer">Recursively Enumerable languages</a>. The article sugge... | habedi/stack-exchange-dataset |
12,753 | $FIRST_k$ set -- is algorithm given by Aho&Ullman correct? | <p>I am writing this, because no matter how I look at the algorithm I see an error :-)</p>

<p>Aho & Ullman in "Theory of Parsing, vol.1" (pp. 357-359) described the algorithm for building $FIRST_k(A)$ set for any $A$ non terminal by incrementally building helper set $F_i(A)$ which has such property that ev... | parsing | 1 | $FIRST_k$ set -- is algorithm given by Aho&Ullman correct? -- (parsing)
<p>I am writing this, because no matter how I look at the algorithm I see an error :-)</p>

<p>Aho & Ullman in "Theory of Parsing, vol.1" (pp. 357-359) described the algorithm for building $FIRST_k(A)$ set for any $A$ non terminal by in... | habedi/stack-exchange-dataset |
12,759 | What kinds of programming pitfalls modern languages are able to find? | <p>I often see claims that modern functional strictly-typed languages are 'safer' than others. These statement mostly linked with type systems and their ability to explicitly express the following pitfalls:</p>
<ul>
<li>Alternatives in function result. Maybe and Either datatypes vs. exceptions and null-pointers... | programming languages type theory | 1 | What kinds of programming pitfalls modern languages are able to find? -- (programming languages type theory)
<p>I often see claims that modern functional strictly-typed languages are 'safer' than others. These statement mostly linked with type systems and their ability to explicitly express the following pitfalls:</p>&... | habedi/stack-exchange-dataset |
12,762 | Get nodes that are participating in any cycle in a graph | <p>I have a problem that states the following :</p>

<blockquote>
 <p>Given a cyclic graph , output for each node if the node removes all cycles in the graph.</p>
</blockquote>

<p>The most trivial way to do this is using a Union-find disjoint set , and for each node , try <strong>not</strong> ... | algorithms graphs data structures | 1 | Get nodes that are participating in any cycle in a graph -- (algorithms graphs data structures)
<p>I have a problem that states the following :</p>

<blockquote>
 <p>Given a cyclic graph , output for each node if the node removes all cycles in the graph.</p>
</blockquote>

<p>The most trivial w... | habedi/stack-exchange-dataset |
12,769 | How is a hypergraph different from a bipartite graph? | <p>How is a <a href="http://en.wikipedia.org/wiki/Hypergraph" rel="nofollow noreferrer">hypergraph</a> different from the bipartite graph generated from the hypergraph by introducing new vertices for each hyperedge, and connecting these vertices with the vertices connected by the original hyperedge. Alternatively, I co... | graphs terminology | 1 | How is a hypergraph different from a bipartite graph? -- (graphs terminology)
<p>How is a <a href="http://en.wikipedia.org/wiki/Hypergraph" rel="nofollow noreferrer">hypergraph</a> different from the bipartite graph generated from the hypergraph by introducing new vertices for each hyperedge, and connecting these verti... | habedi/stack-exchange-dataset |
12,781 | How a TM can represent any algorithm? | <p>As I remember:</p>

<ul>
<li>A decision problem is a problem that has the answer yes or no.</li>
<li>An algorithm (in the context of automata theory) answers yes or no; it halts on all inputs, accepted or not.</li>
<li>A TM represents an algorithm. The TM accepts an input string and executes with... | computability turing machines | 1 | How a TM can represent any algorithm? -- (computability turing machines)
<p>As I remember:</p>

<ul>
<li>A decision problem is a problem that has the answer yes or no.</li>
<li>An algorithm (in the context of automata theory) answers yes or no; it halts on all inputs, accepted or not.</li>
<li>A TM ... | habedi/stack-exchange-dataset |
12,783 | Minimum number of vertices to remove to bound the largest connected component of a graph | <p>I have this problem, maybe anybody could help. </p>

<p>Given a graph $G = (V, E)$ and an integer $k \geq 1$, find the minimum number $l$ of vertices to remove to make the largest connected component of $G \setminus \{v_1, \dots,v_l\}$ have at most $k$ vertices.</p>

<p>I wonder it this problem can b... | graphs np complete combinatorics | 1 | Minimum number of vertices to remove to bound the largest connected component of a graph -- (graphs np complete combinatorics)
<p>I have this problem, maybe anybody could help. </p>

<p>Given a graph $G = (V, E)$ and an integer $k \geq 1$, find the minimum number $l$ of vertices to remove to make the largest co... | habedi/stack-exchange-dataset |
12,789 | Find which vertices to delete from graph to get smallest largest component | <p>Given a graph $G = (V, E)$, find $k$ vertices $\{v^*_1,\dots,v^*_k\}$, which removal would result in a graph with smallest largest component. </p>

<p>I assume for large $n = |V|$ and large $k$ the problem is difficult (NP-hard), but I am interested in small values of $k$ ($k \in \{1, 2, 3, 4\}$).</p>
&... | algorithms complexity theory graphs parameterized complexity | 1 | Find which vertices to delete from graph to get smallest largest component -- (algorithms complexity theory graphs parameterized complexity)
<p>Given a graph $G = (V, E)$, find $k$ vertices $\{v^*_1,\dots,v^*_k\}$, which removal would result in a graph with smallest largest component. </p>

<p>I assume for lar... | habedi/stack-exchange-dataset |
12,794 | Is there a name for this kind of graph? | <p>Is there a name for the DAG obtained from a directed graph by collapsing together the strongly connected components?</p>
 | graphs terminology | 1 | Is there a name for this kind of graph? -- (graphs terminology)
<p>Is there a name for the DAG obtained from a directed graph by collapsing together the strongly connected components?</p>
 | habedi/stack-exchange-dataset |
12,805 | Why/how does the definition of PCP use randomness? | <p>I am confused by the definition of probabilistic checkable proofs. </p>

<p>Language $L$ has an $(r(n),q(n))$ - PCP verifier, if there is a PPA V satisfying:</p>

<p><strong>Efficiency</strong>: $V$ uses at most $r(n)$ random coins and makes at most $q(n)$ nonadaptive queries to location of $\pi$.</p... | complexity theory terminology | 1 | Why/how does the definition of PCP use randomness? -- (complexity theory terminology)
<p>I am confused by the definition of probabilistic checkable proofs. </p>

<p>Language $L$ has an $(r(n),q(n))$ - PCP verifier, if there is a PPA V satisfying:</p>

<p><strong>Efficiency</strong>: $V$ uses at most $r(... | habedi/stack-exchange-dataset |
12,811 | Understanding an example of coin toss expectation maximization | <p>I've been trying to get my head around Expectation maximization algorithms, and I thought I'd start simple. I found this 3-coin example here: <a href="http://cs.dartmouth.edu/~cs104/CS104_11.04.22.pdf" rel="nofollow">http://cs.dartmouth.edu/~cs104/CS104_11.04.22.pdf</a> I understand the calculation of all of the pr... | probability theory statistics | 1 | Understanding an example of coin toss expectation maximization -- (probability theory statistics)
<p>I've been trying to get my head around Expectation maximization algorithms, and I thought I'd start simple. I found this 3-coin example here: <a href="http://cs.dartmouth.edu/~cs104/CS104_11.04.22.pdf" rel="nofollow">ht... | habedi/stack-exchange-dataset |
12,812 | How to prove a problem is NOT NP-Complete? | <p>Is there any general technique for proving a problem NOT being NP-Complete?</p>

<p>I got this question on the exam that asked me to show whether some problem (see below) is NP-Complete. I could not think of any real solution, and just proved it was in P. Obviously this is not a real answer.</p>

<p>... | complexity theory np complete proof techniques | 1 | How to prove a problem is NOT NP-Complete? -- (complexity theory np complete proof techniques)
<p>Is there any general technique for proving a problem NOT being NP-Complete?</p>

<p>I got this question on the exam that asked me to show whether some problem (see below) is NP-Complete. I could not think of any re... | habedi/stack-exchange-dataset |
12,825 | Why don't we emphasize "length of input string" when considering time complexity of sorting algorithms? | <p>The knapsack problem is $O(c\,n)$ where $c$ is the capacity of knapsack and $n$ is the number of items. Yet it's exponential because the size of the input is $\log(c)$.</p>

<p>However, why don't we emphasize length of input in other algorithms? To name one example, what would be the <strong>input size $n$</... | algorithms terminology time complexity runtime analysis | 1 | Why don't we emphasize "length of input string" when considering time complexity of sorting algorithms? -- (algorithms terminology time complexity runtime analysis)
<p>The knapsack problem is $O(c\,n)$ where $c$ is the capacity of knapsack and $n$ is the number of items. Yet it's exponential because the size of the inp... | habedi/stack-exchange-dataset |
12,826 | Largest reported speedup for a parallel computation? | <p>A parallel implementation of a computation is usually compared to a sequential version of the same computation. The ratio of the time taken by the sequential version to the time taken by the parallel version is called the <em>speedup</em>. So if 8 cores run their smaller parts of the computation in 2 time units, a... | reference request efficiency parallel computing | 1 | Largest reported speedup for a parallel computation? -- (reference request efficiency parallel computing)
<p>A parallel implementation of a computation is usually compared to a sequential version of the same computation. The ratio of the time taken by the sequential version to the time taken by the parallel version is... | habedi/stack-exchange-dataset |
12,830 | Can expected "depth" of an element and expected "height" differ significantly? | <p>When analysing treaps (or, equivalently, BSTs or Quicksort), it is not too hard to show that</p>

<p>$\qquad\displaystyle \mathbb{E}[d(k)] \in O(\log n)$</p>

<p>where $d(k)$ is the depth of the element with rank $k$ in the set of $n$ keys.
Intuitively, this seems to imply that also</p>

... | algorithms data structures algorithm analysis probability theory average case | 1 | Can expected "depth" of an element and expected "height" differ significantly? -- (algorithms data structures algorithm analysis probability theory average case)
<p>When analysing treaps (or, equivalently, BSTs or Quicksort), it is not too hard to show that</p>

<p>$\qquad\displaystyle \mathbb{E}[d(k)] \in O(\l... | habedi/stack-exchange-dataset |
12,834 | Why do Bloom filters work? | <p>Let's say I am using Bloom filters to create a function to check if a word exists in a document or not. If I pick a hash function to fill out a bit bucket for all words in my document. Then if for a given number of words, wouldn't the whole bit bucket be all 1s? If so then checking for any word will return true? Wh... | data structures probabilistic algorithms bloom filters dictionaries | 1 | Why do Bloom filters work? -- (data structures probabilistic algorithms bloom filters dictionaries)
<p>Let's say I am using Bloom filters to create a function to check if a word exists in a document or not. If I pick a hash function to fill out a bit bucket for all words in my document. Then if for a given number of w... | habedi/stack-exchange-dataset |
12,841 | Differences between basic, complex and terminological facts in a Knowledge Base using First-Order Logic | <p>I've been reading the excellent book <a href="http://books.google.pt/books/about/Knowledge_representation_and_reasoning.html?id=OuPtLaA5QjoC&redir_esc=y">Knowledge Representation and Reasoning</a> by Ronald Brachman and Hector Levesque.</p>

<p>In the beginning of Section 3.2 "Vocabulary" of Chapter 3 "E... | terminology logic knowledge representation first order logic reasoning | 1 | Differences between basic, complex and terminological facts in a Knowledge Base using First-Order Logic -- (terminology logic knowledge representation first order logic reasoning)
<p>I've been reading the excellent book <a href="http://books.google.pt/books/about/Knowledge_representation_and_reasoning.html?id=OuPtLaA5Q... | habedi/stack-exchange-dataset |
12,846 | distance between histograms | <p>I have 2 histograms that represent the height of characters in 2 images. 
example: </p>

<ul>
<li>1 <strong>**</strong></li>
<li>2 <strong><em>*</em>***</strong></li>
<li>3 <strong><em>*</em>**<em>*</em></strong></li>
<li>.</li>
<li>.</li>
<li>.</li>
<li>100 <strong><em>*</em>... | machine learning probability theory statistics | 1 | distance between histograms -- (machine learning probability theory statistics)
<p>I have 2 histograms that represent the height of characters in 2 images. 
example: </p>

<ul>
<li>1 <strong>**</strong></li>
<li>2 <strong><em>*</em>***</strong></li>
<li>3 <strong><em>*</em>**<em>*</em></strong><... | habedi/stack-exchange-dataset |
12,851 | Upper bound on the number of edges relative to the height of a DFS tree | <p>Let $T$ be a depth-first search tree of a connected undirected graph $G$ and $h$ be the height of $T$. How do you show that $G$ has no more than $h \times |V|$ edges where $|V|$ is the number of vertices in $G$? </p>
 | graphs spanning trees | 1 | Upper bound on the number of edges relative to the height of a DFS tree -- (graphs spanning trees)
<p>Let $T$ be a depth-first search tree of a connected undirected graph $G$ and $h$ be the height of $T$. How do you show that $G$ has no more than $h \times |V|$ edges where $|V|$ is the number of vertices in $G$? </p>&#... | habedi/stack-exchange-dataset |
12,853 | Heap - Give an $O(n \lg k)$ time algorithm to merge $k$ sorted lists into one sorted list | <p>Most probably, this question is asked before. It's from CLRS (2nd Ed) problem 6.5-8 -- </p>

<blockquote>
 <p>Give an $O(n \lg k)$ time algorithm to merge $k$ sorted lists into one sorted list, where $n$ is the total number of elements in all the input lists. (Hint: Use a min-heap for $k$-way merging.)<... | algorithms algorithm analysis heaps priority queues | 1 | Heap - Give an $O(n \lg k)$ time algorithm to merge $k$ sorted lists into one sorted list -- (algorithms algorithm analysis heaps priority queues)
<p>Most probably, this question is asked before. It's from CLRS (2nd Ed) problem 6.5-8 -- </p>

<blockquote>
 <p>Give an $O(n \lg k)$ time algorithm to merge $k... | habedi/stack-exchange-dataset |
12,867 | Are HTML and CSS regular languages? | <p>I have a question whether or not CSS and HTML are regular languages.</p>

<p>I believe CSS is a regular language, since it should be possible to create a regular expression to match the structure of CSS.</p>

<p>However, I believe that HTML is <strong>not</strong> a regular language since you have ne... | formal languages regular languages finite automata regular expressions | 1 | Are HTML and CSS regular languages? -- (formal languages regular languages finite automata regular expressions)
<p>I have a question whether or not CSS and HTML are regular languages.</p>

<p>I believe CSS is a regular language, since it should be possible to create a regular expression to match the structure o... | habedi/stack-exchange-dataset |
12,876 | Equivalence of regular expressions | <p>Is it possible, in general, to determine whether two regular expressions admit the same set of strings?</p>

<p>Also, in particular, is it possible to determine whether a given regular expression admits the same set of strings as the regular expression ".*" (i.e., accepts anything).</p>
 | regular expressions | 1 | Equivalence of regular expressions -- (regular expressions)
<p>Is it possible, in general, to determine whether two regular expressions admit the same set of strings?</p>

<p>Also, in particular, is it possible to determine whether a given regular expression admits the same set of strings as the regular express... | habedi/stack-exchange-dataset |
12,888 | PCP deterministic emulation | <p>Suppose that $S \in PCP(r(n),q(n))$, colclude that $S \in NTIME(2^r \cdot poly) \cap DTIME(2^{2^r q+r} \cdot poly)$</p>

<p>The idea of a nondeterminstic simulation of the $V$ on input $x$ is simple, guess a proof, check every string $y$ of the length $2^r$, and this simulation should take nondeterministic t... | complexity theory | 1 | PCP deterministic emulation -- (complexity theory)
<p>Suppose that $S \in PCP(r(n),q(n))$, colclude that $S \in NTIME(2^r \cdot poly) \cap DTIME(2^{2^r q+r} \cdot poly)$</p>

<p>The idea of a nondeterminstic simulation of the $V$ on input $x$ is simple, guess a proof, check every string $y$ of the length $2^r$,... | habedi/stack-exchange-dataset |
12,889 | Properties of polynomial time many-one reductions | <p>I'm working on old multiple choice exams and would like to know if the following statements are true or false:</p>

<p>a) $L_1 \le_p L_2 \le_p L_3 \Rightarrow L_1 \le_p L_3$</p>

<p>b) If $L \in \mathsf{NP}$ and $U \le_p L$ holds for all languages $U \in \mathsf{PSPACE}$ then $\mathsf{NP} = \mathsf{P... | complexity theory reductions polynomial time | 1 | Properties of polynomial time many-one reductions -- (complexity theory reductions polynomial time)
<p>I'm working on old multiple choice exams and would like to know if the following statements are true or false:</p>

<p>a) $L_1 \le_p L_2 \le_p L_3 \Rightarrow L_1 \le_p L_3$</p>

<p>b) If $L \in \maths... | habedi/stack-exchange-dataset |
12,896 | A hard $n$-fold integral | <p>Consider the $n$-fold integral 
$$
J = \int_{\theta_1 \in I_1, \theta_2 \in I_2 \ldots, \theta_n \in I_n} d\theta_n\ldots d\theta_2 d\theta_1
$$</p>

<p>whose intervals are defined by 
$$
\begin{align}
I_1 = [0,1] \\
I_i = [\max(c_i,\theta_{i-1}),1] , 2\leq i\leq n 
\end{alig... | time complexity | 1 | A hard $n$-fold integral -- (time complexity)
<p>Consider the $n$-fold integral 
$$
J = \int_{\theta_1 \in I_1, \theta_2 \in I_2 \ldots, \theta_n \in I_n} d\theta_n\ldots d\theta_2 d\theta_1
$$</p>

<p>whose intervals are defined by 
$$
\begin{align}
I_1 = [0,1] \\
I_i = [\max(c_i,\t... | habedi/stack-exchange-dataset |
12,899 | Analysis of algorithms, 'big O' question | <p>The main question is, how exactly is the big O analysis calculated on routines? Is there a specific formula that relates what each function in a program does to a big O calculation?</p>

<p>Also, what about more complex iterations, such as colour conversions etc?</p>

<p>I would like to point out tha... | algorithms algorithm analysis proof techniques runtime analysis | 1 | Analysis of algorithms, 'big O' question -- (algorithms algorithm analysis proof techniques runtime analysis)
<p>The main question is, how exactly is the big O analysis calculated on routines? Is there a specific formula that relates what each function in a program does to a big O calculation?</p>

<p>Also, wha... | habedi/stack-exchange-dataset |
12,902 | Significance of parameters in Tiny Mersenne Twister algorithm | <p>I am trying to implement and optimize the <a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/TINYMT/" rel="nofollow">Tiny Mersenne Twister (TinyMT)</a> algorithm as required by an API I am developing with my team at work. The algorithm utilizes a C structure with 32-bit unsigned integers "mat1", "mat2", "tmat"... | linear algebra randomized algorithms matrices | 1 | Significance of parameters in Tiny Mersenne Twister algorithm -- (linear algebra randomized algorithms matrices)
<p>I am trying to implement and optimize the <a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/TINYMT/" rel="nofollow">Tiny Mersenne Twister (TinyMT)</a> algorithm as required by an API I am developin... | habedi/stack-exchange-dataset |
12,903 | Can a Turing machine decide if a LOOP program stops for the integer input 0 | <p>This is a question I found in a practice exam while I am preparing for my mid term exam.</p>

<p>The answer needs justification, either a pseudo code or a logical explanation why not.</p>

<p>What puzzled me about that question is that we already know that all LOOP programs terminate at some point, t... | turing machines halting problem loops | 1 | Can a Turing machine decide if a LOOP program stops for the integer input 0 -- (turing machines halting problem loops)
<p>This is a question I found in a practice exam while I am preparing for my mid term exam.</p>

<p>The answer needs justification, either a pseudo code or a logical explanation why not.</p>&#x... | habedi/stack-exchange-dataset |
12,909 | What future working opportunities do computer science students have? | <p>If I am right students learning computer science at universities learn very theoretical kind of knowledge. A knowledge most of which (e.g. algorithm theory) can't be used to create everyday software (e.g. MS Word, IE, etc.). </p>

<p>What opportunities do computer science graduates have if they don't want to... | education | 1 | What future working opportunities do computer science students have? -- (education)
<p>If I am right students learning computer science at universities learn very theoretical kind of knowledge. A knowledge most of which (e.g. algorithm theory) can't be used to create everyday software (e.g. MS Word, IE, etc.). </p>
... | habedi/stack-exchange-dataset |
12,916 | r-regular graph and hamiltonian path | <p>I am having some issues proving a problem I am working on. I have been sketching out examples but the proof is not jumping out at me.</p>

<p>Question:
Let $G = (V,E)$ be an undirected $r$-regular graph (that is each vertex has a degree of $r$) for some $0 < r < n$, where $|V| = n > 1$. Prove th... | graphs proof techniques | 1 | r-regular graph and hamiltonian path -- (graphs proof techniques)
<p>I am having some issues proving a problem I am working on. I have been sketching out examples but the proof is not jumping out at me.</p>

<p>Question:
Let $G = (V,E)$ be an undirected $r$-regular graph (that is each vertex has a degree of... | habedi/stack-exchange-dataset |
12,917 | Is oracle computer capable of doing infinite loops? | <p>Solve this problem: "build an infinite binary oscilator"</p>

<p>With a Turing Machine we can solve it</p>

<pre><code>a=False
While True:
 a=not a
 print a,
</code></pre>

<p>then output will be</p>

<pre><code>True False True False True False ...
</code></pre... | turing machines halting problem oracle machines | 1 | Is oracle computer capable of doing infinite loops? -- (turing machines halting problem oracle machines)
<p>Solve this problem: "build an infinite binary oscilator"</p>

<p>With a Turing Machine we can solve it</p>

<pre><code>a=False
While True:
 a=not a
 print a,
</code></pre>
... | habedi/stack-exchange-dataset |
12,925 | circle packing algorithm used by Percolator | <p>I was admiring this rendition of the Mona Lisa from <a href="http://www.flickr.com/photos/quasimondo/4652406419/" rel="nofollow noreferrer">quasimondo</a>'s Flickr account. He says:</p>

<blockquote>
 <p>Combining circle packing with data visualization. The pie charts show
 the distribution of the... | algorithms computational geometry discrete mathematics image processing | 1 | circle packing algorithm used by Percolator -- (algorithms computational geometry discrete mathematics image processing)
<p>I was admiring this rendition of the Mona Lisa from <a href="http://www.flickr.com/photos/quasimondo/4652406419/" rel="nofollow noreferrer">quasimondo</a>'s Flickr account. He says:</p>

... | habedi/stack-exchange-dataset |
12,929 | Example of a false proposition when assuming Type : Type | <p>In Type Theory if one allows Type to be a member of itself, it makes the theory inconsistent. I understand it by analogy to Russel's paradox in Set Theory, but would prefer to see it done in Type Theory. Is there a short example of the equivalent in Type Theory?</p>
 | type theory | 1 | Example of a false proposition when assuming Type : Type -- (type theory)
<p>In Type Theory if one allows Type to be a member of itself, it makes the theory inconsistent. I understand it by analogy to Russel's paradox in Set Theory, but would prefer to see it done in Type Theory. Is there a short example of the equival... | habedi/stack-exchange-dataset |
12,931 | Complexity of taking mod | <p>This seems like a question that should have an easy answer, but I don't have a definitive one: </p>

<blockquote>
 <p>If I have two $n$ bit numbers $a, p$, what is the complexity of
 computing $a\bmod p$ ?</p>
</blockquote>

<p>Merely dividing $a$ by $p$ <a href="http://en.wikipedia.org... | algorithms number theory | 1 | Complexity of taking mod -- (algorithms number theory)
<p>This seems like a question that should have an easy answer, but I don't have a definitive one: </p>

<blockquote>
 <p>If I have two $n$ bit numbers $a, p$, what is the complexity of
 computing $a\bmod p$ ?</p>
</blockquote>

<p>Mere... | habedi/stack-exchange-dataset |
12,932 | Checking whether a digraph on $n$ vertices contains exactly $10\sqrt{n}$ strongly connected components in NL | <p>I am studying now for a test in my complexity course. When I solved previous exams I saw the following question: Prove that the language $L$ of all directed graphs on $n$ vertices that contain exactly $10\sqrt{n}$ strongly connected components is in $NL$. </p>

<p>We saw in class that checking whether a dire... | complexity theory space complexity nondeterminism | 1 | Checking whether a digraph on $n$ vertices contains exactly $10\sqrt{n}$ strongly connected components in NL -- (complexity theory space complexity nondeterminism)
<p>I am studying now for a test in my complexity course. When I solved previous exams I saw the following question: Prove that the language $L$ of all direc... | habedi/stack-exchange-dataset |
12,943 | What is a good algorithm for generating random DFAs? | <p>I am generating random DFAs to test a DFA reduction algorithm on them.</p>

<p>The algorithm that I'm using right now is as follows: for each state $q$, for each symbol in the alphabet $c$, add $\delta (q, c)$ to some random state. Each state has the same probability of becoming a final state.</p>

... | algorithms finite automata randomness pseudo random generators random graphs | 1 | What is a good algorithm for generating random DFAs? -- (algorithms finite automata randomness pseudo random generators random graphs)
<p>I am generating random DFAs to test a DFA reduction algorithm on them.</p>

<p>The algorithm that I'm using right now is as follows: for each state $q$, for each symbol in th... | habedi/stack-exchange-dataset |
12,950 | A text-classifier that explains its decisions | <p>I am building a text categorizer for short sentences. In addition to telling the user "the category of the text you entered is C", I want to be able to explain why I made this decision, in a short and understandable way. For example, I don't want to tell the user "I put your sentence into a complex 3-layered neural... | machine learning classification | 1 | A text-classifier that explains its decisions -- (machine learning classification)
<p>I am building a text categorizer for short sentences. In addition to telling the user "the category of the text you entered is C", I want to be able to explain why I made this decision, in a short and understandable way. For example,... | habedi/stack-exchange-dataset |
12,952 | Show that only a few multiples of .01 decimal are powers of 2 | <p>I am asking this to advance the argument that BigDecimal is better than float or double for representing exact amounts of currency. </p>

<p>Can someone refer me to a proof that between any two integers there are only four values that multiples of .01 and can be exactly represented in base 2? Or at least c... | number formats | 1 | Show that only a few multiples of .01 decimal are powers of 2 -- (number formats)
<p>I am asking this to advance the argument that BigDecimal is better than float or double for representing exact amounts of currency. </p>

<p>Can someone refer me to a proof that between any two integers there are only four val... | habedi/stack-exchange-dataset |
12,953 | Proving that a language is not in P using diagonalization | <p>Pardon me if i'm missing something which is very obvious here but i cant seem to figure it out. </p>

<p>$E=\{ \langle M, w \rangle \mid \text{ Turing Machine encoded by $M$ accepts input $w$ after at most $ 2^{|w|}$ steps}\}$</p>

<p>We have to prove $E\notin P$</p>

<p>The book (Papadimitro... | complexity theory polynomial time check my proof | 1 | Proving that a language is not in P using diagonalization -- (complexity theory polynomial time check my proof)
<p>Pardon me if i'm missing something which is very obvious here but i cant seem to figure it out. </p>

<p>$E=\{ \langle M, w \rangle \mid \text{ Turing Machine encoded by $M$ accepts input $w$ after... | habedi/stack-exchange-dataset |
12,963 | Multicommodity circulation formulation | <p>On the <a href="http://en.wikipedia.org/wiki/Circulation_problem" rel="nofollow">circulation problem page on wikipedia</a>, the multicommodity circulation problem formulation seems to be insufficient, since we can just set all but one flow to $0$, and reduce it to a circulation problem.</p>

<p>I can't find ... | reference request optimization network flow | 1 | Multicommodity circulation formulation -- (reference request optimization network flow)
<p>On the <a href="http://en.wikipedia.org/wiki/Circulation_problem" rel="nofollow">circulation problem page on wikipedia</a>, the multicommodity circulation problem formulation seems to be insufficient, since we can just set all bu... | habedi/stack-exchange-dataset |
12,971 | Find node with key of at least n in a binary search tree | <p>Working on a project for my Data Structures class. </p>

<p>I've implemented a Red/Black tree in Java. One of the operations required of the data structure is "find a node which has a key of at least n". The leaves of the tree are the sentinel node.</p>

<p>My initial thought was using the regular se... | data structures binary trees search trees | 1 | Find node with key of at least n in a binary search tree -- (data structures binary trees search trees)
<p>Working on a project for my Data Structures class. </p>

<p>I've implemented a Red/Black tree in Java. One of the operations required of the data structure is "find a node which has a key of at least n". T... | habedi/stack-exchange-dataset |
12,983 | Which are the most effective sorting algorithms for a large dataset? | <p>A bit of background, the work that I currently and will be doing involves sorting very large amounts of data (in this case, grayscale pixels in descending order), sometimes up to 4 million. </p>

<p>Which are the most effective and efficient sorting algorithms that could handle multiple large datasets (such... | algorithms algorithm analysis sorting | 1 | Which are the most effective sorting algorithms for a large dataset? -- (algorithms algorithm analysis sorting)
<p>A bit of background, the work that I currently and will be doing involves sorting very large amounts of data (in this case, grayscale pixels in descending order), sometimes up to 4 million. </p>

... | habedi/stack-exchange-dataset |
12,984 | Binary Search Tree: Replace $k$ min elements with their average | <p>Given a valid binary search tree whose keys are unique real numbers, and a set of $k$ pointers to the $k$ minimum elements in the tree, will the BST property be maintained if I replace all $k$ elements with the average of the $k$ elements? </p>

<p>The BST property as given in Corman:</p>

<blockquot... | data structures proof techniques search trees | 1 | Binary Search Tree: Replace $k$ min elements with their average -- (data structures proof techniques search trees)
<p>Given a valid binary search tree whose keys are unique real numbers, and a set of $k$ pointers to the $k$ minimum elements in the tree, will the BST property be maintained if I replace all $k$ elements ... | habedi/stack-exchange-dataset |
12,985 | Finding an Uncomputable Function | <p>Let there be 2 sets $X$ and $Y$, both are countable (assume the bijection from $\mathbb{N}$ to the respective sets is computable) and infinite. Let $S$ be the set of all possible functions (NOT necessarily computable, i dont care about computability at this point) from $A$ to $Y$ for all $A \subset X$ (Remember that... | computability | 1 | Finding an Uncomputable Function -- (computability)
<p>Let there be 2 sets $X$ and $Y$, both are countable (assume the bijection from $\mathbb{N}$ to the respective sets is computable) and infinite. Let $S$ be the set of all possible functions (NOT necessarily computable, i dont care about computability at this point) ... | habedi/stack-exchange-dataset |
12,987 | Minimum path in an undirected graph with 2 kinds of edges | <p>Given an <strong>undirected</strong> graph with <strong>positive weights</strong>, there are 2 kinds of edges: locked edges and unlocked edges. 
Determination if a given edge is either locked or unlocked edge takes O(1).</p>

<p>For given two vertices s , t and a positive number k = O(1), How can I find ... | algorithms graphs | 1 | Minimum path in an undirected graph with 2 kinds of edges -- (algorithms graphs)
<p>Given an <strong>undirected</strong> graph with <strong>positive weights</strong>, there are 2 kinds of edges: locked edges and unlocked edges. 
Determination if a given edge is either locked or unlocked edge takes O(1).</p>
&#x... | habedi/stack-exchange-dataset |
12,990 | Where can a student learn image processing? | <p>I am a student of computer science with interest in image processing. I have learned how to apply a few effects to images like making them grayscale, sketching them out of lines, etc. </p>

<p>I would like to learn more about the algorithmic techniques behind creative manipulation of images like making the... | reference request image processing | 1 | Where can a student learn image processing? -- (reference request image processing)
<p>I am a student of computer science with interest in image processing. I have learned how to apply a few effects to images like making them grayscale, sketching them out of lines, etc. </p>

<p>I would like to learn more abou... | habedi/stack-exchange-dataset |
12,992 | How does one efficiently produce all binary sequences with an equal number of 0's and 1's? | <p>A <em>binary sequence</em> of length $n$ is just an ordered sequence $x_1,\ldots,x_n$ so that each $x_j$ is either $0$ or $1$. In order to generate all such binary sequences, one can use the obvious binary tree structure in the following way: the root is "empty", but each left child corresponds to the addition of $0... | algorithms graphs binary trees | 1 | How does one efficiently produce all binary sequences with an equal number of 0's and 1's? -- (algorithms graphs binary trees)
<p>A <em>binary sequence</em> of length $n$ is just an ordered sequence $x_1,\ldots,x_n$ so that each $x_j$ is either $0$ or $1$. In order to generate all such binary sequences, one can use the... | habedi/stack-exchange-dataset |
12,995 | Theta Runtime of Nested for Loops | <p>I have two for loops, one nested within the other. I have two int variables n and U, where <code>U > n</code>. I know that the outer loop runs exactly U times (pretty much <code>for(int i = 0; i < U -1; i++)</code>), and the inner loop runs exactly n times in total <strong>for the duration of the entire execut... | algorithm analysis runtime analysis loops | 1 | Theta Runtime of Nested for Loops -- (algorithm analysis runtime analysis loops)
<p>I have two for loops, one nested within the other. I have two int variables n and U, where <code>U > n</code>. I know that the outer loop runs exactly U times (pretty much <code>for(int i = 0; i < U -1; i++)</code>), and the inner... | habedi/stack-exchange-dataset |
13,008 | Sabatier conjectures | <p>While I was doing
<a href="http://en.wikipedia.org/wiki/Introduction_to_Algorithms" rel="nofollow">CLRS</a> (3rd
edition), I came across this question on page 629:</p>

<p><strong>Professor Sabatier conjectures</strong> the following converse of Theorem
23.1:</p>

<blockquote>
 <p>Le... | graphs | 1 | Sabatier conjectures -- (graphs)
<p>While I was doing
<a href="http://en.wikipedia.org/wiki/Introduction_to_Algorithms" rel="nofollow">CLRS</a> (3rd
edition), I came across this question on page 629:</p>

<p><strong>Professor Sabatier conjectures</strong> the following converse of Theorem
23.1:</p>&... | habedi/stack-exchange-dataset |
13,009 | Automaton for substring matching | <p>Given $s$ as a string over some alphabet, what is the best known algorithm to compute a corresponding deterministic finite-state automaton (DFA) that accepts any string that contains $s$?</p>

<p>I am mostly interested of the lowest time complexity so if you tell me what is the best known complexity in O not... | automata finite automata strings substrings | 1 | Automaton for substring matching -- (automata finite automata strings substrings)
<p>Given $s$ as a string over some alphabet, what is the best known algorithm to compute a corresponding deterministic finite-state automaton (DFA) that accepts any string that contains $s$?</p>

<p>I am mostly interested of the l... | habedi/stack-exchange-dataset |
13,011 | Solve modulus with constraints for multiple equations | <p>I'm trying write a program to solve equations from the following form:</p>

<p>$$ \begin{align}
a \bmod x &= t_1 \\
b \bmod x &= t_2 \\
\end{align} $$</p>

<p>where $a$, $b$, $t_1$ and $t_2$ are known values.</p>

<p>I have multiple equations of the same form and I'd like ... | algorithms computer algebra | 1 | Solve modulus with constraints for multiple equations -- (algorithms computer algebra)
<p>I'm trying write a program to solve equations from the following form:</p>

<p>$$ \begin{align}
a \bmod x &= t_1 \\
b \bmod x &= t_2 \\
\end{align} $$</p>

<p>where $a$, $b$, $t_1$ and $t_2$ are... | habedi/stack-exchange-dataset |
13,015 | Pairwise comparisons with confidence | <p>There is a lot of information available on the subject of Pairwise Comparisons but I haven't found any guidance on how to optimize pair measurements that have confidence values attached to them.</p>

<p>Imagine that an AI black box has been trained on many pairs of objects in order to predict the distance be... | machine learning artificial intelligence computational geometry | 1 | Pairwise comparisons with confidence -- (machine learning artificial intelligence computational geometry)
<p>There is a lot of information available on the subject of Pairwise Comparisons but I haven't found any guidance on how to optimize pair measurements that have confidence values attached to them.</p>

<p>... | habedi/stack-exchange-dataset |
13,030 | Partition problem with distinct integers | <p>The <a href="https://en.wikipedia.org/wiki/Partition_problem" rel="nofollow noreferrer">partition problem</a> is a well-known NP-complete problem. In the definitions I have seen, the input is assumed to be a multiset of integers, and we want to decide the existence of a partition into two sets that have the same sum... | complexity theory np complete partitions | 1 | Partition problem with distinct integers -- (complexity theory np complete partitions)
<p>The <a href="https://en.wikipedia.org/wiki/Partition_problem" rel="nofollow noreferrer">partition problem</a> is a well-known NP-complete problem. In the definitions I have seen, the input is assumed to be a multiset of integers, ... | habedi/stack-exchange-dataset |
13,039 | Dynamic Programming To calculate the combinations | <p>This is a problem from a past contest at topcoder : <a href="http://community.topcoder.com/stat?c=problem_statement&pm=12338" rel="nofollow">Problem</a>.</p>

<p>Its solution is given here : <a href="http://apps.topcoder.com/wiki/display/tc/SRM+566" rel="nofollow">Solution [Scroll Down to Penguin Emperor... | combinatorics dynamic programming | 1 | Dynamic Programming To calculate the combinations -- (combinatorics dynamic programming)
<p>This is a problem from a past contest at topcoder : <a href="http://community.topcoder.com/stat?c=problem_statement&pm=12338" rel="nofollow">Problem</a>.</p>

<p>Its solution is given here : <a href="http://apps.topc... | habedi/stack-exchange-dataset |
13,052 | In the "tall cache assumption" what does $\Omega$ represent? | <p>Within the field of cache-oblivious algorithms the ideal cache model is used for determining the cache complexity of an algorithm. One of the assumptions of the ideal cache model is that it models a "tall cache". This is given by the statement $Z = \Omega(L^2)$. Where $Z$ is the size of the cache and $L$ is the s... | asymptotics landau notation computation models cpu cache | 1 | In the "tall cache assumption" what does $\Omega$ represent? -- (asymptotics landau notation computation models cpu cache)
<p>Within the field of cache-oblivious algorithms the ideal cache model is used for determining the cache complexity of an algorithm. One of the assumptions of the ideal cache model is that it mod... | habedi/stack-exchange-dataset |
13,055 | Time complexity and space complexity in recursive algorithm | <pre><code>"The designer of an algorithm needs to balance between space complexity and time
complexity." - Comment on the validity of the statement in the context of recursive
algorithms.
</code></pre>

<p>This is a question from my university's previous paper. But i couldn't find a decent answer. A... | algorithms time complexity space complexity | 1 | Time complexity and space complexity in recursive algorithm -- (algorithms time complexity space complexity)
<pre><code>"The designer of an algorithm needs to balance between space complexity and time
complexity." - Comment on the validity of the statement in the context of recursive
algorithms.
</code></pr... | habedi/stack-exchange-dataset |
13,056 | Empirical studies about benefits of Q&A sites for programming | <p>I'm looking for empirical papers which investigate if a user can benefit from Q&A sites like Stack Overflow. I welcome any papers related to this topic, e.g: </p>

<ul>
<li>an experiment, investigating if a specific task can be executed faster,</li>
<li>an analysis, investigating if a user unders... | reference request software engineering empirical research social networks | 1 | Empirical studies about benefits of Q&A sites for programming -- (reference request software engineering empirical research social networks)
<p>I'm looking for empirical papers which investigate if a user can benefit from Q&A sites like Stack Overflow. I welcome any papers related to this topic, e.g: </p>

... | habedi/stack-exchange-dataset |
13,061 | Guessing the smallest unique positive integer | <p>Let us consider the following game: there are some players and a computer. Each player inputs one positive integer and his name (player doesn't know another's numbers, just his own). When all the players made their moves, computer outputs a name of winner – who submitted the <em>lowest unique</em> number.</p>
&#... | game theory randomness | 1 | Guessing the smallest unique positive integer -- (game theory randomness)
<p>Let us consider the following game: there are some players and a computer. Each player inputs one positive integer and his name (player doesn't know another's numbers, just his own). When all the players made their moves, computer outputs a na... | habedi/stack-exchange-dataset |
13,070 | About metric TSP instances | <p><a href="http://en.wikipedia.org/wiki/Christofides_algorithm" rel="nofollow">Christofides' 1.5-approximation</a> considers complete graphs as inputs, and as I understand this is essential. If the input graph is not complete, how can I add new edges with suitable weights such that the resulting complete graph still s... | graphs approximation traveling salesman | 1 | About metric TSP instances -- (graphs approximation traveling salesman)
<p><a href="http://en.wikipedia.org/wiki/Christofides_algorithm" rel="nofollow">Christofides' 1.5-approximation</a> considers complete graphs as inputs, and as I understand this is essential. If the input graph is not complete, how can I add new ed... | habedi/stack-exchange-dataset |
13,072 | what does it mean by problem of size $0$? | <p>I am having problems understanding a basic concept in CLRS, it is about worst case partitioning during quicksort -- </p>

<blockquote>
 <p>The worst-case behavior for quicksort occurs when the partitioning routine produces one subproblem with $n − 1$ elements and one with $0$ elements.</p>
</blockqu... | algorithms quicksort | 1 | what does it mean by problem of size $0$? -- (algorithms quicksort)
<p>I am having problems understanding a basic concept in CLRS, it is about worst case partitioning during quicksort -- </p>

<blockquote>
 <p>The worst-case behavior for quicksort occurs when the partitioning routine produces one subproble... | habedi/stack-exchange-dataset |
13,082 | 3 Colorability reduction to SAT | <p>I'd like to reduce 3 colorability to SAT. I've stuffed up somewhere because I've shown it's equivalent to 2 SAT.</p>

<p>Given some graph $G = (V,E)$ and three colors, red, blue, green. For every vertex $i$, let the boolean variable $i_r$ tell you whether the $i$-th vertex is red (or more precisely, that the... | complexity theory | 1 | 3 Colorability reduction to SAT -- (complexity theory)
<p>I'd like to reduce 3 colorability to SAT. I've stuffed up somewhere because I've shown it's equivalent to 2 SAT.</p>

<p>Given some graph $G = (V,E)$ and three colors, red, blue, green. For every vertex $i$, let the boolean variable $i_r$ tell you whethe... | habedi/stack-exchange-dataset |
13,092 | Howto formally go about proving that two LTL formulas are equivalent? | <p>Do they need to "unwind" exactly to the same set of paths or does it suffice when one set is contained in the other ? </p>

<p>Or is it sufficient to argue that M,s satisfies both LTL formulas for any starting s and a model M, that is, reaching with both at "true" ?</p>

<p><strong>Generally.</strong... | logic proof techniques linear temporal logic | 1 | Howto formally go about proving that two LTL formulas are equivalent? -- (logic proof techniques linear temporal logic)
<p>Do they need to "unwind" exactly to the same set of paths or does it suffice when one set is contained in the other ? </p>

<p>Or is it sufficient to argue that M,s satisfies both LTL formu... | habedi/stack-exchange-dataset |
13,097 | Is lambda calculus suitable for expressing semantics of non-functional languages? | <p>Would it be convenient to express semantics of imperative languages (e.g. C) and object-oriented languages (e.g. Java) with $\lambda$-calculus?</p>

<p>Or in the other words: is $\lambda$-calculus a suitable candidate for expressing semantics of all context-sensitive languages?</p>
 | programming languages lambda calculus semantics | 1 | Is lambda calculus suitable for expressing semantics of non-functional languages? -- (programming languages lambda calculus semantics)
<p>Would it be convenient to express semantics of imperative languages (e.g. C) and object-oriented languages (e.g. Java) with $\lambda$-calculus?</p>

<p>Or in the other words:... | habedi/stack-exchange-dataset |
13,118 | Why is this sequence of recurrence relevant? | <p>I am learning how to solve the time complexity for the recurrence relation</p>

<p>$$
 T(n) = 2T(n - 1) + n^2\text{, where }T(1) = 1
$$</p>

<p>The solution notes that I should begin by considering the following sequence:</p>

<p>$$
 \text{Define }T^k(n) = T^{k - 1}(n + 1) -... | proof techniques recurrence relation | 1 | Why is this sequence of recurrence relevant? -- (proof techniques recurrence relation)
<p>I am learning how to solve the time complexity for the recurrence relation</p>

<p>$$
 T(n) = 2T(n - 1) + n^2\text{, where }T(1) = 1
$$</p>

<p>The solution notes that I should begin by considering the f... | habedi/stack-exchange-dataset |
13,126 | Does an abstract syntax tree have to be a tree? | <p>Does the output of a parser have to be a tree or could it also be general graph?</p>

<p>Moreover, is there any existing language or a plausible one that uses general graphs representation instead of trees for their syntax?</p>
 | compilers parsing | 1 | Does an abstract syntax tree have to be a tree? -- (compilers parsing)
<p>Does the output of a parser have to be a tree or could it also be general graph?</p>

<p>Moreover, is there any existing language or a plausible one that uses general graphs representation instead of trees for their syntax?</p>
 | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.