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 |
|---|---|---|---|---|---|---|
80,588 | Brute force algorithm for "Binary Puzzle" | <h2> Binary puzzle</h2>

<p>Binary puzzle is an puzzle played on a $n × n$ grid; intially some of the cells contain a zero or a one (fixed cells); the aim of the game is to fill the remaining empty cells according to the following rules:</p>

<ul>
<li>Each cell shoul... | algorithms | 1 | Brute force algorithm for "Binary Puzzle" -- (algorithms)
<h2> Binary puzzle</h2>

<p>Binary puzzle is an puzzle played on a $n × n$ grid; intially some of the cells contain a zero or a one (fixed cells); the aim of the game is to fill the remaining empty cells according to the ... | habedi/stack-exchange-dataset |
80,590 | Is possible to prove undecidability of the halting problem in Coq? | <p>I was watching the "<a href="https://youtu.be/zmhd8clDd_Y?t=2m58s" rel="noreferrer">Five Stages of Accepting Constructive Mathematics</a>" by Andrej Bauer and he says that there is two kinds of proof by contradiction (or two things that mathematicians call proof by contradiction):</p>

<ol>
<li>Assume $P... | halting problem coq | 1 | Is possible to prove undecidability of the halting problem in Coq? -- (halting problem coq)
<p>I was watching the "<a href="https://youtu.be/zmhd8clDd_Y?t=2m58s" rel="noreferrer">Five Stages of Accepting Constructive Mathematics</a>" by Andrej Bauer and he says that there is two kinds of proof by contradiction (or two ... | habedi/stack-exchange-dataset |
80,593 | Time Complexity of a iterative program | <pre><code>sum = 0;
for (int i = 1; i <= n; i++ )
 for (int j = 1; j <= i*i; j++)
 if (j % i ==0)
 for (int k = 0; k < j k++)
 sum++;
</code></pre>

<p>I am trying to find out time complexity of this above program. </p>

<p>First "for ... | algorithms algorithm analysis runtime analysis loops | 1 | Time Complexity of a iterative program -- (algorithms algorithm analysis runtime analysis loops)
<pre><code>sum = 0;
for (int i = 1; i <= n; i++ )
 for (int j = 1; j <= i*i; j++)
 if (j % i ==0)
 for (int k = 0; k < j k++)
 sum++;
</code></pre>
&#... | habedi/stack-exchange-dataset |
80,597 | DFA and equivalence classes: counting odd numbers of b's | <p>I am studying for an exam and found an exercise about finding the equivalence classes for $L=a^*ba^*(ba^*ba^*)^*$, the language over $\{a,b\}^*$ with an odd number of b's. </p>

<p>We found three equivalence classes: $[a^*], [a^*ba^*(ba^*ba^*)^*], [a^*ba^*ba^*(ba^*ba^*)^*]$. This means the minimal DFA would ... | formal languages | 1 | DFA and equivalence classes: counting odd numbers of b's -- (formal languages)
<p>I am studying for an exam and found an exercise about finding the equivalence classes for $L=a^*ba^*(ba^*ba^*)^*$, the language over $\{a,b\}^*$ with an odd number of b's. </p>

