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 |
|---|---|---|---|---|---|---|
70,951 | Can a Turing machine be both decidable and undecidable relative to itself? | <p>Consider the language:</p>

<p>$A'_{TM} = \{\langle M,w\rangle: M \mbox{ is a TM with access to an oracle for } A_{TM} \mbox{ and } M \mbox{ accepts } w\}$</p>

<p>Clearly, we expect that any language is decidable relative to itself, including $A'_{TM}$. So let $F$ be an oracle decider for $A'_{TM}$ ... | turing machines undecidability oracle machines | 1 | Can a Turing machine be both decidable and undecidable relative to itself? -- (turing machines undecidability oracle machines)
<p>Consider the language:</p>

<p>$A'_{TM} = \{\langle M,w\rangle: M \mbox{ is a TM with access to an oracle for } A_{TM} \mbox{ and } M \mbox{ accepts } w\}$</p>

<p>Clearly, w... | habedi/stack-exchange-dataset |
70,958 | Insertion sort vs Merge sort - memory access | <p>I am a computer science sophomore doing a data structures and algorithms course. My professor said that insertion sort requires random access, while merge sort does not.</p>

<p>According to him, the insertion step in insertion sort requires random access. But can't it be implemented using sequential access ... | algorithms sorting memory access mergesort | 1 | Insertion sort vs Merge sort - memory access -- (algorithms sorting memory access mergesort)
<p>I am a computer science sophomore doing a data structures and algorithms course. My professor said that insertion sort requires random access, while merge sort does not.</p>

<p>According to him, the insertion step i... | habedi/stack-exchange-dataset |
70,960 | Is the search for a k-Hamiltonian Path NP-hard? | <p>A $k$-Hamiltonian Path is an Hamiltonian Path where each node (but the last $k$ nodes on the path) is connected to his $k$ successors, and the last $k$ nodes are connected to all of their successors.</p>

<p>This is an Hamiltonian Path:
<a href="https://i.stack.imgur.com/MFXAM.png" rel="nofollow noreferr... | proof techniques np hard hamiltonian path | 1 | Is the search for a k-Hamiltonian Path NP-hard? -- (proof techniques np hard hamiltonian path)
<p>A $k$-Hamiltonian Path is an Hamiltonian Path where each node (but the last $k$ nodes on the path) is connected to his $k$ successors, and the last $k$ nodes are connected to all of their successors.</p>

<p>This i... | habedi/stack-exchange-dataset |
70,983 | Very divisible subsets | <p>I've recently come across the following problem.</p>

<p>We're given up to $10^4$ distinct positive integers $a_1,\dots , a_n$, each of them below $10^6$. Let's call a subset $S \subset \{a_1,\dots,a_n\}$ a very divisible subset if any number in this subset divides the product of other numbers in this subset... | number theory | 1 | Very divisible subsets -- (number theory)
<p>I've recently come across the following problem.</p>

<p>We're given up to $10^4$ distinct positive integers $a_1,\dots , a_n$, each of them below $10^6$. Let's call a subset $S \subset \{a_1,\dots,a_n\}$ a very divisible subset if any number in this subset divides t... | habedi/stack-exchange-dataset |
70,984 | Why is backpropagation called backwards propagation of error, when it back propagates error derivatives? | <p><a href="https://en.wikipedia.org/wiki/Backpropagation" rel="nofollow noreferrer">Wikipedia</a> says:</p>

<blockquote>
 <p>The backward propagation of errors or backpropagation, is a common method of training artificial neural networks and used in conjunction with an optimization method such as gradien... | neural networks | 1 | Why is backpropagation called backwards propagation of error, when it back propagates error derivatives? -- (neural networks)
<p><a href="https://en.wikipedia.org/wiki/Backpropagation" rel="nofollow noreferrer">Wikipedia</a> says:</p>

<blockquote>
 <p>The backward propagation of errors or backpropagation,... | habedi/stack-exchange-dataset |
