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 |
|---|---|---|---|---|---|---|
47,975 | What is the time complexity of checking if a number is prime? | <p>Could some one please explain how to get the time complexity of checking if a number is prime? I'm really confused as to if it is $O(\sqrt{n})$ or $O(n^2)$.</p>

<p>I iterate from $i=2$ to $\sqrt{n}$ and continuously checking if <code>n%i != 0</code>.</p>

<p>However, do we consider the complexity of... | complexity theory time complexity primes | 1 | What is the time complexity of checking if a number is prime? -- (complexity theory time complexity primes)
<p>Could some one please explain how to get the time complexity of checking if a number is prime? I'm really confused as to if it is $O(\sqrt{n})$ or $O(n^2)$.</p>

<p>I iterate from $i=2$ to $\sqrt{n}$ a... | habedi/stack-exchange-dataset |
47,979 | Branch and bound stanford slides doubt | <p>On the 6th slide at <a href="https://web.stanford.edu/class/ee364b/lectures/bb_slides.pdf" rel="nofollow">https://web.stanford.edu/class/ee364b/lectures/bb_slides.pdf</a>, while defining L2 and U2, why are we taking min for both?</p>
 | algorithms optimization linear programming | 1 | Branch and bound stanford slides doubt -- (algorithms optimization linear programming)
<p>On the 6th slide at <a href="https://web.stanford.edu/class/ee364b/lectures/bb_slides.pdf" rel="nofollow">https://web.stanford.edu/class/ee364b/lectures/bb_slides.pdf</a>, while defining L2 and U2, why are we taking min for both?<... | habedi/stack-exchange-dataset |
47,986 | How many languages exist with input alphabet {0,1} and all strings in the language have length less than or equal to 5? | <p>I'm trying to write a formal proof in automata theory to show a few properties of DFAs but I am having some trouble with this that I am trying to incorporate into my proof. I want to show how many languages $S$ there are such that $S\subseteq\{0,1\}^*$ and $\forall s\in S, |s|\leq 5$ where $s$ is a string.</p>
&... | formal languages finite automata | 1 | How many languages exist with input alphabet {0,1} and all strings in the language have length less than or equal to 5? -- (formal languages finite automata)
<p>I'm trying to write a formal proof in automata theory to show a few properties of DFAs but I am having some trouble with this that I am trying to incorporate i... | habedi/stack-exchange-dataset |
47,992 | How would I simulate a network to explore the percolation threshold of a network connected by the knight's move? | <p>"If we consider the squares of an infinite chess board as nodes of our graph and consider each to be connected to the other eight squares that are a knight's move away from it what is the percolation threshold of this graph?"</p>

<p>Note:One way I have thought about this problem is to try to use vectors: We... | graphs graph traversal simulation | 1 | How would I simulate a network to explore the percolation threshold of a network connected by the knight's move? -- (graphs graph traversal simulation)
<p>"If we consider the squares of an infinite chess board as nodes of our graph and consider each to be connected to the other eight squares that are a knight's move aw... | habedi/stack-exchange-dataset |
47,999 | Homomorphism Languages | <p>Let $h$ be a homomorphism and let $L$ be a language. Writing ${}^*$ for Kleene star, I want to show that $(h^{-1}(L))^* \neq h^{-1}(L^*)$. Can I prove this just by showing that we can have $h^{-1}(L)$ to be empty (because no strings are mapping into $L$) and therefore the right side is the empty set? Doing the sa... | formal languages correctness proof | 1 | Homomorphism Languages -- (formal languages correctness proof)
<p>Let $h$ be a homomorphism and let $L$ be a language. Writing ${}^*$ for Kleene star, I want to show that $(h^{-1}(L))^* \neq h^{-1}(L^*)$. Can I prove this just by showing that we can have $h^{-1}(L)$ to be empty (because no strings are mapping into $... | habedi/stack-exchange-dataset |
48,006 | Does ln n ∈ Θ(log2 n)? | <p>Is that statement false or true? I believe it's false because ln(n) = log base e of n. So therefore, log base 2 of n can be a minimum because in 2^x = n, x will always be less than y in e^y = n. However can it ever be proven that log base 2 of n can be a maximum? </p>
 | asymptotics | 1 | Does ln n ∈ Θ(log2 n)? -- (asymptotics)
<p>Is that statement false or true? I believe it's false because ln(n) = log base e of n. So therefore, log base 2 of n can be a minimum because in 2^x = n, x will always be less than y in e^y = n. However can it ever be proven that log base 2 of n can be a maximum? </p>
 | habedi/stack-exchange-dataset |
48,009 | When does a PDA split? | <p>In case of NFA, if the NFA is in a state and reads $\epsilon$ ( empty string ) the NFA splits in to two, with one being at the current state and other with the state along the $\epsilon$ transition. In case of PDA where transitions are of the type $a,b \to c$, with $a$ being the input alphabet being read, $b$ being ... | automata finite automata pushdown automata nondeterminism | 1 | When does a PDA split? -- (automata finite automata pushdown automata nondeterminism)
<p>In case of NFA, if the NFA is in a state and reads $\epsilon$ ( empty string ) the NFA splits in to two, with one being at the current state and other with the state along the $\epsilon$ transition. In case of PDA where transitions... | habedi/stack-exchange-dataset |
48,017 | Starting BFS at s and t | <p>INPUT: undirected graph, s, t</p>

<p>OUTPUT: connectivity of s and t</p>

<p>I perform BFS on s AND t, each taking turns to make one traversal.</p>

<p>When a vertex exists in both s and t's BFS tree, we can assume it is connected.</p>

<p>When one tree is done traversing but the oth... | algorithms graphs search algorithms search trees graph traversal | 1 | Starting BFS at s and t -- (algorithms graphs search algorithms search trees graph traversal)
<p>INPUT: undirected graph, s, t</p>

<p>OUTPUT: connectivity of s and t</p>

<p>I perform BFS on s AND t, each taking turns to make one traversal.</p>

<p>When a vertex exists in both s and t's BFS tre... | habedi/stack-exchange-dataset |
48,037 | Simpler proof of Rabin's Compression Theorem? | <p>I was doing a presentation on <a href="http://mathworld.wolfram.com/RabinsCompressionTheorem.html" rel="nofollow">Rabin's Compression Theorem</a>, when someone in the audience brought up a point I have no answer to.</p>

<p>Rabin's Compression Theorem states that every reasonable complexity class has a probl... | complexity theory complexity classes check my answer | 1 | Simpler proof of Rabin's Compression Theorem? -- (complexity theory complexity classes check my answer)
<p>I was doing a presentation on <a href="http://mathworld.wolfram.com/RabinsCompressionTheorem.html" rel="nofollow">Rabin's Compression Theorem</a>, when someone in the audience brought up a point I have no answer t... | habedi/stack-exchange-dataset |
48,038 | Heuristics for space-efficient storing of Unordered Finite Sets in a DFA | <p>I've got an algorithm I'm working on that generates, stores, and iterates through a large number of finite sets. I'm finding that memory is a bottleneck long before time is.</p>

<p>The finite sets are subsets of the vertices $V$ in my graph, so each finite set is small, there's just a lot of them.</p>
&... | formal languages graphs data structures finite automata data compression | 1 | Heuristics for space-efficient storing of Unordered Finite Sets in a DFA -- (formal languages graphs data structures finite automata data compression)
<p>I've got an algorithm I'm working on that generates, stores, and iterates through a large number of finite sets. I'm finding that memory is a bottleneck long before t... | habedi/stack-exchange-dataset |
48,045 | What specifically makes quantum computers useful? | <p>I know that quantum computers are able to process a superposition of all possible states with a single pass through the logic.</p>

<p>That seems to be what people point to as being what makes quantum computers special or useful.</p>

<p>However after you have processed the superpositional inputs, yo... | computation models quantum computing | 1 | What specifically makes quantum computers useful? -- (computation models quantum computing)
<p>I know that quantum computers are able to process a superposition of all possible states with a single pass through the logic.</p>

<p>That seems to be what people point to as being what makes quantum computers specia... | habedi/stack-exchange-dataset |
48,050 | Why would you introduce the goto statement into a modern language? | <p>I just found out something really quite extraordinary. While looking through Stackoverflow, I came across a question about removing <code>goto</code> from a php function. PHP doesn't have goto I thought and looked it up on <a href="http://php.net" rel="nofollow noreferrer">php.net</a>. </p>

<p>It turns o... | programming languages language design | 1 | Why would you introduce the goto statement into a modern language? -- (programming languages language design)
<p>I just found out something really quite extraordinary. While looking through Stackoverflow, I came across a question about removing <code>goto</code> from a php function. PHP doesn't have goto I thought an... | habedi/stack-exchange-dataset |
48,055 | Variant of (WEAK) PARTITION with 2 distinct solutions | <p>I am interested in the complexity of the following problem:</p>

<p>Input: A list $a_1\leq ⋯ \leq a_n$ of positive integers.</p>

<p>Question: Are there two vectors $x, x'\in\{−1,0,1\}^n$, with at least one $x_i$ and one $x'_i$ non-zero (the subsets must be non-empty), such that
$$\sum_{i=1}^nx_i... | complexity theory reductions partition problem | 1 | Variant of (WEAK) PARTITION with 2 distinct solutions -- (complexity theory reductions partition problem)
<p>I am interested in the complexity of the following problem:</p>

<p>Input: A list $a_1\leq ⋯ \leq a_n$ of positive integers.</p>

<p>Question: Are there two vectors $x, x'\in\{−1,0,1\}^n$, with a... | habedi/stack-exchange-dataset |
48,057 | RSA Encryption & Anonymity | <p>Considering plain RSA encryption, assume we have B who wants to send 10 messages to either A1 or A2. The recipients' public key, namely the exponent e1, e2 and prime product n1, n2 for A1/A2 respectively, is publicly known.</p>

<p>When B sends out, he will either encrypt his messages via $c_i = (m_i)^{e_1} ... | encryption | 1 | RSA Encryption & Anonymity -- (encryption)
<p>Considering plain RSA encryption, assume we have B who wants to send 10 messages to either A1 or A2. The recipients' public key, namely the exponent e1, e2 and prime product n1, n2 for A1/A2 respectively, is publicly known.</p>

<p>When B sends out, he will either e... | habedi/stack-exchange-dataset |
48,059 | Is it possible to come up with a graph instance that would force Dijkstra to perform a decrease key on every single edge? | <p>From the analysis of Dijkstra there is a $O(mlogn)$ factor that assumes we do a decreasekey for every single edge of the given input graph.</p>

<p>However I find it hard to come up with an instance that can actually require this. All you have to do create the edges and then add the weights in a way that wou... | algorithms data structures shortest path | 1 | Is it possible to come up with a graph instance that would force Dijkstra to perform a decrease key on every single edge? -- (algorithms data structures shortest path)
<p>From the analysis of Dijkstra there is a $O(mlogn)$ factor that assumes we do a decreasekey for every single edge of the given input graph.</p>
&... | habedi/stack-exchange-dataset |
48,062 | Are all minimum spanning trees optimized for fairness? | <p>I know by definition that a minimum spanning tree (MST) of a weighted, connected graph has the lowest global value for for sum of all edges in a path that connects all vertices.</p>

<p>I'm curious if all MSTs are also optimized for lowest individual edge value possible. (I know that ones calculated with Kru... | graphs minimum spanning tree | 1 | Are all minimum spanning trees optimized for fairness? -- (graphs minimum spanning tree)
<p>I know by definition that a minimum spanning tree (MST) of a weighted, connected graph has the lowest global value for for sum of all edges in a path that connects all vertices.</p>

<p>I'm curious if all MSTs are also o... | habedi/stack-exchange-dataset |
48,065 | What does Big O notation actually specify? | <p>Regarding time complexity I've read conflicting things:</p>

<p>1) That it is worst case.</p>

