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 |
|---|---|---|---|---|---|---|
43,102 | Why Turing wasn't wrong? | <p>Computer science is a science and as a science each thesis can be refutable. So, why there is no "major" counter-thesis?
After all, Einstein was a well known "genius" and has lived a long life and he has got many opponents. Why isn't it the same case for Turing?</p>
 | church turing thesis | 1 | Why Turing wasn't wrong? -- (church turing thesis)
<p>Computer science is a science and as a science each thesis can be refutable. So, why there is no "major" counter-thesis?
After all, Einstein was a well known "genius" and has lived a long life and he has got many opponents. Why isn't it the same case for Turing?... | habedi/stack-exchange-dataset |
43,105 | Dominator Tree for DAG | <p>Is there a fast algorithm to compute dominator tree for acyclic graphs?</p>

<p>The Lengauer-Tarjan Algorithm is a fast algorithm for general flowgraphs. But if a graph is acyclic, do we have a faster algorithm?</p>
 | algorithms graphs reference request | 1 | Dominator Tree for DAG -- (algorithms graphs reference request)
<p>Is there a fast algorithm to compute dominator tree for acyclic graphs?</p>

<p>The Lengauer-Tarjan Algorithm is a fast algorithm for general flowgraphs. But if a graph is acyclic, do we have a faster algorithm?</p>
 | habedi/stack-exchange-dataset |
43,118 | Determine if the language is $R$ | <p>Consider the following language: </p>

<p>$$L = \{ \langle M \rangle \ |\ M \text { is a TM that decides the halting problem} \}$$</p>

<blockquote>
 <p>determine whether or not the language is in $R$.</p>
</blockquote>

<p>Now, from my understanding an $\langle M \rangle \in L$ does... | formal languages turing machines reductions undecidability | 1 | Determine if the language is $R$ -- (formal languages turing machines reductions undecidability)
<p>Consider the following language: </p>

<p>$$L = \{ \langle M \rangle \ |\ M \text { is a TM that decides the halting problem} \}$$</p>

<blockquote>
 <p>determine whether or not the language is in $R... | habedi/stack-exchange-dataset |
43,124 | If the decision problem can be solved in poly time, show the optimization problem also can | <p>Here is a problem I am trying to solve:</p>

