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 |
|---|---|---|---|---|---|---|
57,071 | What Exactly is "Improvement" in Seed AI? | <p>From <a href="https://wiki.lesswrong.com/wiki/Seed_AI" rel="nofollow">LessWrongWiki</a>, a seed AI</p>

<blockquote>
 <p>[I]mproves itself by recursively rewriting its own source code without human intervention. </p>
</blockquote>

<p>Some would even say this could bring about an <a href="ht... | artificial intelligence recursion | 1 | What Exactly is "Improvement" in Seed AI? -- (artificial intelligence recursion)
<p>From <a href="https://wiki.lesswrong.com/wiki/Seed_AI" rel="nofollow">LessWrongWiki</a>, a seed AI</p>

<blockquote>
 <p>[I]mproves itself by recursively rewriting its own source code without human intervention. </p>
</... | habedi/stack-exchange-dataset |
57,076 | Letter Combinations of a Phone Number | <p>I came across this problem in the “Elements of Programming Interviews” interview preparation book, and also on the site, <a href="https://leetcode.com/problems/letter-combinations-of-a-phone-number/" rel="nofollow">leetcode.com (link to problem).</a></p>

<p>Problem statement – Letter Combinations of a Phone... | algorithms combinatorics sets | 1 | Letter Combinations of a Phone Number -- (algorithms combinatorics sets)
<p>I came across this problem in the “Elements of Programming Interviews” interview preparation book, and also on the site, <a href="https://leetcode.com/problems/letter-combinations-of-a-phone-number/" rel="nofollow">leetcode.com (link to problem... | habedi/stack-exchange-dataset |
57,081 | How to calculate the time complexity of a Catalan-like recurrence by substitution? | <p>I was given the following problem:</p>

<blockquote>
 <p>Calculate the computational time complexity of the recurrence $$P(n) = \begin{cases} 1 & \text{if } n = 1 \\ \sum_{k=1}^{n-1} P(k) P(n-k) & \text{if } n \geq 2 \end{cases}$$ <em>using the substitution method.</em> <strong>Answer:</strong> ... | recurrence relation | 1 | How to calculate the time complexity of a Catalan-like recurrence by substitution? -- (recurrence relation)
<p>I was given the following problem:</p>

<blockquote>
 <p>Calculate the computational time complexity of the recurrence $$P(n) = \begin{cases} 1 & \text{if } n = 1 \\ \sum_{k=1}^{n-1} P(k) P(n-... | habedi/stack-exchange-dataset |
57,082 | Is NEXP = co-NEXP? | <p>It is known that $\mathsf{NL}=\mathsf{Co{-}NL}$ and unknown if $\mathsf{NP}=\mathsf{Co{-}NP}$. But what about
$$\mathsf{NEXP}=\mathsf{Co{-}NEXP}?$$
Is it known whether these two classes are equal?</p>
 | complexity theory closure properties complexity classes | 1 | Is NEXP = co-NEXP? -- (complexity theory closure properties complexity classes)
<p>It is known that $\mathsf{NL}=\mathsf{Co{-}NL}$ and unknown if $\mathsf{NP}=\mathsf{Co{-}NP}$. But what about
$$\mathsf{NEXP}=\mathsf{Co{-}NEXP}?$$
Is it known whether these two classes are equal?</p>
 | habedi/stack-exchange-dataset |
57,087 | What is the consensus algorithm that requires an odd number of nodes? | <p>Last week I stood up and gave a talk on the <a href="https://raft.github.io/" rel="nofollow">Raft Consensus Algorithm</a>. </p>

<p>The first question I got was:</p>

<blockquote>
 <p>Doesn't it need an odd number of nodes?</p>
</blockquote>

<p>I answered "During leader election, th... | distributed systems consensus | 1 | What is the consensus algorithm that requires an odd number of nodes? -- (distributed systems consensus)
<p>Last week I stood up and gave a talk on the <a href="https://raft.github.io/" rel="nofollow">Raft Consensus Algorithm</a>. </p>

<p>The first question I got was:</p>

<blockquote>
 <p>Doesn't... | habedi/stack-exchange-dataset |
57,093 | Longest path of a DAG containing a single node? | <p>I'm interested in implementing an algorithm detailed on <a href="https://en.wikipedia.org/wiki/Longest_path_problem#Acyclic_graphs_and_critical_paths" rel="nofollow">this Wiki page</a> for finding the longest path of a DAG.</p>

<p>The second part of the algorithm says the length of the longest path of a nod... | graphs | 1 | Longest path of a DAG containing a single node? -- (graphs)
<p>I'm interested in implementing an algorithm detailed on <a href="https://en.wikipedia.org/wiki/Longest_path_problem#Acyclic_graphs_and_critical_paths" rel="nofollow">this Wiki page</a> for finding the longest path of a DAG.</p>

<p>The second part o... | habedi/stack-exchange-dataset |
57,110 | Showing a language is a subset of another language? | <p>I'm actually trying to give an example of a language being context-free and its superset that isn't context-free. I came up with this, but I'm not sure if this particular language is a superset of the other.</p>

<p>Let A be a context-free language. A = {a^n b^n | n >= 0}.</p>

<p>Let B be a non cont... | formal languages | 1 | Showing a language is a subset of another language? -- (formal languages)
<p>I'm actually trying to give an example of a language being context-free and its superset that isn't context-free. I came up with this, but I'm not sure if this particular language is a superset of the other.</p>

<p>Let A be a context-... | habedi/stack-exchange-dataset |
57,112 | In Data Mining, what does it mean to be greedy? | <p>I am looking at a number of algorithms in Data Mining and some are described as being greedy. My issue is that they seem to be using the term greedy in different ways, which seems contradictory. </p>

<p>For example, with <a href="https://en.wikipedia.org/wiki/Hierarchical_clustering" rel="nofollow">Hierarch... | algorithms terminology greedy algorithms data mining | 1 | In Data Mining, what does it mean to be greedy? -- (algorithms terminology greedy algorithms data mining)
<p>I am looking at a number of algorithms in Data Mining and some are described as being greedy. My issue is that they seem to be using the term greedy in different ways, which seems contradictory. </p>

<p... | habedi/stack-exchange-dataset |
57,125 | How Is a Computer Able to Store and Quickly Manipulate All the Data Required For A Computer Display? | <p>I did some quick math on how much data is contained on a screen at any given instant and I ended up with a number well beyond what I thought was possible. 256 colors for Red, Green, and Blue each define a pixel and there are currently 1920x1080 pixels on my screen so..</p>

<p>256 x 256 x 256 x 1920 x 1080 b... | computer architecture combinatorics graphics | 1 | How Is a Computer Able to Store and Quickly Manipulate All the Data Required For A Computer Display? -- (computer architecture combinatorics graphics)
<p>I did some quick math on how much data is contained on a screen at any given instant and I ended up with a number well beyond what I thought was possible. 256 colors ... | habedi/stack-exchange-dataset |
57,129 | Which object-oriented programming language is the closest to the untyped sigma-calculus? | <p>I'm wondering which of the dynamic object-oriented (or prototype-oriented) languages (like JavaScript, Ruby, Python, etc.) can be considered as the closest to Abadi and Cardelli's untyped <a href="http://lucacardelli.name/Papers/PrimObj1stOrder.pdf" rel="noreferrer">sigma calculus</a>?</p>
 | programming languages object oriented | 1 | Which object-oriented programming language is the closest to the untyped sigma-calculus? -- (programming languages object oriented)
<p>I'm wondering which of the dynamic object-oriented (or prototype-oriented) languages (like JavaScript, Ruby, Python, etc.) can be considered as the closest to Abadi and Cardelli's untyp... | habedi/stack-exchange-dataset |
57,130 | Is it possible that $\mathsf{L} = \mathsf{NP}$? | <p>When I studied computer science 10 years ago, it was still an open question whether $\mathsf{L}$ and $\mathsf{NP}$ are truly different classes. Is that still the case or has the inequality been proven in the meantime?</p>

<p>(I know this is a somewhat stupid question, but there's nothing about it in the com... | complexity theory | 1 | Is it possible that $\mathsf{L} = \mathsf{NP}$? -- (complexity theory)
<p>When I studied computer science 10 years ago, it was still an open question whether $\mathsf{L}$ and $\mathsf{NP}$ are truly different classes. Is that still the case or has the inequality been proven in the meantime?</p>

<p>(I know this... | habedi/stack-exchange-dataset |
57,141 | Practical Applications of regular grammars | <p>A regular grammar is a mathematical object, $G$, with four components, $G = (N, Σ, P, S)$, where. $N$ is a nonempty, finite set of nonterminal symbols, $Σ$ is a finite set of terminal symbols , or alphabet, symbols, $P$ is a set of grammar rules, each of one having one of the forms. $A → aB$. </p>

<p>I wan... | regular languages | 1 | Practical Applications of regular grammars -- (regular languages)
<p>A regular grammar is a mathematical object, $G$, with four components, $G = (N, Σ, P, S)$, where. $N$ is a nonempty, finite set of nonterminal symbols, $Σ$ is a finite set of terminal symbols , or alphabet, symbols, $P$ is a set of grammar rules, each... | habedi/stack-exchange-dataset |
57,144 | What are examples of $\mathsf{NL}$-complete problems? | <p>Wikipedia lists exactly two problems as $\mathsf{NL}$-complete - 2-satisfiability and St-connectivity (although stating that there are "several"):</p>

<p><a href="https://en.wikipedia.org/wiki/Category:NL-complete_problems" rel="nofollow">https://en.wikipedia.org/wiki/Category:NL-complete_problems</a></p>&#... | complexity theory | 1 | What are examples of $\mathsf{NL}$-complete problems? -- (complexity theory)
<p>Wikipedia lists exactly two problems as $\mathsf{NL}$-complete - 2-satisfiability and St-connectivity (although stating that there are "several"):</p>

<p><a href="https://en.wikipedia.org/wiki/Category:NL-complete_problems" rel="no... | habedi/stack-exchange-dataset |
57,148 | Convert integer of mixed radix to standard positional numeral system and vice versa | <p>I have multiple numbers (e.g. <code>[1, 4, 2]</code>) where each number can be one of a specified range of numbers (e.g. <code>[0-1, 0-5, 0-3]</code>). I think one can represent my so chosen numbers by seeing them as digits of a number in the <a href="https://en.wikipedia.org/wiki/Mixed_radix" rel="nofollow">mixed r... | combinatorics number theory integers number formats numeral representations | 1 | Convert integer of mixed radix to standard positional numeral system and vice versa -- (combinatorics number theory integers number formats numeral representations)
<p>I have multiple numbers (e.g. <code>[1, 4, 2]</code>) where each number can be one of a specified range of numbers (e.g. <code>[0-1, 0-5, 0-3]</code>). ... | habedi/stack-exchange-dataset |
57,154 | The importance of the membership problem | <p>Given a word $w$ and a language $L$, we want to check if $w\in L$. This is called the <em>membership problem</em>. Why is the membership problem important?</p>
 | automata decision problem | 1 | The importance of the membership problem -- (automata decision problem)
<p>Given a word $w$ and a language $L$, we want to check if $w\in L$. This is called the <em>membership problem</em>. Why is the membership problem important?</p>
 | habedi/stack-exchange-dataset |
57,157 | Arithmetic of asymptotic functions | <p>I faced some problem that involves arithmetic over asymptotic functions. These are as follows:</p>

<blockquote>
 <ol>
 <li><p>Let f(n)= Ω(n), g(n)= O(n) and h(n)= Ѳ(n). Then [f(n). g(n)] + h(n) is:</p>
 
 <p>(a) $Ω(n)$<br>
 (b) $O(n)$<br>
 (c) $\Theta(n)$
 (d) None of thes... | asymptotics | 1 | Arithmetic of asymptotic functions -- (asymptotics)
<p>I faced some problem that involves arithmetic over asymptotic functions. These are as follows:</p>

<blockquote>
 <ol>
 <li><p>Let f(n)= Ω(n), g(n)= O(n) and h(n)= Ѳ(n). Then [f(n). g(n)] + h(n) is:</p>
 
 <p>(a) $Ω(n)$<br>
 (b) $O(... | habedi/stack-exchange-dataset |
57,172 | Difference between centralized computing and distributed computing using Client-Server | <p>I already understand that Distributed Computing is the breakup of having multiple clients rely on a single source, and having each client utilize other clients for information. But my confusion comes from a type of distributed computing, where one type is the client server model. From what I know, the client server ... | distributed systems computer networks | 1 | Difference between centralized computing and distributed computing using Client-Server -- (distributed systems computer networks)
<p>I already understand that Distributed Computing is the breakup of having multiple clients rely on a single source, and having each client utilize other clients for information. But my con... | habedi/stack-exchange-dataset |
57,180 | Key differences between interactive and time sharing operating systems? | <p>Couldn't find much online on how an interactive system is different from a time-sharing system, or the different traits of both.</p>

<p>My understanding of a time-sharing system is many people at terminals being able to use the system at the same time, and the CPU's aim is to maximise response time not CPU ... | operating systems | 1 | Key differences between interactive and time sharing operating systems? -- (operating systems)
<p>Couldn't find much online on how an interactive system is different from a time-sharing system, or the different traits of both.</p>

<p>My understanding of a time-sharing system is many people at terminals being a... | habedi/stack-exchange-dataset |
57,186 | Genetic Algorithms - Tournament Selection | <p>I know this should be a fairly simple concept but I have been Googling a lot and can't seem to find a definitive definition.</p>

<p>If we had the following random population:</p>

<pre><code>[12,2,3,99,73,32,53,8] 
</code></pre>

<p>And a tournament size of 3. What could be a possible ou... | genetic algorithms | 1 | Genetic Algorithms - Tournament Selection -- (genetic algorithms)
<p>I know this should be a fairly simple concept but I have been Googling a lot and can't seem to find a definitive definition.</p>

<p>If we had the following random population:</p>

<pre><code>[12,2,3,99,73,32,53,8] 
</code></pre>&#... | habedi/stack-exchange-dataset |
57,189 | Questions about SIMD instructions | <p>What is the trend over time for the size of registers of x86 CPUs? I know that we have today 512-bit registers, but is there a kind of Moore's Law to predict the size of registers in the future?</p>

<p>Thank you very much.</p>
 | computer architecture | 1 | Questions about SIMD instructions -- (computer architecture)
<p>What is the trend over time for the size of registers of x86 CPUs? I know that we have today 512-bit registers, but is there a kind of Moore's Law to predict the size of registers in the future?</p>

<p>Thank you very much.</p>
 | habedi/stack-exchange-dataset |
57,195 | Order Notation - Why can't $c$ be in terms of $n$? | <p>For $f(n)$ to be in $O(g(n))$, there must exist a $c > 0$ and $n_0 > 0$ such that</p>

<p>$$0 \leq f(n) \leq cg(n) \text{ for all }n \geq n_0\,.$$</p>

<p>I found a solution to a question where my $c$ is in terms of $n$, but my friend says you can't have that. I'd like to understand why.
My... | landau notation | 1 | Order Notation - Why can't $c$ be in terms of $n$? -- (landau notation)
<p>For $f(n)$ to be in $O(g(n))$, there must exist a $c > 0$ and $n_0 > 0$ such that</p>

<p>$$0 \leq f(n) \leq cg(n) \text{ for all }n \geq n_0\,.$$</p>

<p>I found a solution to a question where my $c$ is in terms of $n$, bu... | habedi/stack-exchange-dataset |
57,199 | Bidirectional Dijkstra vs Dijkstra | <p>Are there any kind of graphs where Bidirectional Dijkstra would expand more than Dijkstra? </p>

<p>I tried to come up with an argument like this:</p>

<p>Let node $n$ be expanded by Bidirectional Dijkstra. Now there are two possibilites:</p>

<ol>
<li>Node $n$ was expanded in the forward... | search algorithms artificial intelligence | 1 | Bidirectional Dijkstra vs Dijkstra -- (search algorithms artificial intelligence)
<p>Are there any kind of graphs where Bidirectional Dijkstra would expand more than Dijkstra? </p>

<p>I tried to come up with an argument like this:</p>

<p>Let node $n$ be expanded by Bidirectional Dijkstra. Now there ar... | habedi/stack-exchange-dataset |
57,211 | Peterson's vs. Bakery Algorithm | <p>From my CS course, the Peterson's Algorithm and the Bakery Algorithm both are solutions which satisfy the 3 requirements of any solution to the critical section problem. a) What are their adv/disadv over each other , and b) if they already solve the critical section problem, why do we need semaphores?</p>
 | process scheduling synchronization | 1 | Peterson's vs. Bakery Algorithm -- (process scheduling synchronization)
<p>From my CS course, the Peterson's Algorithm and the Bakery Algorithm both are solutions which satisfy the 3 requirements of any solution to the critical section problem. a) What are their adv/disadv over each other , and b) if they already solve... | habedi/stack-exchange-dataset |
57,216 | How does Logical Block Addressing affect OS disk scheduling optimizations such as SCAN (Elevator Algorithm)? | <p>If the OS is scanning from one edge of the disk to the other, doing so from behind the Logical Block Addressing (LBA) abstraction, although it may aim to service requests in an elevator-like way, what guarantee do we have that the physical mapping <strong>correlates</strong> to what we see as the OS?</p>

<p... | operating systems scheduling | 1 | How does Logical Block Addressing affect OS disk scheduling optimizations such as SCAN (Elevator Algorithm)? -- (operating systems scheduling)
<p>If the OS is scanning from one edge of the disk to the other, doing so from behind the Logical Block Addressing (LBA) abstraction, although it may aim to service requests in ... | habedi/stack-exchange-dataset |
57,221 | Efficient algorithms for identifying the diamond fork&join vertices and the diamond pairs in directed acyclic graph? | <p>Given a DAG (directed acyclic graph) $G=(V,E)$ without <em>multiple edges</em>, i.e., edges with the same source and target vertices, we define:</p>

<p>A vertex $v_j \in V$ is a diamond-join ($\Diamond_J$) vertex if there exists some other vertex $v_f \in V$ <em>such that</em> there are at least two <em>ver... | algorithms graphs graph algorithms dag | 1 | Efficient algorithms for identifying the diamond fork&join vertices and the diamond pairs in directed acyclic graph? -- (algorithms graphs graph algorithms dag)
<p>Given a DAG (directed acyclic graph) $G=(V,E)$ without <em>multiple edges</em>, i.e., edges with the same source and target vertices, we define:</p>
&#x... | habedi/stack-exchange-dataset |
57,223 | In Minimax, how should we handle draws? | <p>A player playing the <a href="https://en.wikipedia.org/wiki/Minimax" rel="nofollow">Minimax</a> strategy should choose moves which minimise their maximum loss. </p>

<p>What should happen when draws can happen? Should we class the draw as a win because we aren't losing? Or should be class it as a loss becaus... | game theory | 1 | In Minimax, how should we handle draws? -- (game theory)
<p>A player playing the <a href="https://en.wikipedia.org/wiki/Minimax" rel="nofollow">Minimax</a> strategy should choose moves which minimise their maximum loss. </p>

<p>What should happen when draws can happen? Should we class the draw as a win because... | habedi/stack-exchange-dataset |
57,225 | Why descriptive power of context-free grammar is greater than regular expression? | <p>Below is a saying from <a href="http://matt.might.net/articles/grammars-bnf-ebnf/" rel="nofollow">this article</a>.</p>

<blockquote>
 <p>Regular expressions sit just beneath context-free grammars in descriptive power: you could rewrite any regular expression into a grammar that represents the strings m... | context free formal grammars regular expressions | 1 | Why descriptive power of context-free grammar is greater than regular expression? -- (context free formal grammars regular expressions)
<p>Below is a saying from <a href="http://matt.might.net/articles/grammars-bnf-ebnf/" rel="nofollow">this article</a>.</p>

<blockquote>
 <p>Regular expressions sit just b... | habedi/stack-exchange-dataset |
57,226 | Complexity of the Dijkstra algorithm | <p>I'm little confused by computing a time complexity for <code>Dijkstra</code> algorithm. It is said that the complexity is in $O(|V|^2)$ - <a href="https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm" rel="nofollow" title="Wikipedia - Dijkstra">Wikipedia - Dijkstra</a>, which I understand. It's because for each node... | graphs time complexity shortest path | 1 | Complexity of the Dijkstra algorithm -- (graphs time complexity shortest path)
<p>I'm little confused by computing a time complexity for <code>Dijkstra</code> algorithm. It is said that the complexity is in $O(|V|^2)$ - <a href="https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm" rel="nofollow" title="Wikipedia - Dij... | habedi/stack-exchange-dataset |
57,236 | When the heapsort worst case occurs? | <p>The best-, average-, and worst case time complexity of Heapsort for $n$ <em>distinct keys</em> are all $\Theta(n \lg n)$.</p>

<blockquote>
 <p>What are the worst-case inputs for heapsort?</p>
</blockquote>
 | time complexity heap sort | 1 | When the heapsort worst case occurs? -- (time complexity heap sort)
<p>The best-, average-, and worst case time complexity of Heapsort for $n$ <em>distinct keys</em> are all $\Theta(n \lg n)$.</p>

<blockquote>
 <p>What are the worst-case inputs for heapsort?</p>
</blockquote>
 | habedi/stack-exchange-dataset |
57,241 | Known problems in BQP \ NP? | <p>The introduction to Nielsen and Chuang has an Euler diagram of the suspected relationships between various complexity classes which shows $\text{BQP}$ extending slightly outside of $\text{NP}$. Is $\text{BQP} \not\subset \text{NP}$? Are there any specific problems known or suspected to be in $\text{BQP}$ but outsid... | complexity theory complexity classes np quantum computing | 1 | Known problems in BQP \ NP? -- (complexity theory complexity classes np quantum computing)
<p>The introduction to Nielsen and Chuang has an Euler diagram of the suspected relationships between various complexity classes which shows $\text{BQP}$ extending slightly outside of $\text{NP}$. Is $\text{BQP} \not\subset \text... | habedi/stack-exchange-dataset |
57,245 | Language of TMs such that one state is visited most often | <p>To be safe, let me start this question by giving the definition of a TM I will be using: A TM is some $M = (Q, \Sigma, \Gamma, q_0, \delta, q_F)$, where $Q$ is the finite state set, $\Sigma \subset \Gamma$ are the input and working alphabet, $q_0, q_F$ are the initial and final states, and $\delta : Q \times \Gamma ... | computability turing machines undecidability semi decidability | 1 | Language of TMs such that one state is visited most often -- (computability turing machines undecidability semi decidability)
<p>To be safe, let me start this question by giving the definition of a TM I will be using: A TM is some $M = (Q, \Sigma, \Gamma, q_0, \delta, q_F)$, where $Q$ is the finite state set, $\Sigma \... | habedi/stack-exchange-dataset |
57,259 | Space complexity of Horner's method | <p>Following is the excerpt from <a href="https://en.wikipedia.org/wiki/Horner%27s_method#Efficiency" rel="nofollow noreferrer">wiki</a></p>
<blockquote>
<p>If numerical data are represented in terms of digits (or bits), then
the naive algorithm also entails storing approximately <span class="math-container... | algorithm analysis space complexity | 1 | Space complexity of Horner's method -- (algorithm analysis space complexity)
<p>Following is the excerpt from <a href="https://en.wikipedia.org/wiki/Horner%27s_method#Efficiency" rel="nofollow noreferrer">wiki</a></p>
<blockquote>
<p>If numerical data are represented in terms of digits (or bits), then
the n... | habedi/stack-exchange-dataset |
57,262 | Compressing two integers disregarding order | <p>Comparing an ordered pair (x,y) to an unordered pair {x, y} (set), then information theoretically, the difference is only one bit, as whether x comes first or y requires exactly a single bit to represent.</p>

<p>So, if we're given a set {x,y} where x,y are two different 32-bit integers, can we pack them int... | information theory data compression | 1 | Compressing two integers disregarding order -- (information theory data compression)
<p>Comparing an ordered pair (x,y) to an unordered pair {x, y} (set), then information theoretically, the difference is only one bit, as whether x comes first or y requires exactly a single bit to represent.</p>

<p>So, if we'r... | habedi/stack-exchange-dataset |
57,265 | Right linear grammar special case | <p>According to the definition, the productions of a right linear grammar should have the form of $A\to xB$ or $A\to x$,
does $A\to B$ or $A\to xy$ count as productions of a right linear grammar? $A\to B$ can be written as $A\to \epsilon B$ though...</p>
 | regular languages formal grammars | 1 | Right linear grammar special case -- (regular languages formal grammars)
<p>According to the definition, the productions of a right linear grammar should have the form of $A\to xB$ or $A\to x$,
does $A\to B$ or $A\to xy$ count as productions of a right linear grammar? $A\to B$ can be written as $A\to \epsilon B$ th... | habedi/stack-exchange-dataset |
57,272 | Context free Grammar and regular set | <p>I read a question and I don't understand it, is the set consisting of: production rules of Grammars that are CFGs, itself a regular set? The only thing I know is that the type 3 is under the type 2 in CNF.</p>
 | regular languages context free | 1 | Context free Grammar and regular set -- (regular languages context free)
<p>I read a question and I don't understand it, is the set consisting of: production rules of Grammars that are CFGs, itself a regular set? The only thing I know is that the type 3 is under the type 2 in CNF.</p>
 | habedi/stack-exchange-dataset |
57,277 | Boolean function and real degree | <p>Let $f$ be a boolean function with minimum degree real polynomial representing it be of degree $d$.</p>

<p>Is there a relation between number of zeros $f$ or $1-f$ and degree $d$?</p>
 | complexity theory polynomials | 1 | Boolean function and real degree -- (complexity theory polynomials)
<p>Let $f$ be a boolean function with minimum degree real polynomial representing it be of degree $d$.</p>

<p>Is there a relation between number of zeros $f$ or $1-f$ and degree $d$?</p>
 | habedi/stack-exchange-dataset |
57,285 | How to calculate an accurate estimated reading time of text? | <p>I suppose the calculation should not be done by only two factors (average reading speed/words per minute, and word count). But at least by a third parameter, that in my opinion should measure the difficulty of the used vocabulary with some kind of text analysis.</p>

<p>I suppose it would be something like t... | algorithms natural language processing counting mathematical analysis | 1 | How to calculate an accurate estimated reading time of text? -- (algorithms natural language processing counting mathematical analysis)
<p>I suppose the calculation should not be done by only two factors (average reading speed/words per minute, and word count). But at least by a third parameter, that in my opinion shou... | habedi/stack-exchange-dataset |
57,293 | Do we create a programming language by writing a compiler? | <p>Say, I wanted to create my own programming language. Assuming that I have made all of the decisions about how I want it to look and act, do I just need to write a compiler for it? </p>

<p>For example, is the high-level Java code anything other than just text and this text is in the correct format for the co... | programming languages compilers | 1 | Do we create a programming language by writing a compiler? -- (programming languages compilers)
<p>Say, I wanted to create my own programming language. Assuming that I have made all of the decisions about how I want it to look and act, do I just need to write a compiler for it? </p>

<p>For example, is the high... | habedi/stack-exchange-dataset |
57,295 | How to read out a double negation in propositional logic | <p>How would one verbally say ~~R where R = my program is correct? The tildes are negation symbols. I'm not sure if it just cancels out and comes out as 'my program is correct' or if it's something else.</p>

<p>Thank you!</p>
 | logic propositional logic | 1 | How to read out a double negation in propositional logic -- (logic propositional logic)
<p>How would one verbally say ~~R where R = my program is correct? The tildes are negation symbols. I'm not sure if it just cancels out and comes out as 'my program is correct' or if it's something else.</p>

<p>Thank you!</... | habedi/stack-exchange-dataset |
57,303 | Perturbing trees | <p>I have a collection of labelled directed trees, and from these input trees I would like to generate permuted trees that have the same node set but whose edges and labels have been permuted with some probability $p$, such that if $p=0$ the output trees are identical and if $p=1$ the trees are random. The string versi... | algorithms trees randomized algorithms | 1 | Perturbing trees -- (algorithms trees randomized algorithms)
<p>I have a collection of labelled directed trees, and from these input trees I would like to generate permuted trees that have the same node set but whose edges and labels have been permuted with some probability $p$, such that if $p=0$ the output trees are ... | habedi/stack-exchange-dataset |
57,321 | Ford-Fulkerson algorithm with asymmetric adjacency matrix | <p>Suppose that I have a bipartite graph $G=(A \cup B, E)$ and $A = \{1, 2, \dots, n\}$, $B = \{1, 2, \dots, m\}$.
After a virtual sink $s = 0$ and a source $t = n+1$ is included into the graph, I want to implement Ford-Fulkersen max flow algorithm.</p>

<p>To the algorithm, we need a symmetric adjacency ma... | graphs max flow | 1 | Ford-Fulkerson algorithm with asymmetric adjacency matrix -- (graphs max flow)
<p>Suppose that I have a bipartite graph $G=(A \cup B, E)$ and $A = \{1, 2, \dots, n\}$, $B = \{1, 2, \dots, m\}$.
After a virtual sink $s = 0$ and a source $t = n+1$ is included into the graph, I want to implement Ford-Fulkersen max flo... | habedi/stack-exchange-dataset |
57,323 | How should i guide a program to perform correct things? | <p>I want to make a small model of A.I. which can learn itself. I am inspired by 1000+ monkey theorem which states that if 1000+ monkey bangs a keyboard for enough long, then they will eventually produce a Shakespeare's play. So, if you give a banana to one monkey when he produce a correct word, then he would eventuall... | artificial intelligence word combinatorics | 1 | How should i guide a program to perform correct things? -- (artificial intelligence word combinatorics)
<p>I want to make a small model of A.I. which can learn itself. I am inspired by 1000+ monkey theorem which states that if 1000+ monkey bangs a keyboard for enough long, then they will eventually produce a Shakespear... | habedi/stack-exchange-dataset |
57,326 | Effect of Copy-On-Write on 2 processes sharing address space | <p>I am studying operating systems and was going through Copy On Write mechanism. 
From <a href="https://en.wikipedia.org/wiki/Copy-on-write" rel="nofollow">Wiki</a>:</p>

<blockquote>
 <p>When one process modifies the memory, the operating system's kernel intercepts the operation and copies the memory... | operating systems memory management virtual memory shared memory | 1 | Effect of Copy-On-Write on 2 processes sharing address space -- (operating systems memory management virtual memory shared memory)
<p>I am studying operating systems and was going through Copy On Write mechanism. 
From <a href="https://en.wikipedia.org/wiki/Copy-on-write" rel="nofollow">Wiki</a>:</p>

<bloc... | habedi/stack-exchange-dataset |
57,333 | Busy Beaver machines on semi-infinite tape | <p>The <a href="https://en.wikipedia.org/wiki/Busy_beaver">Busy Beaver</a> problem is to find the largest number of non-blank characters that are printed by a terminating Turing machine of no more than a given size on the blank input.</p>

<p>The usual Busy Beaver machines run on a blank tape that is infinite i... | reference request busy beaver | 1 | Busy Beaver machines on semi-infinite tape -- (reference request busy beaver)
<p>The <a href="https://en.wikipedia.org/wiki/Busy_beaver">Busy Beaver</a> problem is to find the largest number of non-blank characters that are printed by a terminating Turing machine of no more than a given size on the blank input.</p>
... | habedi/stack-exchange-dataset |
57,335 | Time complexity of a problem inspired by palindromes | <p><strong>This was inspired by Bradshaw's question originally posted on <a href="https://math.stackexchange.com/questions/1406146/arranging-a-set-of-strings-to-form-a-palindrome-np-complete">Math.SatckExchange</a></strong>.</p>

<p><strong>EVEN PALINDROME</strong>:</p>

<p><strong>Input</strong>: Given... | complexity theory np complete strings | 1 | Time complexity of a problem inspired by palindromes -- (complexity theory np complete strings)
<p><strong>This was inspired by Bradshaw's question originally posted on <a href="https://math.stackexchange.com/questions/1406146/arranging-a-set-of-strings-to-form-a-palindrome-np-complete">Math.SatckExchange</a></strong>.... | habedi/stack-exchange-dataset |
57,336 | Why isnt node checked for nil value in start when transplanting binary tree | <p>Whilst I was reading <a href="https://en.wikipedia.org/wiki/Introduction_to_Algorithms" rel="nofollow noreferrer">CLRS</a> I came across this:</p>
<blockquote>
<p>When TRANSPLANT replaces the subtree rooted at node u with the subtree rooted at node v, node u’s parent becomes node v’s parent, and u’s parent e... | algorithms data structures binary trees algorithm design | 1 | Why isnt node checked for nil value in start when transplanting binary tree -- (algorithms data structures binary trees algorithm design)
<p>Whilst I was reading <a href="https://en.wikipedia.org/wiki/Introduction_to_Algorithms" rel="nofollow noreferrer">CLRS</a> I came across this:</p>
<blockquote>
<p>When TRA... | habedi/stack-exchange-dataset |
57,342 | Write a regular expression - Contains an equal number of 01 and 10 subtrings | <p>I'm trying to write a regular expression for the language $L\subseteq\{0,1\}^*$ of strings that begin with $0$ and contain an equal number of occurrences of the substrings $01$ and $10$. Substrings can overlap, so $010$ is in the language but, e.g., $01101$ is not.</p>

<p>I've worked on a DFA where I c... | regular languages automata finite automata regular expressions | 1 | Write a regular expression - Contains an equal number of 01 and 10 subtrings -- (regular languages automata finite automata regular expressions)
<p>I'm trying to write a regular expression for the language $L\subseteq\{0,1\}^*$ of strings that begin with $0$ and contain an equal number of occurrences of the substr... | habedi/stack-exchange-dataset |
57,348 | How to use a CFG to restrict a subset of a*b*c*d* so that there are at most as many a's and b's as d's? | <blockquote>
 <p>Give Context-free Grammar for the language $\{a^i b^j c^k d^h \mid i,j,h \ge 0, k>0, i+j \le h\}$</p>
</blockquote>

<p>This is a training exercise, for which we don't get any answers, in a course I'm taking. I have found similar examples, but nothing that touches on the <code>i+j≤h... | formal languages context free | 1 | How to use a CFG to restrict a subset of a*b*c*d* so that there are at most as many a's and b's as d's? -- (formal languages context free)
<blockquote>
 <p>Give Context-free Grammar for the language $\{a^i b^j c^k d^h \mid i,j,h \ge 0, k>0, i+j \le h\}$</p>
</blockquote>

<p>This is a training exerc... | habedi/stack-exchange-dataset |
57,351 | Does a context-free grammar with multiple variables have a "starting" point? | <p>So lets consider the following grammar</p>

<p>$$
\begin{align*}
S &\to 0 \mid 0A \\
A &\to 1
\end{align*}
$$</p>

<p>would the string "1" be accepted by the language or must the language start with $S$?</p>
 | context free formal grammars | 1 | Does a context-free grammar with multiple variables have a "starting" point? -- (context free formal grammars)
<p>So lets consider the following grammar</p>

<p>$$
\begin{align*}
S &\to 0 \mid 0A \\
A &\to 1
\end{align*}
$$</p>

<p>would the string "1" be accepted by the lang... | habedi/stack-exchange-dataset |
57,353 | Recurrence: space complexity to Tournament Method | <p>Tournament method have this structure to found min and max (function <code>getMinMax</code>):</p>

<pre><code> mid = (low + high)/2; 
 mml = getMinMax(arr, low, mid);
 mmr = getMinMax(arr, mid+1, high); 

 /* compare minimums of two parts*/
 if (mml.min < mmr.min)
 minmax... | algorithm analysis space analysis | 1 | Recurrence: space complexity to Tournament Method -- (algorithm analysis space analysis)
<p>Tournament method have this structure to found min and max (function <code>getMinMax</code>):</p>

<pre><code> mid = (low + high)/2; 
 mml = getMinMax(arr, low, mid);
 mmr = getMinMax(arr, mid+1, high); 
... | habedi/stack-exchange-dataset |
57,360 | Are there any useful deterministic quantum algorithms for decision problems? | <p>The vast majority of known interesting quantum algorithms are probabilistic. The only deterministic quantum algorithms that I know of (which aren't trivially equivalent to a classical algorithm) are (a) Deutsch's algorithm, in which the quantum speedup is pretty trivial, (b) the Deutsch-Josza algorithm, which solve... | algorithms quantum computing probabilistic algorithms | 1 | Are there any useful deterministic quantum algorithms for decision problems? -- (algorithms quantum computing probabilistic algorithms)
<p>The vast majority of known interesting quantum algorithms are probabilistic. The only deterministic quantum algorithms that I know of (which aren't trivially equivalent to a classi... | habedi/stack-exchange-dataset |
57,362 | What happens after the accept state if there are still letters in the string in a Turing machine? | <p>Lets say there is a turing machine $M$ where<br/>
\begin{align*}
M &= (Q, \Sigma, \Gamma, \delta, q_1, q_{accept}, q_{reject}) \\
Q &= \{q_1, q_2, q_3, q_{accept}, q_{reject} \} \\
Σ &= \{0, 1\} \\
Γ &= \{0, 1, U\} 
\end{align*}</p>

<p>with transition functions
\b... | turing machines | 1 | What happens after the accept state if there are still letters in the string in a Turing machine? -- (turing machines)
<p>Lets say there is a turing machine $M$ where<br/>
\begin{align*}
M &= (Q, \Sigma, \Gamma, \delta, q_1, q_{accept}, q_{reject}) \\
Q &= \{q_1, q_2, q_3, q_{accept}, q_{reject} \} ... | habedi/stack-exchange-dataset |
57,377 | Is language equality for linear context-free grammars decidable? | <p>Let's consider two context-free grammars $G_1$ and $G_2$ and ask the following question: Is $L(G_1) = L(G_2)$, that is, are the two grammars equivalent?</p>

<p>In general, this problem is undecidable. However, if both $G_1$ and $G_2$ are left-linear (or right-linear) grammars, then the problem is decidable,... | formal languages context free formal grammars | 1 | Is language equality for linear context-free grammars decidable? -- (formal languages context free formal grammars)
<p>Let's consider two context-free grammars $G_1$ and $G_2$ and ask the following question: Is $L(G_1) = L(G_2)$, that is, are the two grammars equivalent?</p>

<p>In general, this problem is unde... | habedi/stack-exchange-dataset |
57,384 | Utility of D latch/flip-flop and how it differs from an SR latch/flip-flop | <p>I understand that in a D latch, whenever the clock signal is high, Q matches D, and while the clock signal is low, it holds the previous state of D. For a D flip-flop, Q will hold whatever value D is at the exact moment C goes high, and will hold that same state until C goes high again. I am able to draw the clock d... | circuits | 1 | Utility of D latch/flip-flop and how it differs from an SR latch/flip-flop -- (circuits)
<p>I understand that in a D latch, whenever the clock signal is high, Q matches D, and while the clock signal is low, it holds the previous state of D. For a D flip-flop, Q will hold whatever value D is at the exact moment C goes h... | habedi/stack-exchange-dataset |
57,396 | Finding the Regular Expression of a language | <p>I'm trying to find a regular expression for the language
$$L = \{w\mid n_a(w)+n_b(w)\equiv 2\pmod3\}\,,$$
where $n_a(w)$ is the number of $a$s in $w$.</p>

<p>I can see that this would generate strings of length $3n-1$ and
I can write the expression for a string of whose length is a multiple of t... | finite automata regular expressions | 1 | Finding the Regular Expression of a language -- (finite automata regular expressions)
<p>I'm trying to find a regular expression for the language
$$L = \{w\mid n_a(w)+n_b(w)\equiv 2\pmod3\}\,,$$
where $n_a(w)$ is the number of $a$s in $w$.</p>

<p>I can see that this would generate strings of length $3n... | habedi/stack-exchange-dataset |
57,400 | Is every countably infinite language recursive? | <p>We'll say the alphabet for the languages is finite, say {0,1}.</p>
 | formal languages uncountability | 1 | Is every countably infinite language recursive? -- (formal languages uncountability)
<p>We'll say the alphabet for the languages is finite, say {0,1}.</p>
 | habedi/stack-exchange-dataset |
57,405 | Runtime of this function: $T(n) = 8T(n/3)+nlogn$ | <p>I need to find the runtime of this function:
$$T(n) = 8T(n/3)+nlogn$$</p>

<p>I try to use the "Master Theorem" when
$$a=8,b=3$$
$$n^{log_ba}=n^{log_38}$$
$$f(n)=nlogn$$ 
And I define:
$$\varepsilon = -1.5+log_3 8$$
the first option in "Master Theorem" it`s that (when $\varepsilon... | runtime analysis | 1 | Runtime of this function: $T(n) = 8T(n/3)+nlogn$ -- (runtime analysis)
<p>I need to find the runtime of this function:
$$T(n) = 8T(n/3)+nlogn$$</p>

<p>I try to use the "Master Theorem" when
$$a=8,b=3$$
$$n^{log_ba}=n^{log_38}$$
$$f(n)=nlogn$$ 
And I define:
$$\varepsilon = -1.5+log_3 8$... | habedi/stack-exchange-dataset |
57,411 | Want to know the time complexity inner for loop which is partially iterating the array | <p><strong>Question:</strong> Find out next increasing value of each element in this below array.</p>

<pre><code>int[] array = { 5, 2, 7, 10, 4, 12}
</code></pre>

<p>e.g) <BR>
 5's nextIncreasingValue: 7 <BR>
 2's nextIncreasingValue: 7 <BR>
 7's nextIncreasingValue: 10 <BR... | time complexity | 1 | Want to know the time complexity inner for loop which is partially iterating the array -- (time complexity)
<p><strong>Question:</strong> Find out next increasing value of each element in this below array.</p>

<pre><code>int[] array = { 5, 2, 7, 10, 4, 12}
</code></pre>

<p>e.g) <BR>
 5's n... | habedi/stack-exchange-dataset |
57,416 | Quantum CNot algorithm problem | <p>I have a very simple quantum algorithm:</p>

<p>Let's start with two qubits in the state $|00\rangle$. I apply a Hadamard gate to the first one. Then I apply a CNot gate, with the first one as a control. Then I apply a Hadamard gate to both of them.</p>

<p><a href="https://i.stack.imgur.com/HL2j4.pn... | quantum computing | 1 | Quantum CNot algorithm problem -- (quantum computing)
<p>I have a very simple quantum algorithm:</p>

<p>Let's start with two qubits in the state $|00\rangle$. I apply a Hadamard gate to the first one. Then I apply a CNot gate, with the first one as a control. Then I apply a Hadamard gate to both of them.</p>&#... | habedi/stack-exchange-dataset |
57,425 | Proof for TM accepting any PDA-language | <p>How do you suggest I go about proving this:</p>

<p>Give a short, basic outline of a proof that Turing machines can accept all languages accepted by PDAs. You are allowed to use a non-standard Turing machine.</p>

<p>The best I can come up with is that since TMs are equivalent to computers, where as ... | turing machines context free pushdown automata | 1 | Proof for TM accepting any PDA-language -- (turing machines context free pushdown automata)
<p>How do you suggest I go about proving this:</p>

<p>Give a short, basic outline of a proof that Turing machines can accept all languages accepted by PDAs. You are allowed to use a non-standard Turing machine.</p>
... | habedi/stack-exchange-dataset |
57,427 | Data normalization when control has multiple values in CS/CE | <p>(This question was originally posted at <a href="https://academia.stackexchange.com/questions/68675">https://academia.stackexchange.com/questions/68675</a> but was considered too specific for Academia.)</p>

<p>In computer science/engineering research papers relating to performance improvement wherein execut... | empirical research benchmarking | 1 | Data normalization when control has multiple values in CS/CE -- (empirical research benchmarking)
<p>(This question was originally posted at <a href="https://academia.stackexchange.com/questions/68675">https://academia.stackexchange.com/questions/68675</a> but was considered too specific for Academia.)</p>

<p>... | habedi/stack-exchange-dataset |
57,436 | Running programs backwards | <p>I never used a debugger that can run a program backwards but I would like to. Now I wonder if there is much evidence and theory about backwards runnable programming, when and why a program can be run backwards or when and why not?</p>

<p>Intuitively I find that the computer should be able to run the program... | automata programming languages | 1 | Running programs backwards -- (automata programming languages)
<p>I never used a debugger that can run a program backwards but I would like to. Now I wonder if there is much evidence and theory about backwards runnable programming, when and why a program can be run backwards or when and why not?</p>

<p>Intuiti... | habedi/stack-exchange-dataset |
57,438 | Converting a algorithm to a runtime function | <p>I need to find an upper limit for the runtime of $f(n)$.</p>

<pre><code>f(n):
{
 g(n,1)
}

g(n,k):
{
 if n<=0 return;
 for(i=1; i<=n; i++)
 {
 print "I love data structures!";
 k++;
 g(n-1, k);
 }
 return;
}
</code></pre>

<p>I... | runtime analysis recursion | 1 | Converting a algorithm to a runtime function -- (runtime analysis recursion)
<p>I need to find an upper limit for the runtime of $f(n)$.</p>

<pre><code>f(n):
{
 g(n,1)
}

g(n,k):
{
 if n<=0 return;
 for(i=1; i<=n; i++)
 {
 print "I love data structures!";
 k+... | habedi/stack-exchange-dataset |
57,447 | At what point do electrical signals become actually logic and programmable language? | <p>I get that one transistor can store a value of 1 or 0. That's not the problem. What I don't get is how the fact that a transistor represents a 0 can translate into logic? How do these transistors turn each other one or of? Is there a uniform pattern to the circuit? how do these electrical signals magically transform... | digital circuits | 1 | At what point do electrical signals become actually logic and programmable language? -- (digital circuits)
<p>I get that one transistor can store a value of 1 or 0. That's not the problem. What I don't get is how the fact that a transistor represents a 0 can translate into logic? How do these transistors turn each othe... | habedi/stack-exchange-dataset |
57,452 | Who was the first to define Flow Shop / Job Shop problem? | <p>I spent some time to search in internet who was the first to formaly define Flow Shop and Job Shop problems but with no effect. I'm especially interested in article/book so I can mention it in my master thesis. </p>

<p>I'm guessing that there may be no author of this problems but this information also would... | scheduling | 1 | Who was the first to define Flow Shop / Job Shop problem? -- (scheduling)
<p>I spent some time to search in internet who was the first to formaly define Flow Shop and Job Shop problems but with no effect. I'm especially interested in article/book so I can mention it in my master thesis. </p>

<p>I'm guessing th... | habedi/stack-exchange-dataset |
57,457 | Is $\log(n!)$ in $\Theta(n \log(n))$? | <p>I had two questions on my automated test which I don't understand the answer for.</p>

<p>$\log(n!) = \log(n\cdot (n-1)\cdot \cdots \cdot 2\cdot 1) = \log(n)+\log(n-1)+....+\log(1)$. So it is in $O(n\log(n))$. But is it also in $\Omega(n \log(n))$? I don't think so, but my automated interview test thought... | asymptotics landau notation | 1 | Is $\log(n!)$ in $\Theta(n \log(n))$? -- (asymptotics landau notation)
<p>I had two questions on my automated test which I don't understand the answer for.</p>

<p>$\log(n!) = \log(n\cdot (n-1)\cdot \cdots \cdot 2\cdot 1) = \log(n)+\log(n-1)+....+\log(1)$. So it is in $O(n\log(n))$. But is it also in $\Omega... | habedi/stack-exchange-dataset |
57,464 | Difference between SNN RL and DNN RL? | <p>In Reinfrocement Learning (RL) in Neural Networks (NNs), I've seen two approaches to Q-learning.</p>

<p>The first is to tile the state space with basis functions using Spiking Neural Networks (SNN) to represent reward. This approach is used in <a href="https://mindmodeling.org/cogsci2013/papers/0580/paper05... | machine learning artificial intelligence neural networks reinforcement learning | 1 | Difference between SNN RL and DNN RL? -- (machine learning artificial intelligence neural networks reinforcement learning)
<p>In Reinfrocement Learning (RL) in Neural Networks (NNs), I've seen two approaches to Q-learning.</p>

<p>The first is to tile the state space with basis functions using Spiking Neural Ne... | habedi/stack-exchange-dataset |
57,469 | Big-O and not little-o implies theta? | <p>If $f(n)$ is in $O(g(n))$ but not in $o(g(n))$, is it true that $f(n)$ is in $\Theta(g(n))$?</p>

<p>Similarly, $f(n)$ is $\Omega(g(n))$ but not in $\omega(g(n))$ implies $f(n)$ is in $\Theta(g(n))$?</p>

<p>If not, can you provide an explanation/counter-example, please?</p>
 | asymptotics landau notation | 1 | Big-O and not little-o implies theta? -- (asymptotics landau notation)
<p>If $f(n)$ is in $O(g(n))$ but not in $o(g(n))$, is it true that $f(n)$ is in $\Theta(g(n))$?</p>

<p>Similarly, $f(n)$ is $\Omega(g(n))$ but not in $\omega(g(n))$ implies $f(n)$ is in $\Theta(g(n))$?</p>

<p>If not, can you provid... | habedi/stack-exchange-dataset |
57,471 | How to use Parikh's Theorem to show language is not context free | <p>Parikh's Theorem is quite complicated, I understand intuition of that theorem but I don't see how to use that to prove that language is not context free. I kindly ask you to show me how to do, language isn't important, but for definiteness:</p>

<p>$$ L=\{0^m1^n:m>n\text{ or }(m\text{ is prime and }m\leq... | formal languages context free formal grammars | 1 | How to use Parikh's Theorem to show language is not context free -- (formal languages context free formal grammars)
<p>Parikh's Theorem is quite complicated, I understand intuition of that theorem but I don't see how to use that to prove that language is not context free. I kindly ask you to show me how to do, languag... | habedi/stack-exchange-dataset |
57,473 | How do neural networks create results like its inputs? | <p>I understand basic neural networks (input layer, hidden layers, output layer) and gradient descent learning. However I keep hearing about news talking about neural networks painting and making jazz music. That is puzzling me.</p>

<p>As I understand a neural network, you feed it the input data (i.e. a pictur... | artificial intelligence neural networks | 1 | How do neural networks create results like its inputs? -- (artificial intelligence neural networks)
<p>I understand basic neural networks (input layer, hidden layers, output layer) and gradient descent learning. However I keep hearing about news talking about neural networks painting and making jazz music. That is puzz... | habedi/stack-exchange-dataset |
57,475 | What is the difference between AM and IP | <p><strong>Intro</strong></p>

<p>I am trying to understand how those two models of interactive proof are different. I understand that</p>

<ul>
<li>$\text{AM}$ relies on public coins (the prover knows the random bits used by the verifier)</li>
<li>$\text{IP}$ relies on private coins (the prover... | complexity theory interactive proof systems | 1 | What is the difference between AM and IP -- (complexity theory interactive proof systems)
<p><strong>Intro</strong></p>

<p>I am trying to understand how those two models of interactive proof are different. I understand that</p>

<ul>
<li>$\text{AM}$ relies on public coins (the prover knows the rand... | habedi/stack-exchange-dataset |
57,477 | Equivalent definition of minimal spanning tree | <blockquote>
 <p>Prove that $T$ is MST $\Leftrightarrow$ for any edge $uv \notin T$, $uv$ has the maximal weight on the cycle created by adding $uv$ to $T$.</p>
</blockquote>

<p>It's my attempt to prove $\Rightarrow$:
Consider the cycle $path(v, u) \in T \cup E(v, u)$. If $(v, u)$ is not maximal,... | graphs weighted graphs spanning trees minimum spanning tree | 1 | Equivalent definition of minimal spanning tree -- (graphs weighted graphs spanning trees minimum spanning tree)
<blockquote>
 <p>Prove that $T$ is MST $\Leftrightarrow$ for any edge $uv \notin T$, $uv$ has the maximal weight on the cycle created by adding $uv$ to $T$.</p>
</blockquote>

<p>It's my att... | habedi/stack-exchange-dataset |
57,479 | Reccurrence for the game of pile of stones | <p>I am trying to solve this question from Project Euler for past few days: <a href="https://projecteuler.net/problem=550" rel="nofollow">Divisor game</a>.
The problem is as follows:</p>

<blockquote>
 <p>Two players are playing a game. There are $k$ piles of stones. When it is his turn a player has to... | time complexity recurrence relation dynamic programming number theory game theory | 1 | Reccurrence for the game of pile of stones -- (time complexity recurrence relation dynamic programming number theory game theory)
<p>I am trying to solve this question from Project Euler for past few days: <a href="https://projecteuler.net/problem=550" rel="nofollow">Divisor game</a>.
The problem is as follows:</p>... | habedi/stack-exchange-dataset |
57,497 | Proof of 0/1 knapsack optimal substructure | <p>I'm trying to understand why exactly the 0/1 knapsack problem actually has the optimal substructure property.</p>

<p>Let $E$ be the set of items to consider and $v$ and $w$ the value and weight functions defined over $E$.</p>

<p>Now, suppose that, among all solutions weighing at most $W$, $S \subse... | correctness proof knapsack problems | 1 | Proof of 0/1 knapsack optimal substructure -- (correctness proof knapsack problems)
<p>I'm trying to understand why exactly the 0/1 knapsack problem actually has the optimal substructure property.</p>

<p>Let $E$ be the set of items to consider and $v$ and $w$ the value and weight functions defined over $E$.</p... | habedi/stack-exchange-dataset |
57,516 | Proof for This Greedy Strategy for Equalizing An Array | <p>Recently the following problem was posed in a private coding competition at my workplace:</p>

<blockquote>
 <p>An array $A$ is given that has only positive integers in it. The objective is to equalize the array in minimum possible steps. In every step all but one element are incremented by a fixed step... | greedy algorithms | 1 | Proof for This Greedy Strategy for Equalizing An Array -- (greedy algorithms)
<p>Recently the following problem was posed in a private coding competition at my workplace:</p>

<blockquote>
 <p>An array $A$ is given that has only positive integers in it. The objective is to equalize the array in minimum pos... | habedi/stack-exchange-dataset |
57,518 | Are all languages in P? | <p>Are all languages in $\mathbf{P}$?</p>

<p>Note: The definitions of all the symbols and functions here follow the document [1].</p>

<p>The following is my attempt to answer the question. Assume that we design a special Turing machine $M_1$, no matter what the input is, $M_1$ will jump to the state $... | formal languages turing machines polynomial time | 1 | Are all languages in P? -- (formal languages turing machines polynomial time)
<p>Are all languages in $\mathbf{P}$?</p>

<p>Note: The definitions of all the symbols and functions here follow the document [1].</p>

<p>The following is my attempt to answer the question. Assume that we design a special Tur... | habedi/stack-exchange-dataset |
57,521 | If my computer is a 32 bit system,it has a 32 bit address right?But when i print any memory address in C why do i get a short value? | <p>For example</p>

<pre><code>printf("%u",&a);
</code></pre>

<p><em>gives me output</em>
<strong>65524</strong></p>
 | computer architecture c | 1 | If my computer is a 32 bit system,it has a 32 bit address right?But when i print any memory address in C why do i get a short value? -- (computer architecture c)
<p>For example</p>

<pre><code>printf("%u",&a);
</code></pre>

<p><em>gives me output</em>
<strong>65524</strong></p>
 | habedi/stack-exchange-dataset |
57,524 | Out of these two algorithms. Is there always an input where A is faster then B? (Big theta notation) | <p>I am currently learning landau notations and am stuck on the following True/False question.</p>

<p><img src="https://i.imgur.com/T3sczCQ.png" alt="Quession"></p>

<p>What seems a little confusing to me is the use of big-theta notation to describe worst-case run-time. 
What is the difference in s... | terminology asymptotics runtime analysis landau notation | 1 | Out of these two algorithms. Is there always an input where A is faster then B? (Big theta notation) -- (terminology asymptotics runtime analysis landau notation)
<p>I am currently learning landau notations and am stuck on the following True/False question.</p>

<p><img src="https://i.imgur.com/T3sczCQ.png" alt... | habedi/stack-exchange-dataset |
57,536 | Is it true that independent set is $Ω(n^{1−\epsilon})$-inapproximable unless P=NP? | <p>I was reading a paper and I came to the following : </p>

<p>"Since independent set is $Ω(n^{1−\epsilon})$-inapproximable unless P=NP (see [19]) for any fixed $\epsilon> 0$, the ..." where [19] is the following article : D. Zuckerman. <a href="http://theoryofcomputing.org/articles/v003a006/v003a006.pdf" r... | reductions | 1 | Is it true that independent set is $Ω(n^{1−\epsilon})$-inapproximable unless P=NP? -- (reductions)
<p>I was reading a paper and I came to the following : </p>

<p>"Since independent set is $Ω(n^{1−\epsilon})$-inapproximable unless P=NP (see [19]) for any fixed $\epsilon> 0$, the ..." where [19] is the follow... | habedi/stack-exchange-dataset |
57,538 | How to recursively infer a word/string from a context-free grammar? | <blockquote>
 <p>Give the recursive inference of the word $abcddd$ from the Context-free Grammar:</p>
 
 <p>$A\rightarrow aAd\mid B$<br>
 $B\rightarrow bBd\mid C$<br>
 $C\rightarrow cC\mid cD$<br>
 $D\rightarrow Dd\mid ϵ$</p>
</blockquote>

<p>This is a follow up question to th... | formal languages context free formal grammars | 1 | How to recursively infer a word/string from a context-free grammar? -- (formal languages context free formal grammars)
<blockquote>
 <p>Give the recursive inference of the word $abcddd$ from the Context-free Grammar:</p>
 
 <p>$A\rightarrow aAd\mid B$<br>
 $B\rightarrow bBd\mid C$<br>
 $C\right... | habedi/stack-exchange-dataset |
57,541 | Understanding DPA | <p>DPA denotes “Deterministic Pushdown Automata”.</p>

<p>Is the following (*) true regarding DPA:</p>

<blockquote>
 <p>After all symbols of the input sequence are <em>consumed</em>, the input sequence is accepted either (1) if the stack is empty or (2) if the current state of the DPA is an accept... | automata | 1 | Understanding DPA -- (automata)
<p>DPA denotes “Deterministic Pushdown Automata”.</p>

<p>Is the following (*) true regarding DPA:</p>

<blockquote>
 <p>After all symbols of the input sequence are <em>consumed</em>, the input sequence is accepted either (1) if the stack is empty or (2) if the curre... | habedi/stack-exchange-dataset |
57,542 | Find pth percentile of a stream of numbers | <p>I want to find the pth percentile of a stream of integers, exactly (not approximately).</p>

<p>If we know the number of integers which will be coming in the stream and the numbers can fit into the memory then we can simply sort the integers and find the pth percentile.</p>

<p>But, what if all the n... | streaming algorithm | 1 | Find pth percentile of a stream of numbers -- (streaming algorithm)
<p>I want to find the pth percentile of a stream of integers, exactly (not approximately).</p>

<p>If we know the number of integers which will be coming in the stream and the numbers can fit into the memory then we can simply sort the integers... | habedi/stack-exchange-dataset |
57,548 | Relation between MAX CUT and MIN CUT | <p>I'd like to ask a question about MAX CUT and MIN CUT on graphs with unit edge-weight. I know that MAX CUT is NP-Hard, but MIN CUT is in P (i think)?</p>

<p>Barahona, in 1982, showed (Lemma 1) finding a cut of at least k on a unit-weight graph is equivalent to finding a cut of at most -k on a graph in which ... | complexity theory graphs max cut | 1 | Relation between MAX CUT and MIN CUT -- (complexity theory graphs max cut)
<p>I'd like to ask a question about MAX CUT and MIN CUT on graphs with unit edge-weight. I know that MAX CUT is NP-Hard, but MIN CUT is in P (i think)?</p>

<p>Barahona, in 1982, showed (Lemma 1) finding a cut of at least k on a unit-wei... | habedi/stack-exchange-dataset |
57,549 | Evolutionary algorithm in stochastic environment | <p>Consider the following model problem:</p>

<p>I want to use an <strong>evolutionary algorithm</strong> to optimize the starting point of particles for which it is apriori clear where they would start in state space, but not <strong>when</strong>. Once a particle is placed, it is part of the dynamics, which i... | optimization heuristics evolutionary computing | 1 | Evolutionary algorithm in stochastic environment -- (optimization heuristics evolutionary computing)
<p>Consider the following model problem:</p>

<p>I want to use an <strong>evolutionary algorithm</strong> to optimize the starting point of particles for which it is apriori clear where they would start in state... | habedi/stack-exchange-dataset |
57,564 | Understanding hashtable performance in the worst-case | <p>Under assumption that the hash function is uniform, we have worst-case performance for the search operation in a separate-chaining (e.g. <code>java.util.HashMap</code>) hashtable $O(\log n)$. Why? I cannot really understand this. If we have a uniformly-distributed hash values it should be the case that each hash buc... | time complexity hash tables hashing | 1 | Understanding hashtable performance in the worst-case -- (time complexity hash tables hashing)
<p>Under assumption that the hash function is uniform, we have worst-case performance for the search operation in a separate-chaining (e.g. <code>java.util.HashMap</code>) hashtable $O(\log n)$. Why? I cannot really understan... | habedi/stack-exchange-dataset |
57,565 | Linear-time algorithm to find an odd-length cycle in a directed graph | <blockquote>
 <p><strong><em>Problem:</em></strong> Give a linear-time algorithm to find an odd-length (directed) cycle in a directed graph. <em>(Exercise 3.21 of <a href="http://rads.stackoverflow.com/amzn/click/0073523402" rel="noreferrer">Algorithms</a> by S. Dasgupta, C. Papadimitriou, and U. Vazirani.)</em><... | algorithms graphs graph traversal | 1 | Linear-time algorithm to find an odd-length cycle in a directed graph -- (algorithms graphs graph traversal)
<blockquote>
 <p><strong><em>Problem:</em></strong> Give a linear-time algorithm to find an odd-length (directed) cycle in a directed graph. <em>(Exercise 3.21 of <a href="http://rads.stackoverflow.com/amzn... | habedi/stack-exchange-dataset |
57,566 | Given a r.e. (recursively enumerable) language, L, how many Turing machines semi-decide L? | <p>$L\subseteq \{0,1\}^*$</p>

<p>Since the language is r.e. there is definitely at least one Turing Machine that semi-decides the language. I'm thinking that if you have one Turing Machine that semi-decides the language, you can arbitrarily extend this Turing Machine (by adding redundant states), which means t... | computability turing machines | 1 | Given a r.e. (recursively enumerable) language, L, how many Turing machines semi-decide L? -- (computability turing machines)
<p>$L\subseteq \{0,1\}^*$</p>

<p>Since the language is r.e. there is definitely at least one Turing Machine that semi-decides the language. I'm thinking that if you have one Turing Mach... | habedi/stack-exchange-dataset |
57,576 | Basic questions about network flow calculations | <p><a href="https://en.wikipedia.org/wiki/Flow_network" rel="nofollow">Flow networks</a> are often constructed when one is interested in measuring how resilient a graph is. The idea goes as follows: two vertices are designated as source $(s)$ and sink $(t)$ respectively, to each edge $e$ of the graph a capacity $c_e$ i... | graphs network flow | 1 | Basic questions about network flow calculations -- (graphs network flow)
<p><a href="https://en.wikipedia.org/wiki/Flow_network" rel="nofollow">Flow networks</a> are often constructed when one is interested in measuring how resilient a graph is. The idea goes as follows: two vertices are designated as source $(s)$ and ... | habedi/stack-exchange-dataset |
57,580 | Undecidability of REGULAR_TM (Detail within Proof) | <p>I'm reading through Sipser's Intro to the Theory of Computation for a class, and I'm having trouble understanding one of the examples in the book.</p>

<p>The example shows how $REGULAR_{TM}$, defined as the problem of determining if a Turing machine recognizes a regular language, is undecidable. The way the... | computability turing machines reductions undecidability | 1 | Undecidability of REGULAR_TM (Detail within Proof) -- (computability turing machines reductions undecidability)
<p>I'm reading through Sipser's Intro to the Theory of Computation for a class, and I'm having trouble understanding one of the examples in the book.</p>

<p>The example shows how $REGULAR_{TM}$, defi... | habedi/stack-exchange-dataset |
57,592 | Minimum Weight Directed Subgraph ensuring all pairs reachability? | <p>After some work on Minimum Spanning Trees and Steiner trees in combinatorial problems I came across this problem that I would like to look further in my research, but I want to know if there is an algorithm for it. I couldn't find anything in Google or Google Scholar.</p>

<p>Given a directed graph $G=(V,E)$... | algorithms graphs | 1 | Minimum Weight Directed Subgraph ensuring all pairs reachability? -- (algorithms graphs)
<p>After some work on Minimum Spanning Trees and Steiner trees in combinatorial problems I came across this problem that I would like to look further in my research, but I want to know if there is an algorithm for it. I couldn't fi... | habedi/stack-exchange-dataset |
57,594 | Turing Machine with additional finite memory of size $n$ | <p><strong>The question itself:</strong></p>
<blockquote>
<p>Let us define a generalization of Turing Machines to include a finite memory of >size <span class="math-container">$n$</span>.</p>
<p>We denote such
a Turing Machine formally as:</p>
<p><span class="math-container">$M_{mem} = (Q, Σ, γ, ... | turing machines computation models simulation | 1 | Turing Machine with additional finite memory of size $n$ -- (turing machines computation models simulation)
<p><strong>The question itself:</strong></p>
<blockquote>
<p>Let us define a generalization of Turing Machines to include a finite memory of >size <span class="math-container">$n$</span>.</p>
<p>We... | habedi/stack-exchange-dataset |
57,604 | What is a fast algorithm for partitioning an array into $k$ subsets $A_1<\dots<A_n$? | <p>Let $A$ be an array (equipped with a total ordering $\leq$) of size $n = km$ with $k\in \mathbb{N}$, such such that $A[1],\dots,A[n]$ are all distinct. What is a fast way to find a partition $A_1,\dots,A_k$ of $A$ with $|A_i| = m$ for all $i$, such that $x<y$, if $x\in A_i$ and $y\in A_j$ with $1\leq i<j$?</p>... | algorithms | 1 | What is a fast algorithm for partitioning an array into $k$ subsets $A_1<\dots<A_n$? -- (algorithms)
<p>Let $A$ be an array (equipped with a total ordering $\leq$) of size $n = km$ with $k\in \mathbb{N}$, such such that $A[1],\dots,A[n]$ are all distinct. What is a fast way to find a partition $A_1,\dots,A_k$ of $A$ wi... | habedi/stack-exchange-dataset |
57,617 | KD-Tree implementation with lat/lon coordinates | <p>I have implemented a KD-Tree that stores coordinates (latitude, longitude). I have also implemented a Nearest Neighbor search algorithm using the Haversine distance. My question is, will I get correct results (same nearest neighbor) if I use euclidean distance instead ?</p>

<p>If not, can you give me a conc... | algorithms binary trees search trees | 1 | KD-Tree implementation with lat/lon coordinates -- (algorithms binary trees search trees)
<p>I have implemented a KD-Tree that stores coordinates (latitude, longitude). I have also implemented a Nearest Neighbor search algorithm using the Haversine distance. My question is, will I get correct results (same nearest neig... | habedi/stack-exchange-dataset |
57,631 | Is the system of measuring length in the US Turing complete? | <p>The <a href="https://twitter.com/thomasfuchs/status/732751873304858624?refsrc=email&s=11" rel="nofollow noreferrer">author here writes</a>:</p>

<blockquote>
 <p>Little known fact, the system of measuring length in the US is Turing complete</p>
</blockquote>

<p><a href="https://i.stack.... | computability computation models turing completeness | 1 | Is the system of measuring length in the US Turing complete? -- (computability computation models turing completeness)
<p>The <a href="https://twitter.com/thomasfuchs/status/732751873304858624?refsrc=email&s=11" rel="nofollow noreferrer">author here writes</a>:</p>

<blockquote>
 <p>Little known fact, ... | habedi/stack-exchange-dataset |
57,638 | What is the expressive power of finite-state transducers and pushdown transducers? | <p>One would assume that a finite state transducer can perform any translation such that the resulting string is from a regular grammar. Similarly, that a pushdown transducer can generate strings from CFG grammars.</p>

<p>I am, however, unsure about this because we can construct a finite state transducer which... | automata finite automata transducers | 1 | What is the expressive power of finite-state transducers and pushdown transducers? -- (automata finite automata transducers)
<p>One would assume that a finite state transducer can perform any translation such that the resulting string is from a regular grammar. Similarly, that a pushdown transducer can generate strings... | habedi/stack-exchange-dataset |
57,645 | Is it possible to design a programming task that is unsolvable? | <p>Can a problem (described by a set of inputs and accepted answers) be designed such that for all programs which produce an answer in finite time for a (countably) infinite number of inputs, at least one of those outputs is incorrect. </p>

<p>That is, the program need not terminate for all outputs, but the ou... | computability undecidability | 1 | Is it possible to design a programming task that is unsolvable? -- (computability undecidability)
<p>Can a problem (described by a set of inputs and accepted answers) be designed such that for all programs which produce an answer in finite time for a (countably) infinite number of inputs, at least one of those outputs ... | habedi/stack-exchange-dataset |
57,648 | Why do we not combine random number generators? | <p>There are many applications where a pseudo random number generator is used. So people implement one that they think is great only to find later that it's flawed. Something like this happened with the Javascript random number generator recently. RandU much earlier too. There are also issues of inappropriate initi... | pseudo random generators random number generator | 1 | Why do we not combine random number generators? -- (pseudo random generators random number generator)
<p>There are many applications where a pseudo random number generator is used. So people implement one that they think is great only to find later that it's flawed. Something like this happened with the Javascript ra... | habedi/stack-exchange-dataset |
57,654 | Why does a MP3 encoder use a fast Fourier transform before applying the psychoacoustic model? | <p>Karlheinz Brandenburg depicts a MP3 encoder like this:</p>

<p><a href="https://i.stack.imgur.com/uiuJ2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uiuJ2.png" alt="Block diagram of a MP3 encoder"></a></p>

<p>Source: <a href="http://www.linkwitzlab.com/Brandenburg_mp3_aac.pdf" ... | algorithms data compression fourier transform | 1 | Why does a MP3 encoder use a fast Fourier transform before applying the psychoacoustic model? -- (algorithms data compression fourier transform)
<p>Karlheinz Brandenburg depicts a MP3 encoder like this:</p>

<p><a href="https://i.stack.imgur.com/uiuJ2.png" rel="nofollow noreferrer"><img src="https://i.stack.img... | habedi/stack-exchange-dataset |
57,656 | An one-sentence proof of P ⊆ NP | <p>Recently I am reading a document [1]. In this document, Prof. Cook provides a brief proof of $\mathbf{P} \subseteq \mathbf{NP}$, which is only one sentence:</p>

<blockquote>
 <p>It is trivial to show that $\mathbf{P} \subseteq \mathbf{NP}$, since for each language $L$ over $\Sigma$, if $L \in \mathbf{P... | complexity theory np | 1 | An one-sentence proof of P ⊆ NP -- (complexity theory np)
<p>Recently I am reading a document [1]. In this document, Prof. Cook provides a brief proof of $\mathbf{P} \subseteq \mathbf{NP}$, which is only one sentence:</p>

<blockquote>
 <p>It is trivial to show that $\mathbf{P} \subseteq \mathbf{NP}$, sinc... | habedi/stack-exchange-dataset |
57,672 | Reconciling NP and the decision problem | <p>So I've seen that most NP-Complete problems seem to take the form of decision problems - problems which require only a yes/no answer. However, how can this be reconciled with the requirement that the solution of an NP problem can be checked in polynomial time?</p>

<p>For example, for a graph G, the max cut ... | np complete decision problem | 1 | Reconciling NP and the decision problem -- (np complete decision problem)
<p>So I've seen that most NP-Complete problems seem to take the form of decision problems - problems which require only a yes/no answer. However, how can this be reconciled with the requirement that the solution of an NP problem can be checked in... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.