<p>2) That is average case.</p>

<p>For example if I want to know the time complexity for inserting into an arbitrary point in a linked list ( not the beginning or the end ), on average it will take... | algorithm analysis landau notation | 1 | What does Big O notation actually specify? -- (algorithm analysis landau notation)
<p>Regarding time complexity I've read conflicting things:</p>

<p>1) That it is worst case.</p>

<p>2) That is average case.</p>

<p>For example if I want to know the time complexity for inserting into an arbitra... | habedi/stack-exchange-dataset |
48,072 | Unfeasible linear program becomes feasible if a variable is removed | <p>Apologies, not a computer scientist by trade but I'm playing with linear programming these days.</p>

<p>Let $\{x_i\}$ be $N$ optimization variables with bounds</p>

<p>$$l_i \leq x_i \leq u_i$$</p>

<p>I'm interested in telling if $\exists$ a feasible region under the constraint</p>

... | optimization linear programming linear algebra | 1 | Unfeasible linear program becomes feasible if a variable is removed -- (optimization linear programming linear algebra)
<p>Apologies, not a computer scientist by trade but I'm playing with linear programming these days.</p>

<p>Let $\{x_i\}$ be $N$ optimization variables with bounds</p>

<p>$$l_i \leq x... | habedi/stack-exchange-dataset |
48,081 | Are these valid counterexamples to proofs for CF languages with Non-CF complements? | <p>Someone asked for <a href="https://cs.stackexchange.com/questions/19266/examples-of-context-free-languages-with-a-non-context-free-complements">examples of context-free languages with non-context-free complements</a>.</p>

<p>The first answer says:</p>