<blockquote>
 <p>The bin packing decision problem is defined as follows: given an unlimited number of
 bins, each of capacity equal to $1$, and $n$ objects with sizes $s_1$, $s_2$, $\dots$, $s_n$ ($0 < s_i ≤ 1$), do the objects fit in $k$ bins (where ... | np complete optimization decision problem np | 1 | If the decision problem can be solved in poly time, show the optimization problem also can -- (np complete optimization decision problem np)
<p>Here is a problem I am trying to solve:</p>

<blockquote>
 <p>The bin packing decision problem is defined as follows: given an unlimited number of
 bins, each... | habedi/stack-exchange-dataset |
43,127 | can network layers communicate between each other? | <p>in a network architecture can two layers in different machines communicate between each other using some protocols, without having to go through the layers below, if yes how briefly ? </p>
 | communication protocols | 1 | can network layers communicate between each other? -- (communication protocols)
<p>in a network architecture can two layers in different machines communicate between each other using some protocols, without having to go through the layers below, if yes how briefly ? </p>
 | habedi/stack-exchange-dataset |
43,136 | Determining most efficient algorithm for a problem | <p>This is a very straightforward question, and I apologize if it is a repeat. All I want to know is if there is any general method for determining how efficient the most efficient algorithm for some problem is, in terms of time. Barring that, are there any specific methods used that have accomplished the same for a pa... | algorithms time complexity efficiency | 1 | Determining most efficient algorithm for a problem -- (algorithms time complexity efficiency)
<p>This is a very straightforward question, and I apologize if it is a repeat. All I want to know is if there is any general method for determining how efficient the most efficient algorithm for some problem is, in terms of ti... | habedi/stack-exchange-dataset |
43,146 | Segment trees with insertion/deletion | <p>I have a range query problem to solve. This problem requires not only range queries and update, but also insert or delete an element of the array. There is a series of operations that must be done in the order that they appear in the input. The operations can be one of the following: update a position of the array w... | data structures search trees dictionaries | 1 | Segment trees with insertion/deletion -- (data structures search trees dictionaries)
<p>I have a range query problem to solve. This problem requires not only range queries and update, but also insert or delete an element of the array. There is a series of operations that must be done in the order that they appear in th... | habedi/stack-exchange-dataset |
43,152 | Smallest class of automata model whose corresponding language class contains CFL and is closed against (dis)allowing nondeterminism in the model | <p>From <a href="https://cs.stackexchange.com/questions/43137/machines-for-context-free-languages-which-gain-no-extra-power-from-nondeterminis?noredirect=1#comment86645_43137">a comment</a>, an interesting question popped up. The class of CFLs (the languages recognized by PDAs) are obviously not closed under nondetermi... | formal languages context free closure properties computation models nondeterminism | 1 | Smallest class of automata model whose corresponding language class contains CFL and is closed against (dis)allowing nondeterminism in the model -- (formal languages context free closure properties computation models nondeterminism)
<p>From <a href="https://cs.stackexchange.com/questions/43137/machines-for-context-free... | habedi/stack-exchange-dataset |
43,156 | Can someone help me come up with a formula for calculating the difference in time? | <p>So my assignment is to write a program that prompts the user for two different times on the same day (with 0 being midnight, 0700 being 7:00 am and 2200 being 10 pm) and then returns the difference between the two times with the amount of hours and amount of minutes elapsed. For example, if the user inputted 1255 an... | algorithms | 1 | Can someone help me come up with a formula for calculating the difference in time? -- (algorithms)
<p>So my assignment is to write a program that prompts the user for two different times on the same day (with 0 being midnight, 0700 being 7:00 am and 2200 being 10 pm) and then returns the difference between the two time... | habedi/stack-exchange-dataset |
43,158 | Why in a min priority queue (heap based) it is called "decrease-key" and not just "set-key"? | <p>When you call decrease-key in a min priority queue, you are basically setting the key, you can accidentally put a higher key, right? so why isn't it called "set-key" or "update-key"? why (according to <a href="http://en.wikipedia.org/wiki/Heap_%28data_structure%29" rel="noreferrer">Wikipedia</a> and other sources) a... | terminology data structures priority queues | 1 | Why in a min priority queue (heap based) it is called "decrease-key" and not just "set-key"? -- (terminology data structures priority queues)
<p>When you call decrease-key in a min priority queue, you are basically setting the key, you can accidentally put a higher key, right? so why isn't it called "set-key" or "updat... | habedi/stack-exchange-dataset |
43,159 | Why is the class NP-Complete important compared to NP-hard? | <p>I'm studying computational complexity and I was wondering why the NP-Complete (NPC) problems is an important class at all. I find it obvious why we're interested in showing a given NP problem is NP-hard. </p>

<p>I also understand the definition of NPC, and that showing a given decision problem is NP-hard, ... | complexity theory np complete | 1 | Why is the class NP-Complete important compared to NP-hard? -- (complexity theory np complete)
<p>I'm studying computational complexity and I was wondering why the NP-Complete (NPC) problems is an important class at all. I find it obvious why we're interested in showing a given NP problem is NP-hard. </p>

<p>... | habedi/stack-exchange-dataset |
43,167 | Is the number of nodes in an ORBDD 2n + 2? | <p>Wikipedia says that the number of nodes in a ORBDD (Order Reduced Binary Decision Diagrams) of order $x_1 < x_2 < \dots < x_{2n}$ is $2n + 2$.</p>

<p>But I can't find proof. Anyone?</p>
 | combinatorics bdd | 1 | Is the number of nodes in an ORBDD 2n + 2? -- (combinatorics bdd)
<p>Wikipedia says that the number of nodes in a ORBDD (Order Reduced Binary Decision Diagrams) of order $x_1 < x_2 < \dots < x_{2n}$ is $2n + 2$.</p>

<p>But I can't find proof. Anyone?</p>
 | habedi/stack-exchange-dataset |
43,175 | Complexity of dynamic programming algorithm for Knapsack | <p>Dynamic programming algorithm for Knapsack is stated to have complexity $\mathcal O (nW)$.</p>

<p>However, I've also seen the complexity stated as $\mathcal O (n^2V)$, where $V=\max v_i$.</p>

<p>(Here $n$ is the number of items and $W$ the weight limit).</p>

<p>I see from the algorithm tha... | algorithm analysis runtime analysis dynamic programming pseudo polynomial | 1 | Complexity of dynamic programming algorithm for Knapsack -- (algorithm analysis runtime analysis dynamic programming pseudo polynomial)
<p>Dynamic programming algorithm for Knapsack is stated to have complexity $\mathcal O (nW)$.</p>

<p>However, I've also seen the complexity stated as $\mathcal O (n^2V)$, wher... | habedi/stack-exchange-dataset |
43,181 | Is the unsolvability of the N-Body Problem equivalent to the Halting Problem | <p>There is no general analytic solution to the n-body problem that can produce an analytic function which can be used to give an n-body system's state at arbitrary time t with exact precision. However, there are some special cases of n-body systems for which an analytic function is known.</p>

<p>In much the s... | computability turing machines undecidability computation models | 1 | Is the unsolvability of the N-Body Problem equivalent to the Halting Problem -- (computability turing machines undecidability computation models)
<p>There is no general analytic solution to the n-body problem that can produce an analytic function which can be used to give an n-body system's state at arbitrary time t wi... | habedi/stack-exchange-dataset |
43,188 | Is computing 2^n NP-complete problems EXPTIME or NEXPTIME complete? | <p>Given a NP-complete problem $A$, with parameter $a$ and a problem $B$ with parameter $b$, such that a problem in $A$ of size $\mathcal{O}(2^a)$ is $\mathcal{O}(b)$ when translated to $B$, is $B$ EXPTIME or NEXPTIME complete? I.e. If a problem of exponential size relative to a NPC problem is of linear size in another... | complexity theory time complexity | 1 | Is computing 2^n NP-complete problems EXPTIME or NEXPTIME complete? -- (complexity theory time complexity)
<p>Given a NP-complete problem $A$, with parameter $a$ and a problem $B$ with parameter $b$, such that a problem in $A$ of size $\mathcal{O}(2^a)$ is $\mathcal{O}(b)$ when translated to $B$, is $B$ EXPTIME or NEXP... | habedi/stack-exchange-dataset |
43,197 | Relation between the "Point-Cover-Interval" problem and the "Interval Scheduling" problem | <blockquote>
 <p><strong><em>Point-Cover-Interval Problem:</em></strong> Given a set $\mathcal{I}$ of $n$ intervals $[s_1, f_1], \ldots, [s_n, f_n]$ along a real line, find a <em>minimum</em> number of points $P$ such that each interval contains some point, that is $\forall I \in \mathcal{I}: \exists p \in P, p \i... | algorithms reductions greedy algorithms | 1 | Relation between the "Point-Cover-Interval" problem and the "Interval Scheduling" problem -- (algorithms reductions greedy algorithms)
<blockquote>
 <p><strong><em>Point-Cover-Interval Problem:</em></strong> Given a set $\mathcal{I}$ of $n$ intervals $[s_1, f_1], \ldots, [s_n, f_n]$ along a real line, find a <em>m... | habedi/stack-exchange-dataset |
43,207 | what are the key advantages of pipelining | <p>I was trying to look my book computer architecture and design, but I can not find the answer for this question.
what are-the key-advantages of pipelining?</p>
 | computer architecture cpu pipelines | 1 | what are the key advantages of pipelining -- (computer architecture cpu pipelines)
<p>I was trying to look my book computer architecture and design, but I can not find the answer for this question.
what are-the key-advantages of pipelining?</p>
 | habedi/stack-exchange-dataset |
43,225 | How to interpret these asymptotic runtime bounds for discrete logarithm algorithms? | <p>I am trying to compare asymptotic runtime bounds of a few algorithms presented in this research paper, <a href="https://eprint.iacr.org/2013/400.pdf" rel="nofollow">A quasi-polynomial algorithm for discrete
logarithm in finite fields of small characteristic</a>. The functions are, </p>

<p>$L(\alpha) = ... | asymptotics | 1 | How to interpret these asymptotic runtime bounds for discrete logarithm algorithms? -- (asymptotics)
<p>I am trying to compare asymptotic runtime bounds of a few algorithms presented in this research paper, <a href="https://eprint.iacr.org/2013/400.pdf" rel="nofollow">A quasi-polynomial algorithm for discrete
logar... | habedi/stack-exchange-dataset |
43,228 | Computational complexity of function $U^V$ | <p>Given $(U,V)$ two integers of finite size, I have a question about the complexity of calculating the $V^U$, i.e. $V$ raised to the power $U$. Is their a polynomial time algorithm to do this? If not is this an NP-hard problem?</p>
 | complexity theory | 1 | Computational complexity of function $U^V$ -- (complexity theory)
<p>Given $(U,V)$ two integers of finite size, I have a question about the complexity of calculating the $V^U$, i.e. $V$ raised to the power $U$. Is their a polynomial time algorithm to do this? If not is this an NP-hard problem?</p>
 | habedi/stack-exchange-dataset |
43,230 | A Myhill-Nerode type characterization of the regular languages using fooling sets? | <p>Ultimately, my question is whether it's possible to exactly characterize the regular languages in terms of fooling sets. To help explain my motivation for asking this, here's a quick exposition.</p>

<p>Let $L$ be a language. A set of strings $S$ is called <em>pairwise distinguishable relative to $L$</em> if... | regular languages communication complexity | 1 | A Myhill-Nerode type characterization of the regular languages using fooling sets? -- (regular languages communication complexity)
<p>Ultimately, my question is whether it's possible to exactly characterize the regular languages in terms of fooling sets. To help explain my motivation for asking this, here's a quick exp... | habedi/stack-exchange-dataset |
43,236 | Is a 2 address machine more likely to follow a RISC or CISC design? | <p><strong>The Problem:</strong> If I have a 3 address machine, is my machine more likely to follow RISC or CISC design? 2 addresses? 1 address? 0 address. </p>

<p>To solve this problem I first looked up the different terms.</p>

<ul>
<li><a href="http://cs.stanford.edu/people/eroberts/courses/... | computer architecture operating systems | 1 | Is a 2 address machine more likely to follow a RISC or CISC design? -- (computer architecture operating systems)
<p><strong>The Problem:</strong> If I have a 3 address machine, is my machine more likely to follow RISC or CISC design? 2 addresses? 1 address? 0 address. </p>

<p>To solve this problem I first ... | habedi/stack-exchange-dataset |
43,245 | When is a permutation k-wise independent? | <p>I am a bit confused about what it means for a permutation to be k-wise independent. </p>

<p>If I pick a permutation uniformly at random from $\sigma \in S_n$ then isn't it true that for any $k$ integers, $i_1,i_2,..,i_k$ $\in \{1,2,..,n\}$, the numbers $\sigma(i_1),\sigma(i_2),..,\sigma(i_k)$ are k-wise in... | permutations | 1 | When is a permutation k-wise independent? -- (permutations)
<p>I am a bit confused about what it means for a permutation to be k-wise independent. </p>

<p>If I pick a permutation uniformly at random from $\sigma \in S_n$ then isn't it true that for any $k$ integers, $i_1,i_2,..,i_k$ $\in \{1,2,..,n\}$, the nu... | habedi/stack-exchange-dataset |
43,260 | How to read this inductive language definition? | <p>A language $L$ is defined recursively according to the following rules:</p>

<ul>
<li>$λ ∈ L$</li>
<li>If $w ∈ L$, then $bw ∈ L$ and $waa ∈ L$</li>
</ul>

<p>I am not sure if strings from this language should mix from this definition. Would strings only consist of $bbbb$ and $aaaa$, or ca... | formal languages induction mathematical foundations | 1 | How to read this inductive language definition? -- (formal languages induction mathematical foundations)
<p>A language $L$ is defined recursively according to the following rules:</p>

<ul>
<li>$λ ∈ L$</li>
<li>If $w ∈ L$, then $bw ∈ L$ and $waa ∈ L$</li>
</ul>

<p>I am not sure if strings f... | habedi/stack-exchange-dataset |
43,281 | AMAT question cache here | <p>Suppose that the processor reads cache memory in one clock cycle.In case of cache miss the processor needs 5 clock cycles to read the information in the main memory.What should be the value of Cache hit rate so that AMAT=2?</p>

<p>We know that </p>

<p>AMAT=Hit time+ (Hit rate)*(Miss penalty)</p>&#... | computer architecture cpu cache | 1 | AMAT question cache here -- (computer architecture cpu cache)
<p>Suppose that the processor reads cache memory in one clock cycle.In case of cache miss the processor needs 5 clock cycles to read the information in the main memory.What should be the value of Cache hit rate so that AMAT=2?</p>

<p>We know that <... | habedi/stack-exchange-dataset |
43,289 | Is there any published paper about automated planning software used in the ESA Rosetta mission? | <p>The Rosetta spacecraft has reached a comet in August 2014 and sent a
lander on its surface. It was one of the greatest science news of the year.</p>

<p>Automated Planning and Scheduling techniques are really important in the operations of these kinds of missions. At the last ICAPS there was even an invi... | reference request artificial intelligence planning | 1 | Is there any published paper about automated planning software used in the ESA Rosetta mission? -- (reference request artificial intelligence planning)
<p>The Rosetta spacecraft has reached a comet in August 2014 and sent a
lander on its surface. It was one of the greatest science news of the year.</p>

<p>... | habedi/stack-exchange-dataset |
43,290 | How are graph representations containing only (i, j) instead of both (i, j) and (j, i) named? | <p>When working with undirected graph algorithms using an adjacency-list type structure, it's sometimes enough to store a given edge <code>(i, j)</code> just stored in the list of edges of <code>i</code> or on the list of edges of <code>j</code>. Other times, it's important to have an <code>(i, j)</code> on <code>i</co... | terminology graphs data structures weighted graphs | 1 | How are graph representations containing only (i, j) instead of both (i, j) and (j, i) named? -- (terminology graphs data structures weighted graphs)
<p>When working with undirected graph algorithms using an adjacency-list type structure, it's sometimes enough to store a given edge <code>(i, j)</code> just stored in th... | habedi/stack-exchange-dataset |
43,294 | Difference Between Small and Big-step Operational Semantics | <p>What's the fundamental difference(s) between small and big-step operational semantics?</p>

<p>I'm having a hard time grasping what it is and the motivation for having the two.</p>
 | semantics operational semantics small step semantics | 1 | Difference Between Small and Big-step Operational Semantics -- (semantics operational semantics small step semantics)
<p>What's the fundamental difference(s) between small and big-step operational semantics?</p>

<p>I'm having a hard time grasping what it is and the motivation for having the two.</p>
 | habedi/stack-exchange-dataset |
43,306 | Are deterministic and nondeterministic Cellular Automata equivalent? | <p>It seems that in CA context nondeterministic (ND) means probabilistic, not ND as in <a href="http://en.wikipedia.org/wiki/Nondeterministic_finite_automaton" rel="nofollow">NFSMs</a>. At least I haven't seen a paper or book which discusses NCAs, without talking about probabilistic CAs.</p>

<p>I haven't even ... | closure properties computation models nondeterminism cellular automata | 1 | Are deterministic and nondeterministic Cellular Automata equivalent? -- (closure properties computation models nondeterminism cellular automata)
<p>It seems that in CA context nondeterministic (ND) means probabilistic, not ND as in <a href="http://en.wikipedia.org/wiki/Nondeterministic_finite_automaton" rel="nofollow">... | habedi/stack-exchange-dataset |
43,320 | Algorithm deciding if a radius of a graph is two | <p>Given an unweighted, undirected graph, what is the time complexity to decide if its radius is at most 2? Are there any faster algorithms than doing BFS on each node?</p>
 | algorithms graphs | 1 | Algorithm deciding if a radius of a graph is two -- (algorithms graphs)
<p>Given an unweighted, undirected graph, what is the time complexity to decide if its radius is at most 2? Are there any faster algorithms than doing BFS on each node?</p>
 | habedi/stack-exchange-dataset |
43,323 | How to draw a graph to disprove this statement? | <p><strong>The Problem</strong>: Indicate whether the following statements are true or false:
<BR /></p>
<ul> 
 <li>a. If <em>e</em> is a minimum-weight edge in a connected weighted graph, it must be among edges of at least one minimum spanning tree of the graph.</li>
 <li>b. If <em>e</em> is a ... | algorithms graphs proof techniques weighted graphs | 1 | How to draw a graph to disprove this statement? -- (algorithms graphs proof techniques weighted graphs)
<p><strong>The Problem</strong>: Indicate whether the following statements are true or false:
<BR /></p>
<ul> 
 <li>a. If <em>e</em> is a minimum-weight edge in a connected weighted graph, it must be ... | habedi/stack-exchange-dataset |
43,324 | Why is T not a minimum spanning tree of G? | <p><strong>The Problem:</strong> Let T be a tree constructed by Dijkstra's algorithm in the process of solving the single source shortest-paths problem for a weighted connected graph G.<BR />
 a. True of false: T is a spanning tree of G?<Br/>
 b. True of false: T is a minimum ... | algorithms graphs proof techniques weighted graphs | 1 | Why is T not a minimum spanning tree of G? -- (algorithms graphs proof techniques weighted graphs)
<p><strong>The Problem:</strong> Let T be a tree constructed by Dijkstra's algorithm in the process of solving the single source shortest-paths problem for a weighted connected graph G.<BR />
 a. True... | habedi/stack-exchange-dataset |
43,328 | purpose of supercomputers | <p>Last fall I went on a tour of the Blue Waters supercomputer at the University of Illinois. I asked whether anyone ever used the entire computer. I was told that it was always working on multiple projects. That made me wonder about the usefulness of supercomputers. Perhaps Blue Waters is unusual in that it has to... | computer architecture | 1 | purpose of supercomputers -- (computer architecture)
<p>Last fall I went on a tour of the Blue Waters supercomputer at the University of Illinois. I asked whether anyone ever used the entire computer. I was told that it was always working on multiple projects. That made me wonder about the usefulness of supercompute... | habedi/stack-exchange-dataset |
43,350 | What is the standard notation for introducing syntactical formalism in a paper | <p>Suppose you want to introduce a format for a language, commands, ... etc. (Specially in the filed of computer science) in a paper</p>

<p>for example something like below:</p>

<pre><code>X | Y = [ Z ] <W> [ / ] $P
</code></pre>

<p>By this, I mean, <code>X</code> or <code>Y</code> ... | notation | 1 | What is the standard notation for introducing syntactical formalism in a paper -- (notation)
<p>Suppose you want to introduce a format for a language, commands, ... etc. (Specially in the filed of computer science) in a paper</p>

<p>for example something like below:</p>

<pre><code>X | Y = [ Z ] <W&... | habedi/stack-exchange-dataset |
43,357 | How to convert CFG with Kleene Star, Kleene Plus, and Question Mark to Chomsky Normal Form? | <p>I am fairly new to formal language theory but understand how to convert simple CFGs into both <a href="http://en.wikipedia.org/wiki/Chomsky_normal_form#Converting_a_grammar_to_Chomsky_normal_form" rel="nofollow">Chomsky normal form</a> and <a href="http://www.iitg.ernet.in/gkd/ma513/oct/oct18/note.pdf" rel="nofollow... | formal languages formal grammars | 1 | How to convert CFG with Kleene Star, Kleene Plus, and Question Mark to Chomsky Normal Form? -- (formal languages formal grammars)
<p>I am fairly new to formal language theory but understand how to convert simple CFGs into both <a href="http://en.wikipedia.org/wiki/Chomsky_normal_form#Converting_a_grammar_to_Chomsky_nor... | habedi/stack-exchange-dataset |
43,359 | Can Reduction for Undecidability/Decidability Problems Go Both Ways? | <p>This Problem sparked my question:
Does a TM $M$ enter state $q$ on input $w$?</p>

<p>I proved it was undecidable in this format using the Halting Problem as a subroutine:</p>

<p><code>If HALT
 simulate M on w and return result
 else 
 return false</code></p>

<p>Since ... | turing machines automata undecidability | 1 | Can Reduction for Undecidability/Decidability Problems Go Both Ways? -- (turing machines automata undecidability)
<p>This Problem sparked my question:
Does a TM $M$ enter state $q$ on input $w$?</p>

<p>I proved it was undecidable in this format using the Halting Problem as a subroutine:</p>

<p><co... | habedi/stack-exchange-dataset |
43,363 | Could an NP-hard problem have a mechanical or physical solution method? | <p>Is there any NP-hard problem that we can find a mechanical "polynomial time" solution to? For example, suppose we construct a graph out of something physical, e.g. we have have pipes through which we can move water. If this pipe system was suitably built, could we solve say some routing problem by seeing if water fl... | complexity theory np hard p vs np physics | 1 | Could an NP-hard problem have a mechanical or physical solution method? -- (complexity theory np hard p vs np physics)
<p>Is there any NP-hard problem that we can find a mechanical "polynomial time" solution to? For example, suppose we construct a graph out of something physical, e.g. we have have pipes through which w... | habedi/stack-exchange-dataset |
43,370 | Get the nth lexicographic string of "all" possible combinations of an alphabet | <p>Is there a way to find the nth string of characters from an alphabet, without having to store "all" of the combinations?</p>

<p><strong>Example:</strong> </p>

<p>Alphabet $A = \{a,b,c\}, n=12$.</p>

<p>All possible combinations <em>in lexicographic order</em> are $C = \{a, ab, abc, ac, acb,... | algorithms | 1 | Get the nth lexicographic string of "all" possible combinations of an alphabet -- (algorithms)
<p>Is there a way to find the nth string of characters from an alphabet, without having to store "all" of the combinations?</p>

<p><strong>Example:</strong> </p>

<p>Alphabet $A = \{a,b,c\}, n=12$.</p>
&#... | habedi/stack-exchange-dataset |
43,377 | Multiple FPT Parameters | <p>The class $FPT$ (fixed-parameter tractable) is defined <a href="http://en.wikipedia.org/wiki/Parameterized_complexity" rel="nofollow">here</a>. However, there is only one "parameter" that is studied from the given problem/language.</p>

<p>Is there an equivalently defined class that can take $O(1)$ parameter... | complexity theory parameterized complexity | 1 | Multiple FPT Parameters -- (complexity theory parameterized complexity)
<p>The class $FPT$ (fixed-parameter tractable) is defined <a href="http://en.wikipedia.org/wiki/Parameterized_complexity" rel="nofollow">here</a>. However, there is only one "parameter" that is studied from the given problem/language.</p>

... | habedi/stack-exchange-dataset |
43,390 | How much bits need to add to 100bit of data in order to correct up to 10bits? | <p>I'm trying to calculate how much <strong>minimum</strong> bits need to be added to data of 100bits, in order to correct 10 bits that are messed up by:</p>

<ol>
<li>bits that deleted (Erasure Correcting)</li>
<li>bits that corrupted (Error Correcting)</li>
</ol>

<p>I tried Hamming code a... | information theory encoding scheme error correcting codes | 1 | How much bits need to add to 100bit of data in order to correct up to 10bits? -- (information theory encoding scheme error correcting codes)
<p>I'm trying to calculate how much <strong>minimum</strong> bits need to be added to data of 100bits, in order to correct 10 bits that are messed up by:</p>

<ol>
<li... | habedi/stack-exchange-dataset |
43,391 | Are there any known AM-complete problems/is AM-complete well defined? | <p>I'm curious about whether there are any complete problems in the Arthur-Merlin complexity class. Graph Non-Isomorphism (GNI) seems to be the canonical example of a problem <strong>in</strong> AM, but it's probably not a complete one.</p>

<p>I suppose I'm also wondering if a "complete" problem is well-define... | complexity theory reductions complexity classes interactive proof systems | 1 | Are there any known AM-complete problems/is AM-complete well defined? -- (complexity theory reductions complexity classes interactive proof systems)
<p>I'm curious about whether there are any complete problems in the Arthur-Merlin complexity class. Graph Non-Isomorphism (GNI) seems to be the canonical example of a prob... | habedi/stack-exchange-dataset |
43,404 | Counting Number of arrays where sum of ith row is greater or equal to (i-1)th row | <p>I am working on a problem where I am supposed to count the number of arrays of size $N\times M$ where the sum of elements in the $i$-th row is greater than or equal to the the sum of elements in the $(i-1)$-th row. And the the sum of elements in $N$-th row (the last row) is less than or equal to $M$. All the element... | algorithms permutations | 1 | Counting Number of arrays where sum of ith row is greater or equal to (i-1)th row -- (algorithms permutations)
<p>I am working on a problem where I am supposed to count the number of arrays of size $N\times M$ where the sum of elements in the $i$-th row is greater than or equal to the the sum of elements in the $(i-1)$... | habedi/stack-exchange-dataset |
43,411 | A and B are Turing recognizable, is A - B Turing recognizable? | <p>If A and B are Turing recognizable, is A - B Turing recognizable?</p>

<p>I think that A - B would be Turing recognizable because they're both in the space of Turing recognizability. For example, if A is context free and B is a regular language A - B would result in a language that is sill Turing recogniza... | computability closure properties semi decidability | 1 | A and B are Turing recognizable, is A - B Turing recognizable? -- (computability closure properties semi decidability)
<p>If A and B are Turing recognizable, is A - B Turing recognizable?</p>

<p>I think that A - B would be Turing recognizable because they're both in the space of Turing recognizability. For e... | habedi/stack-exchange-dataset |
43,413 | Irregularity of L = {a^i b^(j+3)| i!=j } | <p>I have a question to find out that $L = \{a^i b^{j+3}\mid i\ne j \}$ is regular or not. I know that it is not regular. I tried with pumping lemma but I am finding just a specific number of $v$'s in $u v^i w$ that not satisfies the language condition, but not ALL $v$'s. What are the best choices for $i$ and $j$ to pr... | formal languages regular languages pumping lemma | 1 | Irregularity of L = {a^i b^(j+3)| i!=j } -- (formal languages regular languages pumping lemma)
<p>I have a question to find out that $L = \{a^i b^{j+3}\mid i\ne j \}$ is regular or not. I know that it is not regular. I tried with pumping lemma but I am finding just a specific number of $v$'s in $u v^i w$ that not satis... | habedi/stack-exchange-dataset |
43,417 | Is this method of proving non-regularity is equivalent to pumping lemma? | <p>I find it really difficult to prove non-regularity of a language using <code>pumping lemma</code>. I do understand that regular language is the language that can be expressed using DFA/RE. So if I can't create DFA/RE for language can I use that as proof of it's non regularity?</p>

<p>For example, following ... | regular languages automata finite automata regular expressions | 1 | Is this method of proving non-regularity is equivalent to pumping lemma? -- (regular languages automata finite automata regular expressions)
<p>I find it really difficult to prove non-regularity of a language using <code>pumping lemma</code>. I do understand that regular language is the language that can be expressed u... | habedi/stack-exchange-dataset |
43,421 | Is the language $L=\{a^{2^{n}} \mid$ n is a natural number$\} $ context free? | <p>I have to determine, and prove, whether the language $L=\{a^{2^{n}} \mid$ n is a natural number$\}$ is context free or not (if it is by a grammar and not by the pumping lemma).</p>

<p>I tried to construct a grammar, but I don't have a working one. I have no problems to construct the language $L=\{a^{2n} \m... | formal languages context free pumping lemma | 1 | Is the language $L=\{a^{2^{n}} \mid$ n is a natural number$\} $ context free? -- (formal languages context free pumping lemma)
<p>I have to determine, and prove, whether the language $L=\{a^{2^{n}} \mid$ n is a natural number$\}$ is context free or not (if it is by a grammar and not by the pumping lemma).</p>

... | habedi/stack-exchange-dataset |
43,433 | Can a language be Turing Complete if its only provision for unlimited code/memory is through recursion? | <p>We've developed an esoteric language. In this language, a program contains a static amount of code, and a static amount of storage space. However, parts of the program can recurse, so the interpreter will spawn another copy of a subset of the code and additional storage space to match. Can this language be Turing Co... | programming languages turing completeness language design | 1 | Can a language be Turing Complete if its only provision for unlimited code/memory is through recursion? -- (programming languages turing completeness language design)
<p>We've developed an esoteric language. In this language, a program contains a static amount of code, and a static amount of storage space. However, par... | habedi/stack-exchange-dataset |
43,434 | How to solve T(n) = T(n-1) + n^2? | <p>See title. I'm trying to apply the method from <a href="https://stackoverflow.com/questions/13674719/easy-solve-tn-tn-1n-by-iteration-method">this question</a>. What I have so far is this, but I don't know how to proceed from here on:</p>

<p>T(n) = T(n-1) + n2</p>

<p>T(n-1) = T(n-2) + (n-1)2 = T(n-... | recurrence relation | 1 | How to solve T(n) = T(n-1) + n^2? -- (recurrence relation)
<p>See title. I'm trying to apply the method from <a href="https://stackoverflow.com/questions/13674719/easy-solve-tn-tn-1n-by-iteration-method">this question</a>. What I have so far is this, but I don't know how to proceed from here on:</p>

<p>T(n) = ... | habedi/stack-exchange-dataset |
43,441 | Solving the graph colourability problem in polynomial time if the equivallent decision problem is in $P$ | <p>For the graph colourability problem, we are given a graph and our goal is to find a colouring of the graph with the fewest possible number of colours so that no two adjacent vertices have the same colour. This problem is known to be NP complete. </p>

<p>Suppose that we have an algorithm $A$ that runs in pol... | algorithms complexity theory graphs | 1 | Solving the graph colourability problem in polynomial time if the equivallent decision problem is in $P$ -- (algorithms complexity theory graphs)
<p>For the graph colourability problem, we are given a graph and our goal is to find a colouring of the graph with the fewest possible number of colours so that no two adjace... | habedi/stack-exchange-dataset |
43,447 | Order-preserving update of a sublist of a list of mutable objects in sublinear time | <h2>Description</h2>

<p>Say I have a source list like: <code>["a","b","c","d"]</code> and want to run a capitalization filter so if I change, <code>"b"</code> to <code>"B"</code>, my derived list looks like <code>["B"]</code>. Next, if I change my source list's <code>"d"</code> to <code>"D"</code>, the derive... | data structures linked lists lists balanced search trees ordering | 1 | Order-preserving update of a sublist of a list of mutable objects in sublinear time -- (data structures linked lists lists balanced search trees ordering)
<h2>Description</h2>

<p>Say I have a source list like: <code>["a","b","c","d"]</code> and want to run a capitalization filter so if I change, <code>"b"</cod... | habedi/stack-exchange-dataset |
43,448 | How do calculators convert from decimal to fraction? | <p><em>Sorry if this question is either obvious or ignorant. I am a high school student with only the computer science knowledge I have taught myself.</em></p>

<p>Calculators have a function that can convert numbers from decimal to fractional equivalents. For example, 0.5 becomes 1/2, and 0.666666667 becomes 2... | algorithms number formats | 1 | How do calculators convert from decimal to fraction? -- (algorithms number formats)
<p><em>Sorry if this question is either obvious or ignorant. I am a high school student with only the computer science knowledge I have taught myself.</em></p>

<p>Calculators have a function that can convert numbers from decima... | habedi/stack-exchange-dataset |
43,463 | Non-Midpoint Segment Splitting in Ruppert's Delaunay Triangulation Refinement Algorithm | <p>Roughly, in <a href="http://www.cs.berkeley.edu/~jrs/papers/2dj.pdf" rel="nofollow">Ruppert's Delaunay Triangulation refinement algorithm</a>, so called <em>encroached edges</em> are split until no more encroached edges remain. </p>

<p>The algorithm specifies splitting the edges at their midpoint (except i... | computational geometry | 1 | Non-Midpoint Segment Splitting in Ruppert's Delaunay Triangulation Refinement Algorithm -- (computational geometry)
<p>Roughly, in <a href="http://www.cs.berkeley.edu/~jrs/papers/2dj.pdf" rel="nofollow">Ruppert's Delaunay Triangulation refinement algorithm</a>, so called <em>encroached edges</em> are split until no mor... | habedi/stack-exchange-dataset |
43,475 | Algorithm: Cracking the Safe | <p>A safe is protected by a four-digit $(0-9)$ combination. The safe only considers the last four digits entered when deciding whether an input matches the passcode.</p>

<p>For instance, if I enter the stream $012345$, I am trying each of the combinations $0123$, $1234$, and $2345$.</p>

<p>Clearly, a ... | algorithms algorithm analysis data structures combinatorics group theory | 1 | Algorithm: Cracking the Safe -- (algorithms algorithm analysis data structures combinatorics group theory)
<p>A safe is protected by a four-digit $(0-9)$ combination. The safe only considers the last four digits entered when deciding whether an input matches the passcode.</p>

<p>For instance, if I enter the st... | habedi/stack-exchange-dataset |
43,484 | CFG for all string that don't end at ba? | <p>Here is my solution:</p>

<pre><code>S-> Sab|Sbb|Saa 
S->aS 
S->bS 
S->ε 
</code></pre>

<p>Is this solution right?</p>
 | context free formal grammars | 1 | CFG for all string that don't end at ba? -- (context free formal grammars)
<p>Here is my solution:</p>

<pre><code>S-> Sab|Sbb|Saa 
S->aS 
S->bS 
S->ε 
</code></pre>

<p>Is this solution right?</p>
 | habedi/stack-exchange-dataset |
43,497 | Finding a good loop invariant | <p>I want to prove that the following program is correct. The code takes an array <code>i</code> of length <code>N</code> and a number <code>x</code>. At the end, the value of <code>found</code> should be true if the array contains <code>x</code> and false otherwise.</p>

<pre><code>found := false;
i := 0 ;... | correctness proof software verification loop invariants | 1 | Finding a good loop invariant -- (correctness proof software verification loop invariants)
<p>I want to prove that the following program is correct. The code takes an array <code>i</code> of length <code>N</code> and a number <code>x</code>. At the end, the value of <code>found</code> should be true if the array contai... | habedi/stack-exchange-dataset |
43,498 | What would be CFG for all strings which does not contain bbb? | <p>Is there a way to get complement? Following is my solution for CFG of all strings that DON'T contain bbb.</p>

<pre><code>S -> aA | aaB | aB | bA | bbA
A -> aA| aB
A -> epsilon
B -> bA | bbA
B -> epsilon
</code></pre>

<p>Is this right?</p>
 | context free formal grammars | 1 | What would be CFG for all strings which does not contain bbb? -- (context free formal grammars)
<p>Is there a way to get complement? Following is my solution for CFG of all strings that DON'T contain bbb.</p>

<pre><code>S -> aA | aaB | aB | bA | bbA
A -> aA| aB
A -> epsilon
B -> bA | bb... | habedi/stack-exchange-dataset |
43,536 | Select the n closest nodes from a starting node in a weighted directed graph | <p>I need to select a given number of nodes from a weighted directed graph such that the nodes selected are the closest to a given starting node. This seems like a common problem to need to solve, but I haven't found much material on it. Does anyone know if this particular problem has a name, or any published materia... | algorithms graphs search algorithms | 1 | Select the n closest nodes from a starting node in a weighted directed graph -- (algorithms graphs search algorithms)
<p>I need to select a given number of nodes from a weighted directed graph such that the nodes selected are the closest to a given starting node. This seems like a common problem to need to solve, but ... | habedi/stack-exchange-dataset |
43,537 | How can I prove this language is not CFL? | <p>I have a question to find out that $L = \{a^m b^n\mid n>0, m - is prime \}$ is CFL or not. I know that it is not a CFL. But I don't know how to prove that. I know how to prove that $L = \{a^m\mid m - is prime \}$ is not CFL, by taking a random length for $vx$ ($uvwxy$) and prove that the length of the whole word ... | formal languages context free formal grammars | 1 | How can I prove this language is not CFL? -- (formal languages context free formal grammars)
<p>I have a question to find out that $L = \{a^m b^n\mid n>0, m - is prime \}$ is CFL or not. I know that it is not a CFL. But I don't know how to prove that. I know how to prove that $L = \{a^m\mid m - is prime \}$ is not C... | habedi/stack-exchange-dataset |
43,547 | What does feedforward inversion mean in the context of convolution and catastrophic codes? | <p>i'm reading the article of J. L. Massey and M. K. Sain, "Inverses of Linear Sequential Circuits" (Date of Publication - 
April 1968) (<a href="http://www.isiweb.ee.ethz.ch/archive/massey_pub/pdf/BI413.pdf" rel="nofollow">here</a>) and i cannot understand - what is "feedforward inversion"? </p>

<p>They g... | terminology coding theory error correcting codes | 1 | What does feedforward inversion mean in the context of convolution and catastrophic codes? -- (terminology coding theory error correcting codes)
<p>i'm reading the article of J. L. Massey and M. K. Sain, "Inverses of Linear Sequential Circuits" (Date of Publication - 
April 1968) (<a href="http://www.isiweb.ee.ethz... | habedi/stack-exchange-dataset |
43,558 | What is the difference between cyber security ontologies and scenario ontologies in this system? | <p>I have been reading the paper <a href="http://ceur-ws.org/Vol-1097/STIDS2013_T13_OltramariEtAl.pdf" rel="nofollow noreferrer">Towards a Cognitive System for Decision Support in Cyber Operations</a>. And I have been trying to understand the role of two ontologies proposed here, <strong>cyber security ontologies</stro... | terminology knowledge representation ontologies | 1 | What is the difference between cyber security ontologies and scenario ontologies in this system? -- (terminology knowledge representation ontologies)
<p>I have been reading the paper <a href="http://ceur-ws.org/Vol-1097/STIDS2013_T13_OltramariEtAl.pdf" rel="nofollow noreferrer">Towards a Cognitive System for Decision S... | habedi/stack-exchange-dataset |
43,559 | Locally finite graph without an optimal path | <p>If I have a locally finite graph (every node has finite number of neighbors) with positive edge weights, is it possible for there to be a path between some start node and goal node but no shortest path between them?</p>

<p>I think that it can only happen if the goal node is somewhere in the infinity, but th... | graphs | 1 | Locally finite graph without an optimal path -- (graphs)
<p>If I have a locally finite graph (every node has finite number of neighbors) with positive edge weights, is it possible for there to be a path between some start node and goal node but no shortest path between them?</p>

<p>I think that it can only hap... | habedi/stack-exchange-dataset |
43,560 | Which element is at its final position after the partitioning step in Quicksort? | <p>In <a href="http://algs4.cs.princeton.edu/23quicksort/" rel="nofollow">Algorithms, 4th Edition,</a> I read that after the partitioning step one element is in its final position.</p>

<blockquote>
 <p>The entry a[j] is in its final place in the array, for some j.</p>
 
 <p>No entry in a[lo] thr... | algorithms correctness proof quicksort partitions | 1 | Which element is at its final position after the partitioning step in Quicksort? -- (algorithms correctness proof quicksort partitions)
<p>In <a href="http://algs4.cs.princeton.edu/23quicksort/" rel="nofollow">Algorithms, 4th Edition,</a> I read that after the partitioning step one element is in its final position.</p>... | habedi/stack-exchange-dataset |
43,562 | Quicksort bounds | <p>I found an implementation of Quicksort <a href="http://www.algolist.net/Algorithms/Sorting/Quicksort" rel="nofollow">here</a>, and now I cannot understand why it works with those left and right bounds.</p>

<p>Right now the link above is unavailable due to some problems with their hosting provider.</p>
&... | algorithms quicksort | 1 | Quicksort bounds -- (algorithms quicksort)
<p>I found an implementation of Quicksort <a href="http://www.algolist.net/Algorithms/Sorting/Quicksort" rel="nofollow">here</a>, and now I cannot understand why it works with those left and right bounds.</p>

<p>Right now the link above is unavailable due to some prob... | habedi/stack-exchange-dataset |
43,569 | Contraint with three variables into three binary constraints | <p>I'm having a hard time tackling the following problem (perhaps some key data is missing). We have a constraint:</p>

<p>$A+B= C$</p>

<p>One is supposed to represent this one constraint using three binary constraints. Is this even possible? No domain is given, but even if it was, I really don't see h... | constraint satisfaction | 1 | Contraint with three variables into three binary constraints -- (constraint satisfaction)
<p>I'm having a hard time tackling the following problem (perhaps some key data is missing). We have a constraint:</p>

<p>$A+B= C$</p>

<p>One is supposed to represent this one constraint using three binary constr... | habedi/stack-exchange-dataset |
43,570 | Prove/ Disprove: For every nontrivial $A,B \in R (RE)$, $A\le_m B$ | <blockquote>
<p>Prove/ Disprove:</p>
<ul>
<li>For every nontrivial <span class="math-container">$A,B\in R$</span>, <span class="math-container">$A\le_m B$</span></li>
<li>For every nontrivial <span class="math-container">$A,B\in RE$</span>, <span class="math-container">$A\le_m B$</span></li>
</ul>&#... | computability | 1 | Prove/ Disprove: For every nontrivial $A,B \in R (RE)$, $A\le_m B$ -- (computability)
<blockquote>
<p>Prove/ Disprove:</p>
<ul>
<li>For every nontrivial <span class="math-container">$A,B\in R$</span>, <span class="math-container">$A\le_m B$</span></li>
<li>For every nontrivial <span class="math-containe... | habedi/stack-exchange-dataset |
43,582 | FSM + state data is Turing complete abstraction? | <p>I'm playing with <a href="http://doc.akka.io/docs/akka/snapshot/scala/fsm.html" rel="nofollow noreferrer">Akka FSM</a>.
The declaration of a an Akka FSM consists of states + data mantained during the states (the akka doc is more clear than me) + events that trigger transitions between states.
Can we say that... | finite automata turing completeness | 1 | FSM + state data is Turing complete abstraction? -- (finite automata turing completeness)
<p>I'm playing with <a href="http://doc.akka.io/docs/akka/snapshot/scala/fsm.html" rel="nofollow noreferrer">Akka FSM</a>.
The declaration of a an Akka FSM consists of states + data mantained during the states (the akka doc is... | habedi/stack-exchange-dataset |
43,599 | Using the pumping lemma to prove that a language is context-free | <p>I am new to automata theory.</p>

<p>Could you give me a little hand with the correct use of the pumping lemma?
I understand now how to proof a language is not context-free, but how do I use the pumping lemma to proof it is? </p>

<p>Do I find one way to break the word into: uvwxy so that v and x... | formal languages context free pumping lemma | 1 | Using the pumping lemma to prove that a language is context-free -- (formal languages context free pumping lemma)
<p>I am new to automata theory.</p>

<p>Could you give me a little hand with the correct use of the pumping lemma?
I understand now how to proof a language is not context-free, but how do I use ... | habedi/stack-exchange-dataset |
43,610 | $k$-Multiset intersection efficient algorithm | <p>Given a collection of sets $C= \{S_1,S_2,\cdots,S_n\}$ such that each set $S_i \in C$ is sorted and has at least $k$ elements.</p>

<p>What is the most efficient algorithm for finding the intersection of these sets: $\bigcap_{S_i \in C}{S_i}$</p>
 | algorithms sets | 1 | $k$-Multiset intersection efficient algorithm -- (algorithms sets)
<p>Given a collection of sets $C= \{S_1,S_2,\cdots,S_n\}$ such that each set $S_i \in C$ is sorted and has at least $k$ elements.</p>

<p>What is the most efficient algorithm for finding the intersection of these sets: $\bigcap_{S_i \in C}{S_i}$... | habedi/stack-exchange-dataset |
43,611 | Computing a boolean function with a small formula | <p>Suppose that $x = (x_1,\ldots,x_n)$ is a binary vector and $f(x)$ is a boolean function. Furthermore suppose $y = (y_1,\ldots,y_m)$ is a binary vector and that $F(x,y)$ is a binary formula of size $k.$ Here by <em>size</em> I mean the number of leaves in $F.$</p>

<p>Suppose I have vectors $S = \{s_1,\ldo... | circuits boolean algebra | 1 | Computing a boolean function with a small formula -- (circuits boolean algebra)
<p>Suppose that $x = (x_1,\ldots,x_n)$ is a binary vector and $f(x)$ is a boolean function. Furthermore suppose $y = (y_1,\ldots,y_m)$ is a binary vector and that $F(x,y)$ is a binary formula of size $k.$ Here by <em>size</em> I mean the... | habedi/stack-exchange-dataset |
43,613 | Given asymptotic bounds, what can we say about small n? | <p>I am trying to wrap my head around these asymptotic notations. Given $f(n)$ and $g(n)$, one can write $f(n) = \Omega(g(n))$ as shorthand for $f(n) \geq c*g(n), n\geq n_0$. But what happens when $n<n_0$. What can we then say about $f(n)$ and $g(n)$? Do we just assume that $f(n)$ is a constant and the relation stil... | asymptotics landau notation | 1 | Given asymptotic bounds, what can we say about small n? -- (asymptotics landau notation)
<p>I am trying to wrap my head around these asymptotic notations. Given $f(n)$ and $g(n)$, one can write $f(n) = \Omega(g(n))$ as shorthand for $f(n) \geq c*g(n), n\geq n_0$. But what happens when $n<n_0$. What can we then say a... | habedi/stack-exchange-dataset |
43,616 | RAW Data Hazard resolution | <p>Let's consider the following MIPS (using pipelined arch.) assembly code:</p>

<pre><code>lw r1,0(r2)
sub r4, r1, r6
and r6, r1, r7
or r8, r1, r9
</code></pre>

<p>the r1 value used in the second and third instruction will not be ready to use until the end of the 4th cycle of the pipe... | computer architecture memory hardware | 1 | RAW Data Hazard resolution -- (computer architecture memory hardware)
<p>Let's consider the following MIPS (using pipelined arch.) assembly code:</p>

<pre><code>lw r1,0(r2)
sub r4, r1, r6
and r6, r1, r7
or r8, r1, r9
</code></pre>

<p>the r1 value used in the second and third instructio... | habedi/stack-exchange-dataset |
43,619 | Find 8 numbers whose sum is closest to a defined value | <p>I have a file that has a number (a positive integer) on each row.</p>

<p>Given a number $q$, I want to find a value that's a sum of some 8 numbers in the file, and is as close to $q$ as possible.</p>

<p>So, supposing that I have a file that looks like this:</p>

<blockquote>
 <p>345<br... | algorithms integers knapsack problems | 1 | Find 8 numbers whose sum is closest to a defined value -- (algorithms integers knapsack problems)
<p>I have a file that has a number (a positive integer) on each row.</p>

<p>Given a number $q$, I want to find a value that's a sum of some 8 numbers in the file, and is as close to $q$ as possible.</p>

<... | habedi/stack-exchange-dataset |
43,628 | Context free grammar for this language | <p>Is this language Context Free?</p>

<p>$L=\{a^{n+3} b^{2m} \mid n \neq m \}$</p>

<p>I think that I could split the languages into $L_1$ and $L_2$ with the conditions $n<m$ and $n>m$, provide 2 CF grammars and then to make the union. But I don't know how to put the condition $n<m$ to the gra... | formal languages context free | 1 | Context free grammar for this language -- (formal languages context free)
<p>Is this language Context Free?</p>

<p>$L=\{a^{n+3} b^{2m} \mid n \neq m \}$</p>

<p>I think that I could split the languages into $L_1$ and $L_2$ with the conditions $n<m$ and $n>m$, provide 2 CF grammars and then to mak... | habedi/stack-exchange-dataset |
43,639 | Construct Turing Machine which accepts the language $ww$ | <p>I try to construct a TM that accepts the language $\{ ww \mid w \in \{a,b\}^* \}$.</p>

<p>Between the words $w$ is no delimeter, so I don't know, how my TM can know where the first $w$ ends and the second $w$ begins. </p>

<p>Is there a trick for this?</p>
 | formal languages turing machines automata | 1 | Construct Turing Machine which accepts the language $ww$ -- (formal languages turing machines automata)
<p>I try to construct a TM that accepts the language $\{ ww \mid w \in \{a,b\}^* \}$.</p>

<p>Between the words $w$ is no delimeter, so I don't know, how my TM can know where the first $w$ ends and the second... | habedi/stack-exchange-dataset |
43,640 | Minimal length of a string that contains two strings | <p>We have two strings $a,b$. I want to find string $c$ that includes $a$ as a subsequence and includes $b$ as a subsequence and the length of $c$ is minimal. Is there an efficient algorithm for this problem?</p>

<p>For example, if $a=1011$ and $b=0100$, the minimal string that include both: $c=101100$. As y... | algorithms optimization dynamic programming strings | 1 | Minimal length of a string that contains two strings -- (algorithms optimization dynamic programming strings)
<p>We have two strings $a,b$. I want to find string $c$ that includes $a$ as a subsequence and includes $b$ as a subsequence and the length of $c$ is minimal. Is there an efficient algorithm for this problem?<... | habedi/stack-exchange-dataset |
43,653 | Necessities for two undirected graphs being isomorphic | <p>As far as I know, for two undirected graphs $G = (V, E) $ and $H = (V', E')$, the following criteria is necessary for them to be isomorphic:</p>

<ol>
<li>$|V| = |V'|$</li>
<li>$|E| = |E'|$</li>
<li>$G$ has $j$ nodes of degree $k$ $\Leftrightarrow $ $H$ has $j$ nodes of degree $k$</li>
</ol>&... | graphs graph isomorphism | 1 | Necessities for two undirected graphs being isomorphic -- (graphs graph isomorphism)
<p>As far as I know, for two undirected graphs $G = (V, E) $ and $H = (V', E')$, the following criteria is necessary for them to be isomorphic:</p>

<ol>
<li>$|V| = |V'|$</li>
<li>$|E| = |E'|$</li>
<li>$G$ has $j$ n... | habedi/stack-exchange-dataset |
43,660 | What is the formal name for an "entry" in an ontology? | <p>I am trying to wrap my head around <a href="https://en.wikipedia.org/wiki/Ontology_(information_science)" rel="nofollow">ontologies</a> and their related counterparts (RDF, OWL, etc.).</p>

<p>My <em>understanding</em> is that an ontology, at the end of the day, really boils down to some database storing obj... | terminology ontologies | 1 | What is the formal name for an "entry" in an ontology? -- (terminology ontologies)
<p>I am trying to wrap my head around <a href="https://en.wikipedia.org/wiki/Ontology_(information_science)" rel="nofollow">ontologies</a> and their related counterparts (RDF, OWL, etc.).</p>

<p>My <em>understanding</em> is that... | habedi/stack-exchange-dataset |
43,667 | Prove that $S_2$ is closed under union and complement | <p>I'm having trouble proving that <span class="math-container">$S_2$</span> is closed under union and complement, even though in <a href="https://en.wikipedia.org/wiki/S2P_(complexity)" rel="nofollow noreferrer">this Wikipedia article</a> it says that:</p>
<blockquote>
<p>It is immediate from the definition th... | complexity theory closure properties complexity classes | 1 | Prove that $S_2$ is closed under union and complement -- (complexity theory closure properties complexity classes)
<p>I'm having trouble proving that <span class="math-container">$S_2$</span> is closed under union and complement, even though in <a href="https://en.wikipedia.org/wiki/S2P_(complexity)" rel="nofollow nore... | habedi/stack-exchange-dataset |
43,672 | A relational algebra extended to model the full DML ("CRUD") domain | <p>There are multiple references about the relational algebra for modeling queries (<code>SELECT</code>) but I have found very very little on the expanded algebra that would include concepts in all of <a href="https://en.wikipedia.org/wiki/Data_manipulation_language" rel="nofollow">DML</a> such as <code>INSERT</code>, ... | database theory databases relational algebra | 1 | A relational algebra extended to model the full DML ("CRUD") domain -- (database theory databases relational algebra)
<p>There are multiple references about the relational algebra for modeling queries (<code>SELECT</code>) but I have found very very little on the expanded algebra that would include concepts in all of <... | habedi/stack-exchange-dataset |
43,675 | MU0 instruction set | <p>As i know the MU0 processor instruction format is as follows: </p>

<p><img src="https://i.stack.imgur.com/NimNj.png" alt="enter image description here"></p>

<p>so the opcode is 4 bit, can anyone explain why it has only 8 instructions, if it could have 16 instructions, 2^4 = 16 ??</p>
 | computer architecture | 1 | MU0 instruction set -- (computer architecture)
<p>As i know the MU0 processor instruction format is as follows: </p>

<p><img src="https://i.stack.imgur.com/NimNj.png" alt="enter image description here"></p>

<p>so the opcode is 4 bit, can anyone explain why it has only 8 instructions, if it could have ... | habedi/stack-exchange-dataset |
43,678 | Chomsky Normal Form-remove unit production | <p>In the step of removing unit productions when converting a grammar to Chomsky normal form, I sometimes found that the variables may end up having the same production bodies. Is this possible? If so, can we consider these variables identical? For example, given:</p>

<pre><code>S->aAA|aA|A|a
A->bBBB... | context free formal grammars normal forms | 1 | Chomsky Normal Form-remove unit production -- (context free formal grammars normal forms)
<p>In the step of removing unit productions when converting a grammar to Chomsky normal form, I sometimes found that the variables may end up having the same production bodies. Is this possible? If so, can we consider these variab... | habedi/stack-exchange-dataset |
43,697 | Proof that CFL aren't closed under intersection using synchronous parallel (N)PDA composition | <p>It is well known that the class of CFLs is not closed under intersection as follows e.g. from the following example:
$$L_1 \cap L_2 = \left\{ a^mb^mc^n \mid m,n \ge 1 \right\} \cap \left\{ a^mb^nc^n \mid m,n \ge 1 \right\} = \left\{ a^ib^ic^i \mid i \ge 1 \right\} \not \in \mathcal{L_2},$$
where $L_1,L_2 \in... | context free automata closure properties pushdown automata | 1 | Proof that CFL aren't closed under intersection using synchronous parallel (N)PDA composition -- (context free automata closure properties pushdown automata)
<p>It is well known that the class of CFLs is not closed under intersection as follows e.g. from the following example:
$$L_1 \cap L_2 = \left\{ a^mb^mc^n \mi... | habedi/stack-exchange-dataset |
43,709 | Why can't hash tables provide O(n) sorting? | <p>Since a sufficiently large hash table takes constant time to both insert and retrieve data, should it not be possible to sort an array by simply inserting each element into the hash table, and then retrieving them in order?</p>

<p>You just insert each number into the hash table, and remember the lowest and ... | data structures runtime analysis sorting hash tables | 1 | Why can't hash tables provide O(n) sorting? -- (data structures runtime analysis sorting hash tables)
<p>Since a sufficiently large hash table takes constant time to both insert and retrieve data, should it not be possible to sort an array by simply inserting each element into the hash table, and then retrieving them i... | habedi/stack-exchange-dataset |
43,721 | Why would you use a monitor instead of a semaphore? | <p>I am currently attending the concurrent programming course in my university and we recently started talking about the concept of a monitor. While I understand the necessity of mutual exclusion, I do not understand why I would use a monitor for that. </p>

<p>As I understand it, a monitor guarantees that exac... | concurrency synchronization mutual exclusion | 1 | Why would you use a monitor instead of a semaphore? -- (concurrency synchronization mutual exclusion)
<p>I am currently attending the concurrent programming course in my university and we recently started talking about the concept of a monitor. While I understand the necessity of mutual exclusion, I do not understand w... | habedi/stack-exchange-dataset |
43,723 | What is practical difference between NP and PSPACE-complete? | <p>Here's something that has puzzled me lately, and perhaps someone can explain what I'm missing.</p>

<p>Problems in NP are those that can be solved on a NDTM in polynomial time. Now assuming P$\,\neq\,$NP, PSPACE$\,\neq\,$NP etc. this means that there are NP-complete problems that cannot be solved in polynomi... | complexity theory np complete complexity classes | 1 | What is practical difference between NP and PSPACE-complete? -- (complexity theory np complete complexity classes)
<p>Here's something that has puzzled me lately, and perhaps someone can explain what I'm missing.</p>

<p>Problems in NP are those that can be solved on a NDTM in polynomial time. Now assuming P$\,... | habedi/stack-exchange-dataset |
43,731 | Travelling Salesman which can repeat cities | <p>In the TSP problem, we usually assume a complete graph. If we can only visit each city once, we need a complete graph to ensure that there will be a path from every city to every other city. This is easy to accomplish as if there is no straight path between A and B, we can simply assign a new edge whose length is th... | graphs reference request traveling salesman | 1 | Travelling Salesman which can repeat cities -- (graphs reference request traveling salesman)
<p>In the TSP problem, we usually assume a complete graph. If we can only visit each city once, we need a complete graph to ensure that there will be a path from every city to every other city. This is easy to accomplish as if ... | habedi/stack-exchange-dataset |
43,732 | What is the order of this traversal method? | <p>Please see below pseudo-code for finding the max-height of a b-tree</p>

<pre><code>maxDepth()
1. If tree is empty then return 0
2. Else
 (a) Get the max depth of left subtree recursively i.e., 
 call maxDepth( tree->left-subtree)
 (a) Get the max depth of right subtr... | algorithms terminology trees binary trees graph traversal | 1 | What is the order of this traversal method? -- (algorithms terminology trees binary trees graph traversal)
<p>Please see below pseudo-code for finding the max-height of a b-tree</p>

<pre><code>maxDepth()
1. If tree is empty then return 0
2. Else
 (a) Get the max depth of left subtree recursivel... | habedi/stack-exchange-dataset |
43,738 | Complete examples of program correctness proofs | <p>Does anyone have any complete example of a proof of program correctness? I'm talking about something that includes the usual predicate, base case, inductive hypothesis, and inductive step. But also important is the loop invariant, and termination. I'm just not sure what the proper format for something like this is.<... | algorithms reference request programming languages proof techniques correctness proof | 1 | Complete examples of program correctness proofs -- (algorithms reference request programming languages proof techniques correctness proof)
<p>Does anyone have any complete example of a proof of program correctness? I'm talking about something that includes the usual predicate, base case, inductive hypothesis, and induc... | habedi/stack-exchange-dataset |
43,740 | When did polynomial-time algorithm become of interest? | <p>I would like to understand why and when polynomial algorithms became of interest.</p>

<p>When did people realize the role and importance of efficient versus non-efficient algorithms? Did that happen when the concept of an algorithm was discovered, or the the term algorithm used.</p>

<p>For instance... | algorithms reference request efficiency polynomial time history | 1 | When did polynomial-time algorithm become of interest? -- (algorithms reference request efficiency polynomial time history)
<p>I would like to understand why and when polynomial algorithms became of interest.</p>

<p>When did people realize the role and importance of efficient versus non-efficient algorithms? D... | habedi/stack-exchange-dataset |
43,744 | Fast algorithm for interpolating data from polar coordinates to cartesian coordinates | <p>I have a set of solution nodes generated over a polar grid. I would like to convert / interpolate these solution nodes onto a Cartesian grid:</p>

<p><img src="https://i.imgur.com/6jI9yWX.png" alt="polar-to-cart"> </p>

<p>That is, using the image above, for each node in the Cartesian grid I would in... | algorithms computational geometry | 1 | Fast algorithm for interpolating data from polar coordinates to cartesian coordinates -- (algorithms computational geometry)
<p>I have a set of solution nodes generated over a polar grid. I would like to convert / interpolate these solution nodes onto a Cartesian grid:</p>

<p><img src="https://i.imgur.com/6jI9... | habedi/stack-exchange-dataset |
43,748 | Algorithm for automatic/optimal database joins? | <p>I'm curious if there is existing literature or well known algorithms out there for a problem I am working on. </p>

<p>Given a normalized relational database with valid foreign key constraints and a list of fields across different tables, what is a good or at least consistent algorithm for determining the (i... | algorithms data structures optimization database theory databases | 1 | Algorithm for automatic/optimal database joins? -- (algorithms data structures optimization database theory databases)
<p>I'm curious if there is existing literature or well known algorithms out there for a problem I am working on. </p>

<p>Given a normalized relational database with valid foreign key constrain... | habedi/stack-exchange-dataset |
43,752 | $A$ is finite, $B$ is NPC - When there's a polynomial reduction from $A$ to $B$? | <blockquote>
 <p>$A$ is finite, $B$ is NPC - When there's a polynomial reduction from $A$ to $B$?</p>
</blockquote>

<p>Basically, I've understood that if $A$ is finite, then there's a reduction for every $B$ which isn't trivial (empty or $\Sigma^*$).</p>

<p>BUT, if $B$ is NPC then $B\ne \empt... | complexity theory reductions | 1 | $A$ is finite, $B$ is NPC - When there's a polynomial reduction from $A$ to $B$? -- (complexity theory reductions)
<blockquote>
 <p>$A$ is finite, $B$ is NPC - When there's a polynomial reduction from $A$ to $B$?</p>
</blockquote>

<p>Basically, I've understood that if $A$ is finite, then there's a red... | habedi/stack-exchange-dataset |
43,762 | How does this Turing machine accept $a^n b^n$? | <p>I'm reading <a href="https://courses.engr.illinois.edu/cs373/sp2013/Lectures/lec19.pdf" rel="nofollow noreferrer">this tutorial from the University of Illinois</a> about Turing Machines, and I don't understand something.</p>

<p>They give a pseudocode algorithm for an machine that accepts strings from the la... | formal languages turing machines automata correctness proof | 1 | How does this Turing machine accept $a^n b^n$? -- (formal languages turing machines automata correctness proof)
<p>I'm reading <a href="https://courses.engr.illinois.edu/cs373/sp2013/Lectures/lec19.pdf" rel="nofollow noreferrer">this tutorial from the University of Illinois</a> about Turing Machines, and I don't unders... | habedi/stack-exchange-dataset |
43,763 | Cache question help me here? | <p>Quantify the effect in performance which comes from using the cache ,if We are going to use a program which is made from 500 machine instructions ,from which 100 are in a cycle which is executed 25 times.Suppose that the main memory has a memory stall of 10 units of time and the cache memory has a stall of 1 unit.</... | cpu cache memory hardware | 1 | Cache question help me here? -- (cpu cache memory hardware)
<p>Quantify the effect in performance which comes from using the cache ,if We are going to use a program which is made from 500 machine instructions ,from which 100 are in a cycle which is executed 25 times.Suppose that the main memory has a memory stall of 10... | habedi/stack-exchange-dataset |
43,766 | How do you swap consecutive boxes on a Turing Machine tape? | <p>I can't figure out how to swap boxes on a Turing Machine tape.</p>

<p>So for example, I have a tape that says</p>

<pre><code>a 1 0 1 1 1 0
^
</code></pre>

<p>And I want to move that <code>a</code> over so that it is in the middle. (but my end goal is not important here)</p>
&#x... | turing machines | 1 | How do you swap consecutive boxes on a Turing Machine tape? -- (turing machines)
<p>I can't figure out how to swap boxes on a Turing Machine tape.</p>

<p>So for example, I have a tape that says</p>

<pre><code>a 1 0 1 1 1 0
^
</code></pre>

<p>And I want to move that <code>a</code> over... | habedi/stack-exchange-dataset |
43,771 | How can I prove algorithm correctness? | <p>How can I prove algorithm correctness ?
when i face a problem and come up with a solution the only way to know if this a valid solution or not is by trying some test cases. if they pass through the algorithm and produce the expected output then my algorithm most properly true.
but obviously this is not hold ... | algorithms algorithm analysis | 1 | How can I prove algorithm correctness? -- (algorithms algorithm analysis)
<p>How can I prove algorithm correctness ?
when i face a problem and come up with a solution the only way to know if this a valid solution or not is by trying some test cases. if they pass through the algorithm and produce the expected output... | habedi/stack-exchange-dataset |
43,778 | Can Tarjan's SCC algorithm find satisfying assignment to just 'any' digraph? | <p>Is Tarjan's algorithm capable of finding satisfying assignment to any digraph consists of variables (vertices) and implications (edges)? I know that it solves implication graphs constructed by 2SAT clauses, but I wonder if the algorithm can handle the digraphs which cannot be expressed as 2SAT clauses. Let me clarif... | satisfiability | 1 | Can Tarjan's SCC algorithm find satisfying assignment to just 'any' digraph? -- (satisfiability)
<p>Is Tarjan's algorithm capable of finding satisfying assignment to any digraph consists of variables (vertices) and implications (edges)? I know that it solves implication graphs constructed by 2SAT clauses, but I wonder ... | habedi/stack-exchange-dataset |
43,779 | Is an inverse homomorphism always a homomorphism? | <p>Given a homomorphism $h: \Sigma \rightarrow \Delta^*$ such that e.g. $\forall a \in \Sigma: h(a) = \delta$, where $\delta \in \Delta$ (i.e. all symbols from the alphabet $\Sigma$ have the same image $\delta$), is the inverse homomorphism $h^{-1}$ a homomorphism?</p>

<p>Since a homomorphism maps every symbol... | formal languages | 1 | Is an inverse homomorphism always a homomorphism? -- (formal languages)
<p>Given a homomorphism $h: \Sigma \rightarrow \Delta^*$ such that e.g. $\forall a \in \Sigma: h(a) = \delta$, where $\delta \in \Delta$ (i.e. all symbols from the alphabet $\Sigma$ have the same image $\delta$), is the inverse homomorphism $h^{-1}... | habedi/stack-exchange-dataset |
43,782 | Why is it true that $NP \ne coNP \implies X = \emptyset$? | <p>Let the class of languages $$X = \{ L \ | \ L\in NPC \land L\in coNPC\}$$</p>

<p>Why is it true that $NP \ne coNP \implies X = \emptyset$?</p>
 | complexity theory computability | 1 | Why is it true that $NP \ne coNP \implies X = \emptyset$? -- (complexity theory computability)
<p>Let the class of languages $$X = \{ L \ | \ L\in NPC \land L\in coNPC\}$$</p>

<p>Why is it true that $NP \ne coNP \implies X = \emptyset$?</p>
 | habedi/stack-exchange-dataset |
43,788 | Why is my proof wrong for $L = H_{TM} \cap \overline{A_{TM}} $ | <p>$A_{TM} = \{<M,w> | $ M is a TM and M accepts w $\}$</p>

<p>$H_{TM} = \{<M,w> | $ M is a TM and M halts on w $\}$</p>

<p>I thought that $L = H_{TM} \cap \overline{A_{TM}} \in R$</p>

<p>But I saw the proof for why $L \in RE \setminus R$</p>

<p>But I don't understand w... | turing machines undecidability | 1 | Why is my proof wrong for $L = H_{TM} \cap \overline{A_{TM}} $ -- (turing machines undecidability)
<p>$A_{TM} = \{<M,w> | $ M is a TM and M accepts w $\}$</p>

<p>$H_{TM} = \{<M,w> | $ M is a TM and M halts on w $\}$</p>

<p>I thought that $L = H_{TM} \cap \overline{A_{TM}} \in R$</p>
... | habedi/stack-exchange-dataset |
43,793 | Find all the paths from node A to node B | <p>You are given a bunch of nodes evenly spaced in a rectangular grid. The rectangle is M nodes long and N nodes wide. Node A is in the upper left hand (northwest) corner and node B is at the bottom right hand corner (southeast). From each node you can only move east, south, or diagonally southeast to the next adjacent... | algorithms graphs shortest path enumeration | 1 | Find all the paths from node A to node B -- (algorithms graphs shortest path enumeration)
<p>You are given a bunch of nodes evenly spaced in a rectangular grid. The rectangle is M nodes long and N nodes wide. Node A is in the upper left hand (northwest) corner and node B is at the bottom right hand corner (southeast). ... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.