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 |
|---|---|---|---|---|---|---|
111,012 | Search vs planning in artificial intelligence | <p>I'm studying artificial intelligence following the Russell & Norvig book. 
We did a search and planning part that for me is the same (at least on the representation).
I'd like to know what is the difference between these two techniques, but I couldn't find it.</p>

<p>Looking online I found this ... | machine learning artificial intelligence search planning | 1 | Search vs planning in artificial intelligence -- (machine learning artificial intelligence search planning)
<p>I'm studying artificial intelligence following the Russell & Norvig book. 
We did a search and planning part that for me is the same (at least on the representation).
I'd like to know what is the d... | habedi/stack-exchange-dataset |
111,028 | How to prove the language of Turing machines that run at most $4|x|^2$ steps is not recursive? | <p>I am trying to prove that the language</p>

<p><span class="math-container">$$ L=\{M\mid M\text{ is a TM and for all }x\in \Sigma^*\text{ with }|x|>2, M\text{ on }x\text{ runs at most }4|x|^2\text{ steps}\} $$</span></p>

<p>belongs to <strong>Co-RE</strong> but not <strong>R</strong>.</p>
&#x... | turing machines reductions undecidability halting problem | 1 | How to prove the language of Turing machines that run at most $4|x|^2$ steps is not recursive? -- (turing machines reductions undecidability halting problem)
<p>I am trying to prove that the language</p>