<p>We found three equivalence classes: $[a^*], [a^*b... | habedi/stack-exchange-dataset |
80,605 | Lower bounds: Detecting a length 2 path | <blockquote>
 <p>Prove that determining if a non-directed graph of $n$ vertices has or doesn't have a length $2$ path requires time $\Omega(n^2)$, assuming that the graph is represented as an adjacency matrix.</p>
</blockquote>
 | graphs lower bounds | 1 | Lower bounds: Detecting a length 2 path -- (graphs lower bounds)
<blockquote>
 <p>Prove that determining if a non-directed graph of $n$ vertices has or doesn't have a length $2$ path requires time $\Omega(n^2)$, assuming that the graph is represented as an adjacency matrix.</p>
</blockquote>
 | habedi/stack-exchange-dataset |
80,614 | Mathematics topics or fields that increase computer programming proficiency? | <p>Generally computer programmers who are mathematicians or have mathematics background are very good in terms of algorithms and computer programming in general.</p>

<p><strong>What I am not saying:</strong></p>

<p>Mathematics is needed to be a good computer programmer.
Mathematics is necessary fo... | mathematical foundations | 1 | Mathematics topics or fields that increase computer programming proficiency? -- (mathematical foundations)
<p>Generally computer programmers who are mathematicians or have mathematics background are very good in terms of algorithms and computer programming in general.</p>

<p><strong>What I am not saying:</stro... | habedi/stack-exchange-dataset |
80,623 | NP-completeness | <p>Q: Suppose a language A is NP-complete. Is this following statement correct?:</p>

<p>A: If there is a polynomial algorithm to solve A, then it can be used to all the problems in NP.</p>

<p>My (and some others) first thoughts were that this answer is correct. But if you look at the following picture... | np complete np decision problem | 1 | NP-completeness -- (np complete np decision problem)
<p>Q: Suppose a language A is NP-complete. Is this following statement correct?:</p>

<p>A: If there is a polynomial algorithm to solve A, then it can be used to all the problems in NP.</p>

<p>My (and some others) first thoughts were that this answer... | habedi/stack-exchange-dataset |
80,624 | Does "in-place" for $n$ items imply space dominated by $n$? | <p>Does the characterisation of an algorithm for $n$ items as <em>in-place</em> imply space ∊ $ο(n)$</p>

<ol>
<li>formally</li>
<li>informally ("among coders")?</li>
</ol>
 | terminology asymptotics | 1 | Does "in-place" for $n$ items imply space dominated by $n$? -- (terminology asymptotics)
<p>Does the characterisation of an algorithm for $n$ items as <em>in-place</em> imply space ∊ $ο(n)$</p>

<ol>
<li>formally</li>
<li>informally ("among coders")?</li>
</ol>
 | habedi/stack-exchange-dataset |
80,626 | Estimate complexity of integer sequence enumeration | <p>I would like to seek help on the complexity of the following problem. Given positive integers $m$, $n$, $D_1$ and $D_2$, find all sequences $a_1\lt a_2 \lt \dots \lt a_n$ are there such that:</p>

<ol>
<li>each $a_i\in\{1, \dots, m\}$</li>
<li>$\sum_{i=1}^n a_i = D_1$</li>
<li>$\sum_{i=1}^n a_i... | integer programming | 1 | Estimate complexity of integer sequence enumeration -- (integer programming)
<p>I would like to seek help on the complexity of the following problem. Given positive integers $m$, $n$, $D_1$ and $D_2$, find all sequences $a_1\lt a_2 \lt \dots \lt a_n$ are there such that:</p>

<ol>
<li>each $a_i\in\{1, \do... | habedi/stack-exchange-dataset |
80,628 | Basic question on intermediate code generation | <p><img src="https://i.stack.imgur.com/IWSuZ.jpg" alt="Intemediate code optimizer diagram"></p>

<p>In this diagram, I have a doubt in the 2nd picture. How can different languages have same independent code optimizer ? </p>

<p>I think that different languages will have their own code optimizer(differen... | compilers | 1 | Basic question on intermediate code generation -- (compilers)
<p><img src="https://i.stack.imgur.com/IWSuZ.jpg" alt="Intemediate code optimizer diagram"></p>

<p>In this diagram, I have a doubt in the 2nd picture. How can different languages have same independent code optimizer ? </p>

<p>I think that d... | habedi/stack-exchange-dataset |
80,636 | Minimum spanning tree of a connected induced subgraph | <p>I'm doing an online course in which I'm struggling with the following multiple-choice question:</p>
<blockquote>
<p>Suppose <span class="math-container">$ T $</span> is a minimum spanning tree of the connected graph <span class="math-container">$ G $</span>.
Let <span class="math-container">$ H $</span> ... | graphs minimum spanning tree | 1 | Minimum spanning tree of a connected induced subgraph -- (graphs minimum spanning tree)
<p>I'm doing an online course in which I'm struggling with the following multiple-choice question:</p>
<blockquote>
<p>Suppose <span class="math-container">$ T $</span> is a minimum spanning tree of the connected graph <span... | habedi/stack-exchange-dataset |
80,640 | Is NPSPACE also closed under polynomial-time reduction and under log-space reduction? | <p>The complexity classes P, NP, and PSPACE are closed under polynomial-time reduction.</p>

<p>The complexity classes L, NL, P, NP and PSPACE are closed under log-space reduction.</p>

<p>I wonder if NPSPACE is also closed under polynomial-time reduction and/or under log-space reduction.</p>
 | complexity theory reductions complexity classes | 1 | Is NPSPACE also closed under polynomial-time reduction and under log-space reduction? -- (complexity theory reductions complexity classes)
<p>The complexity classes P, NP, and PSPACE are closed under polynomial-time reduction.</p>

<p>The complexity classes L, NL, P, NP and PSPACE are closed under log-space red... | habedi/stack-exchange-dataset |
80,648 | Is my problem NP-Hard? | <p>I have a grocery dotted list of pairs which are missing items that I need and I don't have any of them, so I am going to the supermarket.</p>

<p>Each pair in the dotted list is the name of the missing item that I need and a natural number which is the quantity/amount i.e. how many of this item I need.</p>&#... | complexity theory decision problem | 1 | Is my problem NP-Hard? -- (complexity theory decision problem)
<p>I have a grocery dotted list of pairs which are missing items that I need and I don't have any of them, so I am going to the supermarket.</p>

<p>Each pair in the dotted list is the name of the missing item that I need and a natural number which ... | habedi/stack-exchange-dataset |
80,649 | Are typical sets larger, when information is messier? | <p>Let $0\le q<p\le \frac{1}{2}$, and let $P,Q$ be two Bernoulli Random Variables such that:
$$Pr[P=1]=p ; Pr[P=0]=1-p$$ and $$Pr[Q=1]=q ; Pr[Q=0]=1-q$$
<strong>My question:</strong> Does it follow that, for any $\epsilon>0$ and $n$ as large as desired $|A_\epsilon^{(n)}(Q)|<|A_\epsilon^{(n)}(P)|$? I.e... | probability theory sets information theory | 1 | Are typical sets larger, when information is messier? -- (probability theory sets information theory)
<p>Let $0\le q<p\le \frac{1}{2}$, and let $P,Q$ be two Bernoulli Random Variables such that:
$$Pr[P=1]=p ; Pr[P=0]=1-p$$ and $$Pr[Q=1]=q ; Pr[Q=0]=1-q$$
<strong>My question:</strong> Does it follow that, for... | habedi/stack-exchange-dataset |
80,654 | Is it an open problem if generalized resolution is always possible? | <p>Let we have a 3CNF under following restriction: each variable occurs 3 times.</p>

<p>Then I apply generalized resolution (GR) (I don't know which name would fit more) technique (number of clauses can be arbitrary large, just an example):</p>

<p>$(x\lor A)\land(x\lor B)\land(\overline x\lor C)=(A\lo... | algorithms logic satisfiability | 1 | Is it an open problem if generalized resolution is always possible? -- (algorithms logic satisfiability)
<p>Let we have a 3CNF under following restriction: each variable occurs 3 times.</p>

<p>Then I apply generalized resolution (GR) (I don't know which name would fit more) technique (number of clauses can be ... | habedi/stack-exchange-dataset |
80,656 | Unrolling closures into SAT boolean formula | <p>I need to verify some assertions about the minimalist Turing-complete language <a href="https://web.archive.org/web/20160507165333/http://semarch.linguistics.fas.nyu.edu/barker/Iota" rel="nofollow noreferrer">Jot</a>.</p>

<p>Many of the assertions I want to investigate are semi-deciable (co-recursively enum... | satisfiability lambda calculus kolmogorov complexity | 1 | Unrolling closures into SAT boolean formula -- (satisfiability lambda calculus kolmogorov complexity)
<p>I need to verify some assertions about the minimalist Turing-complete language <a href="https://web.archive.org/web/20160507165333/http://semarch.linguistics.fas.nyu.edu/barker/Iota" rel="nofollow noreferrer">Jot</a... | habedi/stack-exchange-dataset |
80,673 | How is PowerPoint Turing complete? | <p>From my understanding, Turing complete means that the program or machine can complete any computation that a Turing machine can complete, which to me means any computation. So how can something like HTML or PowerPoint be Turing complete?</p>
 | computability turing completeness | 1 | How is PowerPoint Turing complete? -- (computability turing completeness)
<p>From my understanding, Turing complete means that the program or machine can complete any computation that a Turing machine can complete, which to me means any computation. So how can something like HTML or PowerPoint be Turing complete?</p>&#... | habedi/stack-exchange-dataset |
80,676 | Proof that locality is sufficient in showing two graphs are isomorphic | <p>Using the graph representation with (node, [list of neighbours]), to show that two graphs are isomorphic it is sufficient to:</p>

<ul>
<li>show that the vertices have the same degree and</li>
<li>for every pair of vertices with the same degree, the degrees of the nodes in their adjacency list must b... | algorithms graphs correctness proof graph isomorphism | 1 | Proof that locality is sufficient in showing two graphs are isomorphic -- (algorithms graphs correctness proof graph isomorphism)
<p>Using the graph representation with (node, [list of neighbours]), to show that two graphs are isomorphic it is sufficient to:</p>

<ul>
<li>show that the vertices have the sam... | habedi/stack-exchange-dataset |
80,677 | How can I multiply a binary representation by ten using logic gates? | <p>So I’m currently working on something and I have converted all decimal digits 0-9 into binary.
But now I want to take say 6 in binary and increase its order of magnitude by base 10 (turning 6 into 60) without converting back to base 10.
Is this possible and if so is there a way to do it with any number, X --... | arithmetic binary | 1 | How can I multiply a binary representation by ten using logic gates? -- (arithmetic binary)
<p>So I’m currently working on something and I have converted all decimal digits 0-9 into binary.
But now I want to take say 6 in binary and increase its order of magnitude by base 10 (turning 6 into 60) without converting b... | habedi/stack-exchange-dataset |
80,678 | Where does LL parser belong in the top-down parsers classification | <p>There are four types of top-down parsers according to <a href="https://stackoverflow.com/a/45977727/2545680">this answer</a>:</p>

<ul>
<li>recursive descent backtracking</li>
<li>recursive descent predictive</li>
<li>table-driven with backtracking</li>
<li>table-driven predictive.</li>
<... | formal grammars compilers parsers syntax trees | 1 | Where does LL parser belong in the top-down parsers classification -- (formal grammars compilers parsers syntax trees)
<p>There are four types of top-down parsers according to <a href="https://stackoverflow.com/a/45977727/2545680">this answer</a>:</p>

<ul>
<li>recursive descent backtracking</li>
<li>re... | habedi/stack-exchange-dataset |
80,684 | What is the definition of a property? | <p>I have seen 2 answers in stackoverflow:</p>

<ol>
<li><p><a href="https://cs.stackexchange.com/a/21399/74184">A "trivial" property is one that holds either for all languages or for none.</a></p></li>
<li><p><a href="https://cs.stackexchange.com/a/22108/74184">The property is trivial if it contains ev... | computability rice theorem | 1 | What is the definition of a property? -- (computability rice theorem)
<p>I have seen 2 answers in stackoverflow:</p>

<ol>
<li><p><a href="https://cs.stackexchange.com/a/21399/74184">A "trivial" property is one that holds either for all languages or for none.</a></p></li>
<li><p><a href="https://cs.stac... | habedi/stack-exchange-dataset |
80,686 | Complexity of ANOTHER HAMILTONIAN CIRCUIT problem | <p>All references I find about the ANOTHER HAMILTONIAN CIRCUIT problem:</p>

<blockquote>
 <p>Given a graph and a hamiltonian circuit on it, is there another
 hamiltonian circuit on it?</p>
</blockquote>

<p>I was trying to reduce it to the hamiltonian circuit problem but I always need to ... | complexity theory graphs np complete hamiltonian circuit | 1 | Complexity of ANOTHER HAMILTONIAN CIRCUIT problem -- (complexity theory graphs np complete hamiltonian circuit)
<p>All references I find about the ANOTHER HAMILTONIAN CIRCUIT problem:</p>

<blockquote>
 <p>Given a graph and a hamiltonian circuit on it, is there another
 hamiltonian circuit on it?</p>&... | habedi/stack-exchange-dataset |
80,691 | Find the Context Free Grammar | <p>Let $\Sigma = \{a, b\}$. For each of the following languages, find a grammar that generates it.</p>

<p>(a) $L_1 = \{a^n b^m : n\geq 0, m>n\}$</p>

<p>(b) $L_1^3$</p>

<p>(C) $L_1^*$</p>

<p>I know the grammar for the language $L_1$, that is<br></p>

<p>$S \rightarrow aSb \... | formal languages context free formal grammars | 1 | Find the Context Free Grammar -- (formal languages context free formal grammars)
<p>Let $\Sigma = \{a, b\}$. For each of the following languages, find a grammar that generates it.</p>

<p>(a) $L_1 = \{a^n b^m : n\geq 0, m>n\}$</p>

<p>(b) $L_1^3$</p>

<p>(C) $L_1^*$</p>

<p>I know the... | habedi/stack-exchange-dataset |
80,695 | Find the grammar for the given language | <p>$L = \{ w: |w| \bmod 3 \geq |w| \bmod 2 \}$ </p>

<p>I know, when the length of strings is not $3, 9, 15, 21,\dots,$ they will be members of the given language but unable to write a grammar for this language.</p>

<p>Please confirm one more thing, that this given language is regular?</p>
 | formal languages regular languages | 1 | Find the grammar for the given language -- (formal languages regular languages)
<p>$L = \{ w: |w| \bmod 3 \geq |w| \bmod 2 \}$ </p>

<p>I know, when the length of strings is not $3, 9, 15, 21,\dots,$ they will be members of the given language but unable to write a grammar for this language.</p>

<p>Plea... | habedi/stack-exchange-dataset |
80,700 | 2CNF with 3 variable occurences | <p>If we do not allow unit clauses, can 2CNF containing 3 occurences per variable be unsatisfiable?</p>

<p>Every time I try to connect opposing variables to a cycle, I need to draw 4 edges for at least one variable (2 per positive and negative occurences).</p>

<p>So, is it even possible?</p>
 | boolean algebra 2 sat | 1 | 2CNF with 3 variable occurences -- (boolean algebra 2 sat)
<p>If we do not allow unit clauses, can 2CNF containing 3 occurences per variable be unsatisfiable?</p>

<p>Every time I try to connect opposing variables to a cycle, I need to draw 4 edges for at least one variable (2 per positive and negative occurenc... | habedi/stack-exchange-dataset |
80,705 | Mathematical equivalent of reduce()? | <p>filter() in functional programming can be thought of as being analogous to an equation that <em>filters</em> the range of the variable.</p>

<p>map() can be through of as a function mapping domain to codomain.</p>

<p>reduce() is the only one I have a problem with. To me it just seems to be a special... | functional programming mathematical foundations | 1 | Mathematical equivalent of reduce()? -- (functional programming mathematical foundations)
<p>filter() in functional programming can be thought of as being analogous to an equation that <em>filters</em> the range of the variable.</p>

<p>map() can be through of as a function mapping domain to codomain.</p>
&... | habedi/stack-exchange-dataset |
80,711 | How can I partition a graph such that as few edges as possible cross partition boundaries? | <p>The following problem appeared while trying to distribute a program over a cluster of computers:</p>

<p>Given an undirected graph $G=(V,E)$ and an integer $n$, partition the vertices of $G$ into $n$ partitions $V_i$ of about equal size such that the number of edges crossing partition boundaries is minimised... | algorithms graphs optimization | 1 | How can I partition a graph such that as few edges as possible cross partition boundaries? -- (algorithms graphs optimization)
<p>The following problem appeared while trying to distribute a program over a cluster of computers:</p>

<p>Given an undirected graph $G=(V,E)$ and an integer $n$, partition the vertice... | habedi/stack-exchange-dataset |
80,713 | What is the complexity of deciding if the intersection of a regular language and a context free language is empty? | <p>Let's say we have a context free language, the CFG that produces it.</p>

<p>And then we have a DFA for a regular language.</p>

<p>If the intersection is empty is decidable, but how and how efficiently?</p>

<p>And if you could be so kind, please explain the best known algorithm as simple as... | complexity theory formal languages | 1 | What is the complexity of deciding if the intersection of a regular language and a context free language is empty? -- (complexity theory formal languages)
<p>Let's say we have a context free language, the CFG that produces it.</p>

<p>And then we have a DFA for a regular language.</p>

<p>If the interse... | habedi/stack-exchange-dataset |
80,718 | Why $\left\lceil lgn \right\rceil <lgn+1\le 2lgn\quad for\quad all\quad n\ge 2$ | <p>I have some confusion about 3.2-4 in CLRS.
 Here is the question :</p>

<p>Is the function $\left\lceil \log { n } \right\rceil !$ polynomially bounded? Is the function $\left\lceil \log { \log { n } } \right\rceil !$ polynomially bounded?</p>

<p>Here is the official answer:
<a href="http... | asymptotics notation | 1 | Why $\left\lceil lgn \right\rceil <lgn+1\le 2lgn\quad for\quad all\quad n\ge 2$ -- (asymptotics notation)
<p>I have some confusion about 3.2-4 in CLRS.
 Here is the question :</p>

<p>Is the function $\left\lceil \log { n } \right\rceil !$ polynomially bounded? Is the function $\left\lceil \log { \log { n ... | habedi/stack-exchange-dataset |
80,722 | If $B$ is in $SPACE(n^2)$ and $A \leq_p B$ then so $A$ will be in $SPACE(n^2)$? | <p>We know that if $B$ is in $P$ and if $A \leq_p B$ then $A$ is in $P$ too.</p>

<p>If $B$ is in $SPACE(n^2)$ and $A \leq_p B$ then so $A$ will be in $SPACE(n^2)$?</p>

<p>I think that the answer to this question is true, because if $A\in P$ then $A \in PSPACE$, and then $A$ could be in $SPACE(n^2)$. ... | complexity theory time complexity space complexity | 1 | If $B$ is in $SPACE(n^2)$ and $A \leq_p B$ then so $A$ will be in $SPACE(n^2)$? -- (complexity theory time complexity space complexity)
<p>We know that if $B$ is in $P$ and if $A \leq_p B$ then $A$ is in $P$ too.</p>

<p>If $B$ is in $SPACE(n^2)$ and $A \leq_p B$ then so $A$ will be in $SPACE(n^2)$?</p>
&#... | habedi/stack-exchange-dataset |
80,727 | Minimal colouring problem aproximation threshold | <blockquote>
 <p>Given that 3-colouring and 4-colouring are NP-complete show that the
 aproximation threshold of the minimal colouring problem is greater or
 equal than $\frac{4}{3}$.</p>
</blockquote>

<p>My current approach is to work by contradiction assuming there was such an algorithm th... | complexity theory colorings | 1 | Minimal colouring problem aproximation threshold -- (complexity theory colorings)
<blockquote>
 <p>Given that 3-colouring and 4-colouring are NP-complete show that the
 aproximation threshold of the minimal colouring problem is greater or
 equal than $\frac{4}{3}$.</p>
</blockquote>

<p>My cu... | habedi/stack-exchange-dataset |
80,733 | Cases where string concatenation is commutative | <p>Strings are known to not satisfy the commutative property.
pq is not equal qp unless p is empty string. Is there a case where pq can be qp where both are non empty strings and p and q are distinct</p>
 | formal languages | 1 | Cases where string concatenation is commutative -- (formal languages)
<p>Strings are known to not satisfy the commutative property.
pq is not equal qp unless p is empty string. Is there a case where pq can be qp where both are non empty strings and p and q are distinct</p>
 | habedi/stack-exchange-dataset |
80,735 | Feature selections : Still a high dimentionality | <p>One of the advantage of using a features reduction/sub feature selection is to avoid a high dimentionality.</p>

<p>The most known method is the Forward selection, where it finds the best combinations of features among others, iteratively. Now please have a look at this picture retrieved from a ppt slide on ... | image processing classification features | 1 | Feature selections : Still a high dimentionality -- (image processing classification features)
<p>One of the advantage of using a features reduction/sub feature selection is to avoid a high dimentionality.</p>

<p>The most known method is the Forward selection, where it finds the best combinations of features a... | habedi/stack-exchange-dataset |
80,738 | Showing MAXIMUM CLique is NPO-simple and MAXIMUM GRAPH COLORING is not | <p>Recall the notion of <a href="https://en.wikipedia.org/wiki/Optimization_problem#NP_optimization_problem" rel="nofollow noreferrer">NPO problem</a>. An NPO problem is simple if the following is true:</p>

<p>$\forall k \in \mathbb{N}^*. (\forall x. OPT(x) \leq k) \in P$ </p>

<p>In words, given any p... | complexity theory optimization colorings clique | 1 | Showing MAXIMUM CLique is NPO-simple and MAXIMUM GRAPH COLORING is not -- (complexity theory optimization colorings clique)
<p>Recall the notion of <a href="https://en.wikipedia.org/wiki/Optimization_problem#NP_optimization_problem" rel="nofollow noreferrer">NPO problem</a>. An NPO problem is simple if the following is... | habedi/stack-exchange-dataset |
80,740 | If $L_1,L_2\in \mathrm{NP}$ and $w\in L_1$ or $w\in L_2$ then can $L_1\cup L_2=L$'s verifier use the same certificate $c$ for $w$? | <p>I read the following solution for Showing that <span class="math-container">$\mathrm{NP}$</span> is closed under union
and they used the same <span class="math-container">$c$</span> for both the verifies <span class="math-container">$V_1$</span> and <span class="math-container">$V_2$</span>. <strong>Why is it co... | complexity theory | 1 | If $L_1,L_2\in \mathrm{NP}$ and $w\in L_1$ or $w\in L_2$ then can $L_1\cup L_2=L$'s verifier use the same certificate $c$ for $w$? -- (complexity theory)
<p>I read the following solution for Showing that <span class="math-container">$\mathrm{NP}$</span> is closed under union
and they used the same <span class="math... | habedi/stack-exchange-dataset |
80,750 | Average number of comparisons in sorted insertion | <p>The questions is pretty simple: Given a sorted array of N elements, what is the average number of comparisons made in order to add a new element (let's call it x) in its correct position?<br>
I am using linear search for that task.</p>

<p>So far, I've tried to solve it this way:</p>

<pre><code>... | algorithm analysis mathematical analysis | 1 | Average number of comparisons in sorted insertion -- (algorithm analysis mathematical analysis)
<p>The questions is pretty simple: Given a sorted array of N elements, what is the average number of comparisons made in order to add a new element (let's call it x) in its correct position?<br>
I am using linear search ... | habedi/stack-exchange-dataset |
80,756 | A confusion about the Reduction via Computation History | <p>[Updates: Thanks for @Raphael 's notification, I delete the screenshot of the book and type the $LaTex$ materials]</p>

<p>In Sisper's Intro to the theory of Computation, there is a reduction method via Computation History. He proves theorem 5.10 and 5.13 (3rd edition, page223) by that method. (I append the ... | computability reductions undecidability proof techniques linear bounded automata | 1 | A confusion about the Reduction via Computation History -- (computability reductions undecidability proof techniques linear bounded automata)
<p>[Updates: Thanks for @Raphael 's notification, I delete the screenshot of the book and type the $LaTex$ materials]</p>

<p>In Sisper's Intro to the theory of Computati... | habedi/stack-exchange-dataset |
80,759 | Construction of the complement of universal Turing machine - where is the catch? | <p>This is pretty fundamental but I'm getting confused. Let $U$ be the Universal Turing Machine and $L_{u}$ the language it accepts which is recursively enumerable. Obviously we are not able to construct the machine for its complement i.e. for $\bar{L_{u}}$, otherwise the whole theory crashes but still let's try. Let $... | computability turing machines undecidability proof techniques | 1 | Construction of the complement of universal Turing machine - where is the catch? -- (computability turing machines undecidability proof techniques)
<p>This is pretty fundamental but I'm getting confused. Let $U$ be the Universal Turing Machine and $L_{u}$ the language it accepts which is recursively enumerable. Obvious... | habedi/stack-exchange-dataset |
80,771 | Movement on Labyrinth with Best First Search | <p>I have the following labyrinth where <code>R</code> is the robot(the parent node), red blocks are the obstacles where the <code>R</code> cannot move and <code>GOAL</code> is the node where we want the robot to go. Every node should be written in this form <code>R(1,2,4)</code>, <code>1</code> is the row, <code>2</co... | algorithms graphs shortest path heuristics searching | 1 | Movement on Labyrinth with Best First Search -- (algorithms graphs shortest path heuristics searching)
<p>I have the following labyrinth where <code>R</code> is the robot(the parent node), red blocks are the obstacles where the <code>R</code> cannot move and <code>GOAL</code> is the node where we want the robot to go. ... | habedi/stack-exchange-dataset |
80,774 | Prove that Hitting Set is NP-Complete | <p>The Hitting Set Problem (HS) is defined as follow. Let $(C,k$)</p>

<ul>
<li>$C = \{ S_1, S_2, ..., S_m \}$ collection of subset of S i.e. $ S_i \subseteq S , \forall i$ </li>
<li>$k \in \mathbb{N}$ </li>
</ul>

<p>We want to know if exists ${S}' \subset S$ where $|{S}'| < k$ such that... | complexity theory np complete decision problem information theory | 1 | Prove that Hitting Set is NP-Complete -- (complexity theory np complete decision problem information theory)
<p>The Hitting Set Problem (HS) is defined as follow. Let $(C,k$)</p>

<ul>
<li>$C = \{ S_1, S_2, ..., S_m \}$ collection of subset of S i.e. $ S_i \subseteq S , \forall i$ </li>
<li>$k \in \math... | habedi/stack-exchange-dataset |
80,778 | When is conditional Kolmogorov complexity zero? | <p>It seems intuitive that conditional Kolmogorov complexity is only zero when the bitstrings are the same, and otherwise is greater than 0. I.e. if $b_1 = b_2$, then $K(b_1|b_2) = 0$, otherwise $K(b_1|b_2) > 0$.</p>

<p>However, if that is the case, then we could break a long bitstring into many smaller, d... | kolmogorov complexity | 1 | When is conditional Kolmogorov complexity zero? -- (kolmogorov complexity)
<p>It seems intuitive that conditional Kolmogorov complexity is only zero when the bitstrings are the same, and otherwise is greater than 0. I.e. if $b_1 = b_2$, then $K(b_1|b_2) = 0$, otherwise $K(b_1|b_2) > 0$.</p>

<p>However, if ... | habedi/stack-exchange-dataset |
80,798 | Portfolio rebalancing algorithm | <p>Quite possibly this problem is already solved and has it's own name, but I was unable to find any directions.</p>

<p>So, I have a portfolio with some items in it:</p>

<pre>
| Name | Price | Amount | Share |
|--------|-------|--------|-------|
| Item 1 | 200 | 1 | 25% |
| ... | algorithms optimization | 1 | Portfolio rebalancing algorithm -- (algorithms optimization)
<p>Quite possibly this problem is already solved and has it's own name, but I was unable to find any directions.</p>

<p>So, I have a portfolio with some items in it:</p>

<pre>
| Name | Price | Amount | Share |
|--------|-------|---... | habedi/stack-exchange-dataset |
80,802 | How is it possible that $L_1$ is $NP$? | <p><strong>The question is from my complexity-theory course.</strong></p>

<h2>The question</h2>

<p>If $L_1,L_2,L_3 \in \lbrace 0,1 \rbrace^*$, and different from $\lbrace 0,1 \rbrace^*$ and from the empty language, prove that if $L_1 \leq_p L_2 \cap L_3$, where $L_2 \in NP$ and $L_3 \in P$ then $L_1 ... | complexity theory np complexity classes sets | 1 | How is it possible that $L_1$ is $NP$? -- (complexity theory np complexity classes sets)
<p><strong>The question is from my complexity-theory course.</strong></p>

<h2>The question</h2>

<p>If $L_1,L_2,L_3 \in \lbrace 0,1 \rbrace^*$, and different from $\lbrace 0,1 \rbrace^*$ and from the empty language... | habedi/stack-exchange-dataset |
80,805 | How to prove a complete binary tree of depth N has $2^{N+1} - 1$ nodes? | <p>Here is the description of a proof problem: </p>

<p>A complete binary tree of depth <strong>N</strong> is a binary tree in which every node on levels $0,1,2,...,N-1$ is a parent and has two children, and each node on level <strong>N</strong> is a leaf. </p>

<p>It's asking for <em>proving binary ... | algorithms data structures | 1 | How to prove a complete binary tree of depth N has $2^{N+1} - 1$ nodes? -- (algorithms data structures)
<p>Here is the description of a proof problem: </p>

<p>A complete binary tree of depth <strong>N</strong> is a binary tree in which every node on levels $0,1,2,...,N-1$ is a parent and has two children, a... | habedi/stack-exchange-dataset |
80,817 | Can we have a strictly monotonically increasing/decreasing sequence generated by a distributed system? | <p>Just what the title says.
Can we have a strictly monotonically increasing/decreasing sequence generated by a distributed system (without a single point of failure)?</p>

<p>My current thoughts are that this is a consensus problem, and is thus impossible to achieve in an asynchronous messaging system (lik... | distributed systems synchronization consensus | 1 | Can we have a strictly monotonically increasing/decreasing sequence generated by a distributed system? -- (distributed systems synchronization consensus)
<p>Just what the title says.
Can we have a strictly monotonically increasing/decreasing sequence generated by a distributed system (without a single point of fail... | habedi/stack-exchange-dataset |
80,821 | Branch & Bound: Avoiding equivalent solutions | <p>There is a certain family of typical branch & bound problems in which we have to put $n$ objects into $m$ indistinguishable bags.</p>

<p>Usually solutions are represented by $n$-size vectors in which $V[i]$ means that the $i$-th element is in the $V[i]$-th bag.</p>

<p>Is there a way to avoid ge... | time complexity branch and bound | 1 | Branch & Bound: Avoiding equivalent solutions -- (time complexity branch and bound)
<p>There is a certain family of typical branch & bound problems in which we have to put $n$ objects into $m$ indistinguishable bags.</p>

<p>Usually solutions are represented by $n$-size vectors in which $V[i]$ means that th... | habedi/stack-exchange-dataset |
80,831 | Are the undecidable languages closed under complement? | <p>Are the undecidable languages closed under complement? 
How can the answer be proved?</p>
 | formal languages computability undecidability closure properties | 1 | Are the undecidable languages closed under complement? -- (formal languages computability undecidability closure properties)
<p>Are the undecidable languages closed under complement? 
How can the answer be proved?</p>
 | habedi/stack-exchange-dataset |
80,834 | Is there a discipline studying the prioritizing of repeated tasks? | <p>Sorting algorithms have a huge literature behind them, and the algorithm I'm planning has some similarities to the topic, but I couldn't even find the correct search terms to know whether a field exists which studies such algorithms.</p>
<p>Imagine the following problem: there is a serial communication channel o... | algorithms sorting | 1 | Is there a discipline studying the prioritizing of repeated tasks? -- (algorithms sorting)
<p>Sorting algorithms have a huge literature behind them, and the algorithm I'm planning has some similarities to the topic, but I couldn't even find the correct search terms to know whether a field exists which studies such algo... | habedi/stack-exchange-dataset |
80,837 | Is smn theorem the same concept as currying? | <p>I am studying the s-m-n theorem and the concept reminded me of currying.</p>

<p>From wikipedia article about <a href="https://en.wikipedia.org/wiki/Smn_theorem" rel="noreferrer">s-m-n theorem</a>:</p>

<blockquote>
 <p>the theorem says that for a given programming language and positive integers... | computability | 1 | Is smn theorem the same concept as currying? -- (computability)
<p>I am studying the s-m-n theorem and the concept reminded me of currying.</p>

<p>From wikipedia article about <a href="https://en.wikipedia.org/wiki/Smn_theorem" rel="noreferrer">s-m-n theorem</a>:</p>

<blockquote>
 <p>the theorem ... | habedi/stack-exchange-dataset |
80,848 | Why don't imperative languages like C or Go support Haskell-like parametric polymorphism? | <p>Why don't imperative languages support parametric polymorphism as powerful as whats in Haskell and OCaml?</p>

<p>More specifically if I call a function <code>foo(x)</code> that internally calls <code>bar(x)</code> which internally calls <code>baz(x)</code>, what prevents the type of parameter <code>x</code>... | programming languages functional programming language design imperative programming | 1 | Why don't imperative languages like C or Go support Haskell-like parametric polymorphism? -- (programming languages functional programming language design imperative programming)
<p>Why don't imperative languages support parametric polymorphism as powerful as whats in Haskell and OCaml?</p>

<p>More specificall... | habedi/stack-exchange-dataset |
80,859 | What is instruction throughput and instruction latency? | <p>I was reading an article on an alternative method of modulo reduction and i couldn't understand the following excerpt (Those in bold) :</p>

<p>"A single 32-bit division on a recent x64 processor has a t<strong>hroughput of one instruction every six cycles</strong> with a <strong>latency of 26 cycles</strong... | terminology computer architecture cpu | 1 | What is instruction throughput and instruction latency? -- (terminology computer architecture cpu)
<p>I was reading an article on an alternative method of modulo reduction and i couldn't understand the following excerpt (Those in bold) :</p>

<p>"A single 32-bit division on a recent x64 processor has a t<strong... | habedi/stack-exchange-dataset |
80,860 | Maximisation of graphs weight | <p>I have a graph related problem.
Let $G$ be an undirected weighted graph of $N$ nodes. I want to find $p$ independent (they have no edge linking them) sub-graphs of $m$ nodes in a way that the total weight is maximized.</p>

<p>For example, let $G$ be a graph of $16$ nodes, I want to find $4$ sub-graphs o... | algorithms graphs optimization | 1 | Maximisation of graphs weight -- (algorithms graphs optimization)
<p>I have a graph related problem.
Let $G$ be an undirected weighted graph of $N$ nodes. I want to find $p$ independent (they have no edge linking them) sub-graphs of $m$ nodes in a way that the total weight is maximized.</p>

<p>For example,... | habedi/stack-exchange-dataset |
80,865 | Greedy algorithms: Minimum sum number pairing | <blockquote>
 <p>Given $n$ real numbers (where $n$ is even) find a pairing which minimizes the maximum sum of a pair.</p>
</blockquote>

<p>I think the optimal pairing is obtained by sorting the original set, pairing the first element with the last one, and so on. But I get stuck trying to prove it.</p... | correctness proof greedy algorithms | 1 | Greedy algorithms: Minimum sum number pairing -- (correctness proof greedy algorithms)
<blockquote>
 <p>Given $n$ real numbers (where $n$ is even) find a pairing which minimizes the maximum sum of a pair.</p>
</blockquote>

<p>I think the optimal pairing is obtained by sorting the original set, pairing... | habedi/stack-exchange-dataset |
80,866 | How does continuous computer vision works? | <p>First: I have programmed a few programs dealing with computer vision (not with libraries but from scratch):</p>

<ul>
<li>Simple Character and Figure Recognition </li>
<li>Character and Figure Recognition with Neural networks</li>
<li>Facial recognition</li>
</ul>

<p>so I am not aski... | machine learning pattern recognition facial recognition | 1 | How does continuous computer vision works? -- (machine learning pattern recognition facial recognition)
<p>First: I have programmed a few programs dealing with computer vision (not with libraries but from scratch):</p>

<ul>
<li>Simple Character and Figure Recognition </li>
<li>Character and Figure Reco... | habedi/stack-exchange-dataset |
80,874 | 3-SAT with 3 variable occurences | <p>3-SAT with at most 3 occurences per variable is $\mathsf{NP}$-hard.</p>

<p>Now I'll try to solve it using these:</p>

<ol>
<li>Theorem: SAT where all clauses have length 3 and variables occur 3 times, is satisfiable.</li>
<li>Double propagation. If there is a clause $(a\lor b)$ and no clause... | 3 sat | 1 | 3-SAT with 3 variable occurences -- (3 sat)
<p>3-SAT with at most 3 occurences per variable is $\mathsf{NP}$-hard.</p>

<p>Now I'll try to solve it using these:</p>

<ol>
<li>Theorem: SAT where all clauses have length 3 and variables occur 3 times, is satisfiable.</li>
<li>Double propagation. If... | habedi/stack-exchange-dataset |
80,876 | Find non-smooth function that meets conditions | <p>I learned the following theorem in class:
"If $T(n)$ is asymptotically non-decreasing and $f(n)$ is smooth, then $T(n) =
O(f(n)|n=b^k, k=integer)$ implies $T(n) = O(f(n))$."</p>

<p>I'm trying to show using a counterexample that this theorem doesn't hold if $f(n)$ is non-decreasing but not smooth. Sm... | algorithm analysis | 1 | Find non-smooth function that meets conditions -- (algorithm analysis)
<p>I learned the following theorem in class:
"If $T(n)$ is asymptotically non-decreasing and $f(n)$ is smooth, then $T(n) =
O(f(n)|n=b^k, k=integer)$ implies $T(n) = O(f(n))$."</p>

<p>I'm trying to show using a counterexample that t... | habedi/stack-exchange-dataset |
80,881 | CNF and small-depth circuits | <p>I'm reading on small-depth circuits. Since every formula can be turned into a CNF formula, which has depth at most 3, why should we study deeper circuits? Is it because convertion to CNF may result in an explosive blow-up? If so, can you give an example?</p>
 | circuits | 1 | CNF and small-depth circuits -- (circuits)
<p>I'm reading on small-depth circuits. Since every formula can be turned into a CNF formula, which has depth at most 3, why should we study deeper circuits? Is it because convertion to CNF may result in an explosive blow-up? If so, can you give an example?</p>
 | habedi/stack-exchange-dataset |
80,882 | What is the algorithm for Blockchain's Byzantine Fault Tolerance? | <p>This person was <a href="https://www.quora.com/Why-is-a-blockchain-implementation-different-than-a-distributed-consensus-system-like-raft" rel="nofollow noreferrer">asked</a>: "Why is a <a href="https://en.wikipedia.org/wiki/Blockchain" rel="nofollow noreferrer">blockchain</a> implementation different than a distrib... | algorithms fault tolerance blockchain byzantine | 1 | What is the algorithm for Blockchain's Byzantine Fault Tolerance? -- (algorithms fault tolerance blockchain byzantine)
<p>This person was <a href="https://www.quora.com/Why-is-a-blockchain-implementation-different-than-a-distributed-consensus-system-like-raft" rel="nofollow noreferrer">asked</a>: "Why is a <a href="htt... | habedi/stack-exchange-dataset |
80,883 | Universal family of hash functions | <p>How to prove that a $k$-universal family of hash functions is $(k-1)$-universal family?</p>

<p>I tried to prove it by definition of k-universal family of hash functions but I didn't know how to use the definition.</p>

<p>If I prove it, Is it necessary that a $1$-universal family of hash function is... | hash | 1 | Universal family of hash functions -- (hash)
<p>How to prove that a $k$-universal family of hash functions is $(k-1)$-universal family?</p>

<p>I tried to prove it by definition of k-universal family of hash functions but I didn't know how to use the definition.</p>

<p>If I prove it, Is it necessary th... | habedi/stack-exchange-dataset |
80,887 | Randomized algorithm for 3SAT | <p>There is a very simple randomized algorithm that, given a 3SAT, produces an assignment satisfying at least 7/8 of the clauses (in expectation): choose a random assignment. A random assignment satisfies each clause with probability 7/8, and so linearity of expectation shows that the expected fraction of clauses satis... | randomized algorithms 3 sat | 1 | Randomized algorithm for 3SAT -- (randomized algorithms 3 sat)
<p>There is a very simple randomized algorithm that, given a 3SAT, produces an assignment satisfying at least 7/8 of the clauses (in expectation): choose a random assignment. A random assignment satisfies each clause with probability 7/8, and so linearity o... | habedi/stack-exchange-dataset |
80,892 | Union of R.E. and Non R.E. language | <p>Let 
\begin{align*}
 L_1 &=\{\langle M,w\rangle \mid M\text{ halts on }w\}\\
 L_2 &=\{\langle M,w\rangle \mid M\text{ does not halt on }w\}\,.
\end{align*}
Here $M$ represents encoding of a Turing machine (T.M.) and $w$ is the input string. What is the class of $L=L_1 \cup L_2$?</p>... | computability turing machines | 1 | Union of R.E. and Non R.E. language -- (computability turing machines)
<p>Let 
\begin{align*}
 L_1 &=\{\langle M,w\rangle \mid M\text{ halts on }w\}\\
 L_2 &=\{\langle M,w\rangle \mid M\text{ does not halt on }w\}\,.
\end{align*}
Here $M$ represents encoding of a Turing machine (T.M.) ... | habedi/stack-exchange-dataset |
80,894 | Understanding the geometrical interpretation of word2vec | <p>I'm trying to understand how the $word2vec$ method actually nudges word vectors of similar semantic/syntactic content closer together in the word vector space.</p>

<p>I've read <a href="https://www.quora.com/How-does-word2vec-work-Can-someone-walk-through-a-specific-example/answer/Stephan-Gouws" rel="nofoll... | optimization machine learning natural language processing | 1 | Understanding the geometrical interpretation of word2vec -- (optimization machine learning natural language processing)
<p>I'm trying to understand how the $word2vec$ method actually nudges word vectors of similar semantic/syntactic content closer together in the word vector space.</p>

<p>I've read <a href="ht... | habedi/stack-exchange-dataset |
80,896 | Is there a name for the "tree" aproach to listing things? | <p>I've only been studying computer science for a few weeks, so I apologize if this is a silly or naive question.</p>

<p>Suppose we're trying to list all elements of the set $$C(r) = \{(x,y,z) \in \mathbb{N}^3 : \sqrt{x^2+y^2+z^2} \leq r\}.$$</p>

<p>An obvious approach would be this: first, list all i... | algorithms terminology trees lists | 1 | Is there a name for the "tree" aproach to listing things? -- (algorithms terminology trees lists)
<p>I've only been studying computer science for a few weeks, so I apologize if this is a silly or naive question.</p>

<p>Suppose we're trying to list all elements of the set $$C(r) = \{(x,y,z) \in \mathbb{N}^3 : \... | habedi/stack-exchange-dataset |
80,897 | compute a gradient with "minimal" colorstops from a ordered set of RGB colors | <p>I got a array of colors that are closely related = most of the time there is no sharp transition between color[n] and color[n+1].</p>

<p>Exemple of such an array of colors 
[<strong>0</strong>,.1,.2,.3,.4,.5,.6,.7,.8,.9,<strong>1.0</strong>,.8,.6,.4,0.2,<strong>0</strong>]</p>

<p>You'll notice ... | algorithms graphics | 1 | compute a gradient with "minimal" colorstops from a ordered set of RGB colors -- (algorithms graphics)
<p>I got a array of colors that are closely related = most of the time there is no sharp transition between color[n] and color[n+1].</p>

<p>Exemple of such an array of colors 
[<strong>0</strong>,.1,.2,.3... | habedi/stack-exchange-dataset |
80,913 | Bucket sort with gaussian distribution | <p><a href="https://en.wikipedia.org/wiki/Bucket_sort" rel="noreferrer">Bucket sort</a> algorithm lets you sort an array of $n$ elements in expected $O(n)$ time, supposing the elements are equally distributed in the $\lbrack 0,1 )$ interval.</p>

<p>Is there a way to modify the bucket sort in order to sort in e... | sorting | 1 | Bucket sort with gaussian distribution -- (sorting)
<p><a href="https://en.wikipedia.org/wiki/Bucket_sort" rel="noreferrer">Bucket sort</a> algorithm lets you sort an array of $n$ elements in expected $O(n)$ time, supposing the elements are equally distributed in the $\lbrack 0,1 )$ interval.</p>

<p>Is there a... | habedi/stack-exchange-dataset |
80,918 | What's the possibility of random guessing a youtube's video ID | <p>Let's say i make a program that produces an eleven character long ID like youtube does and tries to find a valid video in youtube. What's the actual possibility that it's going to produce a valid ID corresponding to a real video and also an unlisted one??</p>
 | random number generator | 1 | What's the possibility of random guessing a youtube's video ID -- (random number generator)
<p>Let's say i make a program that produces an eleven character long ID like youtube does and tries to find a valid video in youtube. What's the actual possibility that it's going to produce a valid ID corresponding to a real vi... | habedi/stack-exchange-dataset |
80,923 | Why NFA is called Non-deterministic? | <p>I have this [kind of funny] question in mind. Why is the <a href="https://en.wikipedia.org/wiki/Nondeterministic_finite_automaton" rel="noreferrer">non-deterministic finite automaton</a> called <strong>non-deterministic</strong> while we define the transitions for inputs. Well, even though there are <strong>multiple... | finite automata nondeterminism | 1 | Why NFA is called Non-deterministic? -- (finite automata nondeterminism)
<p>I have this [kind of funny] question in mind. Why is the <a href="https://en.wikipedia.org/wiki/Nondeterministic_finite_automaton" rel="noreferrer">non-deterministic finite automaton</a> called <strong>non-deterministic</strong> while we define... | habedi/stack-exchange-dataset |
80,924 | Is the below language Non R.E? | <p>$L_0=\{\langle M,w,0\rangle\mid M \text{ halts on } w\}$</p>

<p>$L_1=\{⟨M,w,1⟩\mid M \text{ does not halts on } w\}$</p>

<p>Here $\langle M,w,i \rangle$ is a triplet, whose first component $M$ is an encoding of a Turing Machine, second component $w$ is a string, and third component $i$ is a bit. </... | computability undecidability halting problem | 1 | Is the below language Non R.E? -- (computability undecidability halting problem)
<p>$L_0=\{\langle M,w,0\rangle\mid M \text{ halts on } w\}$</p>

<p>$L_1=\{⟨M,w,1⟩\mid M \text{ does not halts on } w\}$</p>

<p>Here $\langle M,w,i \rangle$ is a triplet, whose first component $M$ is an encoding of a Turin... | habedi/stack-exchange-dataset |
80,935 | Possible combinations of soccer results | <p>I'm trying to calculate the best and worst position for each team in the ranking based on the weekly matches.</p>

<p>Suppose we have 4 teams with these position:</p>

<p>Pos.| Name | Pts.</p>

<p>1 | Team A | 12</p>

<p>2 | Team B | 10 </p>

<p>3 | Team C | 8 </p>
... | algorithms combinatorics | 1 | Possible combinations of soccer results -- (algorithms combinatorics)
<p>I'm trying to calculate the best and worst position for each team in the ranking based on the weekly matches.</p>

<p>Suppose we have 4 teams with these position:</p>

<p>Pos.| Name | Pts.</p>

<p>1 | Team A | 12</p>
... | habedi/stack-exchange-dataset |
80,951 | Min-cut in DAGs with unit edge weights | <p>I'm trying to better understand the min-cut problem for directed acyclic graphs. I understand that the minimum capacity cut has equal capacity to the max flow of a graph by the max flow-min cut theorem (<a href="https://en.wikipedia.org/wiki/Max-flow_min-cut_theorem" rel="nofollow noreferrer">https://en.wikipedia.or... | algorithms graphs network flow | 1 | Min-cut in DAGs with unit edge weights -- (algorithms graphs network flow)
<p>I'm trying to better understand the min-cut problem for directed acyclic graphs. I understand that the minimum capacity cut has equal capacity to the max flow of a graph by the max flow-min cut theorem (<a href="https://en.wikipedia.org/wiki/... | habedi/stack-exchange-dataset |
80,952 | Convert a decimal floating-point number into a binary floating-point number | <p>Let's say I have a decimal floating-point number, i.e. a mantissa and precision (negative exponent), both represented as integers. How do I convert this into a binary floating point number (of the sort you find in most programming languages, with only the standard operations available). This should be done with maxi... | algorithms floating point base conversion | 1 | Convert a decimal floating-point number into a binary floating-point number -- (algorithms floating point base conversion)
<p>Let's say I have a decimal floating-point number, i.e. a mantissa and precision (negative exponent), both represented as integers. How do I convert this into a binary floating point number (of t... | habedi/stack-exchange-dataset |
80,959 | The sorting problem for partially ordered sets | <p>I have two questions about sorting for posets, one easy and one hard:</p>

<p>Easy: Suppose we have a set of objects and a partial order. Given any two objects such that $a \leq b$, we want to delete $b$ from the set. Is there a sub-quadratic time algorithm that can accomplish this, perhaps for some suitable... | algorithms complexity theory sorting partial order order theory | 1 | The sorting problem for partially ordered sets -- (algorithms complexity theory sorting partial order order theory)
<p>I have two questions about sorting for posets, one easy and one hard:</p>

<p>Easy: Suppose we have a set of objects and a partial order. Given any two objects such that $a \leq b$, we want to ... | habedi/stack-exchange-dataset |
80,962 | How do Hard Drives Send and Recieve Data? | <p>Ok. I know this is probably a commonly asked question. Before you refer me to a site or answer this yourself, I ask for you to please read this through. I have been into computers and electronics for quite a while. I have a pretty good understanding of electronics, and would like to become a computer hardware engine... | memory hardware memory access | 1 | How do Hard Drives Send and Recieve Data? -- (memory hardware memory access)
<p>Ok. I know this is probably a commonly asked question. Before you refer me to a site or answer this yourself, I ask for you to please read this through. I have been into computers and electronics for quite a while. I have a pretty good unde... | habedi/stack-exchange-dataset |
80,972 | Canonical form for a graph | <p>I am trying to find a description for canonical form (labelling) for a graph. Specifically, how do we arrive at canonical form for a given graph?</p>
 | algorithms graphs | 1 | Canonical form for a graph -- (algorithms graphs)
<p>I am trying to find a description for canonical form (labelling) for a graph. Specifically, how do we arrive at canonical form for a given graph?</p>
 | habedi/stack-exchange-dataset |
80,974 | Is $\{ w \in L : wx \in L, \textrm{for some } x \neq \epsilon\}$ a CFG language if $L$ is CFG? | <p>Let $L$ be CFG. Is $\{ w \in L : wx \in L, \textrm{for some } x \neq \epsilon\}$ also CFG?</p>
 | context free closure properties | 1 | Is $\{ w \in L : wx \in L, \textrm{for some } x \neq \epsilon\}$ a CFG language if $L$ is CFG? -- (context free closure properties)
<p>Let $L$ be CFG. Is $\{ w \in L : wx \in L, \textrm{for some } x \neq \epsilon\}$ also CFG?</p>
 | habedi/stack-exchange-dataset |
80,978 | Why are computable functions continuous? | <p>I am working on writing an <em>easy to read</em> document about denotational semantics of the lambda calculus. For that I introduce CPOs, monotonicity and continuity.
A CPO is a set <span class="math-container">$M$</span> with a partial order <span class="math-container">$\leq$</span> and a bottom element <span ... | computability denotational semantics | 1 | Why are computable functions continuous? -- (computability denotational semantics)
<p>I am working on writing an <em>easy to read</em> document about denotational semantics of the lambda calculus. For that I introduce CPOs, monotonicity and continuity.
A CPO is a set <span class="math-container">$M$</span> with a p... | habedi/stack-exchange-dataset |
80,979 | Why Finite Automata are restricted in reading the input? | <p><em>Well, I should have posted this question before <a href="https://cs.stackexchange.com/questions/80923">Why NFA is called Non-deterministic?</a>. Anyways now this is pondering in my mind.</em> </p>

<p>Why people who came up with this automaton theory restricted the input format of it as a <strong>read-on... | finite automata | 1 | Why Finite Automata are restricted in reading the input? -- (finite automata)
<p><em>Well, I should have posted this question before <a href="https://cs.stackexchange.com/questions/80923">Why NFA is called Non-deterministic?</a>. Anyways now this is pondering in my mind.</em> </p>

<p>Why people who came up wit... | habedi/stack-exchange-dataset |
80,982 | If P=NP, which two languages are NOT NP-complete? | <p>In my last exam this question got asked and i just cant find a clear answer:</p>

<p>If P=NP, which two languages are NOT NP-complete?</p>

<p>So I assume there are two special languages, but which?</p>

<p>Thanks in advance</p>
 | complexity theory np complete np complexity classes p vs np | 1 | If P=NP, which two languages are NOT NP-complete? -- (complexity theory np complete np complexity classes p vs np)
<p>In my last exam this question got asked and i just cant find a clear answer:</p>

<p>If P=NP, which two languages are NOT NP-complete?</p>

<p>So I assume there are two special languages... | habedi/stack-exchange-dataset |
80,986 | Generating cyclical dependency graphs from k-way partitions of DAGs representing boolean networks | <p>My question stems from something mentioned in the following paper*:</p>

<p><a href="http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1600459" rel="nofollow noreferrer">Acyclic Multi-Way Partitioning of Boolean Networks by Jason Cong, Zheng Li, and Rajive Bagrodia</a></p>

<p>Given a DAG r... | graphs circuits partitions | 1 | Generating cyclical dependency graphs from k-way partitions of DAGs representing boolean networks -- (graphs circuits partitions)
<p>My question stems from something mentioned in the following paper*:</p>

<p><a href="http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1600459" rel="nofollow noreferrer"... | habedi/stack-exchange-dataset |
80,989 | Is there a generic algorithm for translating equational rules into corresponding data structures? | <p>When implementing a term rewriting system, one “optimization” one can do is to represent operators known to have certain equational properties with a more directly representative data structure. For example, one can use lists to represent uses of a binary operator known to be associative, rather than using the naïv... | data structures reference request term rewriting | 1 | Is there a generic algorithm for translating equational rules into corresponding data structures? -- (data structures reference request term rewriting)
<p>When implementing a term rewriting system, one “optimization” one can do is to represent operators known to have certain equational properties with a more directly r... | habedi/stack-exchange-dataset |
80,994 | How to prove $n^4 = \mathcal{O}(2^n)$? | <p>I'm new to asymptotic notations and right now I'm trying to prove that $n^4 = \mathcal{O}(2^n)$. 
In my current solution (written below) I used L'Hôpital's rule repeatedly, proving that the limit of $n^4/2^n$ goes to zero. Is this correct?
Additionally I'm wondering whehter there is a simpler solution to thi... | asymptotics | 1 | How to prove $n^4 = \mathcal{O}(2^n)$? -- (asymptotics)
<p>I'm new to asymptotic notations and right now I'm trying to prove that $n^4 = \mathcal{O}(2^n)$. 
In my current solution (written below) I used L'Hôpital's rule repeatedly, proving that the limit of $n^4/2^n$ goes to zero. Is this correct?
Additionally ... | habedi/stack-exchange-dataset |
81,017 | Paired resolution and $\mathsf{NP}$ vs. $\mathsf{coNP}$? | <p>Let we resolve only two clauses at time and then get rid of them. Such resolution clearly takes $O(n)$ steps.</p>

<p><em>Sequence</em> is a set of instructions in the form $(C_{S_1}\cup C_{S_2},v\cup\overline v),...$, where $S_i$ denotes a set of merged clauses, $v\in C_{S_1},\overline v\in C_{S_2}$.</p>&#x... | satisfiability np | 1 | Paired resolution and $\mathsf{NP}$ vs. $\mathsf{coNP}$? -- (satisfiability np)
<p>Let we resolve only two clauses at time and then get rid of them. Such resolution clearly takes $O(n)$ steps.</p>

<p><em>Sequence</em> is a set of instructions in the form $(C_{S_1}\cup C_{S_2},v\cup\overline v),...$, where $S_i... | habedi/stack-exchange-dataset |
81,026 | Does the specific size of matrices affect the performance of matrix operations? | <p>I was reading <a href="https://arxiv.org/abs/1707.06203" rel="nofollow noreferrer">DeepMind's paper on I2A's</a> and realized that the sizes of the hidden layers in their model were all like 32, 64, 256, and so on: all powers of 2. I have found the same thing in other papers.</p>

<p>Is there any performance... | machine learning neural networks matrices | 1 | Does the specific size of matrices affect the performance of matrix operations? -- (machine learning neural networks matrices)
<p>I was reading <a href="https://arxiv.org/abs/1707.06203" rel="nofollow noreferrer">DeepMind's paper on I2A's</a> and realized that the sizes of the hidden layers in their model were all like... | habedi/stack-exchange-dataset |
81,027 | Is it possible to reconstruct graph if we have given matrix of shortest pairs | <p>I'm trying to reconstruct graph if we have given the result of floyd-warshall algorithm, more formally:</p>

<p>Let's say we have given undirected weighted tree (graph without cycles) with $N$ nodes, such that from this graph we only have given matrix $g$ of size $N \cdot N$ elements, such that $g(i, j)$ giv... | graphs graph traversal weighted graphs | 1 | Is it possible to reconstruct graph if we have given matrix of shortest pairs -- (graphs graph traversal weighted graphs)
<p>I'm trying to reconstruct graph if we have given the result of floyd-warshall algorithm, more formally:</p>

<p>Let's say we have given undirected weighted tree (graph without cycles) wit... | habedi/stack-exchange-dataset |
81,030 | Knuth's proof of O(1) for linear probing | <p>I'm currently reading Knuth's proof about O(1) number of probes in
linear probing. I have a small question on the page 536 (Volume 3, 2nd Edition). Knuth says </p>

<blockquote>
 <p>Let $f(M, N)$ be the number of hash sequences such that position 0 of the table will be empty after the keys have been... | hash hash tables hashing | 1 | Knuth's proof of O(1) for linear probing -- (hash hash tables hashing)
<p>I'm currently reading Knuth's proof about O(1) number of probes in
linear probing. I have a small question on the page 536 (Volume 3, 2nd Edition). Knuth says </p>

<blockquote>
 <p>Let $f(M, N)$ be the number of hash sequences s... | habedi/stack-exchange-dataset |
81,045 | How does Hoare's quicksort work, even if the final position of the pivot after partition() is not what its position is in the sorted array? | <p>All variable names are from <a href="https://en.wikipedia.org/wiki/Quicksort" rel="nofollow noreferrer">Quicksort's wikipedia page</a>'s Lomuto's and Hoare's quick sorts pseudocode.</p>

<p>If <code>p</code> is what is returned by the <code>partition</code> function, Hoare divides his array from <code>lo</co... | sorting quicksort | 1 | How does Hoare's quicksort work, even if the final position of the pivot after partition() is not what its position is in the sorted array? -- (sorting quicksort)
<p>All variable names are from <a href="https://en.wikipedia.org/wiki/Quicksort" rel="nofollow noreferrer">Quicksort's wikipedia page</a>'s Lomuto's and Hoar... | habedi/stack-exchange-dataset |
81,052 | Fibonacci Sequence recursion algorithm and the time complexity | <p>I am reading a free book on algorithms </p>

<p><a href="http://www.cse.iitd.ernet.in/~Naveen/courses/CSL630/all.pdf" rel="nofollow noreferrer">http://www.cse.iitd.ernet.in/~Naveen/courses/CSL630/all.pdf</a></p>

<p>and on page 13 it says </p>

<p>"Compare this to the recurrence relation for ... | algorithms time complexity | 1 | Fibonacci Sequence recursion algorithm and the time complexity -- (algorithms time complexity)
<p>I am reading a free book on algorithms </p>

<p><a href="http://www.cse.iitd.ernet.in/~Naveen/courses/CSL630/all.pdf" rel="nofollow noreferrer">http://www.cse.iitd.ernet.in/~Naveen/courses/CSL630/all.pdf</a></p>&#x... | habedi/stack-exchange-dataset |
81,058 | Finding an element in a infinite unsorted doubly linked list | <p>Is there any way to find an element in an unsorted doubly linked list given an element and pointer from which we can navigate? (we can't use head/tail pointers since the list is infinite)</p>
 | algorithms search algorithms linked lists | 1 | Finding an element in a infinite unsorted doubly linked list -- (algorithms search algorithms linked lists)
<p>Is there any way to find an element in an unsorted doubly linked list given an element and pointer from which we can navigate? (we can't use head/tail pointers since the list is infinite)</p>
 | habedi/stack-exchange-dataset |
81,061 | In what situations should a particular sorting algorithm, such as heap sort, be chosen over others? | <p>In my algorithm class my teacher said that we should always use counting sort when we want to sort integers. After he said this I was curious to know in which situations I should choose one sort algorithm over another.</p>

<p>Looking at the complexities of the worst cases of the algorithms I know (heapsort,... | algorithms sorting | 1 | In what situations should a particular sorting algorithm, such as heap sort, be chosen over others? -- (algorithms sorting)
<p>In my algorithm class my teacher said that we should always use counting sort when we want to sort integers. After he said this I was curious to know in which situations I should choose one sor... | habedi/stack-exchange-dataset |
81,063 | Analyzing time complexity for change making algorithm (Brute force) | <p>I'm new to analyzing time complexities and I have a question. To compute the nth fibonacci number, the recurrence tree will look like so:
<a href="https://i.stack.imgur.com/KNser.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KNser.png" alt="Fibonacci recurrence tree"></a></p>

<p>Sin... | algorithms time complexity asymptotics recurrence relation coin change | 1 | Analyzing time complexity for change making algorithm (Brute force) -- (algorithms time complexity asymptotics recurrence relation coin change)
<p>I'm new to analyzing time complexities and I have a question. To compute the nth fibonacci number, the recurrence tree will look like so:
<a href="https://i.stack.imgur.... | habedi/stack-exchange-dataset |
81,065 | Best Algorithm for searching for an index in an array such that A[i] = i | <p>Recently i got a question in one of my exams about asking for an algorithm which searches an element in a sorted array such that $A[i] = i$. My algorithm was based on binary search and did a $O (\log n)$ order of comparisons.
The other part of question demanded to prove there exists no other algorithm which does... | algorithms lower bounds binary search | 1 | Best Algorithm for searching for an index in an array such that A[i] = i -- (algorithms lower bounds binary search)
<p>Recently i got a question in one of my exams about asking for an algorithm which searches an element in a sorted array such that $A[i] = i$. My algorithm was based on binary search and did a $O (\log n... | habedi/stack-exchange-dataset |
81,073 | Is $G_2(V_2,E_2)$ a subgraph of $G_1(V_1,E_1)$ given number of vertices and adjacency matrix for both? | <p>Given $n_1$ and $n_2$ number of verteces and the adjacency matrix for both graphs, one should determine whether $G_2$ is a subgraph of $G_1$.</p>

<p>I am supposed to use C++ for this, and though I could probably come out with a solution including $20$ for functions, it's most likely not the best approach to... | algorithms graphs | 1 | Is $G_2(V_2,E_2)$ a subgraph of $G_1(V_1,E_1)$ given number of vertices and adjacency matrix for both? -- (algorithms graphs)
<p>Given $n_1$ and $n_2$ number of verteces and the adjacency matrix for both graphs, one should determine whether $G_2$ is a subgraph of $G_1$.</p>

<p>I am supposed to use C++ for this... | habedi/stack-exchange-dataset |
81,075 | Why is the language $NP-hard$? | <p>Let's denote $IS(G)$ to be the size of the maximal independent set in $G$.
Consider the following language:
$$A = \left \{ G\ |\ IS(G)\ge \frac{1}{5}n \right \}$$</p>

<p>I know that $gap-IS [1/8 + \varepsilon , 1/4-\varepsilon]$ is $NP$-hard.</p>

<p>How can I infer that $A$ is $NP$-hard by... | complexity theory reductions np hard | 1 | Why is the language $NP-hard$? -- (complexity theory reductions np hard)
<p>Let's denote $IS(G)$ to be the size of the maximal independent set in $G$.
Consider the following language:
$$A = \left \{ G\ |\ IS(G)\ge \frac{1}{5}n \right \}$$</p>

<p>I know that $gap-IS [1/8 + \varepsilon , 1/4-\varepsilon... | habedi/stack-exchange-dataset |
81,080 | Do I have the right definition of VC dimension? | <p>I am having some trouble understanding the notion of the VC dimension. The definition I have is the following:</p>

<blockquote>
 <p>The VC dimension of a set of hypothesis functions $H$ is the cardinality of the largest set which $H$ can shatter. We say that $H$ shatters some set $S \subseteq \mathcal{... | machine learning vc dimension | 1 | Do I have the right definition of VC dimension? -- (machine learning vc dimension)
<p>I am having some trouble understanding the notion of the VC dimension. The definition I have is the following:</p>

<blockquote>
 <p>The VC dimension of a set of hypothesis functions $H$ is the cardinality of the largest ... | habedi/stack-exchange-dataset |
81,091 | The Church-Turing-Thesis in proofs | <p>Currently I'm trying to understand a proof of the statement:</p>

<p>"A language is semi-decidable if and only if some enumerator enumerates it."</p>

<p>that we did in my lecture. One direction of the proof goes as follows:</p>

<hr>

<p>Let E be an enumerator that enumerates L. We c... | computability turing machines proof techniques semi decidability church turing thesis | 1 | The Church-Turing-Thesis in proofs -- (computability turing machines proof techniques semi decidability church turing thesis)
<p>Currently I'm trying to understand a proof of the statement:</p>

<p>"A language is semi-decidable if and only if some enumerator enumerates it."</p>

<p>that we did in my lec... | habedi/stack-exchange-dataset |
81,097 | Should crossover operation in a genetic algorithm modify individuals in order to be "valid"? | <p>I'm working in a project to create levels for a videogame using genetic algorithms.</p>

<p>I'm using a undirected graph to represent the level, each node represent a room and each room have a maximum of four possible connections (north, south, east, west). Also each connection just have one compatible conne... | algorithms genetic algorithms | 1 | Should crossover operation in a genetic algorithm modify individuals in order to be "valid"? -- (algorithms genetic algorithms)
<p>I'm working in a project to create levels for a videogame using genetic algorithms.</p>

<p>I'm using a undirected graph to represent the level, each node represent a room and each ... | habedi/stack-exchange-dataset |
81,103 | Domain theory: Definition of isomorphisms | <p>Consider the following definitions of CPOs, monotonicity and continuity:
The pair $(M, \leq)$ is called CPO (<em>complete partial order</em>), if</p>

<ul>
<li>$M$ is a set,</li>
<li>$\leq$ is a partial order on $M$,</li>
<li>there exists a least element according to $\leq$ in $M$ (called <em... | denotational semantics | 1 | Domain theory: Definition of isomorphisms -- (denotational semantics)
<p>Consider the following definitions of CPOs, monotonicity and continuity:
The pair $(M, \leq)$ is called CPO (<em>complete partial order</em>), if</p>

<ul>
<li>$M$ is a set,</li>
<li>$\leq$ is a partial order on $M$,</li>
<... | habedi/stack-exchange-dataset |
81,110 | Understanding basic operation of TM and FA | <p>As turing machine always halts on <strong>dead configuration</strong>,so consider the case where it halts in final state,if on second last state by reading an input alphabet it comes to final state. Now in final state it will try to find the transition for the next symbol(i.e blank) and as there will be no transiti... | turing machines finite automata | 1 | Understanding basic operation of TM and FA -- (turing machines finite automata)
<p>As turing machine always halts on <strong>dead configuration</strong>,so consider the case where it halts in final state,if on second last state by reading an input alphabet it comes to final state. Now in final state it will try to fin... | habedi/stack-exchange-dataset |
81,112 | Why product type is a dependent SUM? | <p>It might just be a stupid question but I simply see no obvious reason why dependent sum type is a generalized form of product type. Concretely, the sigma type $\Sigma(x:S)T$ degenerates to a product type if $T$ does not depend on $x$ and is expressed to be $S\times T$ in this case.</p>

<p>Where the SUM part... | programming languages type theory | 1 | Why product type is a dependent SUM? -- (programming languages type theory)
<p>It might just be a stupid question but I simply see no obvious reason why dependent sum type is a generalized form of product type. Concretely, the sigma type $\Sigma(x:S)T$ degenerates to a product type if $T$ does not depend on $x$ and is ... | habedi/stack-exchange-dataset |
81,127 | Strongly connected and completely specified Moore equivalent of a Mealy Machine | <p>Problem: Prove that if a Mealy machine is strongly connected and completely specified, the corresponding Moore machine will also be strongly connected and completely specified.</p>

<p>My approach so far:</p>

<p>As the Mealy Machine is completely specified, we have 2 cases for each state:</p>
&#... | automata finite automata connected | 1 | Strongly connected and completely specified Moore equivalent of a Mealy Machine -- (automata finite automata connected)
<p>Problem: Prove that if a Mealy machine is strongly connected and completely specified, the corresponding Moore machine will also be strongly connected and completely specified.</p>

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