<blockquote>
 <p>The language $L_1= \{ww \... | formal languages context free formal grammars | 1 | Are these valid counterexamples to proofs for CF languages with Non-CF complements? -- (formal languages context free formal grammars)
<p>Someone asked for <a href="https://cs.stackexchange.com/questions/19266/examples-of-context-free-languages-with-a-non-context-free-complements">examples of context-free languages wit... | habedi/stack-exchange-dataset |
48,084 | Determining if (infinite) binary language DFAs contain at least 1 prime? | <p>This problem has been given by <a href="https://cstheory.stackexchange.com/users/3227/jeffrey-shallit">Shallit</a> as an open DFA/ complexity theory problem and is currently not even known to be decidable. It seems to be circulating on the internet in a few places (e.g. [1][2]) but not in any papers. Almost nothing ... | regular languages automata discrete mathematics number theory | 1 | Determining if (infinite) binary language DFAs contain at least 1 prime? -- (regular languages automata discrete mathematics number theory)
<p>This problem has been given by <a href="https://cstheory.stackexchange.com/users/3227/jeffrey-shallit">Shallit</a> as an open DFA/ complexity theory problem and is currently not... | habedi/stack-exchange-dataset |
48,094 | How to show that the set of TMs that accept languages of size two is recognizable? | <p>I know how to show $\overline{Lx}$ is unrecognizable.
I know how to show Lx is undecidable.</p>

<p>I would like the mapping reduction function that shows that Lx is recognizable or unrecognizable.</p>

<p>For instance, to show $\overline{Lx}$ is unrecognizable, show $\overline{Htm}$ <= $\over... | computability turing machines semi decidability | 1 | How to show that the set of TMs that accept languages of size two is recognizable? -- (computability turing machines semi decidability)
<p>I know how to show $\overline{Lx}$ is unrecognizable.
I know how to show Lx is undecidable.</p>

<p>I would like the mapping reduction function that shows that Lx is rec... | habedi/stack-exchange-dataset |
48,101 | Generative power and classification of matrix grammars | <p>[Edited] I am reading about matrix grammars from several sources and got confused about its generative power and classification to the Chomsky hierarchy. </p>

<p>In <a href="http://theo.cs.uni-magdeburg.de/lehre/lehre11w/modelle_bio/langbio11-folien4.pdf" rel="nofollow">here</a> it is stated that:</p>
&... | formal languages formal grammars computation models | 1 | Generative power and classification of matrix grammars -- (formal languages formal grammars computation models)
<p>[Edited] I am reading about matrix grammars from several sources and got confused about its generative power and classification to the Chomsky hierarchy. </p>

<p>In <a href="http://theo.cs.uni-mag... | habedi/stack-exchange-dataset |
48,104 | Does applying a homomorphism to the intersection of two CSLs yield RE languages? | <p>For each language $L \in L(RE)$ there are a homomorphism $h$ and two context-free languages $L_1$ and $L_2$ such that $L = h(L_1 \cap L_2)$.</p>

<p>I understand that this is because context-free languages are not closed under intersection so $L_1 \cap L_2$ will produce non-context-free languages. Since cont... | formal languages closure properties semi decidability context sensitive | 1 | Does applying a homomorphism to the intersection of two CSLs yield RE languages? -- (formal languages closure properties semi decidability context sensitive)
<p>For each language $L \in L(RE)$ there are a homomorphism $h$ and two context-free languages $L_1$ and $L_2$ such that $L = h(L_1 \cap L_2)$.</p>

<p>I ... | habedi/stack-exchange-dataset |
48,105 | Clarification notation in CLRS runtime analysis | <p>I am learning algorithms from the clrs book. I am having trouble understanding the notation the book has placed. </p>

<p>The book wrote the following: </p>

<blockquote>
 <p>$t_j$ denote the number of times the <code>while</code> loop test in line 5 is executed for that value of $j$."</p>
<... | algorithm analysis notation | 1 | Clarification notation in CLRS runtime analysis -- (algorithm analysis notation)
<p>I am learning algorithms from the clrs book. I am having trouble understanding the notation the book has placed. </p>

<p>The book wrote the following: </p>

<blockquote>
 <p>$t_j$ denote the number of times the <co... | habedi/stack-exchange-dataset |
48,123 | Where does entanglement fit into quantum computing? | <p>I've been reading up on quantum computing online from various sources, including this link <a href="http://twistedoakstudios.com/blog/Post2644_grovers-quantum-search-algorithm" rel="nofollow">http://twistedoakstudios.com/blog/Post2644_grovers-quantum-search-algorithm</a>.</p>

<p>I get how quantum gates work... | quantum computing | 1 | Where does entanglement fit into quantum computing? -- (quantum computing)
<p>I've been reading up on quantum computing online from various sources, including this link <a href="http://twistedoakstudios.com/blog/Post2644_grovers-quantum-search-algorithm" rel="nofollow">http://twistedoakstudios.com/blog/Post2644_grovers... | habedi/stack-exchange-dataset |
48,124 | If $n^{\log n}$ is not polynomial or exponential, then what this function is called? | <p>I just found this sentence on page 6 of Garey and Johnson's "Computers and Intractability".</p>

<blockquote>
 <p>Any algorithm whose time complexity function cannot be so bounded is called an exponential time algorithm (although it should be noted that this definition includes certain non-polynomial ti... | algorithms terminology polynomial time | 1 | If $n^{\log n}$ is not polynomial or exponential, then what this function is called? -- (algorithms terminology polynomial time)
<p>I just found this sentence on page 6 of Garey and Johnson's "Computers and Intractability".</p>

<blockquote>
 <p>Any algorithm whose time complexity function cannot be so bou... | habedi/stack-exchange-dataset |
48,128 | Find k nearest neighbors on a sphere | <p>Given a set $S$ of $N$ points on a sphere, and another point $P$ on the sphere, I want to find the $k$ points in $S$ that are the closest (Euclidean or great circle distance).</p>

<p>I'm willing to do a reasonable amount of pre-computation. The solution must be exact and efficient (faster than linear time)... | data structures computational geometry nearest neighbour | 1 | Find k nearest neighbors on a sphere -- (data structures computational geometry nearest neighbour)
<p>Given a set $S$ of $N$ points on a sphere, and another point $P$ on the sphere, I want to find the $k$ points in $S$ that are the closest (Euclidean or great circle distance).</p>

<p>I'm willing to do a reason... | habedi/stack-exchange-dataset |
48,133 | What does detection stability mean? | <p>I am reading the paper "A new approach to intrusion detection using Artificial Neural Networks and fuzzy clustering" by Gang Wang, Jinxing Hao, Jian Ma and Lihua Huang (<em>Expert Systems with Applications</em>, 37(9):6225–6232, 2010, available <a href="http://www.sciencedirect.com/science/article/pii/S0957417... | terminology | 1 | What does detection stability mean? -- (terminology)
<p>I am reading the paper "A new approach to intrusion detection using Artificial Neural Networks and fuzzy clustering" by Gang Wang, Jinxing Hao, Jian Ma and Lihua Huang (<em>Expert Systems with Applications</em>, 37(9):6225–6232, 2010, available <a href="http... | habedi/stack-exchange-dataset |
48,136 | Testing two DFAs generate the same language by trying all strings upto a certain length | <p>Given the language</p>

<p><span class="math-container">$EQ_{\mathrm{dfa}} =$</span> <span class="math-container">$\{\langle A, B\rangle\mid A$</span> and <span class="math-container">$B$</span> are two DFAs and <span class="math-container">$L(A) = L(B)$</span> <span class="math-container">$\}$</span></p>&#x... | automata undecidability | 1 | Testing two DFAs generate the same language by trying all strings upto a certain length -- (automata undecidability)
<p>Given the language</p>

<p><span class="math-container">$EQ_{\mathrm{dfa}} =$</span> <span class="math-container">$\{\langle A, B\rangle\mid A$</span> and <span class="math-container">$B$</spa... | habedi/stack-exchange-dataset |
48,143 | Counting the solutions to a restricted 0-1 knapsack problem | <p>Consider the counting knapsack problem $\mathsf{\#IDKNAP}$ :</p>

<p><strong>Input</strong>: $n \in \mathbb{Z_+}$, $s \in \mathbb{Q}_+$, where $s$ is represented by a fraction $\frac{p}{q}$ in its lowest terms. </p>

<p><strong>Output</strong>: the number of 0-1 solutions (i.e. those having $s_i\in... | time complexity knapsack problems counting | 1 | Counting the solutions to a restricted 0-1 knapsack problem -- (time complexity knapsack problems counting)
<p>Consider the counting knapsack problem $\mathsf{\#IDKNAP}$ :</p>

<p><strong>Input</strong>: $n \in \mathbb{Z_+}$, $s \in \mathbb{Q}_+$, where $s$ is represented by a fraction $\frac{p}{q}$ in its low... | habedi/stack-exchange-dataset |
48,149 | The finer details of Meek's STV | <p><a href="http://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf" rel="nofollow">Meek's version of the Single Transferable Vote system</a> [.pdf] is used in multiple big elections including those of New Zealand and Stack Exchange.</p>

<p><a href="http://www.stv.govt.nz/stv/how.htm" rel="nofollow... | algorithms databases voting | 1 | The finer details of Meek's STV -- (algorithms databases voting)
<p><a href="http://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf" rel="nofollow">Meek's version of the Single Transferable Vote system</a> [.pdf] is used in multiple big elections including those of New Zealand and Stack Exchange.</p>
&... | habedi/stack-exchange-dataset |
48,155 | 'Quick' way to show non-regularity of languages that are 'close' to other non-regular langauges | <p>Take the language $L = \{a b^n c^n \; : \; n \geq 0\}$.</p>

<p>It's obvious that $L$ is non-regular because $\{b^n c^n \; : \; n \geq 0\}$ is non-regular, but I don't know a satisfying way to show that to the hypothetical Devil's advocate reading my proof without dragging out a full argument using the pumpi... | formal languages pumping lemma | 1 | 'Quick' way to show non-regularity of languages that are 'close' to other non-regular langauges -- (formal languages pumping lemma)
<p>Take the language $L = \{a b^n c^n \; : \; n \geq 0\}$.</p>

<p>It's obvious that $L$ is non-regular because $\{b^n c^n \; : \; n \geq 0\}$ is non-regular, but I don't know a sa... | habedi/stack-exchange-dataset |
48,157 | What is the natural language of computers mathematics or logic? | <p>I was reading about the history of computers where i came by <a href="https://en.wikipedia.org/wiki/Machine_code" rel="nofollow">machine code</a></p>

<blockquote>
 <p>A Machine code or machine language is a set of instructions executed directly by a computer's central processing unit (CPU). Each instru... | complexity theory computability logic | 1 | What is the natural language of computers mathematics or logic? -- (complexity theory computability logic)
<p>I was reading about the history of computers where i came by <a href="https://en.wikipedia.org/wiki/Machine_code" rel="nofollow">machine code</a></p>

<blockquote>
 <p>A Machine code or machine lan... | habedi/stack-exchange-dataset |
48,168 | How do quantum computers find the global minimum? | <p>If I understand correctly, quantum computers work by trying multiple methods of solving a problem simultaneously, using quantum superposition. However, if you try to "look" at a superposition-ed atom, you will find either one or the other-1 or 0. What I've heard is that this is random.</p>

<p>So, if you com... | optimization quantum computing | 1 | How do quantum computers find the global minimum? -- (optimization quantum computing)
<p>If I understand correctly, quantum computers work by trying multiple methods of solving a problem simultaneously, using quantum superposition. However, if you try to "look" at a superposition-ed atom, you will find either one or th... | habedi/stack-exchange-dataset |
48,186 | Proving non-regularity of $u u^R v$? | <p>This particular language:</p>

<p>$$L = \{ u u^R v \,:\, u, v \in \{0, 1\}^+\}$$</p>

<p>is giving me a lot of trouble.
I highly suspect that its non-regular, considering that $\{ u u^R : u \in \{0, 1\}^+\}$ is non-regular, and I can't seem to reason out a DFA for it.</p>

<p>However, try... | formal languages pumping lemma | 1 | Proving non-regularity of $u u^R v$? -- (formal languages pumping lemma)
<p>This particular language:</p>

<p>$$L = \{ u u^R v \,:\, u, v \in \{0, 1\}^+\}$$</p>

<p>is giving me a lot of trouble.
I highly suspect that its non-regular, considering that $\{ u u^R : u \in \{0, 1\}^+\}$ is non-regular, ... | habedi/stack-exchange-dataset |
48,187 | Strahler of tree like refutations | <p>I am reading the paper <em>Measuring the hardness of SAT instances</em> by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (<a href="https://www.aaai.org/Papers/AAAI/2008/AAAI08-035.pdf" rel="nofollow noreferrer">PDF</a>). I am trying to understand the last ... | satisfiability | 1 | Strahler of tree like refutations -- (satisfiability)
<p>I am reading the paper <em>Measuring the hardness of SAT instances</em> by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (<a href="https://www.aaai.org/Papers/AAAI/2008/AAAI08-035.pdf" rel="nofollow nor... | habedi/stack-exchange-dataset |
48,202 | Can a second process execute when the Operating System is performing a context switch? | <p>A process was running on a uniprocessor system. It is being context switched. While the scheduler is performing this context switch can another process be allocated the CPU while the context switch is being performed?</p>
 | operating systems | 1 | Can a second process execute when the Operating System is performing a context switch? -- (operating systems)
<p>A process was running on a uniprocessor system. It is being context switched. While the scheduler is performing this context switch can another process be allocated the CPU while the context switch is being ... | habedi/stack-exchange-dataset |
48,220 | Approximating sign function by tanh in Multi Layer perceptrons | <p>This is an exercise problem from the book "Learning from Data". </p>

<p>Given $w_1$ and $\epsilon \gt 0$, find $w_2$ such that, $$\lvert \mbox{sign}(w_1^Tx_n)-\tanh(w_2^Tx_n)\rvert \le \epsilon$$ Where $w_1, w_2, x_n$ are all real vectors. </p>

<p>I know that for large $y$, $\mbox{sign}(y) \approx... | neural networks | 1 | Approximating sign function by tanh in Multi Layer perceptrons -- (neural networks)
<p>This is an exercise problem from the book "Learning from Data". </p>

<p>Given $w_1$ and $\epsilon \gt 0$, find $w_2$ such that, $$\lvert \mbox{sign}(w_1^Tx_n)-\tanh(w_2^Tx_n)\rvert \le \epsilon$$ Where $w_1, w_2, x_n$ are a... | habedi/stack-exchange-dataset |
48,224 | Is non-determinism in a non-deterministic turing machine different from that of finite automata and push down automata? | <p>Let a input string be given as $w_1w_2...w_n$. Then if a NFA is currently in state $r$ ( and has read the input upto alphabet $w_i$ ) then before reading the next input symbol the NFA splits into two NFA, one being in state $r$ and other being in $s$, if there is a transition of the type $r \xrightarrow{\epsilon} s$... | turing machines finite automata pushdown automata computation models nondeterminism | 1 | Is non-determinism in a non-deterministic turing machine different from that of finite automata and push down automata? -- (turing machines finite automata pushdown automata computation models nondeterminism)
<p>Let a input string be given as $w_1w_2...w_n$. Then if a NFA is currently in state $r$ ( and has read the in... | habedi/stack-exchange-dataset |
48,230 | Feasible to apply image "interlacing" concept to video streaming for smoother buffering? | <p>The current state of video buffering technology is to encode a video multiple times at different resolutions, then when your network speed changes you change which video you are buffering from.</p>

<p>Would it be possible to give this same user experience but implement something like the interlacing method ... | algorithms data structures computer architecture | 1 | Feasible to apply image "interlacing" concept to video streaming for smoother buffering? -- (algorithms data structures computer architecture)
<p>The current state of video buffering technology is to encode a video multiple times at different resolutions, then when your network speed changes you change which video you ... | habedi/stack-exchange-dataset |
48,256 | Proof that a given language is not context-free | <p>Given the language $L = \{w \in \{a,b\}^* \, | \, |w| = n \cdot \sqrt{n} \text{ and } n \geq 42\}$ and the assignement to proof that $L \notin CFL$ with the Pumping lemma. </p>

<p>Assuming $L \in CFL$, would it be possible to start with defining a language $L' := L \cap a^+$ which has to be context-free sin... | context free pumping lemma | 1 | Proof that a given language is not context-free -- (context free pumping lemma)
<p>Given the language $L = \{w \in \{a,b\}^* \, | \, |w| = n \cdot \sqrt{n} \text{ and } n \geq 42\}$ and the assignement to proof that $L \notin CFL$ with the Pumping lemma. </p>

<p>Assuming $L \in CFL$, would it be possible to st... | habedi/stack-exchange-dataset |
48,260 | Best Fit Memory Allocation Algorithm Statistical Analysis | <p>I've been reading book on Operating System, in which author writes :</p>

<blockquote>
 <p>Somewhat surprisingly, it(Best fit) also results in more wasted memory than first fit or next fit because it tends to fill up memory with tiny, useless holes. First fit generates larger holes on average.</p>
<... | operating systems memory management statistics | 1 | Best Fit Memory Allocation Algorithm Statistical Analysis -- (operating systems memory management statistics)
<p>I've been reading book on Operating System, in which author writes :</p>

<blockquote>
 <p>Somewhat surprisingly, it(Best fit) also results in more wasted memory than first fit or next fit becau... | habedi/stack-exchange-dataset |
48,267 | Convert a CFG into CNF | <p>I'm still new to <code>CFG and CNF</code> and have trouble sometimes understanding the concepts.</p>

<p>I'm trying to convert this CFG into Chomsky Normal Form: </p>

<pre><code>G: S -> aSbS | bSaS | epsilon
</code></pre>

<p>I think the language generates all strings with same number... | context free normal forms | 1 | Convert a CFG into CNF -- (context free normal forms)
<p>I'm still new to <code>CFG and CNF</code> and have trouble sometimes understanding the concepts.</p>

<p>I'm trying to convert this CFG into Chomsky Normal Form: </p>

<pre><code>G: S -> aSbS | bSaS | epsilon
</code></pre>

<p>I thi... | habedi/stack-exchange-dataset |
48,270 | Proof that there are same number rotation moves in any binary tree with both children compulsory | <p>I am working on this project where I am required to find the theoretical proof for following.</p>

<p>I have a particular type of binary trees, where</p>

<p>1) each internal node will definitely have two children.</p>

<p>2) There are n leaf nodes and can be assumed in order 1 to n from left... | proof techniques trees binary trees | 1 | Proof that there are same number rotation moves in any binary tree with both children compulsory -- (proof techniques trees binary trees)
<p>I am working on this project where I am required to find the theoretical proof for following.</p>

<p>I have a particular type of binary trees, where</p>

<p>1) ea... | habedi/stack-exchange-dataset |
48,280 | Matrix Chain Multiplication Greedy Approach | <p>In the question <a href="http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Dynamic/chainMatrixMult.htm" rel="nofollow">Matrix Chain Multiplication</a> you are given a chain of Matrices and is required to find the optimal way to multiply the matrices together. Normally this is solved using Dynamic Progra... | algorithms algorithm analysis greedy algorithms | 1 | Matrix Chain Multiplication Greedy Approach -- (algorithms algorithm analysis greedy algorithms)
<p>In the question <a href="http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/Dynamic/chainMatrixMult.htm" rel="nofollow">Matrix Chain Multiplication</a> you are given a chain of Matrices and is required to fin... | habedi/stack-exchange-dataset |
48,293 | Why won't a Turing machine halt? | <p>I am reading <a href="http://www.cin.ufpe.br/~jjss/Introcuction%20to%20Theory%20of%20computation%20by%20Micheal%20Sipser%20Ist%20Ed..pdf" rel="nofollow">Sipsers</a>. The book introduces halting problem and proves that is a turing recognisable language but not a turing decidable language. Thus giving a Turing machine... | turing machines halting problem | 1 | Why won't a Turing machine halt? -- (turing machines halting problem)
<p>I am reading <a href="http://www.cin.ufpe.br/~jjss/Introcuction%20to%20Theory%20of%20computation%20by%20Micheal%20Sipser%20Ist%20Ed..pdf" rel="nofollow">Sipsers</a>. The book introduces halting problem and proves that is a turing recognisable lang... | habedi/stack-exchange-dataset |
48,297 | State of the art time complexity for getting (tree) descendants by type/attribute | <p>Let's say I have a tree comprised of nodes where each node is of some type (T), where there is a known/fixed number of types (i.e. similar to attributes in an xml document), and where a node can only have one type. Let's also assume that our tree is somewhat balanced, and that there are far more nodes in the tree th... | data structures time complexity trees database theory balanced search trees | 1 | State of the art time complexity for getting (tree) descendants by type/attribute -- (data structures time complexity trees database theory balanced search trees)
<p>Let's say I have a tree comprised of nodes where each node is of some type (T), where there is a known/fixed number of types (i.e. similar to attributes i... | habedi/stack-exchange-dataset |
48,298 | Algorithm for finding maximum mutually coprime subset of a multiset of integers | <p>For a certain problem I am trying to solve given a list of integers, it is advantageous to me to first identify as many of the integers that are mutually coprime as possible. I'm having trouble thinking of a good general algorithm for this, and everything I've found online seems to relate to problems that are slight... | algorithms | 1 | Algorithm for finding maximum mutually coprime subset of a multiset of integers -- (algorithms)
<p>For a certain problem I am trying to solve given a list of integers, it is advantageous to me to first identify as many of the integers that are mutually coprime as possible. I'm having trouble thinking of a good general ... | habedi/stack-exchange-dataset |
48,302 | Maximum flow, where such paths as source$\to$node$\to$sink must be ignored | <p>How can the maximum flow of a graph be computed when all nodes of the graph are connected to both sink and source nodes (two hypothetical nodes), and the maximum flow method should ignore such paths as $\text{source} \to \text{node} \to \text{sink}$, where $\to$ is a single edge?</p>

<p>A valid path contain... | graphs network flow | 1 | Maximum flow, where such paths as source$\to$node$\to$sink must be ignored -- (graphs network flow)
<p>How can the maximum flow of a graph be computed when all nodes of the graph are connected to both sink and source nodes (two hypothetical nodes), and the maximum flow method should ignore such paths as $\text{source} ... | habedi/stack-exchange-dataset |
48,305 | Checking whether a number divides any of a set of other numbers | <p>Consider a static set $S$ of positive numbers from range $[1..10^9]$. Is there an efficient algorithm to answer queries of the form: "Given a number $d$ is there an element $x \in S$ such that $d | x$".</p>

<ol>
<li>Simple straightforward check takes $O(|S|)$ time per query and uses $O(|S|)$ memory. </... | algorithms data structures number theory | 1 | Checking whether a number divides any of a set of other numbers -- (algorithms data structures number theory)
<p>Consider a static set $S$ of positive numbers from range $[1..10^9]$. Is there an efficient algorithm to answer queries of the form: "Given a number $d$ is there an element $x \in S$ such that $d | x$".</p>&... | habedi/stack-exchange-dataset |
48,320 | Trying to code for calculating cosine series | <p>I was trying to calculate cosine series : 
cos x = 1 - x^2/2! + x^4/4! - x^8/8! .... , where x is in radians:
include iostream</p>

<p>include math.h</p>

<p>using namespace std;</p>

<p>long factorial (long num)</p>

<p>{</p>

<p>if (num >1)</p>

<p>return n... | algorithms programming languages | 1 | Trying to code for calculating cosine series -- (algorithms programming languages)
<p>I was trying to calculate cosine series : 
cos x = 1 - x^2/2! + x^4/4! - x^8/8! .... , where x is in radians:
include iostream</p>

<p>include math.h</p>

<p>using namespace std;</p>

<p>long factoria... | habedi/stack-exchange-dataset |
48,324 | Almost Hamiltonian | <p>A graph is <em>almost Hamiltonian</em> if it contains a cycle that visits every node at least once and at most twice. </p>

<p>Is the problem of determining whether a graph is almost Hamiltonian NP-complete?</p>
 | graphs np complete hamiltonian path | 1 | Almost Hamiltonian -- (graphs np complete hamiltonian path)
<p>A graph is <em>almost Hamiltonian</em> if it contains a cycle that visits every node at least once and at most twice. </p>

<p>Is the problem of determining whether a graph is almost Hamiltonian NP-complete?</p>
 | habedi/stack-exchange-dataset |
48,329 | Size of Propositional Formula | <p>I am study this lecture <a href="http://www.math.ucla.edu/~asl/bsl/1304/1304-001.ps" rel="nofollow">The Complexity of Propositional Proofs</a>. Here there is a term size of propositional formula (page 2), </p>

<blockquote>
 <p>Every tautology $\tau$ on $n$ variables has an $F$-proof in which thera are ... | complexity theory logic propositional logic | 1 | Size of Propositional Formula -- (complexity theory logic propositional logic)
<p>I am study this lecture <a href="http://www.math.ucla.edu/~asl/bsl/1304/1304-001.ps" rel="nofollow">The Complexity of Propositional Proofs</a>. Here there is a term size of propositional formula (page 2), </p>

<blockquote>
 ... | habedi/stack-exchange-dataset |
48,330 | Does a Hadamard Gate have uses outside of pure and evenly mixed states? | <p>The standard usage cases for the Hadamard gate seem to be passing a pure $|0\rangle$ or $|1\rangle$ state in to get an even amplitude (probability) mixed state which has either matching or mismatching phase.</p>

<p>The other use of course, is to take such an even amplitude mixed state, pass it through the H... | quantum computing | 1 | Does a Hadamard Gate have uses outside of pure and evenly mixed states? -- (quantum computing)
<p>The standard usage cases for the Hadamard gate seem to be passing a pure $|0\rangle$ or $|1\rangle$ state in to get an even amplitude (probability) mixed state which has either matching or mismatching phase.</p>

<... | habedi/stack-exchange-dataset |
48,331 | Why some rules in Elementary Cellular Automata halt and others don't? | <p>I was looking over stephen wolfram's work mainly about <a href="http://mathworld.wolfram.com/ElementaryCellularAutomaton.html" rel="nofollow">Elementary Cellular Automata</a>, i see that for all rules with N steps {i.e 200 steps} they show the same pattern {i,e rule 90 running on 20 steps and 100 steps are the same,... | computability cellular automata | 1 | Why some rules in Elementary Cellular Automata halt and others don't? -- (computability cellular automata)
<p>I was looking over stephen wolfram's work mainly about <a href="http://mathworld.wolfram.com/ElementaryCellularAutomaton.html" rel="nofollow">Elementary Cellular Automata</a>, i see that for all rules with N st... | habedi/stack-exchange-dataset |
48,336 | Must you work with all qubits in a circuit when applying a gate? | <p>When looking at this question:
<a href="https://cs.stackexchange.com/questions/34085/how-to-apply-a-1-qubit-gate-to-a-single-qubit-from-an-entangled-pair?rq=1">How to apply a 1-qubit gate to a single qubit from an entangled pair?</a></p>

<p>And other questions, it makes it seem like when you have a quan... | quantum computing | 1 | Must you work with all qubits in a circuit when applying a gate? -- (quantum computing)
<p>When looking at this question:
<a href="https://cs.stackexchange.com/questions/34085/how-to-apply-a-1-qubit-gate-to-a-single-qubit-from-an-entangled-pair?rq=1">How to apply a 1-qubit gate to a single qubit from an entangled p... | habedi/stack-exchange-dataset |
48,340 | Basic Myhill-Nerode Theorem Practice | <p>I wanted to understand the Myhill-Nerode Theorem so I made up a small example to do so.</p>

<blockquote>
 <p>L = (a $+$ b )</p>
</blockquote>

<p>Clearly, this language is regular. So, I should be able to establish a finite number of equivalence classes by using this method.</p>

<p... | formal languages regular languages | 1 | Basic Myhill-Nerode Theorem Practice -- (formal languages regular languages)
<p>I wanted to understand the Myhill-Nerode Theorem so I made up a small example to do so.</p>

<blockquote>
 <p>L = (a $+$ b )</p>
</blockquote>

<p>Clearly, this language is regular. So, I should be able to establish... | habedi/stack-exchange-dataset |
48,343 | Can a functional language be homoiconic? | <p>According to <a href="https://en.wikipedia.org/wiki/Homoiconicity" rel="nofollow">the wikipedia page on homoiconicity</a>:</p>

<blockquote>
 <p>In a homoiconic language the primary representation of programs is also a data structure in a primitive type of the language itself.</p>
</blockquote>
... | programming languages lambda calculus functional programming | 1 | Can a functional language be homoiconic? -- (programming languages lambda calculus functional programming)
<p>According to <a href="https://en.wikipedia.org/wiki/Homoiconicity" rel="nofollow">the wikipedia page on homoiconicity</a>:</p>

<blockquote>
 <p>In a homoiconic language the primary representation ... | habedi/stack-exchange-dataset |
48,352 | One way recurrence O(N)->O(1) | <p><br>
Imagine we have a random number generator where g(n+1) = f(g(n)), where f is some function (e.g linear recurrence).<br><br>
I'm trying to find a system where it's fast to find many steps in the future immediately, whereas it's <strong>hard or impossible to work out a previous state</strong>. <br><br>&#x... | algorithms cryptography pseudo random generators random number generator | 1 | One way recurrence O(N)->O(1) -- (algorithms cryptography pseudo random generators random number generator)
<p><br>
Imagine we have a random number generator where g(n+1) = f(g(n)), where f is some function (e.g linear recurrence).<br><br>
I'm trying to find a system where it's fast to find many steps in the fu... | habedi/stack-exchange-dataset |
48,355 | Non-deterministic algorithms and Tautologies | <p>I am studying the lecture <a href="http://www.math.ucla.edu/%7Easl/bsl/1304/1304-001.ps" rel="nofollow noreferrer">The Complexity of Propositional Proofs</a>. Here there is a definition together with a discussion (page 3). I don't understand
that discussion.</p>
<blockquote>
<p>Let <span class="math-con... | logic satisfiability nondeterminism propositional logic | 1 | Non-deterministic algorithms and Tautologies -- (logic satisfiability nondeterminism propositional logic)
<p>I am studying the lecture <a href="http://www.math.ucla.edu/%7Easl/bsl/1304/1304-001.ps" rel="nofollow noreferrer">The Complexity of Propositional Proofs</a>. Here there is a definition together with a discussi... | habedi/stack-exchange-dataset |
48,371 | In principle, what is the relation between Artifical Intelligence and Turing machine? | <p>I am working on my cs project about AI & Turing machines, so i know that <a href="http://www.alanturing.net/turing_archive/pages/reference%20articles/what%20is%20ai.html" rel="nofollow">Artifical Intelligence</a> is meant to implement different algorithms into the machine {the computer} to solve a problem or a s... | turing machines artificial intelligence computation models | 1 | In principle, what is the relation between Artifical Intelligence and Turing machine? -- (turing machines artificial intelligence computation models)
<p>I am working on my cs project about AI & Turing machines, so i know that <a href="http://www.alanturing.net/turing_archive/pages/reference%20articles/what%20is%20a... | habedi/stack-exchange-dataset |
48,378 | Kleene algebra - powerset class vs class of all regular subsets | <p>I am currently studying materials for my uni subject. There are two examples of Kleene algebras, but I don't see what is the difference between them.</p>

<ul>
<li>Class ${2^{\Sigma}}^{*}$ of all subsets of $\Sigma^{*}$ with constants $\emptyset$ and $\{\varepsilon\}$ and operations $\cup$, $\cdot$ and $... | formal languages regular languages | 1 | Kleene algebra - powerset class vs class of all regular subsets -- (formal languages regular languages)
<p>I am currently studying materials for my uni subject. There are two examples of Kleene algebras, but I don't see what is the difference between them.</p>

<ul>
<li>Class ${2^{\Sigma}}^{*}$ of all subse... | habedi/stack-exchange-dataset |
48,381 | Can input to a Turing machine be of infinite length? | <p>Considering only the alphabet $\Sigma = \{0,1\}$, the strings which can be given as input to the Turing machines are from the set $\Sigma^{*}$. But does it make sense for the input to be an infinite binary string ? For example if a Turing machine accepts all strings starting with a 0, does a binary string of infinit... | turing machines | 1 | Can input to a Turing machine be of infinite length? -- (turing machines)
<p>Considering only the alphabet $\Sigma = \{0,1\}$, the strings which can be given as input to the Turing machines are from the set $\Sigma^{*}$. But does it make sense for the input to be an infinite binary string ? For example if a Turing mach... | habedi/stack-exchange-dataset |
48,386 | Set of all Languages | <p>Sorry if the Question sounds a little trivial.
Let A* be the set of all languages over A={a,b}. Then A can be written as {aUb}*
which is a regular expression.So this is the set of all languages(actually set of all strings) regular.Am i thinking in the right direction. </p>
 | regular languages regular expressions | 1 | Set of all Languages -- (regular languages regular expressions)
<p>Sorry if the Question sounds a little trivial.
Let A* be the set of all languages over A={a,b}. Then A can be written as {aUb}*
which is a regular expression.So this is the set of all languages(actually set of all strings) regular.Am i thinking ... | habedi/stack-exchange-dataset |
48,390 | 2 approximation algorithm for the single machine scheduling problem | <p>We are given one machine and <span class="math-container">$n$</span> jobs that we want to process. </p>

<p>For the <span class="math-container">$n$</span> jobs we have the following data:</p>

<p><span class="math-container">$r_{1}, ... , r_{n}$</span> are the release times</p>

<p><span cla... | algorithms approximation greedy algorithms | 1 | 2 approximation algorithm for the single machine scheduling problem -- (algorithms approximation greedy algorithms)
<p>We are given one machine and <span class="math-container">$n$</span> jobs that we want to process. </p>

<p>For the <span class="math-container">$n$</span> jobs we have the following data:</p>&... | habedi/stack-exchange-dataset |
48,397 | How do you apply a multi qubit gate to specific qubits in a multi qubit circuit? | <p>Let's say that you have a 6 qubit system and you want to apply a Hadamard gate to qubits 2 and 4.</p>

<p>How would you construct a matrix that did that, while leaving the state of the other qubits alone?</p>
 | quantum computing | 1 | How do you apply a multi qubit gate to specific qubits in a multi qubit circuit? -- (quantum computing)
<p>Let's say that you have a 6 qubit system and you want to apply a Hadamard gate to qubits 2 and 4.</p>

<p>How would you construct a matrix that did that, while leaving the state of the other qubits alone?<... | habedi/stack-exchange-dataset |
48,404 | Using closure properties to show that $a^n b^m a^{n+m}$ is not regular | <p>I want to show that $L = \{a^n b^m a^{n+m} \mid n, m \geq 0\}$ is not regular.</p>

<p>Can I say that the complement of $L$ intersected with $a^*b^*$ equals $\{a^n b^n \mid n \geq 0\}$ and since I know that $\{a^n b^n \mid n \geq 0\}$ is not regular, then $L$ is not regular?</p>

<p>Or would I have t... | formal languages pumping lemma | 1 | Using closure properties to show that $a^n b^m a^{n+m}$ is not regular -- (formal languages pumping lemma)
<p>I want to show that $L = \{a^n b^m a^{n+m} \mid n, m \geq 0\}$ is not regular.</p>

<p>Can I say that the complement of $L$ intersected with $a^*b^*$ equals $\{a^n b^n \mid n \geq 0\}$ and since I know ... | habedi/stack-exchange-dataset |
48,405 | If we sort a table column-wise and then row-wise why the table is still sorted column-wise? | <p>Say we have a $n \times n$ table which elements are sorted column-wise, for example:</p>

<p>$$
\left( \begin{array}{ccc}
2 & 4 & 1 \\
3 & 5 & 6 \\
7 & 9 & 8 \end{array} \right) 
$$</p>

<p>I would like to prove that if we sort this table row-wise, it will ... | algorithms sorting correctness proof | 1 | If we sort a table column-wise and then row-wise why the table is still sorted column-wise? -- (algorithms sorting correctness proof)
<p>Say we have a $n \times n$ table which elements are sorted column-wise, for example:</p>

<p>$$
\left( \begin{array}{ccc}
2 & 4 & 1 \\
3 & 5 & 6 \\... | habedi/stack-exchange-dataset |
48,416 | How to prove membership of NP | <p>My tutor often says that proving membership of <strong>NP</strong> is the easy part of proving that a problem is <strong>NP</strong>-complete, and that this should only take a minute. What I don't understand is what exactly you're suppose to do at this step I understand that you're suppose to verify the corre... | algorithms np complete complexity classes np | 1 | How to prove membership of NP -- (algorithms np complete complexity classes np)
<p>My tutor often says that proving membership of <strong>NP</strong> is the easy part of proving that a problem is <strong>NP</strong>-complete, and that this should only take a minute. What I don't understand is what exactly you're suppos... | habedi/stack-exchange-dataset |
48,419 | Is there a difference between total-ordering consistency and linearizability? | <p>By <em>total-ordering</em> I mean the following definition[0]:</p>

<blockquote>
 <p>Total Event Ordering: Controller replicas should process events in the
 same order and subsequently all controller application instances
 should reach the same internal state.</p>
</blockquote>

<p... | distributed systems consensus | 1 | Is there a difference between total-ordering consistency and linearizability? -- (distributed systems consensus)
<p>By <em>total-ordering</em> I mean the following definition[0]:</p>

<blockquote>
 <p>Total Event Ordering: Controller replicas should process events in the
 same order and subsequently a... | habedi/stack-exchange-dataset |
48,422 | Can OR be "undone"? | <p>Suppose that $Z = X \vee Y$, where $X$, $Y$ and $Z$ are 96-bit binary numbers. If I'm given the values of $Z$ and $Y$, is it possible to work out what $X$ is?</p>

<p>I know this is possible with XOR but can it be done with OR?</p>
 | logic | 1 | Can OR be "undone"? -- (logic)
<p>Suppose that $Z = X \vee Y$, where $X$, $Y$ and $Z$ are 96-bit binary numbers. If I'm given the values of $Z$ and $Y$, is it possible to work out what $X$ is?</p>

<p>I know this is possible with XOR but can it be done with OR?</p>
 | habedi/stack-exchange-dataset |
48,425 | Is word size, the size of a memory location? the size of the data bus? or the cpu register size? | <p>Is word size, the size of a memory location? the size of the data bus? or the cpu register size?</p>

<p>Suppose you have a computer, </p>

<p>memory address #0 has byte AB memory address #1 has byte F3 memory address #2 has byte EA So each memory address stores one byte.</p>

<p>And you h... | terminology computer architecture cpu | 1 | Is word size, the size of a memory location? the size of the data bus? or the cpu register size? -- (terminology computer architecture cpu)
<p>Is word size, the size of a memory location? the size of the data bus? or the cpu register size?</p>

<p>Suppose you have a computer, </p>

<p>memory address #0 ... | habedi/stack-exchange-dataset |
48,428 | How to revert a carryless polynomial multiplication? | <p>In the carryless multiplication of two polynomials in a 8-bit environment, is it possible to obtain the original 8-bit values from the result?</p>

<p>As an example:</p>

<p>$$\begin{align}
(x^{11} + x^{10} + x^9 ) + (x^7 + x^5 + x^4 + x^3 + x^1) &= (x^6 + x^5 + x^1) \times (x^5 + x^3 + x^2 +... | algorithms arithmetic polynomials encryption | 1 | How to revert a carryless polynomial multiplication? -- (algorithms arithmetic polynomials encryption)
<p>In the carryless multiplication of two polynomials in a 8-bit environment, is it possible to obtain the original 8-bit values from the result?</p>

<p>As an example:</p>

<p>$$\begin{align}
(x^{... | habedi/stack-exchange-dataset |
48,441 | Are Cellular Automata always computers? | <p>I was reading on Complex Systems journal and found a <a href="http://www.complex-systems.com/abstracts/v01_i02_a03.html" rel="nofollow noreferrer">paper</a> where the author states that a cellular automaton can be viewed as a computer.</p>
<p>In the introduction part:</p>
<blockquote>
<p>Cellular automat... | computation models cellular automata | 1 | Are Cellular Automata always computers? -- (computation models cellular automata)
<p>I was reading on Complex Systems journal and found a <a href="http://www.complex-systems.com/abstracts/v01_i02_a03.html" rel="nofollow noreferrer">paper</a> where the author states that a cellular automaton can be viewed as a computer.... | habedi/stack-exchange-dataset |
48,442 | 3-SAT for variables appearing 3 times | <p>I've been trying to investigate 3-SAT for variables appearing 3 times and so far I'm getting some mixed answers as to its complexity. </p>

<p>For example, <a href="https://people.maths.ox.ac.uk/scott/Papers/restricted3sat.pdf" rel="noreferrer">https://people.maths.ox.ac.uk/scott/Papers/restricted3sat.pdf</a... | np complete 3 sat | 1 | 3-SAT for variables appearing 3 times -- (np complete 3 sat)
<p>I've been trying to investigate 3-SAT for variables appearing 3 times and so far I'm getting some mixed answers as to its complexity. </p>

<p>For example, <a href="https://people.maths.ox.ac.uk/scott/Papers/restricted3sat.pdf" rel="noreferrer">htt... | habedi/stack-exchange-dataset |
48,453 | What is the effect of operating systems on execution speed? | <p>I'm using a Raspberry Pi 2 which works with 900MHz. (Asked this question there and they think it belongs to cs)</p>

<p>My question is: since it also runs an operating system in the background, I expect this would take some of the processing power.</p>

<p>So, how significant is the speed reduction d... | operating systems | 1 | What is the effect of operating systems on execution speed? -- (operating systems)
<p>I'm using a Raspberry Pi 2 which works with 900MHz. (Asked this question there and they think it belongs to cs)</p>

<p>My question is: since it also runs an operating system in the background, I expect this would take some of... | habedi/stack-exchange-dataset |
48,454 | Delay Constrained Shortest Path in $O(D \cdot |E|)$ time | <p>I have the following homework exercise:</p>

<blockquote>
 <p>We are given a network $N=(G,w,d)$, $G=(V,E)$ together with a designated
 source node s∈V and target node $t \in V$, where $w\colon E \to Z^+$ and $d\colon E \to Z^+$. The
 values $w_{i,j}$ correspond to arc weights, $d_{i,j}$ corre... | algorithms complexity theory optimization shortest path | 1 | Delay Constrained Shortest Path in $O(D \cdot |E|)$ time -- (algorithms complexity theory optimization shortest path)
<p>I have the following homework exercise:</p>

<blockquote>
 <p>We are given a network $N=(G,w,d)$, $G=(V,E)$ together with a designated
 source node s∈V and target node $t \in V$, wh... | habedi/stack-exchange-dataset |
48,458 | Is a Petri net without places well-defined? | <p>I'm a bit confused about the definition of a Petri-Net. From <a href="https://de.wikipedia.org/wiki/Petri-Netz" rel="nofollow noreferrer">Wikipedia</a> (<a href="https://en.wikipedia.org/wiki/Petri_net" rel="nofollow noreferrer">EN</a>) I have this defintion:</p>
<blockquote>
<p>A Petri-Net is a 5-Tupel (P, ... | automata petri nets | 1 | Is a Petri net without places well-defined? -- (automata petri nets)
<p>I'm a bit confused about the definition of a Petri-Net. From <a href="https://de.wikipedia.org/wiki/Petri-Netz" rel="nofollow noreferrer">Wikipedia</a> (<a href="https://en.wikipedia.org/wiki/Petri_net" rel="nofollow noreferrer">EN</a>) I have this... | habedi/stack-exchange-dataset |
48,461 | Hash-Table in Practice | <p>I have a set of $n$ values,$v_i$ and want to insert them into a hash-table, $HT$, in a way that each bucket (or hash-table cell) has at most $d$ values. I set $k=\frac{n
}{d}$, where $k$ is the number of buckets. Then, I use SHA hash function, $H$, to find the index a bucket in the hash-table and insert the valu... | data structures hash hash tables algorithm design | 1 | Hash-Table in Practice -- (data structures hash hash tables algorithm design)
<p>I have a set of $n$ values,$v_i$ and want to insert them into a hash-table, $HT$, in a way that each bucket (or hash-table cell) has at most $d$ values. I set $k=\frac{n
}{d}$, where $k$ is the number of buckets. Then, I use SHA hash f... | habedi/stack-exchange-dataset |
48,465 | What is the algorithm for Shannon-Fano code? am I correct? | <p>I am wondering what is the true algorithm for the Shannon-Fano code? The the result I am getting based on the Algorithm in <a href="https://en.wikipedia.org/wiki/Shannon%E2%80%93Fano_coding#Shannon.E2.80.93Fano_Algorithm" rel="nofollow noreferrer">Wikipedia page</a> contradicts the supposed/expected length of the pr... | algorithms coding theory | 1 | What is the algorithm for Shannon-Fano code? am I correct? -- (algorithms coding theory)
<p>I am wondering what is the true algorithm for the Shannon-Fano code? The the result I am getting based on the Algorithm in <a href="https://en.wikipedia.org/wiki/Shannon%E2%80%93Fano_coding#Shannon.E2.80.93Fano_Algorithm" rel="n... | habedi/stack-exchange-dataset |
48,475 | Difficult Question to Understand (Computer Artitechture) | <p>You are designing an elevator controller for a building with 25 floors. The controller has two inputs: UP and DOWN. It produces an output indicating the floor that the elevator is on. There is no floor 13. What is the minimum number of bits of state in the controller?</p>

<p>Answer: The system has at least ... | computer architecture computer algebra | 1 | Difficult Question to Understand (Computer Artitechture) -- (computer architecture computer algebra)
<p>You are designing an elevator controller for a building with 25 floors. The controller has two inputs: UP and DOWN. It produces an output indicating the floor that the elevator is on. There is no floor 13. What is th... | habedi/stack-exchange-dataset |
48,482 | What is the time complexity of this atrocious algorithm? | <p>This grew out of a discussion of deliberately bad algorithms; credit to <a href="http://fora.xkcd.com/viewtopic.php?p=3803292#p3803292" rel="nofollow">benneh</a> on the xkcd forums for the pseudocode algorithm, which I've translated to Python so you can actually run it:</p>

<pre><code>def sort(list):
 ... | algorithms algorithm analysis runtime analysis average case | 1 | What is the time complexity of this atrocious algorithm? -- (algorithms algorithm analysis runtime analysis average case)
<p>This grew out of a discussion of deliberately bad algorithms; credit to <a href="http://fora.xkcd.com/viewtopic.php?p=3803292#p3803292" rel="nofollow">benneh</a> on the xkcd forums for the pseudo... | habedi/stack-exchange-dataset |
48,487 | Number of ways of making change in Big O notation | <p>I have the following algorithm in ML:</p>

<pre><code>fun change(till,0,chg,chgs) = chg::chgs
| change([],amt,chg,chgs) = chgs
| change(c::till,amt,chg,chgs) = if amt<0 then chgs else change(c::till, amt-c,c::chg, change(till,amt,chg,chgs));
</code></pre>

<p>The algorithm takes a ... | algorithms algorithm analysis runtime analysis | 1 | Number of ways of making change in Big O notation -- (algorithms algorithm analysis runtime analysis)
<p>I have the following algorithm in ML:</p>

<pre><code>fun change(till,0,chg,chgs) = chg::chgs
| change([],amt,chg,chgs) = chgs
| change(c::till,amt,chg,chgs) = if amt<0 then chgs else change(c... | habedi/stack-exchange-dataset |
48,488 | Is infinitely fast computer fundamentally impossible even theoretically? | <p>This may get slightly philosophical, but consider the following program:</p>

<pre><code>bool lampState = false;
TimeSpan timeout = 1;
while (true)
{
 lampState = !lampState;
 Thread.Sleep(timeout);
 timeout = timeout / 2;
}
</code></pre>

<p><a href="https://... | computation models hypercomputation | 1 | Is infinitely fast computer fundamentally impossible even theoretically? -- (computation models hypercomputation)
<p>This may get slightly philosophical, but consider the following program:</p>

<pre><code>bool lampState = false;
TimeSpan timeout = 1;
while (true)
{
 lampState = !lampState;&#... | habedi/stack-exchange-dataset |
48,500 | Find the index of the next greatest element in the array | <p><a href="https://i.stack.imgur.com/hYv2E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hYv2E.png" alt="enter image description here"></a></p>

<p>I know there is a stack based approach with O(N) complexity and O(N) space. Can B be created using O(1) space? Such as in place using a single... | algorithms arrays | 1 | Find the index of the next greatest element in the array -- (algorithms arrays)
<p><a href="https://i.stack.imgur.com/hYv2E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hYv2E.png" alt="enter image description here"></a></p>

<p>I know there is a stack based approach with O(N) complexity an... | habedi/stack-exchange-dataset |
48,501 | benchmark data set for Metareasoning problem | <p>I am developing algorithm for solving following problem:</p>

<p>Given a set of items with unknown feature(s) (but know distribution of feature(s)). Algorithm must choose what items to measure(every measure has some cost)). I use Value of information theory to find this measurements.</p>

<p>After m... | machine learning data sets | 1 | benchmark data set for Metareasoning problem -- (machine learning data sets)
<p>I am developing algorithm for solving following problem:</p>

<p>Given a set of items with unknown feature(s) (but know distribution of feature(s)). Algorithm must choose what items to measure(every measure has some cost)). I use V... | habedi/stack-exchange-dataset |
48,510 | Help wrapping my head around a combinatorial optimization problem | <p>Here's the problem I'm trying to solve:</p>

<p>I have a bunch of widgets, whose weights vary over a small range. I would like to find the optimal grouping of them such that each group meets a minimum weight requirement, while maximizing the total number of groups I can form.</p>

<p>Knowing a specif... | combinatorics linear programming | 1 | Help wrapping my head around a combinatorial optimization problem -- (combinatorics linear programming)
<p>Here's the problem I'm trying to solve:</p>

<p>I have a bunch of widgets, whose weights vary over a small range. I would like to find the optimal grouping of them such that each group meets a minimum weig... | habedi/stack-exchange-dataset |
48,511 | How to solve an arrangement problem at the Archive Nationale of France using graph theory? | <p>Good evening! I'm actually doing an internship at the Archives Nationales of France and I encountered a situation I wanted to solve using graphs...</p>

<h1>I. The dusty situation</h1>

<p>We want to optimize the arrangement of books of my library according to their height in order to minimize their ... | algorithms graphs optimization packing | 1 | How to solve an arrangement problem at the Archive Nationale of France using graph theory? -- (algorithms graphs optimization packing)
<p>Good evening! I'm actually doing an internship at the Archives Nationales of France and I encountered a situation I wanted to solve using graphs...</p>

<h1>I. The dusty situ... | habedi/stack-exchange-dataset |
48,514 | The Interleaved Transition System for 2 Independent and Concurrent Transition Systems | <p>This question is about <strong>Model Checking</strong> for <strong>Software Formal Verification</strong><br>
How do you model the joint behavior of 2 <em>independent</em> and <em>concurrent</em> transition systems? </p>

<p>Specifically, given the two independent and concurrent Transition Systems below; ... | model checking software verification transition systems | 1 | The Interleaved Transition System for 2 Independent and Concurrent Transition Systems -- (model checking software verification transition systems)
<p>This question is about <strong>Model Checking</strong> for <strong>Software Formal Verification</strong><br>
How do you model the joint behavior of 2 <em>independent<... | habedi/stack-exchange-dataset |
48,515 | CISC and RISC - synchronous and asynchronous | <p>I have two opposing ideas. I think that all the instructions in a RISC take the same time what makes me believe RISC is associated with synchronous.</p>

<p>At the same time i think that CISC should be synchronous and RISC should be asynchronous.</p>

<p>Can you tell me if RISC is associated with asy... | computer architecture cpu | 1 | CISC and RISC - synchronous and asynchronous -- (computer architecture cpu)
<p>I have two opposing ideas. I think that all the instructions in a RISC take the same time what makes me believe RISC is associated with synchronous.</p>

<p>At the same time i think that CISC should be synchronous and RISC should be ... | habedi/stack-exchange-dataset |
48,521 | An intuitive explanation for LR grammars? | <p>With <a href="https://en.wikipedia.org/wiki/LL_grammar" rel="nofollow">LL grammars</a>, there seems to be a very intuitive explanation, in terms of first and follow tables.( The first letter/s encountered in a particular state, can only mean a particular rule). With <a href="https://en.wikipedia.org/wiki/LR_grammar"... | formal languages formal grammars parsers intuition lr k | 1 | An intuitive explanation for LR grammars? -- (formal languages formal grammars parsers intuition lr k)
<p>With <a href="https://en.wikipedia.org/wiki/LL_grammar" rel="nofollow">LL grammars</a>, there seems to be a very intuitive explanation, in terms of first and follow tables.( The first letter/s encountered in a part... | habedi/stack-exchange-dataset |
48,522 | How do threads decide when to 'go'? | <p>I have written some code that animates two boxes using HTML5 and JavaScript threads. I set them up to move at a fixed rate, which is the same:</p>

<pre><code>executeEvery(box1.animate(), 10);
executeEvery(box2.animate(), 10);
</code></pre>

<p>The result is weird for reasons not important he... | algorithms concurrency threads | 1 | How do threads decide when to 'go'? -- (algorithms concurrency threads)
<p>I have written some code that animates two boxes using HTML5 and JavaScript threads. I set them up to move at a fixed rate, which is the same:</p>

<pre><code>executeEvery(box1.animate(), 10);
executeEvery(box2.animate(), 10);
</... | habedi/stack-exchange-dataset |
48,527 | What does $\log^{O(1)}n$ mean? | <p>What does $\log^{O(1)}n$ mean?</p>

<p>I am aware of big-O notation, but this notation makes no sense to me.
I can't find anything about it either, because there is no way a search engine interprets this correctly.</p>

<p>For a bit of context, the sentence where I found it reads "[...] we call a... | asymptotics landau notation | 1 | What does $\log^{O(1)}n$ mean? -- (asymptotics landau notation)
<p>What does $\log^{O(1)}n$ mean?</p>

<p>I am aware of big-O notation, but this notation makes no sense to me.
I can't find anything about it either, because there is no way a search engine interprets this correctly.</p>

<p>For a bit ... | habedi/stack-exchange-dataset |
48,537 | Why does the Toffoli gate output c XOR (a AND b) instead of just a AND b? | <p>The Toffoli gate takes in three inputs and gives out three outputs, and is often referred to as the quantum AND gate.</p>

<p>It takes in a,b,c and gives out a, b, c XOR (a AND b).</p>

<p>Why does it do that, instead of just giving out a,b,b AND c? or a,b,(a AND b)?</p>
 | quantum computing | 1 | Why does the Toffoli gate output c XOR (a AND b) instead of just a AND b? -- (quantum computing)
<p>The Toffoli gate takes in three inputs and gives out three outputs, and is often referred to as the quantum AND gate.</p>

<p>It takes in a,b,c and gives out a, b, c XOR (a AND b).</p>

<p>Why does it do ... | habedi/stack-exchange-dataset |
48,538 | Is it possible to entangle more than 2 qubits? If so, is it useful? | <p>With 2 qubits, there are 4 ways to entangle the qubits - the four maximally entangled <a href="https://en.wikipedia.org/wiki/Bell_state#The_Bell_states" rel="nofollow">two-qubit Bell states</a>, of which one is $1/\sqrt{2}(|00\rangle + |11\rangle)$. </p>

<p>Is it possible to entangle more than two qubits t... | quantum computing | 1 | Is it possible to entangle more than 2 qubits? If so, is it useful? -- (quantum computing)
<p>With 2 qubits, there are 4 ways to entangle the qubits - the four maximally entangled <a href="https://en.wikipedia.org/wiki/Bell_state#The_Bell_states" rel="nofollow">two-qubit Bell states</a>, of which one is $1/\sqrt{2}(|00... | habedi/stack-exchange-dataset |
48,539 | What does $\alpha_r\supset\beta_r$ mean in the tolerance definition of System Z? | <p>I'm reading up on <a href="https://books.google.de/books?id=KebsCAAAQBAJ&pg=PA171&dq=system%20z%20logic%20default%20reasoning&hl=de&sa=X&redir_esc=y#v=onepage&q=system%20z&f=false" rel="nofollow">System Z</a> introduced by Judea Pearl (in <a href="http://dl.acm.org/citation.cfm?id=1027031... | logic notation reasoning | 1 | What does $\alpha_r\supset\beta_r$ mean in the tolerance definition of System Z? -- (logic notation reasoning)
<p>I'm reading up on <a href="https://books.google.de/books?id=KebsCAAAQBAJ&pg=PA171&dq=system%20z%20logic%20default%20reasoning&hl=de&sa=X&redir_esc=y#v=onepage&q=system%20z&f=fals... | habedi/stack-exchange-dataset |
48,543 | Maximising a particular colour in a vertex colouring | <p>I'm looking for a paper that discusses the maximising of one colour in a vertex colouring.</p>

<p>Suppose that for an unweighted, undirected graph $G=(V,E)$ we define a vertex colouring as a function $c : V\to\mathbb N$ (where we use $\mathbb N$ for the colours). I would then like to maximise $\#\{v\in V\mi... | algorithms graphs reference request graph algorithms | 1 | Maximising a particular colour in a vertex colouring -- (algorithms graphs reference request graph algorithms)
<p>I'm looking for a paper that discusses the maximising of one colour in a vertex colouring.</p>

<p>Suppose that for an unweighted, undirected graph $G=(V,E)$ we define a vertex colouring as a functi... | habedi/stack-exchange-dataset |
48,556 | Why do non regular languages have infinitely many equivalence classes? | <p>For example, for the language $L = \{a^nb^m|n \neq m\}$, why does it have infinitely many equivalence classes? How do I show/see that?</p>
 | regular languages | 1 | Why do non regular languages have infinitely many equivalence classes? -- (regular languages)
<p>For example, for the language $L = \{a^nb^m|n \neq m\}$, why does it have infinitely many equivalence classes? How do I show/see that?</p>
 | habedi/stack-exchange-dataset |
48,557 | Is modulus capable of universal computation? | <p>I heard once that you could translate any digital circuit into a modulus operation, perhaps modulusing against different numbers?</p>

<p>It was a long while ago though and don't remember where I heard it.</p>

<p>Is this true or does it ring any bells?</p>
 | computation models | 1 | Is modulus capable of universal computation? -- (computation models)
<p>I heard once that you could translate any digital circuit into a modulus operation, perhaps modulusing against different numbers?</p>

<p>It was a long while ago though and don't remember where I heard it.</p>

<p>Is this true or do... | habedi/stack-exchange-dataset |
48,564 | How is clock syncing implemented? | <p>I'm looking for an explanation or reference on the implementation of computer clock. To keep the question at the level of logical abstractions: say, we put together some combinational and sequential logic from basic gates. The role of the clock (an oscillator of some sort, but that's going into more detail than need... | computer architecture clocks | 1 | How is clock syncing implemented? -- (computer architecture clocks)
<p>I'm looking for an explanation or reference on the implementation of computer clock. To keep the question at the level of logical abstractions: say, we put together some combinational and sequential logic from basic gates. The role of the clock (an ... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.