<p><span class="math-container">$$ L=\{M\mid M\text{ is a TM and for all }x\in \Sigma^*\text{ with }|x|>... | habedi/stack-exchange-dataset |
111,030 | Without Rare Metals | <p>One often sees assertions that these are "necessary" for modern military and consumer computing applications. I presume that without these rare metals, the devices could be manufactured, but would be larger and/or more expensive. Is this true? </p>
 | memory hardware | 1 | Without Rare Metals -- (memory hardware)
<p>One often sees assertions that these are "necessary" for modern military and consumer computing applications. I presume that without these rare metals, the devices could be manufactured, but would be larger and/or more expensive. Is this true? </p>
 | habedi/stack-exchange-dataset |
111,034 | What is the index of the leftest child of node in a k-nery heap? | <p>Suppose the root node‘s index is 1, what is the index of the leftest child of a node e in a k-nery heap? What is the parent‘s index of a node in k-nery heap?</p>

<p>All questions regarding my problem I found talk about binary heaps, I just can’t think of a simple solution.</p>
 | data structures heaps | 1 | What is the index of the leftest child of node in a k-nery heap? -- (data structures heaps)
<p>Suppose the root node‘s index is 1, what is the index of the leftest child of a node e in a k-nery heap? What is the parent‘s index of a node in k-nery heap?</p>

<p>All questions regarding my problem I found talk abo... | habedi/stack-exchange-dataset |
111,041 | Reduction to proof undecidability of the problem: machine M and N accept infinitely many words | <p>I am struggling with the following problem: 
Decide whether this problem is decidable or not: For two given Turing Machines M and N, there exists infinitely many words accepted by both machine M and machine N. In other words, is language <code>{ encodedMachine(M)#encodedMachine(N) | intersection of language of M... | turing machines reductions undecidability halting problem | 1 | Reduction to proof undecidability of the problem: machine M and N accept infinitely many words -- (turing machines reductions undecidability halting problem)
<p>I am struggling with the following problem: 
Decide whether this problem is decidable or not: For two given Turing Machines M and N, there exists infinitel... | habedi/stack-exchange-dataset |
111,043 | what is the difference between transition function (delta) and extended transition function (delta cap ) in finite automata | <p>my doubt is </p>

<p>what is the difference between transition function (delta) and extended transition function (delta cap ) in finite automata ?</p>

<p>both of them when started at a state q for a string w will lead to same sate p what is the difference </p>

<blockquote>
 <p>is tran... | automata finite automata | 1 | what is the difference between transition function (delta) and extended transition function (delta cap ) in finite automata -- (automata finite automata)
<p>my doubt is </p>

<p>what is the difference between transition function (delta) and extended transition function (delta cap ) in finite automata ?</p>
... | habedi/stack-exchange-dataset |
111,058 | Algorithm for automatic construction of natural deduction proofs | <p>I was wondering if there exists any algorithm for automatic construction of nautral deduction proofs. I'm interested in propositional logic and first order logic.</p>

<p>If there is no algoritm, can you provide some proof of this fact?</p>

<p>PD0: I'm not interested in any page for solving these ki... | logic first order logic propositional logic natural deduction | 1 | Algorithm for automatic construction of natural deduction proofs -- (logic first order logic propositional logic natural deduction)
<p>I was wondering if there exists any algorithm for automatic construction of nautral deduction proofs. I'm interested in propositional logic and first order logic.</p>

<p>If the... | habedi/stack-exchange-dataset |
111,072 | How MO'S algorithm with update query works? | <p>MO'S algorithm is used to answer queries related to a given array by dividing it into blocks(<a href="https://blog.anudeep2011.com/mos-algorithm/" rel="nofollow noreferrer">https://blog.anudeep2011.com/mos-algorithm/</a>) .Though i understood general MO'S algorithm but i am facing difficulty to understand MO'S algor... | algorithms data structures | 1 | How MO'S algorithm with update query works? -- (algorithms data structures)
<p>MO'S algorithm is used to answer queries related to a given array by dividing it into blocks(<a href="https://blog.anudeep2011.com/mos-algorithm/" rel="nofollow noreferrer">https://blog.anudeep2011.com/mos-algorithm/</a>) .Though i understoo... | habedi/stack-exchange-dataset |
111,073 | Does there exist an undecidable problem such that the answer is YES for exactly one input to a UTM, and NO for all others? | <p>Suppose I have a universal Turing Machine (UTM) which accepts some input in binary. Is there a computational problem such that the answer to the problem is YES (accepting) for exactly one input (and hence NO for all others), but determining which input is the accepting one is undecidable?
Or is there a fundament... | turing machines computability undecidability | 1 | Does there exist an undecidable problem such that the answer is YES for exactly one input to a UTM, and NO for all others? -- (turing machines computability undecidability)
<p>Suppose I have a universal Turing Machine (UTM) which accepts some input in binary. Is there a computational problem such that the answer to the... | habedi/stack-exchange-dataset |
111,079 | Enumerate all paths in a given series-parallel graph | <p><a href="https://en.wikipedia.org/wiki/Series-parallel_graph" rel="nofollow noreferrer">Series parallel graph</a> is well-known and widely used. It has a single source and a single destination. The graph can be formed by means of recursive serial or parallel composition.</p>

<p><a href="https://upload.wikim... | graphs time complexity enumeration | 1 | Enumerate all paths in a given series-parallel graph -- (graphs time complexity enumeration)
<p><a href="https://en.wikipedia.org/wiki/Series-parallel_graph" rel="nofollow noreferrer">Series parallel graph</a> is well-known and widely used. It has a single source and a single destination. The graph can be formed by mea... | habedi/stack-exchange-dataset |
111,080 | Why does the BFR (Bradley, Fayyad and Reina) algorithm assume clusters to be normally distributed around its centroid? | <p>I'm following a course on data mining based on the lectures from Stanford University and the book <a href="http://www.mmds.org/" rel="nofollow noreferrer"><em>Mining of massive datasets</em></a>.</p>

<p>On the topic of clustering, the <strong>BFR</strong> algorithm is explained with <a href="https://www.you... | data mining clustering | 1 | Why does the BFR (Bradley, Fayyad and Reina) algorithm assume clusters to be normally distributed around its centroid? -- (data mining clustering)
<p>I'm following a course on data mining based on the lectures from Stanford University and the book <a href="http://www.mmds.org/" rel="nofollow noreferrer"><em>Mining of m... | habedi/stack-exchange-dataset |
111,081 | Are all foldable data structures also recursive? | <p>I was checking what Wikipedia has to say on <em>reduce</em>. It says:</p>

<blockquote>
 <p>In functional programming, fold (also termed reduce, accumulate,
 aggregate, compress, or inject) refers to a family of higher-order
 functions that analyze a <strong>recursive data structure</strong> a... | data structures trees recursion | 1 | Are all foldable data structures also recursive? -- (data structures trees recursion)
<p>I was checking what Wikipedia has to say on <em>reduce</em>. It says:</p>

<blockquote>
 <p>In functional programming, fold (also termed reduce, accumulate,
 aggregate, compress, or inject) refers to a family of h... | habedi/stack-exchange-dataset |
111,111 | What is the name of this sorting algorithm? | <p>I have typeset in a Wikipedia draft <a href="https://en.wikipedia.org/wiki/Draft:Curve_sort" rel="nofollow noreferrer">this</a> sorting algorithm. It is a comparison sort, yet can handle only numeric arrays. </p>

<p>Basically, it marches through the input array and for each new array component it inserts it... | algorithms sorting | 1 | What is the name of this sorting algorithm? -- (algorithms sorting)
<p>I have typeset in a Wikipedia draft <a href="https://en.wikipedia.org/wiki/Draft:Curve_sort" rel="nofollow noreferrer">this</a> sorting algorithm. It is a comparison sort, yet can handle only numeric arrays. </p>

<p>Basically, it marches th... | habedi/stack-exchange-dataset |
111,118 | How to show that the product of two binary numbers can be determined in AC1? | <p>I was working on a proof to determine that a product cannot be done in AC0, how can a proof that can be done in AC1?</p>
 | complexity theory circuits | 1 | How to show that the product of two binary numbers can be determined in AC1? -- (complexity theory circuits)
<p>I was working on a proof to determine that a product cannot be done in AC0, how can a proof that can be done in AC1?</p>
 | habedi/stack-exchange-dataset |
111,119 | For every undirected unweighted graph is every MST also a SPT | <p>I have a feeling this might be wrong an I'm looking for a counter example, however, I couldn't find one yet.. can anyone guide me in the right direction?</p>
 | graphs | 1 | For every undirected unweighted graph is every MST also a SPT -- (graphs)
<p>I have a feeling this might be wrong an I'm looking for a counter example, however, I couldn't find one yet.. can anyone guide me in the right direction?</p>
 | habedi/stack-exchange-dataset |
111,130 | Counting number of states from a regular expression | <p>Given the regular expression: <span class="math-container">$r=ab+((a+\epsilon)c^*)^*$</span>.
Let A be a non-deterministic automaton that accepts the language of r.
How many states are in A?
Answer the question without building A explicitly, explain how you got the answer.</p>

<p>I'm having trou... | automata regular languages regular expressions | 1 | Counting number of states from a regular expression -- (automata regular languages regular expressions)
<p>Given the regular expression: <span class="math-container">$r=ab+((a+\epsilon)c^*)^*$</span>.
Let A be a non-deterministic automaton that accepts the language of r.
How many states are in A?
Answer the... | habedi/stack-exchange-dataset |
111,137 | Calculating millisecond and avoiding float numbers | <p>I have a variable which increases/decreases from <code>0</code> to <code>255</code> every <code>(X) millisecond</code>. so:</p>

<pre><code>(X) x 255 = time in millisecond / 60000 = minute
</code></pre>

<p><code>(X) millisecond</code> is a variable which increases only by it self, for example af... | algorithms | 1 | Calculating millisecond and avoiding float numbers -- (algorithms)
<p>I have a variable which increases/decreases from <code>0</code> to <code>255</code> every <code>(X) millisecond</code>. so:</p>

<pre><code>(X) x 255 = time in millisecond / 60000 = minute
</code></pre>

<p><code>(X) millisecond</... | habedi/stack-exchange-dataset |
111,147 | Given an non-deterministic finite automaton, will its determinization always have unreachable states? | <p>Given an <strong>NFA</strong> that accepts the regular language <strong><em>L</em></strong>, will its equivalent <strong>DFA</strong> which accepts the same language <strong><em>L</em></strong> always have unreachable states.
If it does, why?</p>
 | automata finite automata nondeterminism | 1 | Given an non-deterministic finite automaton, will its determinization always have unreachable states? -- (automata finite automata nondeterminism)
<p>Given an <strong>NFA</strong> that accepts the regular language <strong><em>L</em></strong>, will its equivalent <strong>DFA</strong> which accepts the same language <str... | habedi/stack-exchange-dataset |
111,153 | Is halts-if-valid decideable? | <p>I have a suspicion that Turing's famous proof that the halting problem is undecidable may not prove exactly what people assume that it proves.</p>

<p>It may only prove that it is possible to limit the interface of a program such that it can't give you the most useful information about its inputs. </p>
&... | computability undecidability halting problem | 1 | Is halts-if-valid decideable? -- (computability undecidability halting problem)
<p>I have a suspicion that Turing's famous proof that the halting problem is undecidable may not prove exactly what people assume that it proves.</p>

<p>It may only prove that it is possible to limit the interface of a program such... | habedi/stack-exchange-dataset |
111,154 | Confusion in speed up calculation for pipeline architecture | <p>This is an <a href="https://gateoverflow.in/85759/pipeline-speedup" rel="nofollow noreferrer">online question</a> I am trying to solve.</p>

<p><em>You are given a non-pipelined processor design which has a cycle time of 10ns and average CPI of 1.4.If a pipelined processor having 5 stages are 1ns, 1.5ns, 4ns... | computer architecture cpu performance cpu pipelines | 1 | Confusion in speed up calculation for pipeline architecture -- (computer architecture cpu performance cpu pipelines)
<p>This is an <a href="https://gateoverflow.in/85759/pipeline-speedup" rel="nofollow noreferrer">online question</a> I am trying to solve.</p>

<p><em>You are given a non-pipelined processor desi... | habedi/stack-exchange-dataset |
111,158 | Simple algorithm to select separated points in closed intervals | <p>Within the internal logic of a feature I'm working on, I've run into a need for a solution to essentially this problem:</p>

<p><span class="math-container">$S$</span> is a finite union of <span class="math-container">$K \geq 1$</span> closed intervals,</p>

<p><span class="math-container">$$S = [a_1... | algorithms optimization | 1 | Simple algorithm to select separated points in closed intervals -- (algorithms optimization)
<p>Within the internal logic of a feature I'm working on, I've run into a need for a solution to essentially this problem:</p>

<p><span class="math-container">$S$</span> is a finite union of <span class="math-container... | habedi/stack-exchange-dataset |
111,186 | Count the number of ways numbers 1,2,…,n can be divided into two sets of equal sum | <blockquote>
 <p>count the number of ways numbers 1,2,…,n can be divided into two sets of equal sum.</p>
</blockquote>

<p>This is my recursive algorithm, what is wrong here?:</p>

<pre class="lang-cpp prettyprint-override"><code>int f(int sum,int i){//sum is the current sum, i is the current i... | algorithms dynamic programming recursion | 1 | Count the number of ways numbers 1,2,…,n can be divided into two sets of equal sum -- (algorithms dynamic programming recursion)
<blockquote>
 <p>count the number of ways numbers 1,2,…,n can be divided into two sets of equal sum.</p>
</blockquote>

<p>This is my recursive algorithm, what is wrong here?... | habedi/stack-exchange-dataset |
111,192 | Normal colorings of cubic graphs to SAT | <p>This problem is related to ”Normal coloring of cubic graphs (part 1) - a previous post. We repeat the definitions, slightly modified so as to get to the point (we define normal edge 5 colorability, rather than the more general normal edge <span class="math-container">$k$</span> colorability).</p>

<blockqu... | graphs reductions | 1 | Normal colorings of cubic graphs to SAT -- (graphs reductions)
<p>This problem is related to ”Normal coloring of cubic graphs (part 1) - a previous post. We repeat the definitions, slightly modified so as to get to the point (we define normal edge 5 colorability, rather than the more general normal edge <span class="... | habedi/stack-exchange-dataset |
111,202 | how to maximise the no of edges selected in the graph in form of cycles of unbounded length? | <p>Recently i started looking the perfect cycle cover algorithm related to kidney exchange problem where it is considered as NP-Complete for cycles restricted to a length>2. However if cycles are not restricted by removing the length constraint it is considered as solvable in polynomial time ,But if perfect cycle cover... | algorithms graphs | 1 | how to maximise the no of edges selected in the graph in form of cycles of unbounded length? -- (algorithms graphs)
<p>Recently i started looking the perfect cycle cover algorithm related to kidney exchange problem where it is considered as NP-Complete for cycles restricted to a length>2. However if cycles are not rest... | habedi/stack-exchange-dataset |
111,210 | Are graphic cards using the Map-Reduce model when performing typical gaming rendering | <p>I know that the Map-Reduce model is a common model of parallel computation, perhaps some sort of standard way(?). I also know that graphic cards are specifically built for parallel computation. However when reading about the graphic pipeline I am not sure if there is a point at which the Map Reduce model is used. If... | parallel computing graphics mapreduce | 1 | Are graphic cards using the Map-Reduce model when performing typical gaming rendering -- (parallel computing graphics mapreduce)
<p>I know that the Map-Reduce model is a common model of parallel computation, perhaps some sort of standard way(?). I also know that graphic cards are specifically built for parallel computa... | habedi/stack-exchange-dataset |
111,217 | Lambda Calculus as a branch of set theory | <p>This <a href="https://softwareengineering.stackexchange.com/a/267089/275652">answer</a> to a question about whether C is the mother of all languages contained an interesting tidbit that I am curious about:</p>

<blockquote>
 <p>The functional paradigm, for example, was developed <em>mathematically</em> ... | lambda calculus sets history | 1 | Lambda Calculus as a branch of set theory -- (lambda calculus sets history)
<p>This <a href="https://softwareengineering.stackexchange.com/a/267089/275652">answer</a> to a question about whether C is the mother of all languages contained an interesting tidbit that I am curious about:</p>

<blockquote>
 <p>... | habedi/stack-exchange-dataset |
111,222 | Why is the run time of an $f(n)$ space decider bounded by $2^{O(f(n))}$? | <p>In the proof of Savitch's theorem from the 3rd edition of Sipser's Intro to Theory of Computation, Sipser claims that the maximum time that an <span class="math-container">$ f(n) $</span> space nondeterministic Turing machine that halts on all inputs may use on any branch of its computation is <span class="math-cont... | complexity theory turing machines space complexity nondeterminism | 1 | Why is the run time of an $f(n)$ space decider bounded by $2^{O(f(n))}$? -- (complexity theory turing machines space complexity nondeterminism)
<p>In the proof of Savitch's theorem from the 3rd edition of Sipser's Intro to Theory of Computation, Sipser claims that the maximum time that an <span class="math-container">$... | habedi/stack-exchange-dataset |
111,226 | Analysis of straight insertion | <p>I'm currently reading through N. Wirths': Algorithms + Data Structures = Programs. I'm not sure, but I think there might be an error in the analysis of the provided straight insertion sort. Screenshot of the relevant paragraph is here: <a href="https://imgur.com/a/0wjiWBu" rel="nofollow noreferrer">screenshot</a></p... | algorithms algorithm analysis runtime analysis sorting | 1 | Analysis of straight insertion -- (algorithms algorithm analysis runtime analysis sorting)
<p>I'm currently reading through N. Wirths': Algorithms + Data Structures = Programs. I'm not sure, but I think there might be an error in the analysis of the provided straight insertion sort. Screenshot of the relevant paragraph... | habedi/stack-exchange-dataset |
111,232 | Using pumping lemma to show a language is not context free(Complicated) | <p>How can i show that the following long language is not context free using the pumping lemma?</p>

<p><span class="math-container">$L=\left\{abc^{i_1}bc^{i_2}...bc^{i_{2m}}def^{j_1}ef^{j_2}..ef^{j_{2n}}ghq^{k_1}hq^{k_2}...hq^{k_o}\right\}$</span></p>

<p>Such that: </p>

<p><span class="math-c... | computability automata context free pumping lemma | 1 | Using pumping lemma to show a language is not context free(Complicated) -- (computability automata context free pumping lemma)
<p>How can i show that the following long language is not context free using the pumping lemma?</p>

<p><span class="math-container">$L=\left\{abc^{i_1}bc^{i_2}...bc^{i_{2m}}def^{j_1}ef... | habedi/stack-exchange-dataset |
111,242 | Can an algorithm with $\Theta(n^2)$ run time be faster than an algorithm with $\Theta(n\log n)$ run time? | <p>This is a question posted for extra practice (<em>i.e.,</em> not for credit):</p>

<blockquote>
 <p>Can an algorithm with <span class="math-container">$\Theta(n^2)$</span> run time be faster than an algorithm with <span class="math-container">$\Theta(n\log n)$</span> run time? Explain.</p>
</blockqu... | complexity theory time complexity asymptotics amortized analysis | 1 | Can an algorithm with $\Theta(n^2)$ run time be faster than an algorithm with $\Theta(n\log n)$ run time? -- (complexity theory time complexity asymptotics amortized analysis)
<p>This is a question posted for extra practice (<em>i.e.,</em> not for credit):</p>

<blockquote>
 <p>Can an algorithm with <span ... | habedi/stack-exchange-dataset |
111,243 | Complexity of Double Selection Sort | <p>I would like to find the best, average, worst-case complexities of below code.</p>

<p>Its a variant of selection sort. In each pass both min and max is calculated and placed at proper position</p>

<pre><code>def double_selection_sort(arr):
 n = len(arr)
 for i in range(int(n/2)):
... | algorithm analysis time complexity | 1 | Complexity of Double Selection Sort -- (algorithm analysis time complexity)
<p>I would like to find the best, average, worst-case complexities of below code.</p>

<p>Its a variant of selection sort. In each pass both min and max is calculated and placed at proper position</p>

<pre><code>def double_sele... | habedi/stack-exchange-dataset |
111,248 | using 2 short CRC(s) VS one longer CRC | <p>I'm doing some research on the CRCs, but i can't find informations about the use of two (or more) short CRCs compared to the use of a longer CRC:</p>

<p>Suppose that i have a dataword A of some length and 3 different generator polynomials, 2 of degree 8 and one of degree 16. These polynomials are used respe... | coding theory crc | 1 | using 2 short CRC(s) VS one longer CRC -- (coding theory crc)
<p>I'm doing some research on the CRCs, but i can't find informations about the use of two (or more) short CRCs compared to the use of a longer CRC:</p>

<p>Suppose that i have a dataword A of some length and 3 different generator polynomials, 2 of d... | habedi/stack-exchange-dataset |
111,249 | Questions about Randomized Median algorithm? | <p>In textbook by Mitzenmacher and Upfal <a href="http://mcs.ninhthuan.top/wp-content/uploads/2017/09/Probability-and-Computing-2nd-Edition.pdf" rel="nofollow noreferrer">here</a>, they write in page 62, the following:</p>

<blockquote>
 <p>By repeating Algorithm 3.1 until it succeeds in finding the median... | algorithms randomized algorithms randomized | 1 | Questions about Randomized Median algorithm? -- (algorithms randomized algorithms randomized)
<p>In textbook by Mitzenmacher and Upfal <a href="http://mcs.ninhthuan.top/wp-content/uploads/2017/09/Probability-and-Computing-2nd-Edition.pdf" rel="nofollow noreferrer">here</a>, they write in page 62, the following:</p>
... | habedi/stack-exchange-dataset |
111,254 | Printing words starting with a given letter with the least amount of appearances with the print itself being an another appearance | <p>I've had problems with this one and was unable to solve it on my Algorithms 1 exam:</p>

<p>Input:
-n words
-k letters</p>

<p>Problem:
For each letter print out the one word which starts with that letter and has the least number of appearances. If there are more than one, write the lexic... | algorithms | 1 | Printing words starting with a given letter with the least amount of appearances with the print itself being an another appearance -- (algorithms)
<p>I've had problems with this one and was unable to solve it on my Algorithms 1 exam:</p>

<p>Input:
-n words
-k letters</p>

<p>Problem:
For ea... | habedi/stack-exchange-dataset |
111,256 | Separating numbers with a minimal difference | <p>Given is a positive integer integer <span class="math-container">$n$</span>, and integers <span class="math-container">$a_1,b_1,\dots,a_n,b_n$</span> with <span class="math-container">$ a_i\leq b_i$</span> for each <span class="math-container">$i$</span>. What is the complexity of deciding whether there exist intege... | algorithms np hard | 1 | Separating numbers with a minimal difference -- (algorithms np hard)
<p>Given is a positive integer integer <span class="math-container">$n$</span>, and integers <span class="math-container">$a_1,b_1,\dots,a_n,b_n$</span> with <span class="math-container">$ a_i\leq b_i$</span> for each <span class="math-container">$i$<... | habedi/stack-exchange-dataset |
111,257 | What is the time complexity of the below code? | <pre><code>i=12

while( i < n )

{

i=i^5

i=i/3

i=i∗7

}
</code></pre>

<p>What is the complexity of the given program?</p>
 | time complexity | 1 | What is the time complexity of the below code? -- (time complexity)
<pre><code>i=12

while( i < n )

{

i=i^5

i=i/3

i=i∗7

}
</code></pre>

<p>What is the complexity of the given program?</p>
 | habedi/stack-exchange-dataset |
111,271 | How to prove the union of languages recognized by a set of turing-recognizable Turing machines is also turing-recognizable? | <p>Let <span class="math-container">$G = \{\langle M_1\rangle, \langle M_2\rangle, \langle M_3\rangle,\cdots\}$</span> be an infinite turing recognizable language, whose members are descriptions of turing machines.</p>

<p>How can one prove that the union of all the languages recognized by the turing machines i... | turing machines computability | 1 | How to prove the union of languages recognized by a set of turing-recognizable Turing machines is also turing-recognizable? -- (turing machines computability)
<p>Let <span class="math-container">$G = \{\langle M_1\rangle, \langle M_2\rangle, \langle M_3\rangle,\cdots\}$</span> be an infinite turing recognizable languag... | habedi/stack-exchange-dataset |
111,280 | Propositional truncation of excluded middle | <p>It is clear to me that it should be impossible to prove :</p>

<pre><code>exclMidl = isProp A → ((A) ⊎ (¬ A))
</code></pre>

<p>Because it would give deciding oracle for every Proposition.</p>

<p>My question is about the following Types:</p>

<pre><code>exclMidl' = isProp A → ∥ (... | dependent types homotopy type theory agda cubical type theory | 1 | Propositional truncation of excluded middle -- (dependent types homotopy type theory agda cubical type theory)
<p>It is clear to me that it should be impossible to prove :</p>

<pre><code>exclMidl = isProp A → ((A) ⊎ (¬ A))
</code></pre>

<p>Because it would give deciding oracle for every Propositio... | habedi/stack-exchange-dataset |
111,293 | Converse of pumping lemma for regular expressions | <p>I want to come up with a language that satisfies the pumping lemma while not being a regular expression.</p>

<p>I thought of <span class="math-container">$\{0^i1^j: i > j > 0\} $</span>. The pumping seems to work just fine, and this is not a regular expression, as it would not be possible to create a... | regular languages regular expressions pumping lemma | 1 | Converse of pumping lemma for regular expressions -- (regular languages regular expressions pumping lemma)
<p>I want to come up with a language that satisfies the pumping lemma while not being a regular expression.</p>

<p>I thought of <span class="math-container">$\{0^i1^j: i > j > 0\} $</span>. The pump... | habedi/stack-exchange-dataset |
111,302 | True Error of a binary classifier | <p>For a given classifier h, How is the true error over a distribution D defined?
<span class="math-container">\begin{align*}
L_D(h) &= \sideset{\mathbb{E}}{}{}_{x,y \sim D} \Pr[h(x) \neq y] \\ &=
\sideset{\mathbb{E}}{}{}_{x,y \sim D}
\begin{cases}
\Pr[y \neq 0|x] & \text{if } h(x) = 0, ... | machine learning | 1 | True Error of a binary classifier -- (machine learning)
<p>For a given classifier h, How is the true error over a distribution D defined?
<span class="math-container">\begin{align*}
L_D(h) &= \sideset{\mathbb{E}}{}{}_{x,y \sim D} \Pr[h(x) \neq y] \\ &=
\sideset{\mathbb{E}}{}{}_{x,y \sim D}
\begi... | habedi/stack-exchange-dataset |
111,306 | Is a language whose Turing Machine doesn't halt for some positive cases but for others does not recursive? | <p>Say language <span class="math-container">$L$</span> is <strong><em>recursively enumerable</em></strong>, but <strong><em>not recursive</em></strong>.
Say <span class="math-container">$a$</span> and <span class="math-container">$b$</span> are symbols of the alphabet and <span class="math-container">$w$</span> a ... | turing machines computability undecidability semi decidability | 1 | Is a language whose Turing Machine doesn't halt for some positive cases but for others does not recursive? -- (turing machines computability undecidability semi decidability)
<p>Say language <span class="math-container">$L$</span> is <strong><em>recursively enumerable</em></strong>, but <strong><em>not recursive</em></... | habedi/stack-exchange-dataset |
111,308 | Is F(F(s,x), x) necessarily a PRF if F is? | <p>Given a PRF - F, is <span class="math-container">$G_s(x)=F_{F_s(x)}(x)$</span> necessarily a PRF? </p>

<p>First I thought how to tackle this problem. First I tried using a hybrid argument:
<span class="math-container">$|\mathbb P[F_{F_s(x)}(x)] -\mathbb P[f(x)]|\leq |\mathbb P[F_{F_s(x)}(x)] -\mathbb P[... | cryptography | 1 | Is F(F(s,x), x) necessarily a PRF if F is? -- (cryptography)
<p>Given a PRF - F, is <span class="math-container">$G_s(x)=F_{F_s(x)}(x)$</span> necessarily a PRF? </p>

<p>First I thought how to tackle this problem. First I tried using a hybrid argument:
<span class="math-container">$|\mathbb P[F_{F_s(x)}(x)... | habedi/stack-exchange-dataset |
111,309 | Winning strategy using Dynamic Programing | <p>Let <span class="math-container">$G=(V,E)$</span> be a DAG and let <span class="math-container">$v_0\in V$</span>.
Alice and Bob are playing a game in which every player has his own turn and Bob is starting. In every turn <span class="math-container">$i$</span>, the player is picking an edge <span class="math-co... | graphs dynamic programming | 1 | Winning strategy using Dynamic Programing -- (graphs dynamic programming)
<p>Let <span class="math-container">$G=(V,E)$</span> be a DAG and let <span class="math-container">$v_0\in V$</span>.
Alice and Bob are playing a game in which every player has his own turn and Bob is starting. In every turn <span class="math... | habedi/stack-exchange-dataset |
111,313 | Difference between multi-tape Turing machine and single tape machine | <p>A beginner's question about "fine-grained" computational power.<br>
Let <span class="math-container">$M_k$</span> be a <span class="math-container">$k$</span>-tapes turing machine, and let <span class="math-container">$M$</span> be a single tape turing machine. We know that <span class="math-container">$M_k$</sp... | complexity theory computability time complexity computation models | 1 | Difference between multi-tape Turing machine and single tape machine -- (complexity theory computability time complexity computation models)
<p>A beginner's question about "fine-grained" computational power.<br>
Let <span class="math-container">$M_k$</span> be a <span class="math-container">$k$</span>-tapes turing ... | habedi/stack-exchange-dataset |
111,318 | Is this a syntax error or a semantic error? | <p>I came across the following question</p>
<blockquote>
<p>The error in the expression " <strong>if x>y x=2;</strong> " is detected by</p>
<p>a. Syntax analyzer
b. Lexical analyzer
c. semantic analyzer</p>
</blockquote>
<p>I know that the parentheses of x>y are missing, but ... | compilers | 1 | Is this a syntax error or a semantic error? -- (compilers)
<p>I came across the following question</p>
<blockquote>
<p>The error in the expression " <strong>if x>y x=2;</strong> " is detected by</p>
<p>a. Syntax analyzer
b. Lexical analyzer
c. semantic analyzer</p>
</blockquote>
... | habedi/stack-exchange-dataset |
111,324 | Why isn't the search space size of TSP $(n-1)!$ instead of $n!$? | <p>I'm just learning about the travelling salesman problem, and I've been playing around with it. I'm not sure if what I've found is just a special case or not. My professor says the search space size is <span class="math-container">$n!$</span>, where <span class="math-container">$n$</span> is the number of cities.</p>... | traveling salesman | 1 | Why isn't the search space size of TSP $(n-1)!$ instead of $n!$? -- (traveling salesman)
<p>I'm just learning about the travelling salesman problem, and I've been playing around with it. I'm not sure if what I've found is just a special case or not. My professor says the search space size is <span class="math-container... | habedi/stack-exchange-dataset |
111,328 | D has polynomial verifyer, the certificate for any word $w \in D$ is at most O(|log w|) space. Prove $D \in P$ | <p>Given that a language D has a polynomial verifier, </p>

<p>and given that for every word <span class="math-container">$w \in D$</span>, the length of the certificate <span class="math-container">$c$</span> is <span class="math-container">$O(\log|w|)$</span> space.</p>

<p>How can I prove that <span ... | complexity theory turing machines np | 1 | D has polynomial verifyer, the certificate for any word $w \in D$ is at most O(|log w|) space. Prove $D \in P$ -- (complexity theory turing machines np)
<p>Given that a language D has a polynomial verifier, </p>

<p>and given that for every word <span class="math-container">$w \in D$</span>, the length of the c... | habedi/stack-exchange-dataset |
111,330 | Select K columns from matrix and one element from each row that has maximum sum | <p>Given matrix of size N x M (N- rows, M - columns), given integer value K(K < N and K < M). Select arbitrary K columns and create new matrix of size N x K after that select max element from each row and calculate sum - S. Task is to find such K columns, so that this sum S will be maximum for given matrix N x M ... | algorithms matrix | 1 | Select K columns from matrix and one element from each row that has maximum sum -- (algorithms matrix)
<p>Given matrix of size N x M (N- rows, M - columns), given integer value K(K < N and K < M). Select arbitrary K columns and create new matrix of size N x K after that select max element from each row and calcul... | habedi/stack-exchange-dataset |
111,331 | Turing Machines: What is the difference between recognizing, deciding, total, accepting, rejecting? | <p>I have seen a remark saying "we usually say that a turing machine accepts/rejects a string, while it decides a language" Is this correct?</p>

<p>As I have also seen places where we mention a Turing machine "accepting a language"</p>

<p>See comment on OP's answer here, then the answer by Jan Hudec :... | turing machines | 1 | Turing Machines: What is the difference between recognizing, deciding, total, accepting, rejecting? -- (turing machines)
<p>I have seen a remark saying "we usually say that a turing machine accepts/rejects a string, while it decides a language" Is this correct?</p>

<p>As I have also seen places where we mentio... | habedi/stack-exchange-dataset |
111,332 | Can a Turing Machine be defined over many languages? | <p>What does it mean, if possible, for a Turing machine to be defined over many languages?</p>
 | turing machines | 1 | Can a Turing Machine be defined over many languages? -- (turing machines)
<p>What does it mean, if possible, for a Turing machine to be defined over many languages?</p>
 | habedi/stack-exchange-dataset |
111,337 | Turing Machines: What is the difference between the language realised by a problem and the language for which the TM accepts on? | <p>A decision problem A corresponds to the language L1 if L1 contains all of the solutions to A.</p>

<p>A language L2 is defined as the set of all inputs to which a TM halts and accepts.</p>

<p>What is the link between these two languages?</p>
 | turing machines | 1 | Turing Machines: What is the difference between the language realised by a problem and the language for which the TM accepts on? -- (turing machines)
<p>A decision problem A corresponds to the language L1 if L1 contains all of the solutions to A.</p>

<p>A language L2 is defined as the set of all inputs to whic... | habedi/stack-exchange-dataset |
111,339 | What is the link between the language defined by the Turing Machine and the algorithm that the Turing machine implements? | <p>What is the link between the language defined by the Turing Machine and the algorithm that the Turing machine implements?</p>

<p>I.e. What is the link between the language and the algorithm</p>
 | turing machines | 1 | What is the link between the language defined by the Turing Machine and the algorithm that the Turing machine implements? -- (turing machines)
<p>What is the link between the language defined by the Turing Machine and the algorithm that the Turing machine implements?</p>

<p>I.e. What is the link between the la... | habedi/stack-exchange-dataset |
111,346 | What does it mean for a TM to solve a problem? | <p>When we say a TM solves a problem, what does this mean?</p>
 | turing machines computability terminology | 1 | What does it mean for a TM to solve a problem? -- (turing machines computability terminology)
<p>When we say a TM solves a problem, what does this mean?</p>
 | habedi/stack-exchange-dataset |
111,353 | Analyze time series data to get min max over past period of time | <p>The algorithm should analyze measured time series data in <strong>realtime</strong> and should check if all values of the specified last period lay inside a specified range. The range is calculated with max-min over the specified time period.</p>

<h2>Input data</h2>

<pre><code>t | 10:00 | 10... | algorithms | 1 | Analyze time series data to get min max over past period of time -- (algorithms)
<p>The algorithm should analyze measured time series data in <strong>realtime</strong> and should check if all values of the specified last period lay inside a specified range. The range is calculated with max-min over the specified time p... | habedi/stack-exchange-dataset |
111,360 | Show that there are infinitely more problems than we will ever be able to compute | <p>I was looking at <a href="https://www.youtube.com/watch?v=moPtwq_cVH8" rel="noreferrer">this</a> reading of MIT on computational complexity and on minute <em>15:00</em> Erik Demaine embarks on a demonstration to show what is stated in the title of this question. However I cannot follow his reasoning, in practice wha... | computability proof techniques decision problem uncountability | 1 | Show that there are infinitely more problems than we will ever be able to compute -- (computability proof techniques decision problem uncountability)
<p>I was looking at <a href="https://www.youtube.com/watch?v=moPtwq_cVH8" rel="noreferrer">this</a> reading of MIT on computational complexity and on minute <em>15:00</em... | habedi/stack-exchange-dataset |
111,374 | How does a=2 twice in this code sample? | <p>I am just starting out learning code.</p>

<p>The output of the following code is OOOXOXOO, but I don't see how X can be printed twice. How does a=2 more than once?</p>

<pre><code>a = 1
while a < 3:
 b = 1
 while b < 3:
 if a == 2:
 print ("X"),
... | python iteration | 1 | How does a=2 twice in this code sample? -- (python iteration)
<p>I am just starting out learning code.</p>

<p>The output of the following code is OOOXOXOO, but I don't see how X can be printed twice. How does a=2 more than once?</p>

<pre><code>a = 1
while a < 3:
 b = 1
 while b &l... | habedi/stack-exchange-dataset |
111,375 | Why is subarray $A[p..k-1]$ empty when $k=p$? | <p>I'm working through a proof of correctness for merge sort.</p>

<p>I'm given a loop invariant for a for loop, which makes reference to a subarray <span class="math-container">$A[p..k-1]$</span>. During the initialization step of the correctness proof, my textbook says "Prior to the first iteration of the loop... | algorithm analysis arrays correctness proof notation mergesort | 1 | Why is subarray $A[p..k-1]$ empty when $k=p$? -- (algorithm analysis arrays correctness proof notation mergesort)
<p>I'm working through a proof of correctness for merge sort.</p>

<p>I'm given a loop invariant for a for loop, which makes reference to a subarray <span class="math-container">$A[p..k-1]$</span>. ... | habedi/stack-exchange-dataset |
111,380 | Prove completeness of a language with Turing Machine | <p>I'm trying to prove that a simple computer language is Turing Complete. For that, I did some researches about Turing Machine and I found (if I understand correctly), that we can prove that by simuling a Turing Machine with this language. Like Turing Machine has completeness, the fact to simulate it shows the languag... | turing machines turing completeness | 1 | Prove completeness of a language with Turing Machine -- (turing machines turing completeness)
<p>I'm trying to prove that a simple computer language is Turing Complete. For that, I did some researches about Turing Machine and I found (if I understand correctly), that we can prove that by simuling a Turing Machine with ... | habedi/stack-exchange-dataset |
111,384 | Why $P$ cannot have NULL string in Arden's Theorem? | <p>Arden's Theorem says that in the equation <span class="math-container">$R=Q+RP$</span>, the <span class="math-container">$P$</span> cannot have NULL string. In this respect,the theorem will not be valid for the expression <span class="math-container">$R=Q+R(NULL+01)$</span>. Am I correct? If so, then what will be th... | formal grammars regular expressions | 1 | Why $P$ cannot have NULL string in Arden's Theorem? -- (formal grammars regular expressions)
<p>Arden's Theorem says that in the equation <span class="math-container">$R=Q+RP$</span>, the <span class="math-container">$P$</span> cannot have NULL string. In this respect,the theorem will not be valid for the expression <s... | habedi/stack-exchange-dataset |
111,391 | Min cut of at most k edges | <p>I have been studying for my algorithms exam and whilst doing previous exams found this question for which I am not sure how to handle.</p>

<p>Given a graph <span class="math-container">$G=(V,E)$</span> with integer capacities <span class="math-container">$C:E \rightarrow \mathbb{N}$</span>, find an efficien... | algorithms network flow | 1 | Min cut of at most k edges -- (algorithms network flow)
<p>I have been studying for my algorithms exam and whilst doing previous exams found this question for which I am not sure how to handle.</p>

<p>Given a graph <span class="math-container">$G=(V,E)$</span> with integer capacities <span class="math-containe... | habedi/stack-exchange-dataset |
111,394 | Are there any "complete" languages in $coNP -NP$? | <p>Suppose <span class="math-container">$coNP \neq NP$</span></p>

<p>language B would be called "complete" in <span class="math-container">$coNP-NP$</span> if:</p>

<ol>
<li><span class="math-container">$B\in coNP - NP$</span></li>
<li><span class="math-container">$A\in coNP-NP \implies A\leq_... | complexity theory np complete np co np | 1 | Are there any "complete" languages in $coNP -NP$? -- (complexity theory np complete np co np)
<p>Suppose <span class="math-container">$coNP \neq NP$</span></p>

<p>language B would be called "complete" in <span class="math-container">$coNP-NP$</span> if:</p>

<ol>
<li><span class="math-container">$B... | habedi/stack-exchange-dataset |
111,401 | Turing Machines proof notations | <p>In context of "Computability", I have went over some proofs for Recursion
Theorem using Turing Machine description. A TM <span class="math-container">$M$</span> stands for a single tape
Turing machine and <span class="math-container">$\langle M \rangle$</span> is the description of TM <span class="math-conta... | algorithms formal languages turing machines | 1 | Turing Machines proof notations -- (algorithms formal languages turing machines)
<p>In context of "Computability", I have went over some proofs for Recursion
Theorem using Turing Machine description. A TM <span class="math-container">$M$</span> stands for a single tape
Turing machine and <span class="math-conta... | habedi/stack-exchange-dataset |
111,410 | SAT algorithm for determining if a graph is disjoint | <p>What are some good algorithms to have a SAT (CNF) solver determine if a given graph is fully-connected or disjoint?</p>

<p>The best one I can think of is this:</p>

<ul>
<li>Number the nodes 1..N, where N is the number of nodes in the graph.</li>
<li>define N^2 variables with the ordered pai... | graphs satisfiability constraint satisfaction | 1 | SAT algorithm for determining if a graph is disjoint -- (graphs satisfiability constraint satisfaction)
<p>What are some good algorithms to have a SAT (CNF) solver determine if a given graph is fully-connected or disjoint?</p>

<p>The best one I can think of is this:</p>

<ul>
<li>Number the nodes 1... | habedi/stack-exchange-dataset |
111,413 | Relaxation of the knapsack constraints | <p>A set <span class="math-container">$\mathcal{A}$</span> is the relaxation of another set <span class="math-container">$\mathcal{B}$</span>, if <span class="math-container">$\mathcal{B} \subseteq \mathcal{A}$</span>.</p>

<p>I have a set of points defined as the knapsack constraint</p>

<p><span class... | linear programming knapsack problems | 1 | Relaxation of the knapsack constraints -- (linear programming knapsack problems)
<p>A set <span class="math-container">$\mathcal{A}$</span> is the relaxation of another set <span class="math-container">$\mathcal{B}$</span>, if <span class="math-container">$\mathcal{B} \subseteq \mathcal{A}$</span>.</p>

<p>I ha... | habedi/stack-exchange-dataset |
111,419 | Which is the correct XOR Gate Symbol | <p>I'm confused between 2 XOR gate symbols, they have a minor difference but I'd still like to know if they truly are identical.</p>

<p>One looks like - <a href="https://i.stack.imgur.com/O1n13.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O1n13.png" alt="this"></a></p>

<p>The oth... | boolean algebra | 1 | Which is the correct XOR Gate Symbol -- (boolean algebra)
<p>I'm confused between 2 XOR gate symbols, they have a minor difference but I'd still like to know if they truly are identical.</p>

<p>One looks like - <a href="https://i.stack.imgur.com/O1n13.png" rel="nofollow noreferrer"><img src="https://i.stack.im... | habedi/stack-exchange-dataset |
111,421 | When scheduling intervals across multiple resources, why sort? | <p>I am reading <a href="https://www.goodreads.com/book/show/145055.Algorithm_Design" rel="nofollow noreferrer">this</a> book and am at a point when the <strong>Interval Partitioning Problem</strong> is discussed. The pseudocode they provide for it is the following:</p>

<pre><code>Sort the intervals by their s... | algorithms | 1 | When scheduling intervals across multiple resources, why sort? -- (algorithms)
<p>I am reading <a href="https://www.goodreads.com/book/show/145055.Algorithm_Design" rel="nofollow noreferrer">this</a> book and am at a point when the <strong>Interval Partitioning Problem</strong> is discussed. The pseudocode they provide... | habedi/stack-exchange-dataset |
111,433 | What is a trivial language? | <p>I have heard the quote "L is a trivial language" What does this mean and how do we relate this to Turing machines and complexity theory?</p>
 | turing machines | 1 | What is a trivial language? -- (turing machines)
<p>I have heard the quote "L is a trivial language" What does this mean and how do we relate this to Turing machines and complexity theory?</p>
 | habedi/stack-exchange-dataset |
111,434 | What is the intuition behind the relationship between space and time for an algorithm? | <p>I believe I have heard that you can never have more space than the algorithms running time. I could be wrong, maybe other way around. What is the intuition behind this?</p>
 | complexity theory turing machines | 1 | What is the intuition behind the relationship between space and time for an algorithm? -- (complexity theory turing machines)
<p>I believe I have heard that you can never have more space than the algorithms running time. I could be wrong, maybe other way around. What is the intuition behind this?</p>
 | habedi/stack-exchange-dataset |
111,437 | Is the certificate for primality testing polynomial in the length of the input? | <p>If we were to assume that primality testing was in NP.</p>

<p>What would the certificate be, so that a polynomial time verifier can check the number X is indeed prime?</p>
 | np | 1 | Is the certificate for primality testing polynomial in the length of the input? -- (np)
<p>If we were to assume that primality testing was in NP.</p>

<p>What would the certificate be, so that a polynomial time verifier can check the number X is indeed prime?</p>
 | habedi/stack-exchange-dataset |
111,439 | Why is EXPTIME in EXPSPACE? | <p>What is the intuition behind EXPTIME being inside EXPSPACE?</p>

<p>When space complexity is usually smaller than time complexity or in the worse case, they are equal</p>
 | complexity theory | 1 | Why is EXPTIME in EXPSPACE? -- (complexity theory)
<p>What is the intuition behind EXPTIME being inside EXPSPACE?</p>

<p>When space complexity is usually smaller than time complexity or in the worse case, they are equal</p>
 | habedi/stack-exchange-dataset |
111,445 | Böhm-Jacopini theorem | <p>I had a discussion with a friend developer and teacher. He told me about the Structured program theorem arguing that this theorem is one of the most important to know about. However, I have never heard about it and I don't understand how it may have deeply contributed to the computer theory. It seems quite cited in ... | algorithms turing machines | 1 | Böhm-Jacopini theorem -- (algorithms turing machines)
<p>I had a discussion with a friend developer and teacher. He told me about the Structured program theorem arguing that this theorem is one of the most important to know about. However, I have never heard about it and I don't understand how it may have deeply contri... | habedi/stack-exchange-dataset |
111,456 | L(M)=L where M is a TM that can move right or stay, so L is decidable | <p>Suppose that L(M)=L where M is a one tape TM that can move right or stay.</p>

<p>I need to Show that L is decidable.</p>

<p>I thought of reducing a PDA to this TM, since moving to the right is equivalent to popping and pushing some new symbol to the stack. and staying is the same as not touching th... | formal languages turing machines computability pushdown automata | 1 | L(M)=L where M is a TM that can move right or stay, so L is decidable -- (formal languages turing machines computability pushdown automata)
<p>Suppose that L(M)=L where M is a one tape TM that can move right or stay.</p>

<p>I need to Show that L is decidable.</p>

<p>I thought of reducing a PDA to this... | habedi/stack-exchange-dataset |
111,461 | Meaning of L* if L is a language | <p>I can't find anywhere the meaning of <span class="math-container">$L^*$</span>, given that <span class="math-container">$L$</span> is a language. I know <span class="math-container">$^* $</span> means repetition, for example <span class="math-container">$0^*$</span> = <span class="math-container">$\{ \epsilon, 0, 00... | regular languages notation kleene star | 1 | Meaning of L* if L is a language -- (regular languages notation kleene star)
<p>I can't find anywhere the meaning of <span class="math-container">$L^*$</span>, given that <span class="math-container">$L$</span> is a language. I know <span class="math-container">$^* $</span> means repetition, for example <span class="ma... | habedi/stack-exchange-dataset |
111,466 | Is the capacity achieving input of a discrete memoryless channel unique? | <p>Consider a classical discrete memoryless channel (DMC). Let <span class="math-container">$p$</span> be an input probability distribution and <span class="math-container">$Q$</span> be the channel's transition matrix. <span class="math-container">$q = Qp$</span> is a valid output probability distribution. The compone... | information theory communication protocols | 1 | Is the capacity achieving input of a discrete memoryless channel unique? -- (information theory communication protocols)
<p>Consider a classical discrete memoryless channel (DMC). Let <span class="math-container">$p$</span> be an input probability distribution and <span class="math-container">$Q$</span> be the channel'... | habedi/stack-exchange-dataset |
111,473 | How can instruction fetch and decode pipeline stages run simultaneously in a CPU with dynamic branch prediction? | <p>I have recently been investigating CPU pipelining and branch prediction and have a question about how exactly these fit together.</p>

<p>If, for example, instructions are meant to be fetched in one stage of the pipeline and decoded in the next while the next instruction is fetched simultaneously, how is it ... | computer architecture cpu cpu pipelines | 1 | How can instruction fetch and decode pipeline stages run simultaneously in a CPU with dynamic branch prediction? -- (computer architecture cpu cpu pipelines)
<p>I have recently been investigating CPU pipelining and branch prediction and have a question about how exactly these fit together.</p>

<p>If, for examp... | habedi/stack-exchange-dataset |
111,477 | The role of asymptotic notation in $e^x=1++Θ(^2)$? | <p>I'm reading CLRS and there is the following:</p>

<blockquote>
 <p>When x→0, the approximation of <span class="math-container">$e^x$</span> by <span class="math-container">$1+x$</span> is
 quite good:
 <span class="math-container">$$e^x=1++Θ(^2)$$</span></p>
</blockquote>

<p>I sup... | asymptotics | 1 | The role of asymptotic notation in $e^x=1++Θ(^2)$? -- (asymptotics)
<p>I'm reading CLRS and there is the following:</p>

<blockquote>
 <p>When x→0, the approximation of <span class="math-container">$e^x$</span> by <span class="math-container">$1+x$</span> is
 quite good:
 <span class="math-contai... | habedi/stack-exchange-dataset |
111,478 | It is decidable whether a pushdown automaton will accept a word? | <p>I'm asking myself if the problem of decide whether a push down automaton will accept a word is decidable. </p>

<p>I would say that you can simulate a push down automaton with a Turing Machine and, if it doesn't loop forever, accept the word when the automaton accepts, or reject when it does. In this case, t... | computability proof techniques pushdown automata | 1 | It is decidable whether a pushdown automaton will accept a word? -- (computability proof techniques pushdown automata)
<p>I'm asking myself if the problem of decide whether a push down automaton will accept a word is decidable. </p>

<p>I would say that you can simulate a push down automaton with a Turing Machi... | habedi/stack-exchange-dataset |
111,483 | The law of excluded middle and decidability | <p>I will divide my question in two parts. The first part I am sure that there is a objective answer, but I am not sure about the second part.</p>

<p>First part:
Is it all (decisions) problems trivial to prove decidable after assuming the Law of Excluded Middle (LEM)? e.g. There is no problem hard to prove... | logic proof techniques | 1 | The law of excluded middle and decidability -- (logic proof techniques)
<p>I will divide my question in two parts. The first part I am sure that there is a objective answer, but I am not sure about the second part.</p>

<p>First part:
Is it all (decisions) problems trivial to prove decidable after assuming ... | habedi/stack-exchange-dataset |
111,485 | Minimum cost max flow network problem with an alternative flow cost | <p>Is there a standard name or a reference for the network flow problem that looks very similar to the minimum cost maximum flow problem, only the flow cost that I wish to minimize isn't sum of edge.flow * edge.weight over edges, but rather sum of [edge.flow > 0] * edge.weight over edges, where [edge.flow > 0] equals ... | network flow | 1 | Minimum cost max flow network problem with an alternative flow cost -- (network flow)
<p>Is there a standard name or a reference for the network flow problem that looks very similar to the minimum cost maximum flow problem, only the flow cost that I wish to minimize isn't sum of edge.flow * edge.weight over edges, but ... | habedi/stack-exchange-dataset |
111,505 | Term for a graph decomposition based on a maximum matching | <p>Let <span class="math-container">$M$</span> be a maximum cardinality matching in a bipartite graph <span class="math-container">$G(X+Y,E)$</span>. Let <span class="math-container">$X_0$</span> be the subset of <span class="math-container">$X$</span> unmatched by <span class="math-container">$M$</span>. Define the fo... | terminology reference request matching bipartite matching decomposition | 1 | Term for a graph decomposition based on a maximum matching -- (terminology reference request matching bipartite matching decomposition)
<p>Let <span class="math-container">$M$</span> be a maximum cardinality matching in a bipartite graph <span class="math-container">$G(X+Y,E)$</span>. Let <span class="math-container">$... | habedi/stack-exchange-dataset |
111,507 | Turing Machine equivalence in MinTM proof | <p>The proof with contradiction that <strong><span class="math-container">$MIN_{\mathrm{TM}}$</span> is not Turing-recognizable</strong> from Michael Sipser's textbook "Introduction to the Theory of Computation" (Theorem 6.7) is as follows: </p>

<blockquote>
 <p><span class="math-container">$C=$</span> "O... | turing machines recursion semi decidability | 1 | Turing Machine equivalence in MinTM proof -- (turing machines recursion semi decidability)
<p>The proof with contradiction that <strong><span class="math-container">$MIN_{\mathrm{TM}}$</span> is not Turing-recognizable</strong> from Michael Sipser's textbook "Introduction to the Theory of Computation" (Theorem 6.7) is ... | habedi/stack-exchange-dataset |
111,509 | Minimum number of comparision to find the third largest element in an array of distinct integers? | <p>For the second largest element, I know that the formula is <span class="math-container">$n+ \lceil\log n \rceil -2 $</span></p>

<p>Is there any formula for the third largest element? and if so, what is the derivation?</p>
 | selection problem comparison | 1 | Minimum number of comparision to find the third largest element in an array of distinct integers? -- (selection problem comparison)
<p>For the second largest element, I know that the formula is <span class="math-container">$n+ \lceil\log n \rceil -2 $</span></p>

<p>Is there any formula for the third largest el... | habedi/stack-exchange-dataset |
111,512 | Introduction to Algorithms (CLRS) Ex 5.2-5 solution | <p>The following is Ex 5.2-5 from Introduction to Algorithms (CLRS), 2nd Edition.</p>

<blockquote>
 <p>Let <span class="math-container">$A[1...n]$</span> be an array of n distinct numbers. If <span class="math-container">$i<j$</span> and <span class="math-container">$A[i]>A[j]$</span>, then the pair... | probability theory randomized algorithms | 1 | Introduction to Algorithms (CLRS) Ex 5.2-5 solution -- (probability theory randomized algorithms)
<p>The following is Ex 5.2-5 from Introduction to Algorithms (CLRS), 2nd Edition.</p>

<blockquote>
 <p>Let <span class="math-container">$A[1...n]$</span> be an array of n distinct numbers. If <span class="mat... | habedi/stack-exchange-dataset |
111,519 | Permute an array in O(n) time with O(1) extra space with a given ordering function? | <p>This question arises from a problem on a problem solving site (<a href="https://practice.geeksforgeeks.org/problems/-rearrange-array-alternately/0" rel="nofollow noreferrer">https://practice.geeksforgeeks.org/problems/-rearrange-array-alternately/0</a>). </p>

<p>Given a sorted (ascending order) array <spa... | algorithms permutations | 1 | Permute an array in O(n) time with O(1) extra space with a given ordering function? -- (algorithms permutations)
<p>This question arises from a problem on a problem solving site (<a href="https://practice.geeksforgeeks.org/problems/-rearrange-array-alternately/0" rel="nofollow noreferrer">https://practice.geeksforgeeks... | habedi/stack-exchange-dataset |
111,523 | Average case analysis of linear search | <p>Based on CLRS question 2.2:</p>

<p><strong>Consider linear search again. How many elements of the input
sequence need to be checked on the average, assuming that the element being
searched for is equally likely to be any element in the array? How about in the worst case? What are the average-case an... | time complexity asymptotics | 1 | Average case analysis of linear search -- (time complexity asymptotics)
<p>Based on CLRS question 2.2:</p>

<p><strong>Consider linear search again. How many elements of the input
sequence need to be checked on the average, assuming that the element being
searched for is equally likely to be any element... | habedi/stack-exchange-dataset |
111,525 | Problem class of assigning N persons to N tasks, zero costs with prefs | <p>I am looking for the general problem class / computational complexity / algorithms for the following problem:</p>

<p><em>N tasks must be accomplished by N persons. 1 task to be done by exactly 1 person and vice versa. There is a binary preferences matrix whose (i,j) entry is 0 if person i can not do task j,... | complexity classes assignment problem resource allocation | 1 | Problem class of assigning N persons to N tasks, zero costs with prefs -- (complexity classes assignment problem resource allocation)
<p>I am looking for the general problem class / computational complexity / algorithms for the following problem:</p>

<p><em>N tasks must be accomplished by N persons. 1 task to ... | habedi/stack-exchange-dataset |
111,531 | Iteration vs Recursion question in Lisp method | <p>I am curious if the following method would be called iterative or recursive:</p>

<p><code>(define (deep-reverse items)
 (define (iter things answer)
 (cond ((null? things) answer)
 ((pair? (car things)) 
 (iter (cdr things) (cons (deep-reverse (car things)) answer)))&... | recursion iteration lisp | 1 | Iteration vs Recursion question in Lisp method -- (recursion iteration lisp)
<p>I am curious if the following method would be called iterative or recursive:</p>

<p><code>(define (deep-reverse items)
 (define (iter things answer)
 (cond ((null? things) answer)
 ((pair? (car things)) &#x... | habedi/stack-exchange-dataset |
111,536 | Slowdown when accessing data at page boundaries? | <p>Hi I have a program which accesses memory words that are located X bytes apart in virtual address space. For instance, <code>for (int i=0;<some stop condition>;i+=X){array[i]=4;}</code>.</p>

<p>I measure the execution time with a varying value of <code>X</code>. Interestingly, when <code>X</code> is t... | computer architecture cpu cache memory hardware virtual memory performance | 1 | Slowdown when accessing data at page boundaries? -- (computer architecture cpu cache memory hardware virtual memory performance)
<p>Hi I have a program which accesses memory words that are located X bytes apart in virtual address space. For instance, <code>for (int i=0;<some stop condition>;i+=X){array[i]=4;}</co... | habedi/stack-exchange-dataset |
111,547 | Language which is recursively enumerable but not recursive | <p>Can someone provide me with some examples of languages which are recursively enumerable but are not recursive. I know that there exist some languages which are not Recursive but recursively enumerable but couldn't find such examples anywhere.. :(</p>
 | turing machines automata | 1 | Language which is recursively enumerable but not recursive -- (turing machines automata)
<p>Can someone provide me with some examples of languages which are recursively enumerable but are not recursive. I know that there exist some languages which are not Recursive but recursively enumerable but couldn't find such exam... | habedi/stack-exchange-dataset |
111,550 | Checking whether there is k circles with common area | <p>I have N circles with different radius and position in the plane. The problem is finding k circles which have a common area.Obviously this can be solved using Brute-Force in <span class="math-container">$O(N^k)$</span>. Is there a more efficient way to do such query?</p>
 | computational geometry | 1 | Checking whether there is k circles with common area -- (computational geometry)
<p>I have N circles with different radius and position in the plane. The problem is finding k circles which have a common area.Obviously this can be solved using Brute-Force in <span class="math-container">$O(N^k)$</span>. Is there a more ... | habedi/stack-exchange-dataset |
111,555 | Nodes in a binary search tree that span a range | <p>I have a binary search tree of height <span class="math-container">$h$</span> with an integer in each leaf. I also have a range <span class="math-container">$[\ell,u]$</span>. I want to find a set of nodes that span the range <span class="math-container">$[\ell,u]$</span>, i.e., a set <span class="math-container">... | binary trees search trees | 1 | Nodes in a binary search tree that span a range -- (binary trees search trees)
<p>I have a binary search tree of height <span class="math-container">$h$</span> with an integer in each leaf. I also have a range <span class="math-container">$[\ell,u]$</span>. I want to find a set of nodes that span the range <span clas... | habedi/stack-exchange-dataset |
111,556 | Constraint propagation using Projection rule | <p>I've found this example of constraint propagation using projection rule 
<a href="https://i.stack.imgur.com/vSokf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vSokf.png" alt="enter image description here"></a></p>

<p>We have</p>

<pre><code>C = { x1 ≠ x2, x1 ≥ x2 }

... | constraint satisfaction constraint programming | 1 | Constraint propagation using Projection rule -- (constraint satisfaction constraint programming)
<p>I've found this example of constraint propagation using projection rule 
<a href="https://i.stack.imgur.com/vSokf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vSokf.png" alt="enter image descrip... | habedi/stack-exchange-dataset |
111,563 | Asymptotic notation and random variables | <p>I have two random variables <span class="math-container">$X$</span> and <span class="math-container">$Y$</span> and I want to bound the value of one in terms of the other (for now, I don't care about the actual distribution of their values). </p>

<p>Suppose that the two variables can have different distribu... | asymptotics notation big o notation | 1 | Asymptotic notation and random variables -- (asymptotics notation big o notation)
<p>I have two random variables <span class="math-container">$X$</span> and <span class="math-container">$Y$</span> and I want to bound the value of one in terms of the other (for now, I don't care about the actual distribution of their va... | habedi/stack-exchange-dataset |
111,566 | How can I prove the languages of incompressible words is undecidable? | <p>I have hard time understanding the proof by contradiction for the claim "<span class="math-container">$L=\{x : K(x) \ge |x| \}$</span>" is undecidable ".</p>

<p>The proof is as follows : </p>

<blockquote>
 <p>M' = " On input <span class="math-container">$n$</span> </p>
 
 <ol>
 ... | turing machines undecidability kolmogorov complexity | 1 | How can I prove the languages of incompressible words is undecidable? -- (turing machines undecidability kolmogorov complexity)
<p>I have hard time understanding the proof by contradiction for the claim "<span class="math-container">$L=\{x : K(x) \ge |x| \}$</span>" is undecidable ".</p>

<p>The proof is as fol... | habedi/stack-exchange-dataset |
111,571 | Encoding a "not-k-out-of-n" constraint for SAT solvers | <p>I'm finding myself needing to encode a "not-k-out-of-n" constraint in a SAT solver.</p>

<p>The "at-most-k-out-of-n" constraint for SAT solvers is something I can find research about -- <a href="http://www.cs.toronto.edu/~fbacchus/csc2512/at_most_k.pdf" rel="nofollow noreferrer">this paper</a> by Frisch and ... | satisfiability sat solvers applied theory | 1 | Encoding a "not-k-out-of-n" constraint for SAT solvers -- (satisfiability sat solvers applied theory)
<p>I'm finding myself needing to encode a "not-k-out-of-n" constraint in a SAT solver.</p>

<p>The "at-most-k-out-of-n" constraint for SAT solvers is something I can find research about -- <a href="http://www.c... | habedi/stack-exchange-dataset |
111,574 | Does every Partially Ordered relation and its dual have the same number of topological orderings? | <p>Given the Hasse Diagram of a Partially Ordered Relation, is it the case that both the POSET itself and its dual POSET have the same number of topological orderings? I have tried a few examples, and although it does seem to be the case, I need a formal way of proving the same. So please help me with this.</p>
 | partial order | 1 | Does every Partially Ordered relation and its dual have the same number of topological orderings? -- (partial order)
<p>Given the Hasse Diagram of a Partially Ordered Relation, is it the case that both the POSET itself and its dual POSET have the same number of topological orderings? I have tried a few examples, and al... | habedi/stack-exchange-dataset |
111,582 | Is it reasonable to model row buffers in DRAM corresponding to the same bank ID as one big row buffer? | <p>I'm creating a simple row buffer simulator to go along with a simple cache simulator in order to count hits and misses in the row buffer. Whenever a cache block isn't in the cache I want to go look for it in the row buffers of the main memory and record whether it is present of not. </p>

<p>How accurate wou... | computer architecture memory management simulation memory hardware | 1 | Is it reasonable to model row buffers in DRAM corresponding to the same bank ID as one big row buffer? -- (computer architecture memory management simulation memory hardware)
<p>I'm creating a simple row buffer simulator to go along with a simple cache simulator in order to count hits and misses in the row buffer. When... | habedi/stack-exchange-dataset |
111,589 | Is "lazy evaluation" part of the compilation process or a run-time feature? | <p>I'm studing the <code>Clean</code> functional programming language, and like other functional PL it uses Lazy Evaluation.</p>

<p>The thing that I can't get is when a PL that using that kind of evaluation evaluates the needed parameters. 
Does the compiler recognize which parameters are used and generate... | functional programming evaluation strategies | 1 | Is "lazy evaluation" part of the compilation process or a run-time feature? -- (functional programming evaluation strategies)
<p>I'm studing the <code>Clean</code> functional programming language, and like other functional PL it uses Lazy Evaluation.</p>

<p>The thing that I can't get is when a PL that using th... | habedi/stack-exchange-dataset |
111,605 | Turing machine where the next step is determined by the state and the symbols up to the read/write head | <p>Given a modified type of turning machine where</p>

<p><span class="math-container">$\delta = Q\times \Gamma^* \implies Q\times \Gamma \times \{L,R\}$</span></p>

<p>where the next step of the machine is determined by the current state and whatever written on the tape up to the current point.</p>
... | complexity theory turing machines church turing thesis | 1 | Turing machine where the next step is determined by the state and the symbols up to the read/write head -- (complexity theory turing machines church turing thesis)
<p>Given a modified type of turning machine where</p>

<p><span class="math-container">$\delta = Q\times \Gamma^* \implies Q\times \Gamma \times \{L... | habedi/stack-exchange-dataset |
111,609 | Covering radius of a code in the Hamming space | <p><a href="https://inf.ethz.ch/personal/emo/SatSem05/Papers/DantsinEtal02TCS.pdf" rel="nofollow noreferrer">A deterministic <span class="math-container">$(2−2/(k+1))^n$</span> algorithm for <span class="math-container">$k$</span>-SAT based on local search</a></p>

<p> I have read this paper and I couldn't unde... | hamming distance | 1 | Covering radius of a code in the Hamming space -- (hamming distance)
<p><a href="https://inf.ethz.ch/personal/emo/SatSem05/Papers/DantsinEtal02TCS.pdf" rel="nofollow noreferrer">A deterministic <span class="math-container">$(2−2/(k+1))^n$</span> algorithm for <span class="math-container">$k$</span>-SAT based on local s... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.