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 |
|---|---|---|---|---|---|---|
35,758 | Why is it the lower the h(n) cost the more nodes need to be expanded in A*? | <p>Why is it the lower the h(n) cost the more nodes need to be expanded in A*?</p>

<p>As found here - <a href="http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html" rel="nofollow">http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html</a></p>

<blockquote>
 <p>If h(n) is al... | algorithm analysis search algorithms heuristics | 1 | Why is it the lower the h(n) cost the more nodes need to be expanded in A*? -- (algorithm analysis search algorithms heuristics)
<p>Why is it the lower the h(n) cost the more nodes need to be expanded in A*?</p>

<p>As found here - <a href="http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html" rel=... | habedi/stack-exchange-dataset |
35,759 | What would be the real-world implications of a constructive $P=NP$ proof? | <p>I have a high-level understanding of the $P=NP$ problem and I understand that if it were absolutely "proven" to be true with a provided solution, it would open the door for solving numerous problems within the realm of computer science.</p>

<p>My question is, if someone were to publish a indisputable, const... | complexity theory p vs np | 1 | What would be the real-world implications of a constructive $P=NP$ proof? -- (complexity theory p vs np)
<p>I have a high-level understanding of the $P=NP$ problem and I understand that if it were absolutely "proven" to be true with a provided solution, it would open the door for solving numerous problems within the re... | habedi/stack-exchange-dataset |
35,764 | Group isomorphism to graph ismorphism | <p>In reading some blogs about computational complexity (for example <a href="http://rjlipton.wordpress.com/2013/05/11/advances-on-group-isomorphism/">here</a>)I assimilated the notion that deciding if two groups are isomorphic is easier than testing two graphs for isomorphism. For example, on the stated page it says t... | complexity theory graph isomorphism group theory | 1 | Group isomorphism to graph ismorphism -- (complexity theory graph isomorphism group theory)
<p>In reading some blogs about computational complexity (for example <a href="http://rjlipton.wordpress.com/2013/05/11/advances-on-group-isomorphism/">here</a>)I assimilated the notion that deciding if two groups are isomorphic ... | habedi/stack-exchange-dataset |
35,787 | Do I require loading in this example of load store architecture? | <p>I'm currently revising for my Concurrent Programming exam and I'm going through the past papers and one question poses the following process: </p>

<pre><code>Process P1
 integer x;
1a: x = a + a;
1b: b = x;
end P1;
</code></pre>

<p>and asks the following question:</p>

<... | computer architecture | 1 | Do I require loading in this example of load store architecture? -- (computer architecture)
<p>I'm currently revising for my Concurrent Programming exam and I'm going through the past papers and one question poses the following process: </p>

<pre><code>Process P1
 integer x;
1a: x = a + a;
1b: b = ... | habedi/stack-exchange-dataset |
35,794 | Partial order, total order, and version order in transaction histories | <p>In Section 3.1.2 "Transaction Histories" of the <a href="http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-786.pdf" rel="nofollow">PhD thesis by Atul Adya [1]</a>:</p>

<blockquote>
 <p>A <em>history</em> $H$ over a set of transactions consists of two parts: (1) a <strong>partial order</strong> ... | terminology database theory | 1 | Partial order, total order, and version order in transaction histories -- (terminology database theory)
<p>In Section 3.1.2 "Transaction Histories" of the <a href="http://publications.csail.mit.edu/lcs/pubs/pdf/MIT-LCS-TR-786.pdf" rel="nofollow">PhD thesis by Atul Adya [1]</a>:</p>

<blockquote>
 <p>A <em>... | habedi/stack-exchange-dataset |
35,796 | What's the algorithm for floating points equality test? | <p>I've found that <code>0.1 + 0.2 == 0.3</code> is not true in Java (see this <a href="http://ideone.com/kK27xF" rel="nofollow">demo</a>).</p>

<p>So, I'm interested in how equality testing can be implemented for floats. Is there a standardized algorithm?</p>
 | floating point | 1 | What's the algorithm for floating points equality test? -- (floating point)
<p>I've found that <code>0.1 + 0.2 == 0.3</code> is not true in Java (see this <a href="http://ideone.com/kK27xF" rel="nofollow">demo</a>).</p>

<p>So, I'm interested in how equality testing can be implemented for floats. Is there a sta... | habedi/stack-exchange-dataset |
35,799 | Do $s$-$t$ cuts partition contingent vertices? | <p>The definition of an $s$-$t$ cut is a partition of the set of vertices $V$ into $2$ sets $(A, B)$ with $s$ in $A$ and $t$ in $B$. My understanding of set partitions is that the positioning of elements in the graph does not matter.</p>

<p>However, if this is the correct notion of partitioning, then can const... | algorithms graphs | 1 | Do $s$-$t$ cuts partition contingent vertices? -- (algorithms graphs)
<p>The definition of an $s$-$t$ cut is a partition of the set of vertices $V$ into $2$ sets $(A, B)$ with $s$ in $A$ and $t$ in $B$. My understanding of set partitions is that the positioning of elements in the graph does not matter.</p>

<p>... | habedi/stack-exchange-dataset |
35,803 | Efficient algorithm to find vertex with paths to every other vertex | <p>$G=<V,E>$ is a directed graph. I need to write an efficient algorithm that finds a $v \in V$ such that there exists a path $\forall w \in V$ $v \rightarrow w$ ($v$ has a path to every other vertex), or "false" if there aren't any. If there are more than one, return one of them.</p>

<p>The obvious and ... | algorithms graphs search algorithms | 1 | Efficient algorithm to find vertex with paths to every other vertex -- (algorithms graphs search algorithms)
<p>$G=<V,E>$ is a directed graph. I need to write an efficient algorithm that finds a $v \in V$ such that there exists a path $\forall w \in V$ $v \rightarrow w$ ($v$ has a path to every other vertex), or ... | habedi/stack-exchange-dataset |
35,805 | NLP - Deep belief neural networks or logic? | <p>The NLP progresses seems to me that has split in two big group of thoughts:</p>

<ol>
<li><p>Deep learning have a neural network with multiple layers that has been trained and learned to represent knowledge and understand the meaning of sentences. However, such system would be difficult to debug and corr... | natural language processing | 1 | NLP - Deep belief neural networks or logic? -- (natural language processing)
<p>The NLP progresses seems to me that has split in two big group of thoughts:</p>

<ol>
<li><p>Deep learning have a neural network with multiple layers that has been trained and learned to represent knowledge and understand the me... | habedi/stack-exchange-dataset |
35,819 | How do I efficiently checking if a string matches any substring in a collection | <p>I have a collection of substrings</p>

<pre><code>"this" "is" "a" "antelope"
</code></pre>

<p>I need to look at any given string and answer the question "Are any of the given substrings in this string"</p>

<p>So my input string might be</p>

<pre><code>"issue"
</code></pre>&... | algorithms strings | 1 | How do I efficiently checking if a string matches any substring in a collection -- (algorithms strings)
<p>I have a collection of substrings</p>

<pre><code>"this" "is" "a" "antelope"
</code></pre>

<p>I need to look at any given string and answer the question "Are any of the given substrings in thi... | habedi/stack-exchange-dataset |
35,820 | Different boolean degrees polynomially related? | <p>Let $f$ be a Boolean function.</p>

<p>Let $p$ be the minimum degree real polynomial that represents $f$ with degree $d_f$. </p>

<p>Let $p_\epsilon$ be the minimum degree real polynomial with degree $d_{f,\epsilon}$ such that $$|p_\epsilon(x)-f(x)|\leq\epsilon.$$</p>

<p>Let $p_{0,\epsilon}$... | complexity theory | 1 | Different boolean degrees polynomially related? -- (complexity theory)
<p>Let $f$ be a Boolean function.</p>

<p>Let $p$ be the minimum degree real polynomial that represents $f$ with degree $d_f$. </p>

<p>Let $p_\epsilon$ be the minimum degree real polynomial with degree $d_{f,\epsilon}$ such that $$|... | habedi/stack-exchange-dataset |
35,822 | Randomized and deterministic reduction | <p>Given a problem $X$, to show it is is $\sf NP$-complete, one usually shows a deterministic reduction from an $\sf NP$-complete problem.</p>

<p>If it is hard to show deterministic reduction, then one shows a randomized reduction.</p>

<ol>
<li><p>What does a deterministic reduction give about the... | np complete reductions | 1 | Randomized and deterministic reduction -- (np complete reductions)
<p>Given a problem $X$, to show it is is $\sf NP$-complete, one usually shows a deterministic reduction from an $\sf NP$-complete problem.</p>

<p>If it is hard to show deterministic reduction, then one shows a randomized reduction.</p>