70,985 | Does a PDA immediately accept if at final state with empty stack? | <p>If computation on a PDA reaches a final state with an empty stack, will it immediately accept, regardless of whether or not the input tape has ended. For example if I have a PDA to recognize the language of strings where $a^nb^n$, if it was fed the string "aaabbba", will it stop after seeing the last "b" if the stac... | pushdown automata | 1 | Does a PDA immediately accept if at final state with empty stack? -- (pushdown automata)
<p>If computation on a PDA reaches a final state with an empty stack, will it immediately accept, regardless of whether or not the input tape has ended. For example if I have a PDA to recognize the language of strings where $a^nb^n... | habedi/stack-exchange-dataset |
70,989 | Proving that the halting problem is not Turing-reducible to the acceptance problem for Turing machines | <p>Consider $\mbox{Halt}_\mbox{TM} = \{\langle M, w \rangle: M \mbox{ is a TM and } M \mbox{ halts on input } w\}$ and $\mbox{A}_\mbox{TM} = \{\langle M, w \rangle: M \mbox{ is a TM and } M \mbox{ accepts on input } w\}$. I'd like to prove that any oracle TM $T$ that can query the $\mbox{A}_\mbox{TM}$-oracle cannot dec... | turing machines undecidability oracle machines | 1 | Proving that the halting problem is not Turing-reducible to the acceptance problem for Turing machines -- (turing machines undecidability oracle machines)
<p>Consider $\mbox{Halt}_\mbox{TM} = \{\langle M, w \rangle: M \mbox{ is a TM and } M \mbox{ halts on input } w\}$ and $\mbox{A}_\mbox{TM} = \{\langle M, w \rangle: ... | habedi/stack-exchange-dataset |
70,993 | If a language is not Turing reducible to two languages, may it still be Turing reducible to their "union"? | <p>Consider a language $L$ that is undecidable relative to $L_1$ and is also undecidable relative to $L_2$. Suppose, however, that there is a "multi"-oracle Turing machine $M$ that can query both the $L_1$ oracle as well as the $L_2$ oracle such that $M$ decides $L$. In other words, $L$ requires both the $L_1$ and $L_2... | turing machines undecidability oracle machines | 1 | If a language is not Turing reducible to two languages, may it still be Turing reducible to their "union"? -- (turing machines undecidability oracle machines)
<p>Consider a language $L$ that is undecidable relative to $L_1$ and is also undecidable relative to $L_2$. Suppose, however, that there is a "multi"-oracle Turi... | habedi/stack-exchange-dataset |
71,002 | A PDA to recognize the Intersection of two regular languages? | <p>I am studying pushdown automata and I am working on a problem that asks to generate a PDA that accepts the following regular languages:</p>

<blockquote>
 <p>Intersection of L1 and L2</p>
</blockquote>

<p>L1 = L (aaa* bab)<br>
L2 = L (aab* aba)</p>

<p>I can't tell if this is ev... | regular languages pushdown automata | 1 | A PDA to recognize the Intersection of two regular languages? -- (regular languages pushdown automata)
<p>I am studying pushdown automata and I am working on a problem that asks to generate a PDA that accepts the following regular languages:</p>

<blockquote>
 <p>Intersection of L1 and L2</p>
</blockqu... | habedi/stack-exchange-dataset |
71,003 | External consistency vs linearizability | <p>In <a href="https://research.google.com/pubs/pub45855.html" rel="noreferrer">Spanner, TrueTime & The CAP Theorem</a>, Eric Brewer writes:</p>

<blockquote>
 <p>One subtle thing about Spanner is that it gets serializability from
 locks, but it gets <strong>external consistency</strong> (similar ... | distributed systems | 1 | External consistency vs linearizability -- (distributed systems)
<p>In <a href="https://research.google.com/pubs/pub45855.html" rel="noreferrer">Spanner, TrueTime & The CAP Theorem</a>, Eric Brewer writes:</p>

<blockquote>
 <p>One subtle thing about Spanner is that it gets serializability from
 l... | habedi/stack-exchange-dataset |
71,007 | Determining whether a relation is the "union" of two other relations | <p>Given a relations $P$ and $Q$ on $S$, what are the most efficient algorithms to find whether the relation satisfy the constraints $P \cup Q = S \times S$ and $P \cap Q = \emptyset$?</p>

<p>If it helps, for my application the elements of $S$ are strings. Apologies if my question is not up to standard, this i... | sets | 1 | Determining whether a relation is the "union" of two other relations -- (sets)
<p>Given a relations $P$ and $Q$ on $S$, what are the most efficient algorithms to find whether the relation satisfy the constraints $P \cup Q = S \times S$ and $P \cap Q = \emptyset$?</p>

<p>If it helps, for my application the elem... | habedi/stack-exchange-dataset |
71,011 | Given $n$ items with $k$ properties, construct a query that contains between $\frac {n} 3$ to $\frac {2n} 3$ items | <p>I have $n$ items that have a total of $k$ properties. Each item can have any number of properties, from $1$ to $k$. There is no upper limit to k (the lower limit is $\lceil log(n) \rceil$). The items are distinct, so they have different properties.</p>

<p>The query must only contain AND logical operators. F... | algorithms combinatorics sets | 1 | Given $n$ items with $k$ properties, construct a query that contains between $\frac {n} 3$ to $\frac {2n} 3$ items -- (algorithms combinatorics sets)
<p>I have $n$ items that have a total of $k$ properties. Each item can have any number of properties, from $1$ to $k$. There is no upper limit to k (the lower limit is $\... | habedi/stack-exchange-dataset |
71,021 | Closure of regular languages are closed under certain cut operations | <p>Let $f : \mathbb{N} \to \mathbb{N}$ be an integer function. For a language $L$, define </p>

<p>$$f(L) = \{w \mid \exists x : |x| = f(|w|) \text{ and } wx \in L\}$$</p>

<p>For example, if $f(n) = n$ this is just the "halving" operation, and regular languages are well known to be closed under this --... | regular languages | 1 | Closure of regular languages are closed under certain cut operations -- (regular languages)
<p>Let $f : \mathbb{N} \to \mathbb{N}$ be an integer function. For a language $L$, define </p>

<p>$$f(L) = \{w \mid \exists x : |x| = f(|w|) \text{ and } wx \in L\}$$</p>

<p>For example, if $f(n) = n$ this is j... | habedi/stack-exchange-dataset |
71,027 | Constructing logical sentences that involve negative integers over the nonnegative integers | <p>Consider the following statement:</p>

<blockquote>
 <p>If $x$ and $y$ are integers and $z$ is a nonnegative integer and $x + z = y$, then $x$ is at most $y$.</p>
</blockquote>

<p>I'd like to build a sentence for this statement in the model of $(\mathbb{N}, +)$, where $\mathbb{N}$ is the se... | logic first order logic | 1 | Constructing logical sentences that involve negative integers over the nonnegative integers -- (logic first order logic)
<p>Consider the following statement:</p>

<blockquote>
 <p>If $x$ and $y$ are integers and $z$ is a nonnegative integer and $x + z = y$, then $x$ is at most $y$.</p>
</blockquote>&#x... | habedi/stack-exchange-dataset |
71,040 | Hardness of Approximation of MAX-3SAT | <p>This is probably a duplicate of <a href="https://cs.stackexchange.com/questions/12908/how-hard-is-finding-restricted-assignment-of-3-sat-satisfying-7-8-of-the-claus">this question</a>, but I need a somewhat blunter answer. Let's say I have a polynomial time algorithm that finds an assignment that satisfies more tha... | satisfiability | 1 | Hardness of Approximation of MAX-3SAT -- (satisfiability)
<p>This is probably a duplicate of <a href="https://cs.stackexchange.com/questions/12908/how-hard-is-finding-restricted-assignment-of-3-sat-satisfying-7-8-of-the-claus">this question</a>, but I need a somewhat blunter answer. Let's say I have a polynomial time ... | habedi/stack-exchange-dataset |
71,048 | Is every acyclic graph 2-colorable? | <p>Every acyclic graph can be transformed structurally to a tree. Therefore, every node on odd numbered levels can be colored with color $X$ and every node on even numbered levels can be colored with color $Y$. Is the reasoning valid?</p>
 | graphs colorings | 1 | Is every acyclic graph 2-colorable? -- (graphs colorings)
<p>Every acyclic graph can be transformed structurally to a tree. Therefore, every node on odd numbered levels can be colored with color $X$ and every node on even numbered levels can be colored with color $Y$. Is the reasoning valid?</p>
 | habedi/stack-exchange-dataset |
71,051 | Integer solution that approximates a desired stock split | <p>I am building software for an investment manager. The investment manager invests money on behalf of his clients.</p>

<p>The investment manager has a model portfolio, of say 20 stocks, each with certain weightage.</p>

<p>Eg: His model portfolio can look like this:</p>

<p>{GOOG: .03, AAPL: 0... | algorithms | 1 | Integer solution that approximates a desired stock split -- (algorithms)
<p>I am building software for an investment manager. The investment manager invests money on behalf of his clients.</p>

<p>The investment manager has a model portfolio, of say 20 stocks, each with certain weightage.</p>

<p>Eg: Hi... | habedi/stack-exchange-dataset |
71,053 | Optimization problem where penalty is sensitive to permutation | <p>Say, I have the situation where I am looking into all the possibilities to obtain a value of e.g. 20 (exactly) by taking all possible combinations of sums using values from 1 to 5. While doing this, I want to minimize my penalty <strong><em>P</em></strong>. There is no limit to the amount of values I use (I could do... | algorithms optimization permutations | 1 | Optimization problem where penalty is sensitive to permutation -- (algorithms optimization permutations)
<p>Say, I have the situation where I am looking into all the possibilities to obtain a value of e.g. 20 (exactly) by taking all possible combinations of sums using values from 1 to 5. While doing this, I want to min... | habedi/stack-exchange-dataset |
71,058 | Sort write-once array | <p>You have to sort a given array (assuming nothing more than the elements are totally ordered) which is write once read many (WORM) in constant space i.e using a constant number of variables.</p>

<p>So, my naive approach was to fix the position of one element at a time. But in what order? If I do it first to ... | algorithms sorting | 1 | Sort write-once array -- (algorithms sorting)
<p>You have to sort a given array (assuming nothing more than the elements are totally ordered) which is write once read many (WORM) in constant space i.e using a constant number of variables.</p>

<p>So, my naive approach was to fix the position of one element at a... | habedi/stack-exchange-dataset |
71,070 | Pumping Lemma: Proving L={0^n 1^m |m ≤n^2} is not a CFL | <p>I am trying to prove that the language $L=${$0^n 1^m |m ≤n^2$} is not a context free language. To do so I selected a string $w=0^p 1^{p^2}$. However, I am new to the CFL pumping lemma, and I am not sure if my proof is correct. Specifically, does the value of $i$ need to be the same for all divisions?</p>

<p... | context free pumping lemma | 1 | Pumping Lemma: Proving L={0^n 1^m |m ≤n^2} is not a CFL -- (context free pumping lemma)
<p>I am trying to prove that the language $L=${$0^n 1^m |m ≤n^2$} is not a context free language. To do so I selected a string $w=0^p 1^{p^2}$. However, I am new to the CFL pumping lemma, and I am not sure if my proof is correct. Sp... | habedi/stack-exchange-dataset |
71,074 | Can a type system serve as a proof assistant for foreign functions? | <p>Given that:</p>

<ol>
<li>A language with very expressive type systems (e.g. <a href="http://www.idris-lang.org" rel="noreferrer">Idris</a>) can also have escape mechanisms like foreign function interfaces/unsafePerformIO.</li>
<li>There are proof assistants that can be used to prove some properties ... | type theory proof assistants curry howard | 1 | Can a type system serve as a proof assistant for foreign functions? -- (type theory proof assistants curry howard)
<p>Given that:</p>

<ol>
<li>A language with very expressive type systems (e.g. <a href="http://www.idris-lang.org" rel="noreferrer">Idris</a>) can also have escape mechanisms like foreign func... | habedi/stack-exchange-dataset |
71,087 | Solving the 10 players duel game | <p>Players #1 to #10 with hit probabilities $0.1,0.2,...,0.9,1$ (which are common knowledge) take part in a shooting game. </p>

<p><strong>Rules of the game:</strong> Players from #1 to #10 take turns to fire at each other. After round one, survivors repeat the circle (still in the order of #1 to #10). The gam... | algorithms dynamic programming game theory | 1 | Solving the 10 players duel game -- (algorithms dynamic programming game theory)
<p>Players #1 to #10 with hit probabilities $0.1,0.2,...,0.9,1$ (which are common knowledge) take part in a shooting game. </p>

<p><strong>Rules of the game:</strong> Players from #1 to #10 take turns to fire at each other. After ... | habedi/stack-exchange-dataset |
71,091 | Express a "complex" IF-Statement to Linear Programming | <p>In our current project we need to model the following if-statement in linear programming:</p>

<pre><code>If T1 < b < T2 then z = s else z = 0
</code></pre>

<p>where T1 and T2 are two integer values (e.g. T1 = 10 and T2 = 100) and s is also an integer value (e.g. 5).</p>

<p>We alr... | linear programming integer programming | 1 | Express a "complex" IF-Statement to Linear Programming -- (linear programming integer programming)
<p>In our current project we need to model the following if-statement in linear programming:</p>

<pre><code>If T1 < b < T2 then z = s else z = 0
</code></pre>

<p>where T1 and T2 are two integer... | habedi/stack-exchange-dataset |
71,092 | NP-Completeness of modified decision problems | <p>Suppose we have a <strong>NP</strong>-Complete decision problem like independent set or finding matching in graph theory and we change the greatness or smallness of the condition of that problem i.e. change the direction of the inequality in the problem's definition ($ \ge$ or $\le $). 
For example in independen... | complexity theory np complete | 1 | NP-Completeness of modified decision problems -- (complexity theory np complete)
<p>Suppose we have a <strong>NP</strong>-Complete decision problem like independent set or finding matching in graph theory and we change the greatness or smallness of the condition of that problem i.e. change the direction of the inequali... | habedi/stack-exchange-dataset |
71,102 | Interpolation on marching cubes algorithm | <p>I'm currently learning how isosurfaces are extrated from volumetric data. I already understood the original marching cubes algorithm which is based on 3D-voxel data which stores only values of either 1 or 0. For learning purposes I implemented the easier version of it for 2D-volumetric data called marching squares a... | algorithms | 1 | Interpolation on marching cubes algorithm -- (algorithms)
<p>I'm currently learning how isosurfaces are extrated from volumetric data. I already understood the original marching cubes algorithm which is based on 3D-voxel data which stores only values of either 1 or 0. For learning purposes I implemented the easier vers... | habedi/stack-exchange-dataset |
71,106 | Calculate the amount of formal languages | <p>Statement: </p>

<blockquote>
 <p>There are 256 formal languages $L$ with $L \subseteq \{w \in \{a,b\}^*
 \ \vert \ \ \vert w \vert = 3 \}$</p>
</blockquote>

<p>Answer: </p>

<blockquote>
 <p>True.</p>
</blockquote>

<p>My question is why there are 256 formal ... | formal languages | 1 | Calculate the amount of formal languages -- (formal languages)
<p>Statement: </p>

<blockquote>
 <p>There are 256 formal languages $L$ with $L \subseteq \{w \in \{a,b\}^*
 \ \vert \ \ \vert w \vert = 3 \}$</p>
</blockquote>

<p>Answer: </p>

<blockquote>
 <p>True.</p>
</b... | habedi/stack-exchange-dataset |
71,119 | Finite substitution and regular closure properties | <p>I'm not sure if I get the following definition right:</p>

<p>1.Def: A map $\varphi: \Sigma^{*} \rightarrow 2^{\Delta^{*}}$ is called Substitution iff:</p>

<ol>
<li>$\forall u,v \in \Sigma^{*}: \varphi(uv)=\varphi(u) \varphi(v)$</li>
<li>$\varphi(\epsilon)=\{\epsilon\}$</li>
</ol>
&#... | formal languages regular languages closure properties | 1 | Finite substitution and regular closure properties -- (formal languages regular languages closure properties)
<p>I'm not sure if I get the following definition right:</p>

<p>1.Def: A map $\varphi: \Sigma^{*} \rightarrow 2^{\Delta^{*}}$ is called Substitution iff:</p>

<ol>
<li>$\forall u,v \in \Sig... | habedi/stack-exchange-dataset |
71,127 | Comparing the complexity of algorithms for listing k-cliques | <p>Chiba and Nishizeki showed that it is possible to list all $k$-cliques (cliques on $k$ nodes) in time $O(m \cdot a^{k-2})$ where a is the arboricity of the graph and $m$ the number of edges in the graph. <a href="http://www.ecei.tohoku.ac.jp/alg/nishizeki/sub/j/DVD/PDF_J/J053.pdf" rel="nofollow noreferrer">http://ww... | graphs time complexity parameterized complexity | 1 | Comparing the complexity of algorithms for listing k-cliques -- (graphs time complexity parameterized complexity)
<p>Chiba and Nishizeki showed that it is possible to list all $k$-cliques (cliques on $k$ nodes) in time $O(m \cdot a^{k-2})$ where a is the arboricity of the graph and $m$ the number of edges in the graph.... | habedi/stack-exchange-dataset |
71,140 | Complexity calculation of a recursive function with additional O(n) complexity | <p>There is a method that I want to calculate its complexity in asymptotic notation. It calls additional methods(equals and substring) which complexity is $O(n)$. If it was $O(1)$, I could figure out complexity of the calling method. I have tried some operations; however, I'm stuck on calculation with the additional pa... | complexity theory asymptotics | 1 | Complexity calculation of a recursive function with additional O(n) complexity -- (complexity theory asymptotics)
<p>There is a method that I want to calculate its complexity in asymptotic notation. It calls additional methods(equals and substring) which complexity is $O(n)$. If it was $O(1)$, I could figure out comple... | habedi/stack-exchange-dataset |
71,146 | Why do all recent SAT solvers work on CNF instead of circuit SAT? | <p>After the release of the AIGER library to handle and-inverter graphs sometime in 2006 (I think), some circuit SAT solvers were released in 2006-2008, and in a few SAT Races/Competitions there were AIG tracks. However since then it seems the focus has been entirely on either SMT or improving clausal SAT solvers.</p>&... | satisfiability circuits sat solvers | 1 | Why do all recent SAT solvers work on CNF instead of circuit SAT? -- (satisfiability circuits sat solvers)
<p>After the release of the AIGER library to handle and-inverter graphs sometime in 2006 (I think), some circuit SAT solvers were released in 2006-2008, and in a few SAT Races/Competitions there were AIG tracks. H... | habedi/stack-exchange-dataset |
71,149 | Why is it meaningless to say the runtime of an algorithm is at least in the order of n squared? | <p>I would like to know why the following statement </p>

<blockquote>
 <p>The running time of algorithm $A$ is at least $O(n^2)$</p>
</blockquote>

<p>which means the best-case running time of $A$ is $O(n^2)$ is meaningless (CLRS page 53).</p>

<p>But the following is not</p>

... | algorithm analysis asymptotics runtime analysis | 1 | Why is it meaningless to say the runtime of an algorithm is at least in the order of n squared? -- (algorithm analysis asymptotics runtime analysis)
<p>I would like to know why the following statement </p>

<blockquote>
 <p>The running time of algorithm $A$ is at least $O(n^2)$</p>
</blockquote>
&#... | habedi/stack-exchange-dataset |
71,153 | Closure under the Star Operation | <p>I'm doing my homework, but there's one task that I didn't get the idea.</p>

<p>Task:</p>

<p>Recall the alternative definition for the star of a language A that we gave just before Theorem 2.3.1. In Theorems 2.3.1 and 2.6.2 (which is about closure under union operation), we have shown that the class... | regular languages finite automata regular expressions closure properties | 1 | Closure under the Star Operation -- (regular languages finite automata regular expressions closure properties)
<p>I'm doing my homework, but there's one task that I didn't get the idea.</p>

<p>Task:</p>

<p>Recall the alternative definition for the star of a language A that we gave just before Theorem ... | habedi/stack-exchange-dataset |
71,159 | Algorithm to split $n$ distinct items into $k$ nonempty unlabelled subsets | <p>The number of ways to split $n$ items into $k$ nonempty unlabelled subsets ($k<n$) is a Stirling number of the second kind.(<a href="https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind</a>)</p>

<p>I... | algorithms combinatorics discrete mathematics partitions | 1 | Algorithm to split $n$ distinct items into $k$ nonempty unlabelled subsets -- (algorithms combinatorics discrete mathematics partitions)
<p>The number of ways to split $n$ items into $k$ nonempty unlabelled subsets ($k<n$) is a Stirling number of the second kind.(<a href="https://en.wikipedia.org/wiki/Stirling_numbe... | habedi/stack-exchange-dataset |
71,162 | Decide given complexity of given function | <p>I'm trying to determine correct notation for the given functions which are $f(n) = n$ and $g(n) = (log(n))^{100}$. Moreover, I don't understand while calculating its complexity using limit because calculator shows that it goes infinity, so f(n) is growing faster than g(n). But, I found vice versa. Could you explain... | asymptotics | 1 | Decide given complexity of given function -- (asymptotics)
<p>I'm trying to determine correct notation for the given functions which are $f(n) = n$ and $g(n) = (log(n))^{100}$. Moreover, I don't understand while calculating its complexity using limit because calculator shows that it goes infinity, so f(n) is growing f... | habedi/stack-exchange-dataset |
71,164 | How to create new language with languages $L_a = \{a\}, L_b = \{b\}$ and set operations? | <p>I have to create new language with languages $L_a = \{a\}, L_b = \{b\}$ and with set operations which contains only words</p>

<ol>
<li>with even length</li>
<li>with odd length and first letter not equal to last letter</li>
</ol>

<p>So my solution for part 1 is this. Am I rigth?</p>
... | formal languages | 1 | How to create new language with languages $L_a = \{a\}, L_b = \{b\}$ and set operations? -- (formal languages)
<p>I have to create new language with languages $L_a = \{a\}, L_b = \{b\}$ and with set operations which contains only words</p>

<ol>
<li>with even length</li>
<li>with odd length and first le... | habedi/stack-exchange-dataset |
71,172 | What's the difference between dynamic and static pipelines? | <p>I was trying to understand what a reservation table is in the context of pipelining, when I found this reference <a href="http://www2.cs.siu.edu/~cs401/Textbook/ch3.pdf" rel="nofollow noreferrer" title="here">here</a>, where the author mentions that there are <em>static</em> and <em>dynamic</em> pipelines. According... | computer architecture cpu pipelines | 1 | What's the difference between dynamic and static pipelines? -- (computer architecture cpu pipelines)
<p>I was trying to understand what a reservation table is in the context of pipelining, when I found this reference <a href="http://www2.cs.siu.edu/~cs401/Textbook/ch3.pdf" rel="nofollow noreferrer" title="here">here</a... | habedi/stack-exchange-dataset |
71,190 | Stroke Width Transform: Gradient Direction and Rays | <p>I've been trying to implement this <a href="http://cmp.felk.cvut.cz/~cernyad2/TextCaptchaPdf/Detecting%20Text%20in%20Natural%20Scenes%20with%20Stroke%20Width%20Transform.pdf" rel="nofollow noreferrer">paper</a> from Boris Epshtein, Eyal Ofek, and Yonatan Wexler, the pioneers of <a href="http://cmp.felk.cvut.cz/~cern... | algorithms image processing research | 1 | Stroke Width Transform: Gradient Direction and Rays -- (algorithms image processing research)
<p>I've been trying to implement this <a href="http://cmp.felk.cvut.cz/~cernyad2/TextCaptchaPdf/Detecting%20Text%20in%20Natural%20Scenes%20with%20Stroke%20Width%20Transform.pdf" rel="nofollow noreferrer">paper</a> from Boris E... | habedi/stack-exchange-dataset |
71,192 | co-NP but not NP problems | <p>What are the problems that are in <strong>co-NP</strong> but not in <strong>NP</strong>?</p>

<p>i.e, those problems where incorrect strings can be deterministically verified in polynomial time but the correct strings can't be.</p>
 | p vs np co np | 1 | co-NP but not NP problems -- (p vs np co np)
<p>What are the problems that are in <strong>co-NP</strong> but not in <strong>NP</strong>?</p>

<p>i.e, those problems where incorrect strings can be deterministically verified in polynomial time but the correct strings can't be.</p>
 | habedi/stack-exchange-dataset |
71,198 | Polynomial Identity Testing $(\mathsf{PIT\text{}})$ in non commutative setting | <p>Let me define the problems first</p>

<p>Polynomial Identity Testing $(\mathsf{PIT\text{}})$ </p>

<p><strong>Given</strong> : A polynomial $p$ over some field $\mathbb{F}$.</p>

<p><strong>Decide</strong> : Are all coefficients of the monomials of $p$ are equal to zero ?</p>

<p>Pol... | complexity theory randomized algorithms circuits | 1 | Polynomial Identity Testing $(\mathsf{PIT\text{}})$ in non commutative setting -- (complexity theory randomized algorithms circuits)
<p>Let me define the problems first</p>

<p>Polynomial Identity Testing $(\mathsf{PIT\text{}})$ </p>

<p><strong>Given</strong> : A polynomial $p$ over some field $\mathb... | habedi/stack-exchange-dataset |
71,211 | Variation of omega definition | <p>The same question has been asked <a href="https://cs.stackexchange.com/questions/12147/variations-of-omega-and-omega-infinity">here</a></p>

<blockquote>
 <p>Some authors define $\Omega$ in a slightly different way: let’s use
 $ \overset{\infty}{\Omega}$
 (read “omega infinity”) for this alte... | asymptotics landau notation | 1 | Variation of omega definition -- (asymptotics landau notation)
<p>The same question has been asked <a href="https://cs.stackexchange.com/questions/12147/variations-of-omega-and-omega-infinity">here</a></p>

<blockquote>
 <p>Some authors define $\Omega$ in a slightly different way: let’s use
 $ \overs... | habedi/stack-exchange-dataset |
71,221 | Is language $\{a,b\}^*$ same as language $\{xy \in \{a,b\}^* \mid |x|_a = |y|_b \}$? | <p>I need to prove or disprove if these two languages are same.
So I assume that these lanaguages are same because I think that every word from $\{a,b\}^*$ could be concatenated from two words $x$ and $y$ where $|x|_a = |y|_b$. So $x$ and $y$ must belong to $\{a,b\}^*$, too. Then I can write and prove this:</p>
... | formal languages | 1 | Is language $\{a,b\}^*$ same as language $\{xy \in \{a,b\}^* \mid |x|_a = |y|_b \}$? -- (formal languages)
<p>I need to prove or disprove if these two languages are same.
So I assume that these lanaguages are same because I think that every word from $\{a,b\}^*$ could be concatenated from two words $x$ and $y$ wher... | habedi/stack-exchange-dataset |
71,229 | Does a computer do only two things? | <p>According to the book, Introduction to Computation And Programming Using Python by John V Guttag, a computer does only two things:</p>

<ul>
<li>Store data</li>
<li>Manipulate data</li>
</ul>

<p>But is this all? I mean, without I/O, can a computer be considered useful?</p>
 | computer architecture computation models | 1 | Does a computer do only two things? -- (computer architecture computation models)
<p>According to the book, Introduction to Computation And Programming Using Python by John V Guttag, a computer does only two things:</p>

<ul>
<li>Store data</li>
<li>Manipulate data</li>
</ul>

<p>But is this... | habedi/stack-exchange-dataset |
71,236 | NFA models with characters on nodes, not edges | <p>I am attempting to understand the inner workings of the open source string matching library <a href="https://01.org/hyperscan" rel="nofollow noreferrer">Hyperscan</a>.</p>

<p>It takes a multiple-engine approach to the problem of generating string matches, and I'm still in the early stages of following throu... | algorithms finite automata string matching | 1 | NFA models with characters on nodes, not edges -- (algorithms finite automata string matching)
<p>I am attempting to understand the inner workings of the open source string matching library <a href="https://01.org/hyperscan" rel="nofollow noreferrer">Hyperscan</a>.</p>

<p>It takes a multiple-engine approach to... | habedi/stack-exchange-dataset |
71,239 | Can a machine choose whether or not to accept a state in a FSM | <p><a href="https://i.stack.imgur.com/JTSnR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JTSnR.jpg" alt="enter image description here"></a>We were given a question in class with this FSM and had a debate over what the regex would be and the corresponding accepted strings. Does this FSM make sense ... | regular expressions | 1 | Can a machine choose whether or not to accept a state in a FSM -- (regular expressions)
<p><a href="https://i.stack.imgur.com/JTSnR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JTSnR.jpg" alt="enter image description here"></a>We were given a question in class with this FSM and had a debate over w... | habedi/stack-exchange-dataset |
71,240 | Address Word Structure | <p>In Vol. 1 Issue 1, Jan. 1958 of the magazine <em>Communications of the ACM</em>, Dr. Saul Gorn discusses the advantages of the computer architecture of Edvac to that of Eniac.</p>

<p>He states that the Edvac had a <strong>three-plus-one address word structure</strong>, and that the tendencies of his time pe... | computer architecture | 1 | Address Word Structure -- (computer architecture)
<p>In Vol. 1 Issue 1, Jan. 1958 of the magazine <em>Communications of the ACM</em>, Dr. Saul Gorn discusses the advantages of the computer architecture of Edvac to that of Eniac.</p>

<p>He states that the Edvac had a <strong>three-plus-one address word structur... | habedi/stack-exchange-dataset |
71,244 | Comparing complexities with 2 variables | <p>Suppose I have 2 possible algorithms: one runs in O(m+n) and the other runs in O(mn). Suppose also that the task is performed on a connected graph with m edges and n vertices. No other information is given about the graph. How do I know which algorithm is faster?</p>

<p>EDIT:
I don't think my question i... | complexity theory graphs | 1 | Comparing complexities with 2 variables -- (complexity theory graphs)
<p>Suppose I have 2 possible algorithms: one runs in O(m+n) and the other runs in O(mn). Suppose also that the task is performed on a connected graph with m edges and n vertices. No other information is given about the graph. How do I know which algo... | habedi/stack-exchange-dataset |
71,247 | CTL* query evaluation order | <p>I'm currently trying to evaluate a CTL* expression and am not sure how to stepwisely evaluate the queries. 
For example I have <strong>EFG p</strong>. This means something like 'there is a path where eventually there exists a state s where from there on, globally p holds true'. </p>

<p>Globally means th... | logic model checking computation tree logic temporal logic | 1 | CTL* query evaluation order -- (logic model checking computation tree logic temporal logic)
<p>I'm currently trying to evaluate a CTL* expression and am not sure how to stepwisely evaluate the queries. 
For example I have <strong>EFG p</strong>. This means something like 'there is a path where eventually there exis... | habedi/stack-exchange-dataset |
71,248 | Stroke Width Transform: Gradient Direction Computation | <p>I've been trying to implement <a href="http://cmp.felk.cvut.cz/~cernyad2/TextCaptchaPdf/Detecting%20Text%20in%20Natural%20Scenes%20with%20Stroke%20Width%20Transform.pdf" rel="nofollow noreferrer">this paper</a> from Boris Epshtein, Eyal Ofek, and Yonatan Wexler, the pioneers of Stroke Width Transform .</p>

... | algorithms image processing mathematical programming research | 1 | Stroke Width Transform: Gradient Direction Computation -- (algorithms image processing mathematical programming research)
<p>I've been trying to implement <a href="http://cmp.felk.cvut.cz/~cernyad2/TextCaptchaPdf/Detecting%20Text%20in%20Natural%20Scenes%20with%20Stroke%20Width%20Transform.pdf" rel="nofollow noreferrer"... | habedi/stack-exchange-dataset |
71,258 | Maximize points of K dance moves | <p>In this problem, I want to maximize the number of points of K dance moves. There are N possible dance moves.</p>

<p>Each of the dance moves have a point value associated with it which can be positive or negative.</p>

<p>There are also points from transitioning from one dance move to another. We're ... | dynamic programming | 1 | Maximize points of K dance moves -- (dynamic programming)
<p>In this problem, I want to maximize the number of points of K dance moves. There are N possible dance moves.</p>

<p>Each of the dance moves have a point value associated with it which can be positive or negative.</p>

<p>There are also points... | habedi/stack-exchange-dataset |
71,261 | Kleene star Empty language | <p>I had a test a couple of days ago and one of the question had 2 statements :</p>

<ol>
<li><p>$L^+ = L^\ast$</p></li>
<li><p>$L$ contains $\varepsilon$</p></li>
</ol>

<p>I had to say does 1 imply 2, does 2 imply 1 or do they both imply each other.</p>

<p>I answered that only 2 i... | formal languages kleene star | 1 | Kleene star Empty language -- (formal languages kleene star)
<p>I had a test a couple of days ago and one of the question had 2 statements :</p>

<ol>
<li><p>$L^+ = L^\ast$</p></li>
<li><p>$L$ contains $\varepsilon$</p></li>
</ol>

<p>I had to say does 1 imply 2, does 2 imply 1 or do they bo... | habedi/stack-exchange-dataset |
71,267 | how to prove that every finite language is context-free? | <p>I am trying to prove that every finite language is context-free, is there any type of way that I could do it effectively?</p>
 | formal languages regular languages context free | 1 | how to prove that every finite language is context-free? -- (formal languages regular languages context free)
<p>I am trying to prove that every finite language is context-free, is there any type of way that I could do it effectively?</p>
 | habedi/stack-exchange-dataset |
71,268 | Looking for an algorithm to find a shortest path in a special graph | <p>I have the following problem: given a directed unweighted graph and a set of source vertices, it's needed to find the shortest path to the specified vertex. The mentioned graph has two special extensions:</p>

<ol>
<li><p>A graph's edge can be active or inactive depending on edges placed in the path befo... | algorithms graphs search algorithms shortest path | 1 | Looking for an algorithm to find a shortest path in a special graph -- (algorithms graphs search algorithms shortest path)
<p>I have the following problem: given a directed unweighted graph and a set of source vertices, it's needed to find the shortest path to the specified vertex. The mentioned graph has two special e... | habedi/stack-exchange-dataset |
71,269 | Failure of the Pumping Lemma | <p>On the Wikipedia page for the Pumping Lemma for Context-Free Languages, a language, 
$$
\{b^j c^k d^l | j, k, l \in N\} \cup \{a^i b^j c^k d^l | i > 0, j = k = l\}
$$
is introduced. The pumping lemma proof for this supposedly fails because, given a string without <em>a</em>'s, you can pump the <em... | formal languages context free pumping lemma | 1 | Failure of the Pumping Lemma -- (formal languages context free pumping lemma)
<p>On the Wikipedia page for the Pumping Lemma for Context-Free Languages, a language, 
$$
\{b^j c^k d^l | j, k, l \in N\} \cup \{a^i b^j c^k d^l | i > 0, j = k = l\}
$$
is introduced. The pumping lemma proof for this suppo... | habedi/stack-exchange-dataset |
71,272 | Number of n-node binary trees containing an m-node binary subtree | <p>In a paper I see the following lemma about unlabeled binary trees:</p>

<blockquote>
 <p>If $s_1$ and $s_2$ are both m-node binary trees, then the number of n-node binary trees containing $s_1$ as a subtree is the same as the number of n-node binary trees containing $s_2$.</p>
</blockquote>

... | binary trees | 1 | Number of n-node binary trees containing an m-node binary subtree -- (binary trees)
<p>In a paper I see the following lemma about unlabeled binary trees:</p>

<blockquote>
 <p>If $s_1$ and $s_2$ are both m-node binary trees, then the number of n-node binary trees containing $s_1$ as a subtree is the same a... | habedi/stack-exchange-dataset |
71,279 | Proof Idea: How to prove the intersection of regular language and CFL is a CFL? | <p>I know that the intersection of a regular language and a context free language is a context free language. I've seen this fact proven on here and other websites. However, after spending hours reading through proofs, I don't really understand the general idea of the proof itself. I'm not looking for a formal proof, b... | regular languages context free proof techniques | 1 | Proof Idea: How to prove the intersection of regular language and CFL is a CFL? -- (regular languages context free proof techniques)
<p>I know that the intersection of a regular language and a context free language is a context free language. I've seen this fact proven on here and other websites. However, after spendin... | habedi/stack-exchange-dataset |
71,282 | Difference between row-polymorpism and bounded polymorpishm? | <p>I recently came across this <a href="https://brianmckenna.org/blog/row_polymorphism_isnt_subtyping" rel="noreferrer">blog post</a> by Brian McKenna explaining row polymorphism. This seemed like a wonderful idea to me, but then I realized it smells an awful lot like bounded parametric polymorphism:</p>

<p>Wi... | programming languages semantics | 1 | Difference between row-polymorpism and bounded polymorpishm? -- (programming languages semantics)
<p>I recently came across this <a href="https://brianmckenna.org/blog/row_polymorphism_isnt_subtyping" rel="noreferrer">blog post</a> by Brian McKenna explaining row polymorphism. This seemed like a wonderful idea to me, b... | habedi/stack-exchange-dataset |
71,289 | Where does the heuristic come from in the A-star algorithm and how do we know it has the right properties? | <p>I am trying to understand some notes regarding the A-star algorithm. The example used is to show how the algorithm can be used as a (more efficient) alternative to Dijkstra's algorithm for finding shortest path. I am reading about A* search starting page 71 of the UK GCE Computing textbook, Rouse to find shortest pa... | algorithms search algorithms shortest path | 1 | Where does the heuristic come from in the A-star algorithm and how do we know it has the right properties? -- (algorithms search algorithms shortest path)
<p>I am trying to understand some notes regarding the A-star algorithm. The example used is to show how the algorithm can be used as a (more efficient) alternative t... | habedi/stack-exchange-dataset |
71,291 | Is the runtime complexity of sorting $O(n\log n)$ or $O(n\log^2 n)$? | <p>Suppose we want to sort an array that contains $n$ different integers in the range $[1,2n]$. It is known that this requires $\Theta(n\log n)$ comparisons. But comparing integers which might be as large as $n$ might requires time $\Theta(\log n)$ since we have to compare them bitwise. So, apparently the runtime compl... | runtime analysis sorting | 1 | Is the runtime complexity of sorting $O(n\log n)$ or $O(n\log^2 n)$? -- (runtime analysis sorting)
<p>Suppose we want to sort an array that contains $n$ different integers in the range $[1,2n]$. It is known that this requires $\Theta(n\log n)$ comparisons. But comparing integers which might be as large as $n$ might req... | habedi/stack-exchange-dataset |
71,293 | What is the name for polynomially solvable optimisation problems? | <p>An optimisation problem that allows to solve a NPC decision problem through a polynomial reduction is called NP-hard. For these optimisation problems no polynomial algorithm is known.</p>

<p>Symmetrically, is there a standard name for all those optimisation problems for which a polynomial algorithm is known... | terminology optimization polynomial time | 1 | What is the name for polynomially solvable optimisation problems? -- (terminology optimization polynomial time)
<p>An optimisation problem that allows to solve a NPC decision problem through a polynomial reduction is called NP-hard. For these optimisation problems no polynomial algorithm is known.</p>

<p>Symme... | habedi/stack-exchange-dataset |
71,309 | Finding if a CFG is ambiguous | <p>I'm trying to find if the following CFG is ambiguous. </p>

<p>\begin{align*}
 M &\to 0R \mid 1R\\
 R &\to 1RR \mid 0 \mid 0M\\
 P &\to 0PP \mid 1 \mid 1M\,.
\end{align*}</p>

<p>When doing the parse tree, do I treat $0R$ as two separate things or as one? 
If ... | formal languages context free | 1 | Finding if a CFG is ambiguous -- (formal languages context free)
<p>I'm trying to find if the following CFG is ambiguous. </p>

<p>\begin{align*}
 M &\to 0R \mid 1R\\
 R &\to 1RR \mid 0 \mid 0M\\
 P &\to 0PP \mid 1 \mid 1M\,.
\end{align*}</p>

<p>When doing the parse... | habedi/stack-exchange-dataset |
71,316 | How to prove that Inner product of two $n$ dimensional vectors requires at least $n$ many multiplications? | <p><strong>Input :</strong> Two matrices $A$ and $B$ of size $n$ X $n$.</p>

<p><strong>Compute :</strong> Matrix product $A$ X $B$.</p>

<p>Some of the known results about matrix multiplication are given below.</p>

<p>Brute Force : $O(n^3)$.</p>

<p>Nader H. Bshouty : at least $2.5$ $n... | algorithms algorithm analysis lower bounds | 1 | How to prove that Inner product of two $n$ dimensional vectors requires at least $n$ many multiplications? -- (algorithms algorithm analysis lower bounds)
<p><strong>Input :</strong> Two matrices $A$ and $B$ of size $n$ X $n$.</p>

<p><strong>Compute :</strong> Matrix product $A$ X $B$.</p>

<p>Some of ... | habedi/stack-exchange-dataset |
71,324 | Color Filler Algorithm | <p>Is there an algorithm that fills the area outside the edges?</p>

<p>e.g.:
<br>
From this
<br>
<a href="https://i.stack.imgur.com/CfTUM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CfTUM.png" alt="enter image description here"></a>
<br>
to this
<br>
<a hr... | algorithms image processing | 1 | Color Filler Algorithm -- (algorithms image processing)
<p>Is there an algorithm that fills the area outside the edges?</p>

<p>e.g.:
<br>
From this
<br>
<a href="https://i.stack.imgur.com/CfTUM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CfTUM.png" alt="enter image descri... | habedi/stack-exchange-dataset |
71,329 | Draw DFA that accepts concatenated binary string with condition | <p>Let $\Sigma = \{0,1\}$, with $w \in \Sigma^* $ and $value(w)$ the not negative integer value of $w$. $w$ is seen as binary string, with its first index being the least significant bit:</p>

<p>$$value(w_1 w_2 ... w_n) = \Sigma_{i=i}^n 2^{i-1} w_i$$</p>

<p>The languages is defined as:
$$L = \{a_... | regular languages finite automata | 1 | Draw DFA that accepts concatenated binary string with condition -- (regular languages finite automata)
<p>Let $\Sigma = \{0,1\}$, with $w \in \Sigma^* $ and $value(w)$ the not negative integer value of $w$. $w$ is seen as binary string, with its first index being the least significant bit:</p>

<p>$$value(w_1 w... | habedi/stack-exchange-dataset |
71,341 | right and left derivatives of a cfg from parse tree? | <p>i just want to double check with what i concluded from this parse trees.</p>

<blockquote>
<pre><code> A
 / \
 / \
 B C
 / \ / \
 0 D D E
 | |
 0 1
</code></pre>
</blockquote>

<p>from the above tree i get... | automata context free | 1 | right and left derivatives of a cfg from parse tree? -- (automata context free)
<p>i just want to double check with what i concluded from this parse trees.</p>

<blockquote>
<pre><code> A
 / \
 / \
 B C
 / \ / \
 0 D D E
 | |
 ... | habedi/stack-exchange-dataset |
71,353 | Embedding SATISFIABILITY into 3-DIMENSIONAL MATCHING | <blockquote>
 <p>Using the fact that the satisfiability problem is NP Complete, demonstrate that the 3-Dimensional Matching problem is NP Complete. </p>
</blockquote>

<p>I am currently in need of clarification of the proof of the above statement as given in the Combinatorial Optimization text by Papad... | np complete reductions | 1 | Embedding SATISFIABILITY into 3-DIMENSIONAL MATCHING -- (np complete reductions)
<blockquote>
 <p>Using the fact that the satisfiability problem is NP Complete, demonstrate that the 3-Dimensional Matching problem is NP Complete. </p>
</blockquote>

<p>I am currently in need of clarification of the proo... | habedi/stack-exchange-dataset |
71,358 | Can a finite state transducer emit $\epsilon$? | <p>Can a deterministic finite state transducer output ϵ (epsilon) ?</p>

<blockquote>
 <p>A Deterministic Finite-state Transducer (DFT) is a device much like a
 DFA, except that its purpose is not to accept strings or languages but
 to transform input strings into output strings. Informally, it s... | finite automata transducers | 1 | Can a finite state transducer emit $\epsilon$? -- (finite automata transducers)
<p>Can a deterministic finite state transducer output ϵ (epsilon) ?</p>

<blockquote>
 <p>A Deterministic Finite-state Transducer (DFT) is a device much like a
 DFA, except that its purpose is not to accept strings or lang... | habedi/stack-exchange-dataset |
71,374 | Show that every definite language is accepted by a finite automaton | <p>A language $L$ is definite if there is some $k> 0$ such that for any string $w$, whether $w \in L$ depends on the last $k$ symbols of $w$. How can I prove that every definite language is accepted by a finite automaton?</p>
 | finite automata | 1 | Show that every definite language is accepted by a finite automaton -- (finite automata)
<p>A language $L$ is definite if there is some $k> 0$ such that for any string $w$, whether $w \in L$ depends on the last $k$ symbols of $w$. How can I prove that every definite language is accepted by a finite automaton?</p>&#x... | habedi/stack-exchange-dataset |
71,387 | Converting Polynomials into Binary form | <p>How can a polynomial such as $x^3 + 1$ be converted to its binary form of $1001$. Likewise, $10100001 = x^7 + x^5 + 1.$</p>
 | arithmetic polynomials | 1 | Converting Polynomials into Binary form -- (arithmetic polynomials)
<p>How can a polynomial such as $x^3 + 1$ be converted to its binary form of $1001$. Likewise, $10100001 = x^7 + x^5 + 1.$</p>
 | habedi/stack-exchange-dataset |
71,390 | What type of function is main()? | <p>As the functions are of 2 type:<br>1.Pre-defined/library functions,<br>2.User defined functions.</p>

<p>What type of function is <em>main()</em> function?</p>

<p>This doubt comes in my mind while writing a program we define the <em>main()</em> function as we do the others.</p>

<p>Please he... | functional programming c++ | 1 | What type of function is main()? -- (functional programming c++)
<p>As the functions are of 2 type:<br>1.Pre-defined/library functions,<br>2.User defined functions.</p>

<p>What type of function is <em>main()</em> function?</p>

<p>This doubt comes in my mind while writing a program we define the <em>ma... | habedi/stack-exchange-dataset |
71,394 | SVM with different length features | <p>I need to train SVM with 2 different features..the problem is one feature is the HOG with length 144 and other an RGB value with length 3.. Can i combine these two features to train SVM and test using the same? the code iam using is</p>

<p><code>X1=xlsread('train1.xlsx');
Y1=xlsread('CLASS1.xlsx'); &#x... | svm | 1 | SVM with different length features -- (svm)
<p>I need to train SVM with 2 different features..the problem is one feature is the HOG with length 144 and other an RGB value with length 3.. Can i combine these two features to train SVM and test using the same? the code iam using is</p>

<p><code>X1=xlsread('train... | habedi/stack-exchange-dataset |
71,396 | How is a grammatical rule applied if the variable is not part of the source word | <p>I'm currently working with this grammar:</p>

<ol>
<li>$S \to aSBC$</li>
<li>$S \to aBC$</li>
<li>$CB \to BC$</li>
<li>$aB \to ab$ </li>
<li>$bB \to bb$</li>
<li>$bC \to bc$</li>
<li>$cC \to cc$</li>
</ol>

<p>It is supposed to define the language $$ L = \{a^nb^nc^n : ... | formal grammars | 1 | How is a grammatical rule applied if the variable is not part of the source word -- (formal grammars)
<p>I'm currently working with this grammar:</p>

<ol>
<li>$S \to aSBC$</li>
<li>$S \to aBC$</li>
<li>$CB \to BC$</li>
<li>$aB \to ab$ </li>
<li>$bB \to bb$</li>
<li>$bC \to bc$</li>
... | habedi/stack-exchange-dataset |
71,411 | Why does the neural network logistic regression cost function sum for all layers only for lambda? | <p>I'm taking Andrew Ng's machine learning course and week 5 covers the training of neural networks. The modified cost function for neural network training is derived from the logistic regression cost function, and is described as follows:</p>

<p>$$\begin{gather*} J(\Theta) = - \frac{1}{m} \sum_{i=1}^m \sum_{k... | machine learning neural networks | 1 | Why does the neural network logistic regression cost function sum for all layers only for lambda? -- (machine learning neural networks)
<p>I'm taking Andrew Ng's machine learning course and week 5 covers the training of neural networks. The modified cost function for neural network training is derived from the logistic... | habedi/stack-exchange-dataset |
71,420 | How to generate an LL(2) parse table? | <p>The algorithms I've seen for building an LL(1) parse table involve calculating <code>first</code> and <code>follow</code> sets such that:</p>

<pre><code>predict(nonterminal, production) == 
 if epsilon in FIRST(production):
 first(production) union follow(nonterminal)
 else:
... | compilers parsers ll k | 1 | How to generate an LL(2) parse table? -- (compilers parsers ll k)
<p>The algorithms I've seen for building an LL(1) parse table involve calculating <code>first</code> and <code>follow</code> sets such that:</p>

<pre><code>predict(nonterminal, production) == 
 if epsilon in FIRST(production):
 ... | habedi/stack-exchange-dataset |
71,421 | Markov chain probability in a complete graph | <p>I'm having a hard time understanding the following. Assuming we have a complete graph with $n$ vertices, where initially, one of those has an information. At this point, all we care about is that in each time $t$ a node that has the information chooses randomly one of it's neighboors and sends it the info, only if t... | probabilistic algorithms | 1 | Markov chain probability in a complete graph -- (probabilistic algorithms)
<p>I'm having a hard time understanding the following. Assuming we have a complete graph with $n$ vertices, where initially, one of those has an information. At this point, all we care about is that in each time $t$ a node that has the informati... | habedi/stack-exchange-dataset |
71,428 | n-state DFA that requires n-2 steps to check equivalence | <p>We have a DFA $A = (Q,\Sigma, \delta, q_0, F)$.
States $p, q$ $\in Q$ are equivalent, $p \sim q$ if $ \forall w \in \Sigma ^ \ast$ $ \delta^*(p,w) \in F \iff \delta^*(q,w) \in F$</p>

<p>States $p,q$ are equivalent after $i$ steps, $p \sim ^i q$, if $ \forall w \in \Sigma ^ \ast$ such that $|w|\le i$ $ ... | finite automata | 1 | n-state DFA that requires n-2 steps to check equivalence -- (finite automata)
<p>We have a DFA $A = (Q,\Sigma, \delta, q_0, F)$.
States $p, q$ $\in Q$ are equivalent, $p \sim q$ if $ \forall w \in \Sigma ^ \ast$ $ \delta^*(p,w) \in F \iff \delta^*(q,w) \in F$</p>

<p>States $p,q$ are equivalent after $i$ s... | habedi/stack-exchange-dataset |
71,433 | Sum of all distances in connected DAG in $O(n\log n)$ | <p>I have a DAG with $n$ nodes and $n-1$ edges. The edges in DAG (fixed) are defined as follows: For every node $i$, $1 \le i \le n-1$ is connected to node $i+1$. The lengths of the $n-1$ edges are given as input.</p>

<p>I need to compute the sum of all of the distances between all pairs of different vertice... | algorithms graphs shortest path | 1 | Sum of all distances in connected DAG in $O(n\log n)$ -- (algorithms graphs shortest path)
<p>I have a DAG with $n$ nodes and $n-1$ edges. The edges in DAG (fixed) are defined as follows: For every node $i$, $1 \le i \le n-1$ is connected to node $i+1$. The lengths of the $n-1$ edges are given as input.</p>

... | habedi/stack-exchange-dataset |
71,434 | Numbering of computable functions | <p>Is there a numbering (not Gödel numbering) of all computable functions $U(p, x)$, such that the set of numbers of functions defined in zero is exactly the set of even numbers. More formally: $I = \{p,\ |\ U(p, 0)\ \mathrm{defined}\} = 2\mathbb{N}$.</p>

<p>My guess that it's true. But I'm not sure how to pr... | computability discrete mathematics | 1 | Numbering of computable functions -- (computability discrete mathematics)
<p>Is there a numbering (not Gödel numbering) of all computable functions $U(p, x)$, such that the set of numbers of functions defined in zero is exactly the set of even numbers. More formally: $I = \{p,\ |\ U(p, 0)\ \mathrm{defined}\} = 2\mathb... | habedi/stack-exchange-dataset |
71,439 | Context free grammar for $L=\{a^n b c^n | n \ge0\}$ | <p>I'm having trouble with this problem. Can't find a CFG. Someone an idea?</p>

<p>$$L=\{a^n b c^n | n \ge0\}$$</p>
 | context free | 1 | Context free grammar for $L=\{a^n b c^n | n \ge0\}$ -- (context free)
<p>I'm having trouble with this problem. Can't find a CFG. Someone an idea?</p>

<p>$$L=\{a^n b c^n | n \ge0\}$$</p>
 | habedi/stack-exchange-dataset |
71,440 | Sampling from a set of numbers with a fixed sum | <p>Let $s = \{x_1, x_2, \ldots, x_n\}$ be a set of $n$ random non-negative integers where $\sum_i x_i = n$. And let $\{y_1, y_2, \ldots, y_{\sqrt{n}}\}$ denote a subset of size $\sqrt{n}$ of $s$, chosen uniformly at random. Defining $y$ to be $\sum_i y_i$ I am interested in calculating the value of $y$.</p>

<p... | probability theory randomized algorithms sampling chernoff bounds | 1 | Sampling from a set of numbers with a fixed sum -- (probability theory randomized algorithms sampling chernoff bounds)
<p>Let $s = \{x_1, x_2, \ldots, x_n\}$ be a set of $n$ random non-negative integers where $\sum_i x_i = n$. And let $\{y_1, y_2, \ldots, y_{\sqrt{n}}\}$ denote a subset of size $\sqrt{n}$ of $s$, chose... | habedi/stack-exchange-dataset |
71,452 | Creating a temp array vs passing one in Mergesort | <p>In my CS class, we've discussed two ways of dealing with the temporary array required for the merging phase of mergesort. One of them is to pass a full-size temporary array as a parameter, e.g. merge(array, tempArray, first, last), and another is to create a temporary array of appropriate size (or two half-sized arr... | sorting mergesort | 1 | Creating a temp array vs passing one in Mergesort -- (sorting mergesort)
<p>In my CS class, we've discussed two ways of dealing with the temporary array required for the merging phase of mergesort. One of them is to pass a full-size temporary array as a parameter, e.g. merge(array, tempArray, first, last), and another ... | habedi/stack-exchange-dataset |
71,462 | How are partial measurements performed on a N qubit quantum circuit? | <p>I am trying to understand quantum computing concepts and have gone through alot of websites and books such as: Quantum Computing by Mikio and <a href="https://people.eecs.berkeley.edu/~vazirani/f04quantum/notes/lecture1.pdf" rel="nofollow noreferrer">https://people.eecs.berkeley.edu/~vazirani/f04quantum/notes/lectur... | quantum computing | 1 | How are partial measurements performed on a N qubit quantum circuit? -- (quantum computing)
<p>I am trying to understand quantum computing concepts and have gone through alot of websites and books such as: Quantum Computing by Mikio and <a href="https://people.eecs.berkeley.edu/~vazirani/f04quantum/notes/lecture1.pdf" ... | habedi/stack-exchange-dataset |
71,463 | What characterises vertices at fixed indices in all topological orderings? | <p>Let $G$ be a DAG with $v \in V$. Suppose that there exists some $i$ such that for all topological orderings $v_1, \ldots, v_n$ we have $v_i = v$.</p>

<p>What's a set of necessary and sufficient conditions about $v$ for this to occur?</p>
 | graphs | 1 | What characterises vertices at fixed indices in all topological orderings? -- (graphs)
<p>Let $G$ be a DAG with $v \in V$. Suppose that there exists some $i$ such that for all topological orderings $v_1, \ldots, v_n$ we have $v_i = v$.</p>

<p>What's a set of necessary and sufficient conditions about $v$ for th... | habedi/stack-exchange-dataset |
71,473 | What does being Turing complete mean? | <p>I see that most definitions of what it is to be Turing-complete are tautological to a degree. For example if you Google "what does being Turing complete mean", you get:</p>

<blockquote>
 <p>A computer is Turing complete if it can solve any problem that a Turing machine can...</p>
</blockquote>
... | turing machines turing completeness | 1 | What does being Turing complete mean? -- (turing machines turing completeness)
<p>I see that most definitions of what it is to be Turing-complete are tautological to a degree. For example if you Google "what does being Turing complete mean", you get:</p>

<blockquote>
 <p>A computer is Turing complete if i... | habedi/stack-exchange-dataset |
71,485 | Method for finding Hyperrectangle that a coordinate is within | <p>I have a problem at work where I have set of hyperrectangles, in no particular order, that do not overlap and when unioned create a hyperrectangle with no gaps. At the moment I am looking for a way to efficiently figure out which hyperrectangle a given coordinate is within. </p>

<p>I do not always have too ... | algorithms computational geometry hashing | 1 | Method for finding Hyperrectangle that a coordinate is within -- (algorithms computational geometry hashing)
<p>I have a problem at work where I have set of hyperrectangles, in no particular order, that do not overlap and when unioned create a hyperrectangle with no gaps. At the moment I am looking for a way to efficie... | habedi/stack-exchange-dataset |
71,489 | Why are mapping reductions from incomputable Languages OK? | <p>For example, many reductions from $A_{TM}$ will often have the lines:</p>

<pre><code>Simulate M on w:
 if M accepts 
 ...
 else
</code></pre>

<p>But: a reduction is a computable function, right? So why are we allowed to say "if M accepts"?
Also, I can take the same l... | automata reductions | 1 | Why are mapping reductions from incomputable Languages OK? -- (automata reductions)
<p>For example, many reductions from $A_{TM}$ will often have the lines:</p>

<pre><code>Simulate M on w:
 if M accepts 
 ...
 else
</code></pre>

<p>But: a reduction is a computable function,... | habedi/stack-exchange-dataset |
71,491 | Every LEFT-RESET Turing machine has an equivalent conventional Turing machine | <p>I am working on a proof of the theorem that every LEFT-RESET Turing machine has an equivalent conventional, single tape Turing machine. The transitions for the LEFT-RESET Turing machine are {Right, RESET}, and the transitions for the conventional Turing machine are {Left, Right}. Here is the general outline of my pr... | turing machines proof techniques | 1 | Every LEFT-RESET Turing machine has an equivalent conventional Turing machine -- (turing machines proof techniques)
<p>I am working on a proof of the theorem that every LEFT-RESET Turing machine has an equivalent conventional, single tape Turing machine. The transitions for the LEFT-RESET Turing machine are {Right, RES... | habedi/stack-exchange-dataset |
71,502 | Is Post's Problem undecidable for fixed number of tiles i.e. $n\geq5$ | <p>So, I'm refreshing my undecidablility knowledge, and I came across this statement reading about Post's Correspondence Problem on <a href="https://en.wikipedia.org/wiki/Post_correspondence_problem" rel="noreferrer">Wikipedia</a>:</p>

<blockquote>
 <p>A simple variant is to fix n, the number of tiles. Th... | formal languages computability reductions undecidability | 1 | Is Post's Problem undecidable for fixed number of tiles i.e. $n\geq5$ -- (formal languages computability reductions undecidability)
<p>So, I'm refreshing my undecidablility knowledge, and I came across this statement reading about Post's Correspondence Problem on <a href="https://en.wikipedia.org/wiki/Post_corresponden... | habedi/stack-exchange-dataset |
71,511 | what is routine induction? | <p>I read a paper which mentioned routine induction many times.
But when I google it, there are nothing showed up.</p>

<p>I think routine induction means the induction on the structure, analyzing possible cases in proofs.
am I right?</p>

<p>Just to make sure, I am asking it here. </p>
 | proof techniques | 1 | what is routine induction? -- (proof techniques)
<p>I read a paper which mentioned routine induction many times.
But when I google it, there are nothing showed up.</p>

<p>I think routine induction means the induction on the structure, analyzing possible cases in proofs.
am I right?</p>

<p>Just... | habedi/stack-exchange-dataset |
71,512 | Why cannot we reduce the Emptiness problem of LBA to the Acceptance problem of LBA? | <p>I am a little bit confused about the emptiness problem of the linear bounded automaton (LBA). I know that this problem is undecidable. However if we <strong><em>assume</em></strong> that is decidable, what could be wrong if we reduce it to the acceptance problem of LBA?</p>
 | formal languages undecidability linear bounded automata | 1 | Why cannot we reduce the Emptiness problem of LBA to the Acceptance problem of LBA? -- (formal languages undecidability linear bounded automata)
<p>I am a little bit confused about the emptiness problem of the linear bounded automaton (LBA). I know that this problem is undecidable. However if we <strong><em>assume</em>... | habedi/stack-exchange-dataset |
71,522 | Why L is defined as L = SPACE$( \log n)$ instead of L = SPACE$(\log^2 n)$ or L = SPACE$(\sqrt n)$? | <p>$L$ is the class of languages that are decideable in logarithmic space on a deterministic Turing machine. In other words,</p>

<blockquote>
 <p>L = SPACE$( \log n)$</p>
</blockquote>

<p>But why $\log n$, instead of $\log^2 n$ or $\sqrt n$. This is what, I find out in the Theory of computati... | complexity theory space complexity | 1 | Why L is defined as L = SPACE$( \log n)$ instead of L = SPACE$(\log^2 n)$ or L = SPACE$(\sqrt n)$? -- (complexity theory space complexity)
<p>$L$ is the class of languages that are decideable in logarithmic space on a deterministic Turing machine. In other words,</p>

<blockquote>
 <p>L = SPACE$( \log n)$<... | habedi/stack-exchange-dataset |
71,545 | How to prove equivalence relation in this case? | <p>I am working on $\lambda$-terms and trying to prove the $=$ is an equivalence relation on $\lambda$-terms. My problem is proving reflexive relation.</p>

<p>$\frac{}{\theta \vdash x = x}$</p>

<p>$\frac{ \theta,x \# N, y \# M \vdash M = [y := x]N }
 { \theta \vdash \texttt{$\lambda x.... | proof techniques lambda calculus | 1 | How to prove equivalence relation in this case? -- (proof techniques lambda calculus)
<p>I am working on $\lambda$-terms and trying to prove the $=$ is an equivalence relation on $\lambda$-terms. My problem is proving reflexive relation.</p>

<p>$\frac{}{\theta \vdash x = x}$</p>

<p>$\frac{ \theta,x \#... | habedi/stack-exchange-dataset |
71,547 | Why does linear search have $\frac{n}{2}$ comparisons on average? | <p>I'm reading the Wikipedia page on Linear Search and it is mentioned that there are on average $\frac{n}{2}$ comparisons.</p>

<p>I tried working this out on my own.</p>

<p>First I considered the number of cases. There are $n$ cases corresponding to when the target value is the $1$st, $2$nd, ..., $n$... | algorithm analysis runtime analysis average case lists searching | 1 | Why does linear search have $\frac{n}{2}$ comparisons on average? -- (algorithm analysis runtime analysis average case lists searching)
<p>I'm reading the Wikipedia page on Linear Search and it is mentioned that there are on average $\frac{n}{2}$ comparisons.</p>

<p>I tried working this out on my own.</p>
... | habedi/stack-exchange-dataset |
71,558 | How to find the number of discrete states possible by current computers? | <p>In his famous article, "Computing Machinery and Intelligence", Allan Turing talks about discrete-state machines and the largeness of the number of states provided by that time "state-of-the-art" machine, "Manchester Machine", which he states is about 2^165,000. <a href="http://www.loebner.net/Prizef/TuringArticle.ht... | discrete mathematics | 1 | How to find the number of discrete states possible by current computers? -- (discrete mathematics)
<p>In his famous article, "Computing Machinery and Intelligence", Allan Turing talks about discrete-state machines and the largeness of the number of states provided by that time "state-of-the-art" machine, "Manchester Ma... | habedi/stack-exchange-dataset |
71,563 | Making a grammar ambiguous by applying a morphism | <p>I have an encoding of an unambiguous grammar $G$. Can I apply a morphism $σ$ so that the grammar becomes ambiguous?</p>

<p>I have no clear concepts about this, only the idea: "grammar $G$ is ambiguous if there's a string $x \in L(G)$ having two different leftmost derivations in $G$". I would like a good exp... | formal languages formal grammars ambiguity | 1 | Making a grammar ambiguous by applying a morphism -- (formal languages formal grammars ambiguity)
<p>I have an encoding of an unambiguous grammar $G$. Can I apply a morphism $σ$ so that the grammar becomes ambiguous?</p>

<p>I have no clear concepts about this, only the idea: "grammar $G$ is ambiguous if there'... | habedi/stack-exchange-dataset |
71,590 | Decimal to Binary converter with a flaw | <p>Hi I wrote the following recursive decimal to binary function while studying for Andela.</p>

<pre><code>def binary_converter(q):
 if q>255 or not isinstance(q, int) or q<0:
 return "Invalid input"
 if q==0:
 return '0'
 elif q!=0:
 q, r = divmod(q,... | recursion | 1 | Decimal to Binary converter with a flaw -- (recursion)
<p>Hi I wrote the following recursive decimal to binary function while studying for Andela.</p>

<pre><code>def binary_converter(q):
 if q>255 or not isinstance(q, int) or q<0:
 return "Invalid input"
 if q==0:
 ret... | habedi/stack-exchange-dataset |
71,594 | How may an algorithm always color optimally connected bipartite graphs? | <p>Let's consider a greedy algorithm for the coloration problem called the <strong><a href="https://fr.wikipedia.org/wiki/DSATUR" rel="nofollow noreferrer">Dsatur algorithm</a></strong>, designed by Daniel Brélaz in 1979 at the EPFL, Switzerland.. This algorithm is based on an order of vertices which we can obtain from... | algorithms graphs algorithm analysis colorings | 1 | How may an algorithm always color optimally connected bipartite graphs? -- (algorithms graphs algorithm analysis colorings)
<p>Let's consider a greedy algorithm for the coloration problem called the <strong><a href="https://fr.wikipedia.org/wiki/DSATUR" rel="nofollow noreferrer">Dsatur algorithm</a></strong>, designed ... | habedi/stack-exchange-dataset |
71,605 | Calculating force between n points placed on the x-axis | <p>There are $n$ charges placed on the x-axis at points $1,2,3,\dots,n$.
We need to calculate the force on each charge by every other charge.
I need the exact force. Charges can be arbitrary. Inputs are the charges possibly in the form of an array.
Force is defined in the usual physical way.</p>

<p... | algorithms fourier transform | 1 | Calculating force between n points placed on the x-axis -- (algorithms fourier transform)
<p>There are $n$ charges placed on the x-axis at points $1,2,3,\dots,n$.
We need to calculate the force on each charge by every other charge.
I need the exact force. Charges can be arbitrary. Inputs are the charges possibl... | habedi/stack-exchange-dataset |
71,609 | Adjacency matrix and recognizing hierarchy? | <p>I'm currently learning about graphs and I have some questions regarding adjacency matrices. Given an arbitrary adjacency matrix: </p>

<p><a href="https://i.stack.imgur.com/Ucg3W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ucg3W.png" alt="enter image description here"></a></p>

... | graphs adjacency matrix | 1 | Adjacency matrix and recognizing hierarchy? -- (graphs adjacency matrix)
<p>I'm currently learning about graphs and I have some questions regarding adjacency matrices. Given an arbitrary adjacency matrix: </p>

<p><a href="https://i.stack.imgur.com/Ucg3W.png" rel="nofollow noreferrer"><img src="https://i.stack.... | habedi/stack-exchange-dataset |
71,627 | Find pairs of integers (a, b) in an array such that a = b + k in linear time - elements are not unique | <p>A while ago, I was asked to solve a question similar to this:</p>

<blockquote>
 <p><em>We are given an array</em> <code>arr</code> <em>and we would like to find all pairs of items</em> <code>(a, b)</code> <em>where</em> <code>a = b + k</code>. The items are <strong>NOT</strong> unique and it is also po... | algorithms time complexity runtime analysis search algorithms arrays | 1 | Find pairs of integers (a, b) in an array such that a = b + k in linear time - elements are not unique -- (algorithms time complexity runtime analysis search algorithms arrays)
<p>A while ago, I was asked to solve a question similar to this:</p>

<blockquote>
 <p><em>We are given an array</em> <code>arr</c... | habedi/stack-exchange-dataset |
71,629 | Estimating the run time of a program according to a given CPU performance | <p>When we have a recurrence relation of a program, as an example:</p>

<pre><code> T(N) = N log N + 9N + 55
</code></pre>

<p>and the CPU capability let's say (10^6) or any other number. What is the formula or the method to estimate the run time (in second) if we run a program represented by a func... | algorithms performance mathematical analysis | 1 | Estimating the run time of a program according to a given CPU performance -- (algorithms performance mathematical analysis)
<p>When we have a recurrence relation of a program, as an example:</p>

<pre><code> T(N) = N log N + 9N + 55
</code></pre>

<p>and the CPU capability let's say (10^6) or any ot... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.