... | habedi/stack-exchange-dataset |
35,825 | Identical register input operands in assembly | <p>The question is not specific to any processor.
Can I have an assembly instruction, like:</p>
<pre><code> ADD R1 R0 R0
</code></pre>
<p><code>R1</code> is the destination.</p>
<p>My understanding is that, if the register file in a processor supports 2 simultaneous reads in a clock cycle (i.e. 2 re... | computer architecture cpu pipelines | 1 | Identical register input operands in assembly -- (computer architecture cpu pipelines)
<p>The question is not specific to any processor.
Can I have an assembly instruction, like:</p>
<pre><code> ADD R1 R0 R0
</code></pre>
<p><code>R1</code> is the destination.</p>
<p>My understanding is that, if the... | habedi/stack-exchange-dataset |
35,836 | Lower-bounds of a given problem | <p>I have the following problem:</p>

<blockquote>
 <p>You have n objects that have identical weight except for one that is a
 bit heavier than the others. You have a balance scale. You can place
 objects on each side of the scale and see which collection is heavier.</p>
 
 <p>Goal is t... | complexity theory lower bounds | 1 | Lower-bounds of a given problem -- (complexity theory lower bounds)
<p>I have the following problem:</p>

<blockquote>
 <p>You have n objects that have identical weight except for one that is a
 bit heavier than the others. You have a balance scale. You can place
 objects on each side of the scal... | habedi/stack-exchange-dataset |
35,840 | Knight's tour from all starting positions | <p>Is it true that for all $n\geq 5$, there is a knight's tour of an $n\times n$ chessboard beginning at every square?</p>

<p>For example, is it correct, that there is no solution for a $5\times5$ board,
with start position $(5,4)$?</p>
 | graphs | 1 | Knight's tour from all starting positions -- (graphs)
<p>Is it true that for all $n\geq 5$, there is a knight's tour of an $n\times n$ chessboard beginning at every square?</p>

<p>For example, is it correct, that there is no solution for a $5\times5$ board,
with start position $(5,4)$?</p>
 | habedi/stack-exchange-dataset |
35,845 | Prims Algorithm MST | <p>I have this problem : </p>

<p><img src="https://i.stack.imgur.com/XjdGf.png" alt="enter image description here">
And here's my attempted solution, <img src="https://i.stack.imgur.com/SvSz6.png" alt="enter image description here"></p>

<p>could someone inform on whether it's correct</p>

... | algorithms spanning trees | 1 | Prims Algorithm MST -- (algorithms spanning trees)
<p>I have this problem : </p>

<p><img src="https://i.stack.imgur.com/XjdGf.png" alt="enter image description here">
And here's my attempted solution, <img src="https://i.stack.imgur.com/SvSz6.png" alt="enter image description here"></p>

<p>could s... | habedi/stack-exchange-dataset |
35,848 | Why is CAN protocol preferred to be used in automotive application? | <p>Is it only because of the fact that it is asynchronous and can be used for long distance message transfer. An example of where other protocols will fail would help.
Thanks. </p>
 | computer networks communication protocols | 1 | Why is CAN protocol preferred to be used in automotive application? -- (computer networks communication protocols)
<p>Is it only because of the fact that it is asynchronous and can be used for long distance message transfer. An example of where other protocols will fail would help.
Thanks. </p>
 | habedi/stack-exchange-dataset |
35,859 | Validity of reduction (3-SAT) | <p>I'm trying to show that a special variant of the common 3-SAT is NP-complete by reducing 3-SAT to this special variant.</p>

<p>This special variant works like the normal 3CNF-SAT, except every other clause is conjunctive instead of disjunctive. For example an instance of this variant could be
$(x \vee y... | np complete reductions 3 sat | 1 | Validity of reduction (3-SAT) -- (np complete reductions 3 sat)
<p>I'm trying to show that a special variant of the common 3-SAT is NP-complete by reducing 3-SAT to this special variant.</p>

<p>This special variant works like the normal 3CNF-SAT, except every other clause is conjunctive instead of disjunctive.... | habedi/stack-exchange-dataset |
35,865 | Given this transition system, for which states are these (very basic) LTL formulas fulfilled? | <p>I missed a lot of lectures for this module due to surgery so I'm trying to teach it to myself now. This is the question I've been working on:</p>

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

<p>First of all, would I be correct in saying that the LTL form... | logic model checking linear temporal logic temporal logic | 1 | Given this transition system, for which states are these (very basic) LTL formulas fulfilled? -- (logic model checking linear temporal logic temporal logic)
<p>I missed a lot of lectures for this module due to surgery so I'm trying to teach it to myself now. This is the question I've been working on:</p>

<p><i... | habedi/stack-exchange-dataset |
35,869 | How to count bits in cache (direct & 4-way) | <p>Let's say, I have a cache with:</p>

<ul>
<li>2^32 bytes of memory </li>
<li>2048 blocks (of 16 bytes each)</li>
</ul>

<p>Now I'm trying to figure out how much bits each field will contain.</p>

<p>Direct mapped: </p>

<p>One block is 16 bytes (16 * 8 = 128 bits). The blo... | computer architecture cpu cache | 1 | How to count bits in cache (direct & 4-way) -- (computer architecture cpu cache)
<p>Let's say, I have a cache with:</p>

<ul>
<li>2^32 bytes of memory </li>
<li>2048 blocks (of 16 bytes each)</li>
</ul>

<p>Now I'm trying to figure out how much bits each field will contain.</p>

<p>D... | habedi/stack-exchange-dataset |
35,876 | Maximum non-intersecting subset of circles | <p>We are given a set of circles, stored by their center points in an array $A$. In particular, the center of the $i$th circle is at coordinates $(A[i].x, A[i].y)$. All the circles have radius of $k$.</p>

<p>I want to find a subset of circles such that no circles in this subset intersect with each other, suc... | algorithms np hard backtracking | 1 | Maximum non-intersecting subset of circles -- (algorithms np hard backtracking)
<p>We are given a set of circles, stored by their center points in an array $A$. In particular, the center of the $i$th circle is at coordinates $(A[i].x, A[i].y)$. All the circles have radius of $k$.</p>

<p>I want to find a subs... | habedi/stack-exchange-dataset |
35,885 | How can GIF compression be lossless if the maximum # of colors is 256? | <p>I'm reading "Computer Science Made Simple" by V. Anton Spraul, and in the chapter about Graphics, he describes GIF files as follows:</p>

<blockquote>
 <p>A GIF file uses lossless compression to store an image with a maximum of 256 different colors.</p>
</blockquote>

<p>The way I read this,... | image processing data compression | 1 | How can GIF compression be lossless if the maximum # of colors is 256? -- (image processing data compression)
<p>I'm reading "Computer Science Made Simple" by V. Anton Spraul, and in the chapter about Graphics, he describes GIF files as follows:</p>

<blockquote>
 <p>A GIF file uses lossless compression to... | habedi/stack-exchange-dataset |
35,890 | What is the relation between arithmetic circuits and straight line programs? | <p>One definition of <em>arithmetic circuits</em> is as follows:</p>

<blockquote>
 <p>An arithmetic circuit $\Phi$ over the field $\mathbb F$ and the set of variables $X$ usually, $X = \{x_1, \dots , x_n\}$) is a directed acyclic graph as follows. The vertices of $\Phi$ are called gates. Every gate in $\... | complexity theory circuits | 1 | What is the relation between arithmetic circuits and straight line programs? -- (complexity theory circuits)
<p>One definition of <em>arithmetic circuits</em> is as follows:</p>

<blockquote>
 <p>An arithmetic circuit $\Phi$ over the field $\mathbb F$ and the set of variables $X$ usually, $X = \{x_1, \dot... | habedi/stack-exchange-dataset |
35,894 | Why is the Kleene star operator also called the Kleene 'closure' operator? | <p>I've found that if I don't understand the etymology behind a cs/programming term, it usually means that I've missed or misunderstood some important underlying concept.</p>

<p>I don't understand why the Kleene star is also called the Kleene closure.
Is it related to closures in programming, a function wi... | automata regular expressions | 1 | Why is the Kleene star operator also called the Kleene 'closure' operator? -- (automata regular expressions)
<p>I've found that if I don't understand the etymology behind a cs/programming term, it usually means that I've missed or misunderstood some important underlying concept.</p>

<p>I don't understand why t... | habedi/stack-exchange-dataset |
35,897 | Is Karnaugh Map possible for Maxterms? | <p>I read about Minterms i.e. sums of products, simplification using
Karnaugh Graph. Can this graph be used for Maxterms, i.e. products
of sums, as well? If yes, then how?</p>

<p>If not, then is there some other similar way to use, for simplification of Maxterms? I know, one can always convert Maxterm... | logic digital circuits karnaugh map | 1 | Is Karnaugh Map possible for Maxterms? -- (logic digital circuits karnaugh map)
<p>I read about Minterms i.e. sums of products, simplification using
Karnaugh Graph. Can this graph be used for Maxterms, i.e. products
of sums, as well? If yes, then how?</p>

<p>If not, then is there some other similar way... | habedi/stack-exchange-dataset |
35,899 | How to compute max jump distance | <p>I have a BNE-instruction (32 bits), which contains 16 bits for the jump field:</p>

<ul>
<li>Opcode A[31:26]</li>
<li>RS A[25:21]</li>
<li>RT A[20:16]</li>
<li>Immed A[15:0] </li>
</ul>

<p>Assuming the BNE-instruction will now be written in 64 bits format, what would be the (new)... | computer architecture | 1 | How to compute max jump distance -- (computer architecture)
<p>I have a BNE-instruction (32 bits), which contains 16 bits for the jump field:</p>

<ul>
<li>Opcode A[31:26]</li>
<li>RS A[25:21]</li>
<li>RT A[20:16]</li>
<li>Immed A[15:0] </li>
</ul>

<p>Assuming the BNE-instruction wi... | habedi/stack-exchange-dataset |
35,900 | Looking for a paper comparing NLP methods with Data Mining techniques | <p>I've recently attended a conference, where one of the participants mentioned a recent paper published by a Google employee, which showed that using data mining techniques in application to NLP might sometimes give better results than using the NLP methods themselves.</p>

<p>That was the only description he ... | data mining natural language processing | 1 | Looking for a paper comparing NLP methods with Data Mining techniques -- (data mining natural language processing)
<p>I've recently attended a conference, where one of the participants mentioned a recent paper published by a Google employee, which showed that using data mining techniques in application to NLP might som... | habedi/stack-exchange-dataset |
35,918 | Pushdown Automata: CFG to PDA | <p>I have the following grammar for a context-free language:</p>

<p>$G = (\{S,A,B\}, \{x,y,z\}, P, S)$ with
$P = \{S \rightarrow A, A \rightarrow xAz, A \rightarrow xBz, B \rightarrow y\}$</p>

<p>My question is: <strong>How to construct a pushdown automaton associated with the above grammar?</stro... | formal languages context free formal grammars pushdown automata | 1 | Pushdown Automata: CFG to PDA -- (formal languages context free formal grammars pushdown automata)
<p>I have the following grammar for a context-free language:</p>

<p>$G = (\{S,A,B\}, \{x,y,z\}, P, S)$ with
$P = \{S \rightarrow A, A \rightarrow xAz, A \rightarrow xBz, B \rightarrow y\}$</p>

<p>My ... | habedi/stack-exchange-dataset |
35,919 | Relations among different boolean approximations | <p>Essentially similar question to here <a href="https://cs.stackexchange.com/questions/35820/different-boolean-degrees-polynomially-related">Different boolean degrees polynomially related?</a> (change being error condition $\epsilon\in(0,1)$).</p>

<p>Let $p$ be the minimum degree (of degree $d_f$) real polyno... | complexity theory polynomials | 1 | Relations among different boolean approximations -- (complexity theory polynomials)
<p>Essentially similar question to here <a href="https://cs.stackexchange.com/questions/35820/different-boolean-degrees-polynomially-related">Different boolean degrees polynomially related?</a> (change being error condition $\epsilon\in... | habedi/stack-exchange-dataset |
35,931 | What context free grammar generates the language $L(G) = \{a^ib^jc^{2i}d^m\}$ | <p>I am struggling to think of the context-free grammar that generates the language $L(G) = \{a^ib^jc^{2i}d^m\}$, where $i$, $j$ and $m$ are natural numbers.</p>

<p>Also, in general, are there any good methods or ways of thinking that help one to think of context free grammars that generate a given language. A... | formal languages context free formal grammars | 1 | What context free grammar generates the language $L(G) = \{a^ib^jc^{2i}d^m\}$ -- (formal languages context free formal grammars)
<p>I am struggling to think of the context-free grammar that generates the language $L(G) = \{a^ib^jc^{2i}d^m\}$, where $i$, $j$ and $m$ are natural numbers.</p>

<p>Also, in general,... | habedi/stack-exchange-dataset |
35,939 | Sums of all pairs: possible less than quadratic? | <p>Is there an algorithm to prepare all sums of pairs of a list ($L$, size $n$, max value $m$) in $< O(n^2)$ such that query "<em>does this sum of pairs exist</em>" takes $< O(n)$? In other words, can max value $m$ be used to advantage?</p>

<p>E.g. in $L =\{1, 2, 4, 8\}$ and $m = 8$, all (distinct) sums... | divide and conquer | 1 | Sums of all pairs: possible less than quadratic? -- (divide and conquer)
<p>Is there an algorithm to prepare all sums of pairs of a list ($L$, size $n$, max value $m$) in $< O(n^2)$ such that query "<em>does this sum of pairs exist</em>" takes $< O(n)$? In other words, can max value $m$ be used to advantage?</p>... | habedi/stack-exchange-dataset |
35,944 | What does $\Sigma^0_2$-hard and $\Pi^0_2$-hard for a TM's Acceptance Problem mean? | <p>I'm reading about a Turing Machine $M$ and it says the problem of deciding whether M accepts a string is "$\Sigma^0_2$-hard and $\Pi^0_2$-hard".</p>

<p>I haven't seen this kind of notation before and haven't found a good answer from searching. Is this a more specific form of saying NP-hard? </p>
 | turing machines np complete np hard | 1 | What does $\Sigma^0_2$-hard and $\Pi^0_2$-hard for a TM's Acceptance Problem mean? -- (turing machines np complete np hard)
<p>I'm reading about a Turing Machine $M$ and it says the problem of deciding whether M accepts a string is "$\Sigma^0_2$-hard and $\Pi^0_2$-hard".</p>

<p>I haven't seen this kind of not... | habedi/stack-exchange-dataset |
35,951 | Detect if a sentence is in passive voice | <p>Given an English sentence, I am looking for a programmatic way to tell whether the sentence is written in passive voice.</p>

<p>Currently, I just check if there is a <code>was</code> or <code>were</code> inside the sentence. If yes, then the function will say that the sentence is in passive voice (I do no n... | natural language processing | 1 | Detect if a sentence is in passive voice -- (natural language processing)
<p>Given an English sentence, I am looking for a programmatic way to tell whether the sentence is written in passive voice.</p>

<p>Currently, I just check if there is a <code>was</code> or <code>were</code> inside the sentence. If yes, t... | habedi/stack-exchange-dataset |
35,956 | To detect isomorphic graphs Is it enough to check if they have the same number of same degree vertices? | <p>Given two lists of non directional graph edges e.g.
 [(1,3),(3,5),(5,1),(5,7)] [(4,5),(2,3),(3,4),(4,2)]
In order to check if the two graphs are isomorphic is it enough to count the vertices with the same degree between them?</p>

<pre><code>e.g. Vertice 1: 2 1: 0
 2: 0 2: 2... | graphs | 1 | To detect isomorphic graphs Is it enough to check if they have the same number of same degree vertices? -- (graphs)
<p>Given two lists of non directional graph edges e.g.
 [(1,3),(3,5),(5,1),(5,7)] [(4,5),(2,3),(3,4),(4,2)]
In order to check if the two graphs are isomorphic is it enough to count the vertices wi... | habedi/stack-exchange-dataset |
35,963 | Subset-sum approximation algorithm running time | <p>in 35.5 of CLRS i have read about algorithm to find sum as large as possible, but not larger than $t.$ </p>

<p>Essential part of this algorithm is trimming. On every step you delete all numbers which close one to another, but one to represent them all. <a href="http://www.cs.ust.hk/mjg_lib/Classes/COMP572_... | algorithms algorithm analysis approximation | 1 | Subset-sum approximation algorithm running time -- (algorithms algorithm analysis approximation)
<p>in 35.5 of CLRS i have read about algorithm to find sum as large as possible, but not larger than $t.$ </p>

<p>Essential part of this algorithm is trimming. On every step you delete all numbers which close one t... | habedi/stack-exchange-dataset |
35,964 | Reductions where the number of certificates from one problem can be computed for another to varying degrees | <p>Let $A$ and $B$ be two decision problems in $NP$. Consider three cases:</p>

<p>(1) For any instance of problem $A$, one can produce, in polynomial time, an instance of problem $B$ having exactly the same number of solutions as $A$.</p>

<p>(2) For any instance of problem $A$, one can produce, in pol... | complexity theory reductions np | 1 | Reductions where the number of certificates from one problem can be computed for another to varying degrees -- (complexity theory reductions np)
<p>Let $A$ and $B$ be two decision problems in $NP$. Consider three cases:</p>

<p>(1) For any instance of problem $A$, one can produce, in polynomial time, an instanc... | habedi/stack-exchange-dataset |
35,969 | Computability of equality to zero for a simple language | <p>Suppose we have a tree in which leaves are labeled with a set of numbers $L$, and internal nodes with a set of operations $O$.</p>

<p>In particular $L$ can be $\mathbb{N}, \mathbb{Z}$ or $\mathbb{Q}$, and can optionally contain $\pi$ and/or $e$.
$O$ can be any subset of $\{+,-,\cdot,/,\hat\ \}$.</p>
... | algorithms turing machines real numbers equality | 1 | Computability of equality to zero for a simple language -- (algorithms turing machines real numbers equality)
<p>Suppose we have a tree in which leaves are labeled with a set of numbers $L$, and internal nodes with a set of operations $O$.</p>

<p>In particular $L$ can be $\mathbb{N}, \mathbb{Z}$ or $\mathbb{Q}... | habedi/stack-exchange-dataset |
35,971 | Is a Karp–Levin reduction a Levin reduction? | <p>My understanding is that Karp many-one reductions are more general than Levin many-one reductions, and that Levin many-one reductions must allow for the number of certificates for a problem $A$ reduced to $B$ to be recovered from a single oracle call giving the number of certificates for $B$.</p>

<p>So, wha... | complexity theory terminology | 1 | Is a Karp–Levin reduction a Levin reduction? -- (complexity theory terminology)
<p>My understanding is that Karp many-one reductions are more general than Levin many-one reductions, and that Levin many-one reductions must allow for the number of certificates for a problem $A$ reduced to $B$ to be recovered from a singl... | habedi/stack-exchange-dataset |
35,975 | Smallest possible integer not obtained from sumset | <p>Given a number N, and some set $A=\{a, 1\le a\le N\}$, and let $B=\{\text{every integer} \in [1,N]\}$, and $C=B\setminus A$ (Set C has all values from B not in A)</p>

<p>What is the best way of finding the smallest number ($S$) that can't be obtained from the sum of any subset of C?</p>

<p>i.e.<br>... | combinatorics number theory | 1 | Smallest possible integer not obtained from sumset -- (combinatorics number theory)
<p>Given a number N, and some set $A=\{a, 1\le a\le N\}$, and let $B=\{\text{every integer} \in [1,N]\}$, and $C=B\setminus A$ (Set C has all values from B not in A)</p>

<p>What is the best way of finding the smallest number ($... | habedi/stack-exchange-dataset |
35,979 | When should you disable all interrupts in a program? | <p>Consider a machine that has nested interrupts (a higher priority interrupt can interrupt a lower priority one, the current instruction's address is saved and later restored). Why would a programmer want to disable all interrupts using instructions like x86's CLI when you know that even when your code gets interrupte... | operating systems concurrency | 1 | When should you disable all interrupts in a program? -- (operating systems concurrency)
<p>Consider a machine that has nested interrupts (a higher priority interrupt can interrupt a lower priority one, the current instruction's address is saved and later restored). Why would a programmer want to disable all interrupts ... | habedi/stack-exchange-dataset |
35,994 | Why does Randomized Quicksort have O(n log n) worst-case runtime cost | <p><strong>Randomized Quick Sort</strong> is an extension of Quick Sort in which the pivot element is chosen randomly. What can be the worst case time complexity of this algorithm. According to me, it should be <span class="math-container">$O(n^2)$</span>, as the worst case happens when randomly chosen pivot is selecte... | algorithm analysis runtime analysis sorting quicksort | 1 | Why does Randomized Quicksort have O(n log n) worst-case runtime cost -- (algorithm analysis runtime analysis sorting quicksort)
<p><strong>Randomized Quick Sort</strong> is an extension of Quick Sort in which the pivot element is chosen randomly. What can be the worst case time complexity of this algorithm. According ... | habedi/stack-exchange-dataset |
36,001 | Different boolean degrees polynomially related-2? | <p>Essentially similar question to here <a href="https://cs.stackexchange.com/questions/35820/different-boolean-degrees-polynomially-related">Different boolean degrees polynomially related?</a> (change being error condition $\epsilon\in(0,1)$).</p>

<p>Let $p$ be the minimum degree (of degree $d_f$) real polyno... | complexity theory | 1 | Different boolean degrees polynomially related-2? -- (complexity theory)
<p>Essentially similar question to here <a href="https://cs.stackexchange.com/questions/35820/different-boolean-degrees-polynomially-related">Different boolean degrees polynomially related?</a> (change being error condition $\epsilon\in(0,1)$).</p... | habedi/stack-exchange-dataset |
36,005 | Kth largest subset for small K | <p>The $K$th Largest Subset problem is often given as an example of an NP-hard problem. However, the assumption is that $K$ is unconstrained, and can be as large as $2^n$. Clearly, if $K \le 3$ the solution in $O(n)$ time is trivial.</p>

<p>Are there any general results for time complexity of this problem for ... | complexity theory np hard | 1 | Kth largest subset for small K -- (complexity theory np hard)
<p>The $K$th Largest Subset problem is often given as an example of an NP-hard problem. However, the assumption is that $K$ is unconstrained, and can be as large as $2^n$. Clearly, if $K \le 3$ the solution in $O(n)$ time is trivial.</p>

<p>Are ther... | habedi/stack-exchange-dataset |
36,008 | Books to get prepared before self studying Artificial Intelligence | <p>I want to study Artificial Intelligence from <em>Artificial Intelligence: A Modern Approach</em> by <em>Russell</em> and <em>Norvig</em>, in the mid-year vacation. I want to get prepared before diving into the book so I decided to review some relevant subjects like Discrete Mathematics. I know there is a good book f... | artificial intelligence discrete mathematics | 1 | Books to get prepared before self studying Artificial Intelligence -- (artificial intelligence discrete mathematics)
<p>I want to study Artificial Intelligence from <em>Artificial Intelligence: A Modern Approach</em> by <em>Russell</em> and <em>Norvig</em>, in the mid-year vacation. I want to get prepared before diving... | habedi/stack-exchange-dataset |
36,014 | Some slight confusion with the UNTIL operator in CTL (e.g. a U b) | <p>I've sketched a very small transition system in paint that I'll use as an example. </p>

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

<p>I want to see if $A(aUb)$ holds for this transition system. From my understanding, this CTL formula is asking if ALL p... | logic model checking computation tree logic | 1 | Some slight confusion with the UNTIL operator in CTL (e.g. a U b) -- (logic model checking computation tree logic)
<p>I've sketched a very small transition system in paint that I'll use as an example. </p>

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

<p>I w... | habedi/stack-exchange-dataset |
36,015 | Transform unstructured flow charts into structured ones | <p>Has anyone studied the problem of converting a generic flowchart to a semantically equivalent "structured flowchart" (i.e. one that only uses the 'if' and 'while' block structure)? </p>

<p>I can see this may be relevant to code generation and optimization but I've not been able to find anything on the topic... | graphs | 1 | Transform unstructured flow charts into structured ones -- (graphs)
<p>Has anyone studied the problem of converting a generic flowchart to a semantically equivalent "structured flowchart" (i.e. one that only uses the 'if' and 'while' block structure)? </p>

<p>I can see this may be relevant to code generation a... | habedi/stack-exchange-dataset |
36,016 | How does the ID3 Algorithm differ from a generic Decision Tree learning algorithm | <p>Based on the notes of my Machine Learning lecturer, I am struggling to understand how the two algorithms differ? Both seem to select the most informative feature A (based on least entropy), then create subsets of the example set for each value of A. Then create a new branch on the tree by recursively calling ID3 on ... | machine learning decision problem classification | 1 | How does the ID3 Algorithm differ from a generic Decision Tree learning algorithm -- (machine learning decision problem classification)
<p>Based on the notes of my Machine Learning lecturer, I am struggling to understand how the two algorithms differ? Both seem to select the most informative feature A (based on least e... | habedi/stack-exchange-dataset |
36,021 | Simplifying a boolean expression | <p>I need to prove:</p>

<p><code>XY + ~XZ + YZ = XY + ~XZ</code></p>

<p>I cannot think how to do this. </p>

<p>I have tried factorising, but I just don't know of any rule that removes one of the terms like above. </p>

<p>I start with the LHS, naturally: </p>

<p>All I can do ... | logic | 1 | Simplifying a boolean expression -- (logic)
<p>I need to prove:</p>

<p><code>XY + ~XZ + YZ = XY + ~XZ</code></p>

<p>I cannot think how to do this. </p>

<p>I have tried factorising, but I just don't know of any rule that removes one of the terms like above. </p>

<p>I start with the LH... | habedi/stack-exchange-dataset |
36,027 | What is the difference between a Transition System and a Program Graph? (model checking) | <p>As the above question says.</p>

<p>I'm wondering if a transition system is the same as a program graph or they are two different things?</p>

<p>Thank you.</p>
 | terminology model checking transition systems | 1 | What is the difference between a Transition System and a Program Graph? (model checking) -- (terminology model checking transition systems)
<p>As the above question says.</p>

<p>I'm wondering if a transition system is the same as a program graph or they are two different things?</p>

<p>Thank you.</p>&... | habedi/stack-exchange-dataset |
37,028 | Are there some real-world optimization problems with very cheap objective functions? | <p>Many real world optimization tasks (especially black box optimization) have objective functions, which are quite expensive to evaluate. For example to find the optimal shape of an airplane wing, a computer model of the wing needs to be constructed and then a large physical simulation needs to be executed, usually ta... | optimization applied theory evolutionary computing | 1 | Are there some real-world optimization problems with very cheap objective functions? -- (optimization applied theory evolutionary computing)
<p>Many real world optimization tasks (especially black box optimization) have objective functions, which are quite expensive to evaluate. For example to find the optimal shape of... | habedi/stack-exchange-dataset |
37,043 | Given two heuristic values how do I tell which one is admissible? | <p>I am given 2 list of admissible values for a graph, and the graph with the real cost to each of the nodes.</p>

<p>Am I correct in thinking the way to see which one is admissible is add up all the values of the h(n) and compare it to the total real cost of the graph?</p>

<p>Example:</p>

<p>... | search algorithms heuristics | 1 | Given two heuristic values how do I tell which one is admissible? -- (search algorithms heuristics)
<p>I am given 2 list of admissible values for a graph, and the graph with the real cost to each of the nodes.</p>

<p>Am I correct in thinking the way to see which one is admissible is add up all the values of th... | habedi/stack-exchange-dataset |
37,049 | Applying DFS algorithm to a transition system to find reachable states | <p>Currently working on a past exam question which tells me to compute the product of two transition systems and then <strong>use DFS to find the reachable states of the product</strong>. I learnt how to compute the product of transition systems by looking at pages 43 and 44 in the "Principles of Model Checking" book b... | graph traversal model checking transition systems | 1 | Applying DFS algorithm to a transition system to find reachable states -- (graph traversal model checking transition systems)
<p>Currently working on a past exam question which tells me to compute the product of two transition systems and then <strong>use DFS to find the reachable states of the product</strong>. I lear... | habedi/stack-exchange-dataset |
37,061 | Getting sum of all numbers contained in substrings of S on a segment | <p>I have a string of digits $S$ and <em>K</em> queries $l_i, r_I$ - get the sum of all numbers contained in segment of $S$ from $l_i$ to $r_i$.</p>

<p>For example, $S$ = 1034, $l = 1$, $r = 3$. So answer will be $1 + 10 + 103 + 3$ (note: $03$ was not counted, as it starts with $0$)</p>

<p>It has an o... | data structures | 1 | Getting sum of all numbers contained in substrings of S on a segment -- (data structures)
<p>I have a string of digits $S$ and <em>K</em> queries $l_i, r_I$ - get the sum of all numbers contained in segment of $S$ from $l_i$ to $r_i$.</p>

<p>For example, $S$ = 1034, $l = 1$, $r = 3$. So answer will be $1 + 10 ... | habedi/stack-exchange-dataset |
37,069 | How to Know Whether a Topic is Publishable in Computer Science | <p>Forgive my ignorance, but I am very new to the publishing process in Computer Science. I have some research that I have done involving analyzing data formats used in web-based image processing applications being presented in various IEEE papers. Some are conference papers and some actual IEEE transactions. They all ... | image processing information retrieval | 1 | How to Know Whether a Topic is Publishable in Computer Science -- (image processing information retrieval)
<p>Forgive my ignorance, but I am very new to the publishing process in Computer Science. I have some research that I have done involving analyzing data formats used in web-based image processing applications bein... | habedi/stack-exchange-dataset |
37,073 | first intersection of two arrays of integers - double binary search feasible? | <p>I'm interested to find the fastest possible way to find the first element of an intersection of two integers arrays (first match)</p>

<p>Looking for the 'fastest' algorithm I have seen different methods with different time complexities (to calculate the arrays intersection)</p>

<p>i.e: $O(N+M)$, $O... | algorithms binary search | 1 | first intersection of two arrays of integers - double binary search feasible? -- (algorithms binary search)
<p>I'm interested to find the fastest possible way to find the first element of an intersection of two integers arrays (first match)</p>

<p>Looking for the 'fastest' algorithm I have seen different metho... | habedi/stack-exchange-dataset |
37,080 | Trying to understand how the first Hadamard gate in Deutsch–Jozsa algorithm works | <p>I'm still a beginner in the quantum aspect of computer science (self-studying). So please bear with me if this may sound like a stupid question.</p>

<p>I know Hadamard gate transforms qubit into a superposition state with $\frac{1}{2}$ chance that the outcome would be 0 or 1 when the wave function collapses... | algorithms quantum computing | 1 | Trying to understand how the first Hadamard gate in Deutsch–Jozsa algorithm works -- (algorithms quantum computing)
<p>I'm still a beginner in the quantum aspect of computer science (self-studying). So please bear with me if this may sound like a stupid question.</p>

<p>I know Hadamard gate transforms qubit in... | habedi/stack-exchange-dataset |
37,084 | Constrain certain variables in CNF to unique satisfying assignments | <p>[Reposted because the original question was deleted by the poster.]</p>

<p>I'm looking for a way to add additional clauses (and maybe additional variables) to an already existing SAT instance so that solutions with non-unique assignments for certain variables are invalidated.</p>

<p>Currently I enu... | satisfiability sat solvers | 1 | Constrain certain variables in CNF to unique satisfying assignments -- (satisfiability sat solvers)
<p>[Reposted because the original question was deleted by the poster.]</p>

<p>I'm looking for a way to add additional clauses (and maybe additional variables) to an already existing SAT instance so that solution... | habedi/stack-exchange-dataset |
37,087 | Given a minimum vertex cover can we find all the others in polynomial time? | <p>Having found one minimum vertex cover of a connected undirected graph, is there a known polynomial-time algorithm for finding all the other minimum vertex covers of the graph, or is this problem NP-complete as well?</p>

<p><strong>Another question:</strong> what other ways (not necessarily polynomial-time) ... | complexity theory graphs np complete | 1 | Given a minimum vertex cover can we find all the others in polynomial time? -- (complexity theory graphs np complete)
<p>Having found one minimum vertex cover of a connected undirected graph, is there a known polynomial-time algorithm for finding all the other minimum vertex covers of the graph, or is this problem NP-c... | habedi/stack-exchange-dataset |
37,092 | How to make a Post Machine for $a^nb^n$? | <p>I have tried to make a Post machine for that all words of the form $a^nb^n$ by the following steps.</p>

<ol>
<li>add a marker '#'</li>
<li>read first 'a'</li>
<li>read next 'a's and add them</li>
<li>read first 'b'</li>
<li>read next 'b's and add them</li>
<li>read '#' (that we added... | context free automata | 1 | How to make a Post Machine for $a^nb^n$? -- (context free automata)
<p>I have tried to make a Post machine for that all words of the form $a^nb^n$ by the following steps.</p>

<ol>
<li>add a marker '#'</li>
<li>read first 'a'</li>
<li>read next 'a's and add them</li>
<li>read first 'b'</li>
... | habedi/stack-exchange-dataset |
37,093 | Lost in a "one directional" concert | <p>You and a friend lost each other on the line to a concert, and neither is sure which of you is further ahead. Formally, each is at some integer coordinate and may only walk towards a higher coordinate or stay in place.</p>

<p>Assuming you and your friend are following the exact same algorithm (and no, you m... | algorithms randomized algorithms | 1 | Lost in a "one directional" concert -- (algorithms randomized algorithms)
<p>You and a friend lost each other on the line to a concert, and neither is sure which of you is further ahead. Formally, each is at some integer coordinate and may only walk towards a higher coordinate or stay in place.</p>

<p>Assuming... | habedi/stack-exchange-dataset |
37,098 | Parallel algorithm for LU-decomposition | <p>I need to implement LU-decomposition in <a href="http://verif.cs.vsb.cz/kaira/" rel="nofollow">Kaira</a>. In Kaira the programmer writes the "parallel part" as the diagram similar to Petri Nets.</p>

<p>So, could you, please, recommend me some parallel algorithms for LU-decomposition which are really easy to... | parallel computing matrices decomposition | 1 | Parallel algorithm for LU-decomposition -- (parallel computing matrices decomposition)
<p>I need to implement LU-decomposition in <a href="http://verif.cs.vsb.cz/kaira/" rel="nofollow">Kaira</a>. In Kaira the programmer writes the "parallel part" as the diagram similar to Petri Nets.</p>

<p>So, could you, plea... | habedi/stack-exchange-dataset |
37,100 | minimum number of states for the regular expression | <p>Could somebody please tell me if there is a way to create a DFA with 8 states for the regular expression $$(111 + 11111)^*$$
I was able to create a DFA with 8 states, but the place I saw the question has answer as 9 states. And if possible, could you please show me the DFA.</p>

<p>Thanks</p>

<p... | finite automata regular expressions | 1 | minimum number of states for the regular expression -- (finite automata regular expressions)
<p>Could somebody please tell me if there is a way to create a DFA with 8 states for the regular expression $$(111 + 11111)^*$$
I was able to create a DFA with 8 states, but the place I saw the question has answer as 9 stat... | habedi/stack-exchange-dataset |
37,106 | Finding undirected cycles in linear time (triangulating graphs while minimizing degree) | <p>In the article ["Triangulating Planar Graphs While Minimizing the Maximum Degree"] by Kant and Bodlaender [1], Section 4 briefly mentions the extraction of elementary cycles (no repeating edges) from what I assume is an undirected graph <span class="math-container">$H$</span>. It has the following to say:<... | algorithms graphs | 1 | Finding undirected cycles in linear time (triangulating graphs while minimizing degree) -- (algorithms graphs)
<p>In the article ["Triangulating Planar Graphs While Minimizing the Maximum Degree"] by Kant and Bodlaender [1], Section 4 briefly mentions the extraction of elementary cycles (no repeating edges) f... | habedi/stack-exchange-dataset |
37,109 | Need clear explanation to Range updates and Range queries in Binary Indexed trees? | <p>I have gone through few tutorials about how to perform range updates and range queries using Binary indexed tree. I have even gone through <a href="https://cs.stackexchange.com/questions/33014/range-update-range-query-with-binary-indexed-trees">Range update + range query with binary indexed trees</a> . I'm unable to... | algorithms data structures binary trees | 1 | Need clear explanation to Range updates and Range queries in Binary Indexed trees? -- (algorithms data structures binary trees)
<p>I have gone through few tutorials about how to perform range updates and range queries using Binary indexed tree. I have even gone through <a href="https://cs.stackexchange.com/questions/33... | habedi/stack-exchange-dataset |
37,112 | Each finite segment of a noncomputable integer sequence is computable | <p><a href="https://en.wikipedia.org/wiki/Computable_function#Examples" rel="nofollow">Wikipedia claims</a> that "each finite segment of noncomputable sequence of integers is computable".</p>

<p>It continues to clarify: For any noncomputable function, "for any given value of n, [...] a trivial algorithm exists... | computability | 1 | Each finite segment of a noncomputable integer sequence is computable -- (computability)
<p><a href="https://en.wikipedia.org/wiki/Computable_function#Examples" rel="nofollow">Wikipedia claims</a> that "each finite segment of noncomputable sequence of integers is computable".</p>

<p>It continues to clarify: Fo... | habedi/stack-exchange-dataset |
37,118 | Cognitive Computing vs Artificial Intelligence? | <p>Can anyone please tell me the difference between them?
A brief definition of Cognitive Computing would appreciated.</p>

<p>Also how does cognitive computing relate to neural networks?</p>
 | terminology machine learning artificial intelligence | 1 | Cognitive Computing vs Artificial Intelligence? -- (terminology machine learning artificial intelligence)
<p>Can anyone please tell me the difference between them?
A brief definition of Cognitive Computing would appreciated.</p>

<p>Also how does cognitive computing relate to neural networks?</p>
 | habedi/stack-exchange-dataset |
37,120 | Is there a difference between the name scheduler and scheduling? | <p>Sometimes I read about the term "scheduler" (offline-scheduler, online-scheduler,...) and then I see terms called "scheduling" (offline-scheduling, online-scheduling, preemptive scheduling, non preemptive scheduling). Currently I think, that scheduling is the real work and scheduler is just a umbrella term. Is that ... | terminology scheduling | 1 | Is there a difference between the name scheduler and scheduling? -- (terminology scheduling)
<p>Sometimes I read about the term "scheduler" (offline-scheduler, online-scheduler,...) and then I see terms called "scheduling" (offline-scheduling, online-scheduling, preemptive scheduling, non preemptive scheduling). Curren... | habedi/stack-exchange-dataset |
37,134 | Deciding Countability of Languages | <p>Suppose we have given $\Sigma=\{a,b\}$, Which one of the following set is not countable</p>

<blockquote>
 <p>(a) Set of all languages over $\Sigma$</p>
 
 <p>(b) Set of all regular languages over $\Sigma$</p>
 
 <p>(c) Set of all languages over $\Sigma$ accepted by Turing machine</p... | formal languages uncountability | 1 | Deciding Countability of Languages -- (formal languages uncountability)
<p>Suppose we have given $\Sigma=\{a,b\}$, Which one of the following set is not countable</p>

<blockquote>
 <p>(a) Set of all languages over $\Sigma$</p>
 
 <p>(b) Set of all regular languages over $\Sigma$</p>
 
 ... | habedi/stack-exchange-dataset |
37,135 | Couting Self dual functions | <p>The Dual of a Boolean function $F(x_1, x_2, ..., x_n)$, written as $F^D$ is the same expression as that of $F$ with $+$ and $.$ swapped. $F$ is said to be self dual if $$F=F^D$$</p>

<p>How can we count total number of self dual function with $n$ Boolean variables.</p>

<p>I know For $n$ variables to... | boolean algebra | 1 | Couting Self dual functions -- (boolean algebra)
<p>The Dual of a Boolean function $F(x_1, x_2, ..., x_n)$, written as $F^D$ is the same expression as that of $F$ with $+$ and $.$ swapped. $F$ is said to be self dual if $$F=F^D$$</p>

<p>How can we count total number of self dual function with $n$ Boolean varia... | habedi/stack-exchange-dataset |
37,137 | Structural induction over list | <p>I want to prove that <code>unique(reverse(L)) = reverse(unique(L))</code> where L is a List.</p>

<p>List has the following constructors:<br/>
<code>[] : -> List</code><br/>
<code>[e] : Element -> List</code><br/>
<code>cons(e, L) : Element x List -> List</code></p>

<p>I defined... | discrete mathematics induction lists | 1 | Structural induction over list -- (discrete mathematics induction lists)
<p>I want to prove that <code>unique(reverse(L)) = reverse(unique(L))</code> where L is a List.</p>

<p>List has the following constructors:<br/>
<code>[] : -> List</code><br/>
<code>[e] : Element -> List</code><br/>
<cod... | habedi/stack-exchange-dataset |
37,139 | Does randomness make exponential difference? | <p>Schwartz–Zippel lemma can solve the polynomial identity testing in expected poly-time. As far as I know, there is no deterministic poly-time algorithm for the problem, but we do not know if the problem is NP-hard or not, right? Is there any NP-hard problem that can be solved in expected poly-time using a randomized ... | np hard randomized algorithms | 1 | Does randomness make exponential difference? -- (np hard randomized algorithms)
<p>Schwartz–Zippel lemma can solve the polynomial identity testing in expected poly-time. As far as I know, there is no deterministic poly-time algorithm for the problem, but we do not know if the problem is NP-hard or not, right? Is there ... | habedi/stack-exchange-dataset |
37,149 | Direction of restriction for NP hard proves | <p>I have a very silly question, as I am reading through all the proofs showing a problem is NP hard, one of the techniques is by showing an already-proven NP complete problem is a special case for that problem.</p>

<p>I am wondering shouldn't that be another way around? I mean if you show your problem is a sp... | np complete proof techniques | 1 | Direction of restriction for NP hard proves -- (np complete proof techniques)
<p>I have a very silly question, as I am reading through all the proofs showing a problem is NP hard, one of the techniques is by showing an already-proven NP complete problem is a special case for that problem.</p>

<p>I am wondering... | habedi/stack-exchange-dataset |
37,152 | Spandex knapsack? | <p>I'm going camping. While I'm away, I plan to eat only s'mores, which consist of 20% chocolate, 50% marshmallow, and 30% graham cracker. I did a thorough clean-out of my pantry, which revealed multiple packages of each of these ingredients in various sizes.</p>

<p>I'll need at least 5kg of food to get me thr... | optimization knapsack problems | 1 | Spandex knapsack? -- (optimization knapsack problems)
<p>I'm going camping. While I'm away, I plan to eat only s'mores, which consist of 20% chocolate, 50% marshmallow, and 30% graham cracker. I did a thorough clean-out of my pantry, which revealed multiple packages of each of these ingredients in various sizes.</p>&#x... | habedi/stack-exchange-dataset |
37,160 | Can approximation help find the exact answer? | <p>Lets assume we have an array with 100 numbers and we want to find how many '1's there are. Best solution will be reading every numbers and counting. Now we get a hint that there are 50,51 or 52 '1' in the array, can this information help us count the '1's somehow?</p>

<p>What bothering me here is that we ha... | approximation counting | 1 | Can approximation help find the exact answer? -- (approximation counting)
<p>Lets assume we have an array with 100 numbers and we want to find how many '1's there are. Best solution will be reading every numbers and counting. Now we get a hint that there are 50,51 or 52 '1' in the array, can this information help us co... | habedi/stack-exchange-dataset |
37,164 | Defining a new (informal) operator in CTL | <p>If you were given a "new operator" <strong>Wh</strong> and a formula <em>a</em> <strong>Wh</strong> <em>b</em> meaning that <em>a</em> holds for at least as long as <em>b</em> does (in all executions). How would you define this operator in CTL? This is an exercise question in the book "Principles of Model Checking" ... | logic model checking computation tree logic | 1 | Defining a new (informal) operator in CTL -- (logic model checking computation tree logic)
<p>If you were given a "new operator" <strong>Wh</strong> and a formula <em>a</em> <strong>Wh</strong> <em>b</em> meaning that <em>a</em> holds for at least as long as <em>b</em> does (in all executions). How would you define thi... | habedi/stack-exchange-dataset |
37,167 | Why we use context-free grammar for parsing? | <p>Why we use context-free grammar for parsing? Why not regular expression and not context-sensitive grammar?</p>
 | compilers parsers | 1 | Why we use context-free grammar for parsing? -- (compilers parsers)
<p>Why we use context-free grammar for parsing? Why not regular expression and not context-sensitive grammar?</p>
 | habedi/stack-exchange-dataset |
37,179 | Hardness of 3SAT-k | <p>According to <a href="http://courses.csail.mit.edu/6.890/fall14/scribe/lec4.pdf" rel="nofollow">these scribe notes</a> (and a paper), 3SAT-5 is NP-hard. The problem is defined to be: given a 3SAT formula, each variable occurs in at most 5 clauses. It is also proven that 3SAT-4 is NP-hard.</p>

<p>What is the... | np complete np hard satisfiability 3 sat | 1 | Hardness of 3SAT-k -- (np complete np hard satisfiability 3 sat)
<p>According to <a href="http://courses.csail.mit.edu/6.890/fall14/scribe/lec4.pdf" rel="nofollow">these scribe notes</a> (and a paper), 3SAT-5 is NP-hard. The problem is defined to be: given a 3SAT formula, each variable occurs in at most 5 clauses. It i... | habedi/stack-exchange-dataset |
37,183 | Example of a boolean function | <p>Is there an example of real polynomial representation of a Boolean function with $4$ variables whose polynomial degree is $2$ that depends on $4$ variables? </p>
 | complexity theory boolean algebra | 1 | Example of a boolean function -- (complexity theory boolean algebra)
<p>Is there an example of real polynomial representation of a Boolean function with $4$ variables whose polynomial degree is $2$ that depends on $4$ variables? </p>
 | habedi/stack-exchange-dataset |
37,194 | conversion to base-R numbers | <p>I am reading Algorithms 4th edition by Robert Sedgewick and am stumped at a particular problem. On page 460 of the book the author is describing a technique to hash strings and use prime numbers for modular hashing. Starting from the fourth line:</p>

<pre><code> If R is greater than any character value, thi... | hash hash tables primes base conversion | 1 | conversion to base-R numbers -- (hash hash tables primes base conversion)
<p>I am reading Algorithms 4th edition by Robert Sedgewick and am stumped at a particular problem. On page 460 of the book the author is describing a technique to hash strings and use prime numbers for modular hashing. Starting from the fourth li... | habedi/stack-exchange-dataset |
37,197 | Having a problem understanding the execution of I/O in Von Neumann model | <p>I might have gone too deep in my search after the answer which might be much easier than what I figured.</p>

<p>Essentially I wanted to figure out how I/O are executed in a Von Neumann machine, but more I read, the more confused I became.</p>

<p>What they are saying in "Introduction to computing sy... | computer architecture | 1 | Having a problem understanding the execution of I/O in Von Neumann model -- (computer architecture)
<p>I might have gone too deep in my search after the answer which might be much easier than what I figured.</p>

<p>Essentially I wanted to figure out how I/O are executed in a Von Neumann machine, but more I rea... | habedi/stack-exchange-dataset |
37,199 | Selection, crossover and mutation function choice in genetic algorithms | <p>I have been developing a GA for one of the projects I'm working on. I have everything implemented with no problems and I really like how GAs work in general, it's a really cool and relatively new concept. However I'm wondering which specific algorithms I should use for selection, crossover and mutation.</p>

... | algorithms genetic algorithms | 1 | Selection, crossover and mutation function choice in genetic algorithms -- (algorithms genetic algorithms)
<p>I have been developing a GA for one of the projects I'm working on. I have everything implemented with no problems and I really like how GAs work in general, it's a really cool and relatively new concept. Howev... | habedi/stack-exchange-dataset |
37,200 | How do I prove a certain upper bound on the runtime of a probabilistic 2-SAT solver? | <p>As a <em>homework</em> we had to prove a set of upper bounds on a given probabilistic algorithm to find a satisfying assignment for a satisfiable 2-CNF formula. The problem is reproduced below. I'm sorry for all the incorrect language; English is not my native language and scientific language is especially difficult... | satisfiability probabilistic algorithms | 1 | How do I prove a certain upper bound on the runtime of a probabilistic 2-SAT solver? -- (satisfiability probabilistic algorithms)
<p>As a <em>homework</em> we had to prove a set of upper bounds on a given probabilistic algorithm to find a satisfying assignment for a satisfiable 2-CNF formula. The problem is reproduced ... | habedi/stack-exchange-dataset |
37,208 | Longest Common Subsequence Via Dynamic Programming | <p>I read the wikipedia page on the Longest Common Subsequence problem to understand the LCS Table approach, but it seems to result in different solutions given different orders of the original sequences. For example, the traceback table generated <a href="http://en.wikipedia.org/wiki/Longest_common_subsequence_problem... | dynamic programming | 1 | Longest Common Subsequence Via Dynamic Programming -- (dynamic programming)
<p>I read the wikipedia page on the Longest Common Subsequence problem to understand the LCS Table approach, but it seems to result in different solutions given different orders of the original sequences. For example, the traceback table genera... | habedi/stack-exchange-dataset |
37,237 | Linear programming formulation of cheapest k-edge path between two nodes | <p>Given a directed graph $G = (V,E)$ with positive edge weights, find the minimum cost path between $s$ and $t$ that traverses exactly $k$ edges.</p>

<p>Here is my attempt using a flow network:
\begin{align}
\min \sum_{(i,j) \in E} c_{ij}x_{ij}
\end{align}
\begin{align}
\sum_{j \in V} x_{j... | graphs shortest path network flow linear programming | 1 | Linear programming formulation of cheapest k-edge path between two nodes -- (graphs shortest path network flow linear programming)
<p>Given a directed graph $G = (V,E)$ with positive edge weights, find the minimum cost path between $s$ and $t$ that traverses exactly $k$ edges.</p>

<p>Here is my attempt using a... | habedi/stack-exchange-dataset |
37,242 | Fixed base exponentiation with precomputations | <p>I'm trying to compute $g^m$ mod $n$ where $m,n$ are 1024-bit numbers. The method I want to use is fixed base exponentiation with precomputations, also known as fixed-base windowing.The paper I'm following is Brickell et. al. "Fast Exponentiation with Precomputation: Algorithms and Lower Bounds" which can be found <a... | multiplication modular arithmetic | 1 | Fixed base exponentiation with precomputations -- (multiplication modular arithmetic)
<p>I'm trying to compute $g^m$ mod $n$ where $m,n$ are 1024-bit numbers. The method I want to use is fixed base exponentiation with precomputations, also known as fixed-base windowing.The paper I'm following is Brickell et. al. "Fast ... | habedi/stack-exchange-dataset |
37,251 | Defining a new operator in CTL | <p>Lets consider a new operator $B$ where $a B b$ means "in every execution, if $b$ holds some time, then $a$ does so before it" and we're asked to define it in CTL. </p>

<p>My working: the system can only fail if $b$ holds. If $b$ doesn't hold, we're in the clear - so one possible path could be $(¬ □ b)$. The... | logic model checking temporal logic computation tree logic | 1 | Defining a new operator in CTL -- (logic model checking temporal logic computation tree logic)
<p>Lets consider a new operator $B$ where $a B b$ means "in every execution, if $b$ holds some time, then $a$ does so before it" and we're asked to define it in CTL. </p>

<p>My working: the system can only fail if $b... | habedi/stack-exchange-dataset |
37,254 | Fastest way to find natural solutions to Linear equation | <p>$$
a_i * x_i + b_i * x_j = N
$$</p>

<p>$\text{given } a_i, b_i, N \in \mathbb{N}$</p>

<p>i want to find a solution where $x_i, x_j \in \mathbb{N}$ or output if there exists none.</p>

<p>What is the fastest way to calculate this?</p>
 | algorithms | 1 | Fastest way to find natural solutions to Linear equation -- (algorithms)
<p>$$
a_i * x_i + b_i * x_j = N
$$</p>

<p>$\text{given } a_i, b_i, N \in \mathbb{N}$</p>

<p>i want to find a solution where $x_i, x_j \in \mathbb{N}$ or output if there exists none.</p>

<p>What is the fastest way... | habedi/stack-exchange-dataset |
37,268 | What is a rewrite-based system? | <p>I am reading about this in the context of the K semantic framework. I keep encountering terms such as rewrite-term and rewrite logic. My main aim is to understand what is K doing and how it works, so maybe this would be a bit off-topic.</p>
 | term rewriting | 1 | What is a rewrite-based system? -- (term rewriting)
<p>I am reading about this in the context of the K semantic framework. I keep encountering terms such as rewrite-term and rewrite logic. My main aim is to understand what is K doing and how it works, so maybe this would be a bit off-topic.</p>
 | habedi/stack-exchange-dataset |
37,271 | 4-bit input, 5-bit output, logical right shift by 2, which is the correct set of 5 output bits? | <p>Suppose I have the following inputs:</p>

<p>1110<br>
1111</p>

<p>If I perform a logical right shift by 2 on each, are the 5-bit outputs these:</p>

<p>00111<br>
00111</p>

<p>or these:</p>

<p>01110<br>
01111</p>

<p>If it's neither, then I'd appreciate a... | boolean algebra | 1 | 4-bit input, 5-bit output, logical right shift by 2, which is the correct set of 5 output bits? -- (boolean algebra)
<p>Suppose I have the following inputs:</p>

<p>1110<br>
1111</p>

<p>If I perform a logical right shift by 2 on each, are the 5-bit outputs these:</p>

<p>00111<br>
00111... | habedi/stack-exchange-dataset |
37,277 | Efficiently count frequency of n-grams at start of words | <p>I have a text file with all possible 5-grams (26^5 = 11.881.376) organized in rows as:</p>

<p>aaaaa<br>
aaaab<br>
aaaac<br>
aaaad<br>
.....</p>

<p>and I have a txt file (organized in rows) with all English words. I have to find how much time every 5-gram is at the beginning of a wor... | algorithms algorithm analysis search algorithms strings search problem | 1 | Efficiently count frequency of n-grams at start of words -- (algorithms algorithm analysis search algorithms strings search problem)
<p>I have a text file with all possible 5-grams (26^5 = 11.881.376) organized in rows as:</p>

<p>aaaaa<br>
aaaab<br>
aaaac<br>
aaaad<br>
.....</p>

<p>and... | habedi/stack-exchange-dataset |
37,280 | Create CFG and pushdown automaton for {ww} | <p>I've been trying to make a CFG, a pushdown automaton and a regular expression for the language </p>

<p>$\qquad L(M) = \{ww : w \in \{a, b\}^*, |w| \text{ is even}\}$.</p>

<p>I understand how the reverse of the string work, that is </p>

<p>$\qquad L' = \{ ww^R : w \in \{a, b\}^*\}$, </p>&#x... | formal languages context free regular languages pushdown automata | 1 | Create CFG and pushdown automaton for {ww} -- (formal languages context free regular languages pushdown automata)
<p>I've been trying to make a CFG, a pushdown automaton and a regular expression for the language </p>

<p>$\qquad L(M) = \{ww : w \in \{a, b\}^*, |w| \text{ is even}\}$.</p>

<p>I understan... | habedi/stack-exchange-dataset |
37,284 | Solving recurrence relation | <p>I am trying to find a $\Theta$ bound for the following recurrence equation:</p>

<p>$$ T(n,p,k)=T(n,p,k/2)+T(n,p/4,k)+T(n/8,p,k)+npk $$ </p>

<pre><code> npk
 / | \
 / | \ 
T(n,p,k/2) T(n,p/4,k) T(... | time complexity recurrence relation | 1 | Solving recurrence relation -- (time complexity recurrence relation)
<p>I am trying to find a $\Theta$ bound for the following recurrence equation:</p>

<p>$$ T(n,p,k)=T(n,p,k/2)+T(n,p/4,k)+T(n/8,p,k)+npk $$ </p>

<pre><code> npk
 / | \
 / ... | habedi/stack-exchange-dataset |
37,287 | Definition of $D^P$? | <p>What is the definition of the complexity class $D^P$?</p>

<p>In recent papers I sometimes read $D^P$ but could not find a definition of it. Unfortunately <a href="https://complexityzoo.uwaterloo.ca/" rel="nofollow">Complexity Zoo</a> does not give one, too.</p>

<p>Is it the same as: "A language L i... | complexity theory complexity classes | 1 | Definition of $D^P$? -- (complexity theory complexity classes)
<p>What is the definition of the complexity class $D^P$?</p>

<p>In recent papers I sometimes read $D^P$ but could not find a definition of it. Unfortunately <a href="https://complexityzoo.uwaterloo.ca/" rel="nofollow">Complexity Zoo</a> does not gi... | habedi/stack-exchange-dataset |
37,297 | Does stay put TM recognizes same languages as standard TM | <p>I am reading this text book and it says that stay put turing machine recognizes the same languages as regular turing machine by just adding transition functions (without adding any new states or symbols). I am trying to figure that out.. But so far, no luck. I think the key here is "recognizes" rather than "decides"... | computability turing machines undecidability turing completeness | 1 | Does stay put TM recognizes same languages as standard TM -- (computability turing machines undecidability turing completeness)
<p>I am reading this text book and it says that stay put turing machine recognizes the same languages as regular turing machine by just adding transition functions (without adding any new stat... | habedi/stack-exchange-dataset |
37,299 | Quantum computers and computable functions | <p>A quantum computer can possibly calcluate computable functions faster, but it can't calculate functions which a normal computer can't calculate?</p>

<p>If a function is not computable? Does this mean it will never be computable? Even if we change the axioms which our mathematical system is based on or we fi... | computability quantum computing philosophy | 1 | Quantum computers and computable functions -- (computability quantum computing philosophy)
<p>A quantum computer can possibly calcluate computable functions faster, but it can't calculate functions which a normal computer can't calculate?</p>

<p>If a function is not computable? Does this mean it will never be ... | habedi/stack-exchange-dataset |
37,303 | Learning Quadratic Functions | <p>I have seen in some ML tutorial that functions of the form $f(\vec x) = \vec x^T A \vec x$ ($\vec x \in \mathbb{R}^n$ and $A$ is an $n\times n$ real matrix) can be PAC learned. </p>

<p>Can anyone point me to a reference to this fact? </p>
 | reference request machine learning | 1 | Learning Quadratic Functions -- (reference request machine learning)
<p>I have seen in some ML tutorial that functions of the form $f(\vec x) = \vec x^T A \vec x$ ($\vec x \in \mathbb{R}^n$ and $A$ is an $n\times n$ real matrix) can be PAC learned. </p>

<p>Can anyone point me to a reference to this fact? </p>&... | habedi/stack-exchange-dataset |
37,311 | Regular Grammar and Regular Language | <p>From Wikipedia, Regular Language</p>
<blockquote>
<p>All finite languages are regular.</p>
</blockquote>
<p>and Also Regular Grammar, is a way to describe the Regular Language</p>
<blockquote>
<p>Right regular grammar (also called right linear grammar).</p>
<p>Left regular grammar (also c... | automata formal grammars | 1 | Regular Grammar and Regular Language -- (automata formal grammars)
<p>From Wikipedia, Regular Language</p>
<blockquote>
<p>All finite languages are regular.</p>
</blockquote>
<p>and Also Regular Grammar, is a way to describe the Regular Language</p>
<blockquote>
<p>Right regular grammar (also ca... | habedi/stack-exchange-dataset |
37,315 | Create cfg and npda/pda for Language {ww} | <p>I've been trying to make a CFG, and npda/pda for this language (to construct an npda for accepting the language): </p>

<p>L(M)={ww:w∈{a,b}∗,|w| is even}.</p>

<p>i had already solved the reverse of the language (like this):</p>

<p>L′={wwR:w∈{a,b}∗},</p>

<p>Please check this snapsho... | context free pushdown automata | 1 | Create cfg and npda/pda for Language {ww} -- (context free pushdown automata)
<p>I've been trying to make a CFG, and npda/pda for this language (to construct an npda for accepting the language): </p>

<p>L(M)={ww:w∈{a,b}∗,|w| is even}.</p>

<p>i had already solved the reverse of the language (like this)... | habedi/stack-exchange-dataset |
37,318 | How does "do in parallel" work | <p>currently i'm preparing for an exam in a high performance computing course. In this course we discuss several common parallel algorithm patterns called "dwarfs". The first dwarfs we had was the "dense linear algebra", so basically matrix multiplication. In one of the first slides there is a examp... | parallel computing matrices | 1 | How does "do in parallel" work -- (parallel computing matrices)
<p>currently i'm preparing for an exam in a high performance computing course. In this course we discuss several common parallel algorithm patterns called "dwarfs". The first dwarfs we had was the "dense linear algebra", so basically ma... | habedi/stack-exchange-dataset |
37,319 | Regular and not Regular Grammar | <p>According the Peter Linz Book, am a confusing about the two example 
the Grammar G1 = ({S},{a,b},S,P1) with P1 given as </p>

<p>S -> abS|a</p>

<p>and G2 = ({S,S1,S2,},{a,b},S,P2)</p>

<p>S -> S1ab
S1 -> S1ab|S2
S2 -> a</p>

<p>G1,G2 is regular.. </p>

<p>i genera... | automata formal grammars finite automata | 1 | Regular and not Regular Grammar -- (automata formal grammars finite automata)
<p>According the Peter Linz Book, am a confusing about the two example 
the Grammar G1 = ({S},{a,b},S,P1) with P1 given as </p>

<p>S -> abS|a</p>

<p>and G2 = ({S,S1,S2,},{a,b},S,P2)</p>

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