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 |
|---|---|---|---|---|---|---|
13,733 | Representing grammar for list/dictionary with optional end separator as LL(1) | <p>Considering a grammar that includes a dictionary or list with an optional terminal separator - e.g.: </p>

<p>$$ 
\begin{align} 
obj \to & dict \\ 
 &\mid OTHER \\ 
dict \to & \{ \quad \} \\ 
 & \mid \{ \quad pairs \quad \} \\ 
pairs \to ... | formal grammars parsers | 1 | Representing grammar for list/dictionary with optional end separator as LL(1) -- (formal grammars parsers)
<p>Considering a grammar that includes a dictionary or list with an optional terminal separator - e.g.: </p>

<p>$$ 
\begin{align} 
obj \to & dict \\ 
 &\mid OTHER \\ &... | habedi/stack-exchange-dataset |
13,742 | When does the nearest neighbor heuristic fail for the Traveling Salesperson? | <p>Can you provide an example of NN algorithm failure on the Euclidean traveling salesman problem?</p>

<p>I was trying to construct a specific example of this for my friends and was failing.</p>
 | algorithms heuristics traveling salesman | 1 | When does the nearest neighbor heuristic fail for the Traveling Salesperson? -- (algorithms heuristics traveling salesman)
<p>Can you provide an example of NN algorithm failure on the Euclidean traveling salesman problem?</p>

<p>I was trying to construct a specific example of this for my friends and was failin... | habedi/stack-exchange-dataset |
13,757 | Category theory (not) for Programming? | <p>After learning Haskell and other not so pure FP languages I decided to read about Category theory. After gaining good understanding of Category theory I started thinking about how the concepts of category theory can be used to think about <strong>designing programs</strong> but no matter how hard I tried it seems th... | functional programming category theory | 1 | Category theory (not) for Programming? -- (functional programming category theory)
<p>After learning Haskell and other not so pure FP languages I decided to read about Category theory. After gaining good understanding of Category theory I started thinking about how the concepts of category theory can be used to think a... | habedi/stack-exchange-dataset |
13,759 | Results on the languages recognized by undirected DFAs | <p>For my Bachelor's thesis, I consider the class of languages recognized by symmetrical DFAs, that is, deterministic (complete) finite automata satisfying the following condition: </p>

<p>Let $A$ be a complete DFA over the alphabet $\Sigma$. If, for every $a\in \Sigma$ and every transition $u \stackrel{a}{\lo... | formal languages reference request regular languages finite automata | 1 | Results on the languages recognized by undirected DFAs -- (formal languages reference request regular languages finite automata)
<p>For my Bachelor's thesis, I consider the class of languages recognized by symmetrical DFAs, that is, deterministic (complete) finite automata satisfying the following condition: </p>
&... | habedi/stack-exchange-dataset |
13,766 | Alternative proof for the undecidability of $A_{TM}$ | <p>The proof of the undecidability of $A_{TM}$ in Michael Sipser's textbook<code>*</code> contains the definition of a Turing Machine, which accepts the encoding of a TM, if this TM doesn't accept its own encoding, and rejects it, if it does. If this TM is run on its own encoding, there is problem: it should accept if ... | terminology computability turing machines halting problem | 1 | Alternative proof for the undecidability of $A_{TM}$ -- (terminology computability turing machines halting problem)
<p>The proof of the undecidability of $A_{TM}$ in Michael Sipser's textbook<code>*</code> contains the definition of a Turing Machine, which accepts the encoding of a TM, if this TM doesn't accept its own... | habedi/stack-exchange-dataset |
13,771 | Undecidability of a restricted version of the acceptance problem | <p>It's known that the following language, the so-called acceptance problem is undecidable:</p>

<p>$A_{TM} = \{\langle M,w\rangle\,\vert\,M\text{ is a TM which accepts }w\}$</p>

<p>The proof is by contradiction: Assume there is a TM $H$ which decides $A_{TM}$. Let $D$ be another TM. Given the code of ... | computability turing machines undecidability | 1 | Undecidability of a restricted version of the acceptance problem -- (computability turing machines undecidability)
<p>It's known that the following language, the so-called acceptance problem is undecidable:</p>

<p>$A_{TM} = \{\langle M,w\rangle\,\vert\,M\text{ is a TM which accepts }w\}$</p>

<p>The pr... | habedi/stack-exchange-dataset |
13,783 | Definition of deterministic pushdown automaton | <p>Wikipedia <a href="http://en.wikipedia.org/wiki/Pushdown_automaton" rel="nofollow">Pushdown automaton</a> (as of aug 16, 2013) states:</p>

<blockquote>
 <p>In general, pushdown automata may have several computations on a given input string, some of which may be halting in accepting configurations. If o... | terminology pushdown automata | 1 | Definition of deterministic pushdown automaton -- (terminology pushdown automata)
<p>Wikipedia <a href="http://en.wikipedia.org/wiki/Pushdown_automaton" rel="nofollow">Pushdown automaton</a> (as of aug 16, 2013) states:</p>

<blockquote>
 <p>In general, pushdown automata may have several computations on a ... | habedi/stack-exchange-dataset |
13,785 | Formal program verification in practice | <p>As a software engineer, I write a lot of code for industrial products. Relatively complicated stuff with classes, threads, some design efforts, but also some compromises for performance. I do a lot of testing, and I am tired of testing, so I got interested in formal proof tools, such as Coq, Isabelle... Could I use ... | programming languages program correctness software verification | 1 | Formal program verification in practice -- (programming languages program correctness software verification)
<p>As a software engineer, I write a lot of code for industrial products. Relatively complicated stuff with classes, threads, some design efforts, but also some compromises for performance. I do a lot of testing... | habedi/stack-exchange-dataset |
13,788 | When testing n items, how to cover all t-subsets by as few s-subsets as possible? | <p>This problem arose from software testing. The problem is a bit difficult to explain. I will first give an example, then try to generalize the problem.</p>

<p>There are 10 items to be tested, say A to J, and a testing tool that can test 3 items at the same time. Order of items in the testing tool does not ma... | algorithms combinatorics software testing | 1 | When testing n items, how to cover all t-subsets by as few s-subsets as possible? -- (algorithms combinatorics software testing)
<p>This problem arose from software testing. The problem is a bit difficult to explain. I will first give an example, then try to generalize the problem.</p>

<p>There are 10 items to... | habedi/stack-exchange-dataset |
13,795 | Mealy machines to model ciphers | <p>Similar questions have occurred quite a number of times <a href="https://cs.stackexchange.com/q/10280/25">(1)</a> <a href="https://cstheory.stackexchange.com/q/8539/869">(2)</a> <a href="https://cstheory.stackexchange.com/q/14811/869">(3)</a>, but I have, say, a specific instance of one. I'm aware of a bunch of appl... | reference request automata finite automata cryptography | 1 | Mealy machines to model ciphers -- (reference request automata finite automata cryptography)
<p>Similar questions have occurred quite a number of times <a href="https://cs.stackexchange.com/q/10280/25">(1)</a> <a href="https://cstheory.stackexchange.com/q/8539/869">(2)</a> <a href="https://cstheory.stackexchange.com/q/... | habedi/stack-exchange-dataset |
13,803 | Bayesian Network - Inference | <p>I have the following Bayesian Network and need help with answering the following query.</p>

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

<p><strong>EDITED:</strong></p>

<p>Here are my solutions to questions a and b:</p>

<p><strong>a)</s... | probability theory | 1 | Bayesian Network - Inference -- (probability theory)
<p>I have the following Bayesian Network and need help with answering the following query.</p>

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

<p><strong>EDITED:</strong></p>

<p>Here are my solution... | habedi/stack-exchange-dataset |
13,804 | Is the language that accepts strings concatenated with their reverse regular? | <p>If the set of regular languages is closed under the concatenation operation and is also closed under the reverse operation ($x^R$ is the reverse of $x$) then is the language generated by $$\{ww^R|w\in\Sigma^*\}$$ for some input alphabet $\Sigma$, also regular? If not, why not?</p>

<p>I've been trying to fin... | formal languages regular languages context free pumping lemma | 1 | Is the language that accepts strings concatenated with their reverse regular? -- (formal languages regular languages context free pumping lemma)
<p>If the set of regular languages is closed under the concatenation operation and is also closed under the reverse operation ($x^R$ is the reverse of $x$) then is the languag... | habedi/stack-exchange-dataset |
13,810 | What is the reason of inaccuracy of operations on float numbers? | <p>I wonder why in JavaScript</p>

<pre><code>0.1 + 0.2 // return 0.30000000000000004

4%0.1 // return 0.09999999999999978
</code></pre>

<p><a href="http://jsbin.com/oHISAfU/1/edit" rel="nofollow noreferrer">http://jsbin.com/oHISAfU/1/edit</a> (Example)</p>

<p>In C the math.h lib... | floating point | 1 | What is the reason of inaccuracy of operations on float numbers? -- (floating point)
<p>I wonder why in JavaScript</p>

<pre><code>0.1 + 0.2 // return 0.30000000000000004

4%0.1 // return 0.09999999999999978
</code></pre>

<p><a href="http://jsbin.com/oHISAfU/1/edit" rel="nofollow noreferre... | habedi/stack-exchange-dataset |
13,815 | How good are current AI researchers at simulating complex, first-person emotional states? | <p>I just read that IBM's Watson would have a hard time answering questions like "tell me about your first <a href="http://blogs.discovermagazine.com/sciencenotfiction/2010/06/28/watson-fails-the-turing-test-but-just-might-pass-the-jeopardy-test/#.UhH7QGTF1vZ" rel="nofollow">kiss</a>." If you asked a modern, state-of-t... | artificial intelligence | 1 | How good are current AI researchers at simulating complex, first-person emotional states? -- (artificial intelligence)
<p>I just read that IBM's Watson would have a hard time answering questions like "tell me about your first <a href="http://blogs.discovermagazine.com/sciencenotfiction/2010/06/28/watson-fails-the-turin... | habedi/stack-exchange-dataset |
13,817 | To what factor can I compress information from binary to Quinary | <p>I am trying to think if we can have an injective mapping $\mathcal{f}$, say something like $\Sigma_{bool}= \{0,1\}^* $ to $\Sigma_{5} = \{0,1,2,3,4\}^* $ such that $|x| \leq 2.|\mathcal{f}(x)|$</p>

<p>The motivation here is simple, consider I have a word $110110110110110110110$, so i can compress and repres... | formal languages data compression | 1 | To what factor can I compress information from binary to Quinary -- (formal languages data compression)
<p>I am trying to think if we can have an injective mapping $\mathcal{f}$, say something like $\Sigma_{bool}= \{0,1\}^* $ to $\Sigma_{5} = \{0,1,2,3,4\}^* $ such that $|x| \leq 2.|\mathcal{f}(x)|$</p>

<p>The... | habedi/stack-exchange-dataset |
13,823 | Document definition in information retrieval | <p>Is there common formal definition of <strong>Document</strong> in information retrieval field? In many researches authors don't define the term <strong>Document</strong>(maybe because it is evident for them). Wikipedia says "text file, document (computer science) a computer file that contains text" but it doesn't se... | terminology data mining information retrieval | 1 | Document definition in information retrieval -- (terminology data mining information retrieval)
<p>Is there common formal definition of <strong>Document</strong> in information retrieval field? In many researches authors don't define the term <strong>Document</strong>(maybe because it is evident for them). Wikipedia sa... | habedi/stack-exchange-dataset |
13,845 | Max cut in cubic graphs | <p>The following question is related to the <a href="http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCwQFjAA&url=http://en.wikipedia.org/wiki/Maximum_cut&ei=wMQTUuXxLuny4QS55oHgAw&usg=AFQjCNF7PelNFUITFjPfjyXHqig7ivCgvw&sig2=JVB560isHX3-zBpX2khJTQ&... | complexity theory graphs np complete np | 1 | Max cut in cubic graphs -- (complexity theory graphs np complete np)
<p>The following question is related to the <a href="http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CCwQFjAA&url=http://en.wikipedia.org/wiki/Maximum_cut&ei=wMQTUuXxLuny4QS55oHgAw&us... | habedi/stack-exchange-dataset |
13,857 | Order a list of whole numbers so that no two numbers have the average of them sitting between them | <p>Given a whole number N..</p>

<p>Arrange 1 to N in a sequence such that no two numbers have their average sitting between them... </p>

<p>Note - 
If N=20.. average of 19 and 2 = 10.5 is not a whole number .. hence we do not need to worry about such numbers and their averages..
In other words... | algorithms | 1 | Order a list of whole numbers so that no two numbers have the average of them sitting between them -- (algorithms)
<p>Given a whole number N..</p>

<p>Arrange 1 to N in a sequence such that no two numbers have their average sitting between them... </p>

<p>Note - 
If N=20.. average of 19 and 2 = 10.... | habedi/stack-exchange-dataset |
13,861 | Is there a formula to state the number of 'sets' of 'ordered sets within ordered groups'? | <p>I am new to this and an amateur... please help.</p>

<p><strong>My Question in practical terms:</strong>
Given The three following inputs... determine the number of <em>unique</em> group arrangements as an ordered set.</p>

<p><strong>INPUT:</strong>
'a' = Students
'b' = Groups
'c' = ... | combinatorics sets matching | 1 | Is there a formula to state the number of 'sets' of 'ordered sets within ordered groups'? -- (combinatorics sets matching)
<p>I am new to this and an amateur... please help.</p>

<p><strong>My Question in practical terms:</strong>
Given The three following inputs... determine the number of <em>unique</em> g... | habedi/stack-exchange-dataset |
13,862 | Difference between encoding and modulation in transmission | <p>What is the difference between encoding and modulation?</p>

<p>I have seen these terms used sometimes inter-changeably and sometimes differently (the ratio is 50:50).</p>

<p>Can somebody clearly explain this with some non-technical and technical examples both? I have searched this a lot on net and ... | terminology computer networks | 1 | Difference between encoding and modulation in transmission -- (terminology computer networks)
<p>What is the difference between encoding and modulation?</p>

<p>I have seen these terms used sometimes inter-changeably and sometimes differently (the ratio is 50:50).</p>

<p>Can somebody clearly explain th... | habedi/stack-exchange-dataset |
13,873 | Seating Chart Optimization | <p>I'm trying to find an algorithm to solve the seating chart problem. The goal is to place pepole at one (or multiple) tables such that the overall happiness is maximized.</p>

<p>Each seat has neighbors. A person on a seat can talk to persons on neighboring seats (note that these neighbors normally sit next t... | algorithms optimization | 1 | Seating Chart Optimization -- (algorithms optimization)
<p>I'm trying to find an algorithm to solve the seating chart problem. The goal is to place pepole at one (or multiple) tables such that the overall happiness is maximized.</p>

<p>Each seat has neighbors. A person on a seat can talk to persons on neighbor... | habedi/stack-exchange-dataset |
13,874 | What data structure would efficiently store integer ranges? | <p>I need to keep a collection on integers in the range 0 to 65535 so that I can quickly do the following:</p>

<ul>
<li>Insert a new integer</li>
<li>Insert a range of contiguous integers</li>
<li>Remove an integer</li>
<li>Remove all integers below an integer</li>
<li>Test if an integer is... | data structures efficiency search trees integers | 1 | What data structure would efficiently store integer ranges? -- (data structures efficiency search trees integers)
<p>I need to keep a collection on integers in the range 0 to 65535 so that I can quickly do the following:</p>

<ul>
<li>Insert a new integer</li>
<li>Insert a range of contiguous integers</... | habedi/stack-exchange-dataset |
13,882 | Why are weights of Neural Networks initialized with random numbers? | <p>Why are neural networks initial weights initialized as random numbers?
I had read somewhere that this is done to "break the symmetry" and this makes the neural network learn faster.
How does breaking the symmetry make it learn faster?</p>

<p>Would'nt initializing the weights to 0 be a better idea? T... | machine learning artificial intelligence neural networks | 1 | Why are weights of Neural Networks initialized with random numbers? -- (machine learning artificial intelligence neural networks)
<p>Why are neural networks initial weights initialized as random numbers?
I had read somewhere that this is done to "break the symmetry" and this makes the neural network learn faster.&#... | habedi/stack-exchange-dataset |
13,887 | Complexity of deciding if a formula has exactly 1 satisfying assignment | <p>The decision problem</p>

<blockquote>
 <p>Given a Boolean formula $\phi$, does $\phi$ have exactly one satisfying assignment?</p>
</blockquote>

<p>can be seen to be in $\Delta_2$, $\mathsf{UP}$-hard and $\mathsf{coNP}$-hard. Is anything more known about its complexity?</p>
 | complexity theory complexity classes satisfiability | 1 | Complexity of deciding if a formula has exactly 1 satisfying assignment -- (complexity theory complexity classes satisfiability)
<p>The decision problem</p>

<blockquote>
 <p>Given a Boolean formula $\phi$, does $\phi$ have exactly one satisfying assignment?</p>
</blockquote>

<p>can be seen to... | habedi/stack-exchange-dataset |
13,893 | How do computers create 'randomness'? | <p>I have just used a function 'rand()' in my algorithm. In fact, it was arc4random() that I used. However, it got me thinking, how is randomness created in a computer system? 
Can anything ever truly be random when it is produced by a computer?</p>
 | randomness | 1 | How do computers create 'randomness'? -- (randomness)
<p>I have just used a function 'rand()' in my algorithm. In fact, it was arc4random() that I used. However, it got me thinking, how is randomness created in a computer system? 
Can anything ever truly be random when it is produced by a computer?</p>
 | habedi/stack-exchange-dataset |
13,894 | What does it mean when a computer runs 'faster'? | <p>If you have two computers with only one thread, a and b.</p>

<p>And computer a runs twice as fast as computer b.</p>

<p>Does this mean that computer a and can do twice as many operations in a given time in comparison to computer b? </p>

<p>To increase the Hertz of a computer, i.e. the spee... | terminology performance | 1 | What does it mean when a computer runs 'faster'? -- (terminology performance)
<p>If you have two computers with only one thread, a and b.</p>

<p>And computer a runs twice as fast as computer b.</p>

<p>Does this mean that computer a and can do twice as many operations in a given time in comparison to c... | habedi/stack-exchange-dataset |
13,901 | What is the name of this combinator? | <p>I've recently started casually reading into combinatorial logic, and I noticed that a higher-order function that I regularly use is a combinator. This combinator is actually pretty useful (you can use it to define addition on polynomial equations, for example), but I never gave it a decent name. Does anyone recognis... | logic lambda calculus functional programming combinatory logic | 1 | What is the name of this combinator? -- (logic lambda calculus functional programming combinatory logic)
<p>I've recently started casually reading into combinatorial logic, and I noticed that a higher-order function that I regularly use is a combinator. This combinator is actually pretty useful (you can use it to defin... | habedi/stack-exchange-dataset |
13,912 | What's Big O of $\log(n+7)^{\log(n)}$? | <p>As part of my continual improvement plans, I'm reviewing algorithm analysis and I've hit a roadblock. I cannot figure out how to determine the Big O complexity of $\log(n+7)^{\log(n)}$. I've spent the last few days rolling this over in my head and I still haven't made any progress in solving it. Could someone tell m... | algorithms algorithm analysis asymptotics | 1 | What's Big O of $\log(n+7)^{\log(n)}$? -- (algorithms algorithm analysis asymptotics)
<p>As part of my continual improvement plans, I'm reviewing algorithm analysis and I've hit a roadblock. I cannot figure out how to determine the Big O complexity of $\log(n+7)^{\log(n)}$. I've spent the last few days rolling this ove... | habedi/stack-exchange-dataset |
13,918 | Show that A** subset of A*, where A is a regular language | <p>I do not understand the proof for this. I know that every word in $(A^*)^*$ is made up of words from $A^*$, and that this is made up from words in $A$. But how does this help with showing that $(A^*)^*$ is a subset of $A^*$.</p>
 | formal languages regular languages | 1 | Show that A** subset of A*, where A is a regular language -- (formal languages regular languages)
<p>I do not understand the proof for this. I know that every word in $(A^*)^*$ is made up of words from $A^*$, and that this is made up from words in $A$. But how does this help with showing that $(A^*)^*$ is a subset of $... | habedi/stack-exchange-dataset |
13,920 | Proof of Ramsey's theorem: the number of cliques or anti cliques in a graph | <p>Ramsey's theorem states that every graph with $n$ nodes contains either a clique or an independent set with at least $\frac{1}{2}\log_2 n$ nodes.</p>

<p>I tried to look it up at a few places (including Sipser) but I could not make out a lot of sense from the proofs. I would appreciate it if someone can give... | graphs proof techniques combinatorics discrete mathematics | 1 | Proof of Ramsey's theorem: the number of cliques or anti cliques in a graph -- (graphs proof techniques combinatorics discrete mathematics)
<p>Ramsey's theorem states that every graph with $n$ nodes contains either a clique or an independent set with at least $\frac{1}{2}\log_2 n$ nodes.</p>

<p>I tried to look... | habedi/stack-exchange-dataset |
13,923 | Formal language without grammar | <p>Definitions:</p>

<ul>
<li><em>Alphabet</em> $Σ$: finite, non-empty set</li>
<li><em>Language</em>: subset of $Σ^*$</li>
<li><em>Grammar</em>: <a href="http://en.wikipedia.org/wiki/Unrestricted_grammar" rel="nofollow">Unrestricted grammar (Chomsky Type 0)</a></li>
<li><em>Language of a gramma... | formal languages formal grammars | 1 | Formal language without grammar -- (formal languages formal grammars)
<p>Definitions:</p>

<ul>
<li><em>Alphabet</em> $Σ$: finite, non-empty set</li>
<li><em>Language</em>: subset of $Σ^*$</li>
<li><em>Grammar</em>: <a href="http://en.wikipedia.org/wiki/Unrestricted_grammar" rel="nofollow">Unrestric... | habedi/stack-exchange-dataset |
13,930 | Rearrange an array using swap with 0 | <p>This is a Google interview question. I got it from a website.</p>
<blockquote>
<p>You have two arrays <strong>source</strong> and <strong>target</strong>, containing two permutations of the numbers <code>[0..n-1]</code>. You would like to rearrange source so that it equals to target. The only allowed operati... | algorithms sorting permutations | 1 | Rearrange an array using swap with 0 -- (algorithms sorting permutations)
<p>This is a Google interview question. I got it from a website.</p>
<blockquote>
<p>You have two arrays <strong>source</strong> and <strong>target</strong>, containing two permutations of the numbers <code>[0..n-1]</code>. You would like... | habedi/stack-exchange-dataset |
13,937 | Which machine learning algorithms can be used for time series forecasts? | <p>Currently I am playing around with time series forecasts (specifically for Forex). I have seen some scientific papers about echo state networks which are applied to Forex forecast. Are there other good machine learning algorithms for this purpose?</p>

<p>It would also be interesting to extract "profitable" ... | reference request machine learning artificial intelligence | 1 | Which machine learning algorithms can be used for time series forecasts? -- (reference request machine learning artificial intelligence)
<p>Currently I am playing around with time series forecasts (specifically for Forex). I have seen some scientific papers about echo state networks which are applied to Forex forecast.... | habedi/stack-exchange-dataset |
13,943 | Classifying infinite languages of encodings of halting Turing machines | <p>Given this question:</p>
<blockquote>
<p><span class="math-container">$L$</span> is an infinite language of encoded Turing machines who always halt.</p>
<ol>
<li><span class="math-container">$L$</span> might be decidable</li>
<li><span class="math-container">$L$</span> might be in RE but not in R... | computability turing machines | 1 | Classifying infinite languages of encodings of halting Turing machines -- (computability turing machines)
<p>Given this question:</p>
<blockquote>
<p><span class="math-container">$L$</span> is an infinite language of encoded Turing machines who always halt.</p>
<ol>
<li><span class="math-container">$L$<... | habedi/stack-exchange-dataset |
13,947 | Good way to describe co-RE (co-recursively enumerable)? | <p>I get that R is a set of languages that are decidable by a Turing Machines</p>

<p>And that RE is a set of languages that a each language can be recognized by a TM, that is the machine will halt when given a word from that language and loop otherwise.</p>

<p>But I can't wrap my head around co-RE. I... | terminology computability | 1 | Good way to describe co-RE (co-recursively enumerable)? -- (terminology computability)
<p>I get that R is a set of languages that are decidable by a Turing Machines</p>

<p>And that RE is a set of languages that a each language can be recognized by a TM, that is the machine will halt when given a word from that... | habedi/stack-exchange-dataset |
13,954 | Looking for cheat sheet to J.C. Reynolds symbols | <p>Most specifically, his use of small epsilon introduced at the end of section 1 of "Types, Abstraction and Parametric Polymorphism" is throwing me, but in general I would like references to symbols in the Type and Logical Relations literature.</p>
 | terminology reference request type theory abstract data types | 1 | Looking for cheat sheet to J.C. Reynolds symbols -- (terminology reference request type theory abstract data types)
<p>Most specifically, his use of small epsilon introduced at the end of section 1 of "Types, Abstraction and Parametric Polymorphism" is throwing me, but in general I would like references to symbols in t... | habedi/stack-exchange-dataset |
13,955 | Why is the difference of two NP-complete languages not in NP? | <p>I found something in my notes I don't really understand, maybe you could help.</p>

<p>Let $A$ = Independent Set and $B$ = Clique. Then, we clearly have</p>

<ul>
<li>$A \in \mathsf{NPC}$ and</li>
<li>$B \in \mathsf{NP}$.</li>
</ul>

<p>Now, the claim is that $A \setminus B \notin... | complexity theory np complete np | 1 | Why is the difference of two NP-complete languages not in NP? -- (complexity theory np complete np)
<p>I found something in my notes I don't really understand, maybe you could help.</p>

<p>Let $A$ = Independent Set and $B$ = Clique. Then, we clearly have</p>

<ul>
<li>$A \in \mathsf{NPC}$ and</li>&... | habedi/stack-exchange-dataset |
13,956 | Why is this language involving reversal regular? | <p>For a language to be regular it needs to be recognized by DFA/NFA.</p>

<p>Let $L = \{ xy^rzyx^r \mid |x| , |y|, |z| \ge 1 \}$ over the alphabet $\{0,1\}$.</p>

<p>$x^r$ means the reverse of $x$.</p>

<p>A DFA has no memory, so how can it handle the reverse check?</p>
 | formal languages regular languages | 1 | Why is this language involving reversal regular? -- (formal languages regular languages)
<p>For a language to be regular it needs to be recognized by DFA/NFA.</p>

<p>Let $L = \{ xy^rzyx^r \mid |x| , |y|, |z| \ge 1 \}$ over the alphabet $\{0,1\}$.</p>

<p>$x^r$ means the reverse of $x$.</p>

<p>... | habedi/stack-exchange-dataset |
13,960 | Why is this language regular? | <p>If you could include your thought process in determining why it's regular it would help me a lot.</p>

<ul>
<li><p>$L_1 = (0^*(10)^*11)$</p></li>
<li><p>$L_2 = \{ \langle M \rangle \mid M \text{ is a Turing machine that halts on all inputs from }L_1 \}$</p></li>
<li><p>$L_3 = \{ x \in \{0,1\}^* \... | formal languages computability regular languages | 1 | Why is this language regular? -- (formal languages computability regular languages)
<p>If you could include your thought process in determining why it's regular it would help me a lot.</p>

<ul>
<li><p>$L_1 = (0^*(10)^*11)$</p></li>
<li><p>$L_2 = \{ \langle M \rangle \mid M \text{ is a Turing machine th... | habedi/stack-exchange-dataset |
13,977 | What would be the over all speed-up achieved? | <p>Suppose we are using a dual core processor and we run 2 applications (1 with 80% resource requirements and the other with 20% resource requirements).<br><br>Now the first program is parallelizable for 40% and the second one not parallelizable.<br><br>My question is what would be the speed up achieved in this case.<b... | parallel computing | 1 | What would be the over all speed-up achieved? -- (parallel computing)
<p>Suppose we are using a dual core processor and we run 2 applications (1 with 80% resource requirements and the other with 20% resource requirements).<br><br>Now the first program is parallelizable for 40% and the second one not parallelizable.<br>... | habedi/stack-exchange-dataset |
13,981 | Deciding if language is Context-Free | <p>I need help with deciding if $L$ is context-free.</p>

<p>$$L = \{a^pb^{q+r}c^sd^{q+t}e^{p+r} \mid p, q, r, s \ge 0\ , s > t\}$$</p>

<p>Can be rewritten into:</p>

<p>$$L = \{a^pb^qb^rc^sd^qd^te^pe^r \mid p, q, r, s \ge 0\ , s > t\}$$</p>

<p>When we see the first occurrence of... | formal languages context free | 1 | Deciding if language is Context-Free -- (formal languages context free)
<p>I need help with deciding if $L$ is context-free.</p>

<p>$$L = \{a^pb^{q+r}c^sd^{q+t}e^{p+r} \mid p, q, r, s \ge 0\ , s > t\}$$</p>

<p>Can be rewritten into:</p>

<p>$$L = \{a^pb^qb^rc^sd^qd^te^pe^r \mid p, q, r, s \... | habedi/stack-exchange-dataset |
13,988 | Can you do an in-place reversal of a string on a vanilla turing machine in time $o(n^2)$? | <p>By a vanilla Turing machine, I mean a Turing machine with one tape (no special input or output tapes).</p>

<p>The problem is as follows: the tape is initially empty, other than a string of $n$ $1$s and $0$s terminated by an end-of-string character. The tape head starts at the beginning of the string. The go... | complexity theory turing machines time complexity lower bounds | 1 | Can you do an in-place reversal of a string on a vanilla turing machine in time $o(n^2)$? -- (complexity theory turing machines time complexity lower bounds)
<p>By a vanilla Turing machine, I mean a Turing machine with one tape (no special input or output tapes).</p>

<p>The problem is as follows: the tape is i... | habedi/stack-exchange-dataset |
13,997 | Calculate the number of elements after multiplying/adding two polynomials | <p>Suppose I have two polynomials $f(x)$ and $g(x)$ and I somehow represent their coefficients.
I have a couple of ways to hold a polynomial depending on how many significant coefficients the polynomial has.
I want to determine the amount of significant coefficients in the results of
$f(x) + g(x)$ ,$f(x) \c... | algorithms time complexity optimization efficiency arithmetic | 1 | Calculate the number of elements after multiplying/adding two polynomials -- (algorithms time complexity optimization efficiency arithmetic)
<p>Suppose I have two polynomials $f(x)$ and $g(x)$ and I somehow represent their coefficients.
I have a couple of ways to hold a polynomial depending on how many significant ... | habedi/stack-exchange-dataset |
13,999 | Complexity of finding a spanning tree that minimizes the maximum interference | <p>Given $n$ nodes in the plane, connect the nodes by a spanning tree.
For each node $v$ we construct a disk centered at $v$ with radius equal to the distance to $v$’s furthest neighbor in the spanning tree. The <strong>interference</strong> of a node $v$ is then defined as the number of such disks that include the ... | complexity theory graphs computational geometry | 1 | Complexity of finding a spanning tree that minimizes the maximum interference -- (complexity theory graphs computational geometry)
<p>Given $n$ nodes in the plane, connect the nodes by a spanning tree.
For each node $v$ we construct a disk centered at $v$ with radius equal to the distance to $v$’s furthest neighbor... | habedi/stack-exchange-dataset |
14,002 | Count the number of integers satisfying two conditions using DP | <p>Given two integers $n$ and $m$, how many numbers exist such that all integers have all digits from $0$ to $n-1$, the difference between two adjacent digits is exactly $1$, and the number of digits in the integer is at most $m$?</p>

<p>The integer cannot start with a $0$. All digits from $0$ to $n-1$ must be... | algorithms combinatorics dynamic programming | 1 | Count the number of integers satisfying two conditions using DP -- (algorithms combinatorics dynamic programming)
<p>Given two integers $n$ and $m$, how many numbers exist such that all integers have all digits from $0$ to $n-1$, the difference between two adjacent digits is exactly $1$, and the number of digits in the... | habedi/stack-exchange-dataset |
14,004 | Is the DPLL algorithm complexity in terms of # of clauses or # of variables? | <p>I'm a bit confused how worst case complexity is estimated for the <a href="http://en.wikipedia.org/wiki/DPLL_algorithm" rel="nofollow">DPLL algorithm</a>. Is it in terms of number of clauses, number of variables, or something else?</p>
 | time complexity asymptotics | 1 | Is the DPLL algorithm complexity in terms of # of clauses or # of variables? -- (time complexity asymptotics)
<p>I'm a bit confused how worst case complexity is estimated for the <a href="http://en.wikipedia.org/wiki/DPLL_algorithm" rel="nofollow">DPLL algorithm</a>. Is it in terms of number of clauses, number of varia... | habedi/stack-exchange-dataset |
14,008 | Designing a DFA that accepts strings such that nth character from last satisfies condition | <p><em>This is a homework question, so I am only looking for hints.</em></p>

<p>I got a question in an assignment which states :</p>

<blockquote>
 <p>Design a DFA that accepts strings having 1 as the 4th character from the end, on the alphabet {0,1}</p>
</blockquote>

<p>I have been a... | formal languages regular languages finite automata | 1 | Designing a DFA that accepts strings such that nth character from last satisfies condition -- (formal languages regular languages finite automata)
<p><em>This is a homework question, so I am only looking for hints.</em></p>

<p>I got a question in an assignment which states :</p>

<blockquote>
 <p>... | habedi/stack-exchange-dataset |
14,019 | Classification of 2d arrays of outlines | <p>I am not experienced in machine learning but I have been looking at the Python toolklit <code>scikit-learn</code>. I have thousands of mammograms and I have written an algorithm to find the outline of the images. I have some cases where the outline of the mammogram is not correct. I would like to be able to take the... | machine learning data mining | 1 | Classification of 2d arrays of outlines -- (machine learning data mining)
<p>I am not experienced in machine learning but I have been looking at the Python toolklit <code>scikit-learn</code>. I have thousands of mammograms and I have written an algorithm to find the outline of the images. I have some cases where the ou... | habedi/stack-exchange-dataset |
14,022 | Theoretical foundations of Divide and Conquer | <p>When it comes to the design of algorithms, one often employs the following techniques:</p>

<ul>
<li>Dynamic Programming</li>
<li>The Greedy-Strategy</li>
<li>Divide-and-Conquer</li>
</ul>

<p>While for the first two methods, there are well-known theoretical foundations, namely the Be... | algorithms reference request divide and conquer | 1 | Theoretical foundations of Divide and Conquer -- (algorithms reference request divide and conquer)
<p>When it comes to the design of algorithms, one often employs the following techniques:</p>

<ul>
<li>Dynamic Programming</li>
<li>The Greedy-Strategy</li>
<li>Divide-and-Conquer</li>
</ul>
&... | habedi/stack-exchange-dataset |
14,026 | DFA - Equivalence classes | <p>I am preparing for my exam in formal languages and I need some help with one question from one old exam.</p>

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

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

<... | formal languages finite automata | 1 | DFA - Equivalence classes -- (formal languages finite automata)
<p>I am preparing for my exam in formal languages and I need some help with one question from one old exam.</p>

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

<p><img src="https://i.stack.imgur.c... | habedi/stack-exchange-dataset |
14,034 | Tag system variant | <p>Is there an "official" name for this slight variant of the well known <a href="http://en.wikipedia.org/wiki/Tag_system">Tag System</a> model of computation, and/or has it been used somewhere?</p>

<ul>
<li>a finite alphabet of symbols $\Sigma$</li>
<li>a halt symbol $H$</li>
<li>an ordered set of... | reference request computation models | 1 | Tag system variant -- (reference request computation models)
<p>Is there an "official" name for this slight variant of the well known <a href="http://en.wikipedia.org/wiki/Tag_system">Tag System</a> model of computation, and/or has it been used somewhere?</p>

<ul>
<li>a finite alphabet of symbols $\Sigma$<... | habedi/stack-exchange-dataset |
14,037 | Word classification algorithms | <p>I am looking for algorithms to classify words in a paragraph of text. I am particularly interested in a classification to determine if a certain word is noun, verb, etc., but also looking for any kind of word-classification algorithms. I am given a smaller input (e.g. 200 words) so there is no many options for machi... | machine learning natural language processing classification computational linguistics | 1 | Word classification algorithms -- (machine learning natural language processing classification computational linguistics)
<p>I am looking for algorithms to classify words in a paragraph of text. I am particularly interested in a classification to determine if a certain word is noun, verb, etc., but also looking for any... | habedi/stack-exchange-dataset |
14,038 | Difference between free and global variables | <p>Is there any difference between free variable and global variable? Or they are just synonyms? In which situations I should use one or another?</p>
 | terminology programming languages | 1 | Difference between free and global variables -- (terminology programming languages)
<p>Is there any difference between free variable and global variable? Or they are just synonyms? In which situations I should use one or another?</p>
 | habedi/stack-exchange-dataset |
14,043 | Number of binary trees with given height | <p>I was wondering how many binary trees we have with height of $h$ with $n$ nodes(another question is how many binary trees we have with height $ \lfloor{lg (n)}\rfloor$).</p>

<p>Edit: I forgot to add the number of nodes.</p>
 | data structures counting | 1 | Number of binary trees with given height -- (data structures counting)
<p>I was wondering how many binary trees we have with height of $h$ with $n$ nodes(another question is how many binary trees we have with height $ \lfloor{lg (n)}\rfloor$).</p>

<p>Edit: I forgot to add the number of nodes.</p>
 | habedi/stack-exchange-dataset |
14,044 | Is changing or appending data an idempotent operation? | <p>As far as I know idempotent operation is a operation that can be applied many times with the same effect. Also I learnt recently that updating a tuple in a database is also idempotent. I thought that an idempotent operation was like a read-only stateless call (thanks to HTTP world with its famous <code>GET</code> re... | terminology programming languages functional programming | 1 | Is changing or appending data an idempotent operation? -- (terminology programming languages functional programming)
<p>As far as I know idempotent operation is a operation that can be applied many times with the same effect. Also I learnt recently that updating a tuple in a database is also idempotent. I thought that ... | habedi/stack-exchange-dataset |
14,050 | DFA drawing for binary string with substrings of minimum length 3 with at least two zeroes in each substring | <p>In trying to gain a better understanding of finite state machines, I stumbled across this idea and have been confused as to how to approach this case in terms of a DFA.</p>

<blockquote>
 <p>The set of binary strings of length at least 3 where every substring
 of length 3 contains at least two 0s.<... | formal languages automata finite automata | 1 | DFA drawing for binary string with substrings of minimum length 3 with at least two zeroes in each substring -- (formal languages automata finite automata)
<p>In trying to gain a better understanding of finite state machines, I stumbled across this idea and have been confused as to how to approach this case in terms of... | habedi/stack-exchange-dataset |
14,066 | How to decribe an action with STRIPS? | <p>The state space is decribed with 3 boolean variables $p,q$ and $r$ (so we have 8 states total). We have an action, let's say $a$. Action $a$ can be executed when $p=\text{False}$ and $q=\text{True}$ and the result is $p=\text{True}$, $q=\text{False}$ and $r=\text{False}$</p>

<p>How can we describe this acti... | artificial intelligence | 1 | How to decribe an action with STRIPS? -- (artificial intelligence)
<p>The state space is decribed with 3 boolean variables $p,q$ and $r$ (so we have 8 states total). We have an action, let's say $a$. Action $a$ can be executed when $p=\text{False}$ and $q=\text{True}$ and the result is $p=\text{True}$, $q=\text{False}$... | habedi/stack-exchange-dataset |
14,068 | Difficulty in understanding an approach to SPOJ $d$-query problem | <p>I was trying to solve <a href="http://www.spoj.com/problems/DQUERY/" rel="nofollow">this problem on SPOJ</a>:</p>

<blockquote>
 <p>Given a sequence of $n$ numbers $a_1, a_2, \ldots, a_n$ and a number of $d$-queries. A $d$-query is a pair $(i, j)$, $(1 \leq i \leq j \leq n)$. For each $d$-query $(i, j)$... | algorithms | 1 | Difficulty in understanding an approach to SPOJ $d$-query problem -- (algorithms)
<p>I was trying to solve <a href="http://www.spoj.com/problems/DQUERY/" rel="nofollow">this problem on SPOJ</a>:</p>

<blockquote>
 <p>Given a sequence of $n$ numbers $a_1, a_2, \ldots, a_n$ and a number of $d$-queries. A $d$... | habedi/stack-exchange-dataset |
14,086 | Closing shapes at non-endpoints | <p>Consider how one would represent the following image in vector graphics:</p>

<p><img src="https://i.stack.imgur.com/h7E7D.png" alt="A heart shape with mirrored spiral tails at the bottom."></p>

<p>Pretty simple, right? The entire shape can be represented by a single path element.</p>

<p>B... | computational geometry graphics | 1 | Closing shapes at non-endpoints -- (computational geometry graphics)
<p>Consider how one would represent the following image in vector graphics:</p>

<p><img src="https://i.stack.imgur.com/h7E7D.png" alt="A heart shape with mirrored spiral tails at the bottom."></p>

<p>Pretty simple, right? The entire... | habedi/stack-exchange-dataset |
14,107 | Theory of multi-label classification | <p><a href="https://en.wikipedia.org/wiki/Multi-label_classification">Multi-label classification</a> is a machine-learning problem where each sample can have zero or more labels from a closed set of possible labels. This task has applications in several fields. For example, in dialog systems, each sentence that the hum... | machine learning correctness proof classification | 1 | Theory of multi-label classification -- (machine learning correctness proof classification)
<p><a href="https://en.wikipedia.org/wiki/Multi-label_classification">Multi-label classification</a> is a machine-learning problem where each sample can have zero or more labels from a closed set of possible labels. This task ha... | habedi/stack-exchange-dataset |
14,121 | Finding asymptotically tight bounds $\Theta$ of two procedures | <p>I would like to check time complexity of two procedures for which I am not totally convinced that I got it right. Now the first procedure is this:</p>

<pre><code>public static int c(int n) {
 int i, j, s = 0;
 if (n > 1) {
 for(i = 0; i < n; i*=2) {
 for(j = n; ... | algorithms algorithm analysis time complexity runtime analysis | 1 | Finding asymptotically tight bounds $\Theta$ of two procedures -- (algorithms algorithm analysis time complexity runtime analysis)
<p>I would like to check time complexity of two procedures for which I am not totally convinced that I got it right. Now the first procedure is this:</p>

<pre><code>public static i... | habedi/stack-exchange-dataset |
14,125 | Confusing equivalence $\Phi(n,n)\downarrow \Leftrightarrow \text{HALT}(n,n)$ | <p>Let $B$ be a recursive enumerable set and $B = W_n$, where $W_n = \{x \in \mathbb N \mid \Phi(x,n)\downarrow\}$ and $\Phi^{(n)}(x_1, \ldots, x_n, y)$ is the value of the function at the terminal snaphot.</p>

<p>There is a definition that leaves me really confused:
$$n \in W_n \Leftrightarrow \Phi(n,n)\d... | computability halting problem | 1 | Confusing equivalence $\Phi(n,n)\downarrow \Leftrightarrow \text{HALT}(n,n)$ -- (computability halting problem)
<p>Let $B$ be a recursive enumerable set and $B = W_n$, where $W_n = \{x \in \mathbb N \mid \Phi(x,n)\downarrow\}$ and $\Phi^{(n)}(x_1, \ldots, x_n, y)$ is the value of the function at the terminal snaphot.</... | habedi/stack-exchange-dataset |
14,133 | What's wrong with my beta reduction of pred c_0 on Church numerals? | <p>I'm trying to calculate $\text{pred}\, c_0$, where $\text{pred}$ is the previous church encoded number and $c_0$ is the number $0$ ($\lambda s. \lambda z. z$).</p>

<p>The formula for $\text{pred}$ is $\lambda n. \lambda s. \lambda z. n (\lambda g. \lambda h. h (g s))(\lambda u.z)(\lambda v.v)$</p>

... | lambda calculus church numerals | 1 | What's wrong with my beta reduction of pred c_0 on Church numerals? -- (lambda calculus church numerals)
<p>I'm trying to calculate $\text{pred}\, c_0$, where $\text{pred}$ is the previous church encoded number and $c_0$ is the number $0$ ($\lambda s. \lambda z. z$).</p>

<p>The formula for $\text{pred}$ is $\l... | habedi/stack-exchange-dataset |
14,135 | Solution for a combinatorial minimization problem | <p>Let's say we have an inequality, $p \le {a \choose b}$ where $p$ is a fixed constant and $a, b$ are variables. The problem is that, we are trying to find the minimum $a$ with respect to the inequality $p \le {a \choose b}$. Is there a closed form solution (can be approximate as well/doesn't have to be exact) for tha... | optimization combinatorics | 1 | Solution for a combinatorial minimization problem -- (optimization combinatorics)
<p>Let's say we have an inequality, $p \le {a \choose b}$ where $p$ is a fixed constant and $a, b$ are variables. The problem is that, we are trying to find the minimum $a$ with respect to the inequality $p \le {a \choose b}$. Is there a ... | habedi/stack-exchange-dataset |
14,142 | Is CS more like software and CE more like hardware? | <p>At my university, a degree is "Computer Science and Engineering" but at US universities I understand that the degrees are different so what is the fundamental difference? Is computer engineering lower level like hardware and operating systems while computer science is more like language technologies?</p>
 | terminology education | 1 | Is CS more like software and CE more like hardware? -- (terminology education)
<p>At my university, a degree is "Computer Science and Engineering" but at US universities I understand that the degrees are different so what is the fundamental difference? Is computer engineering lower level like hardware and operating sys... | habedi/stack-exchange-dataset |
14,147 | Complete graph invariant | <p>Does anybody know whether the multiset of the determinants (possibly together with the order of the submatrix they refer to) of all the principal minors of the (symmetric) adjacency matrix of a graph is a complete invariant for graph isomorphism (i.e. that multiset uniquely identifies a graph up to isomorphism)?</p>... | graphs graph isomorphism | 1 | Complete graph invariant -- (graphs graph isomorphism)
<p>Does anybody know whether the multiset of the determinants (possibly together with the order of the submatrix they refer to) of all the principal minors of the (symmetric) adjacency matrix of a graph is a complete invariant for graph isomorphism (i.e. that multi... | habedi/stack-exchange-dataset |
14,150 | Is there a correlation of zip compression ratio and density of information provided by a text? | <p>I'll phrase my question using an intuitive and rather extreme example:</p>

<p><strong>Is the expected compression ratio (using zip compression) of a children's book higher than that of a novel written for adults?</strong></p>

<p>I read somewhere that specifically the compression ratio for zip compr... | information theory data compression | 1 | Is there a correlation of zip compression ratio and density of information provided by a text? -- (information theory data compression)
<p>I'll phrase my question using an intuitive and rather extreme example:</p>

<p><strong>Is the expected compression ratio (using zip compression) of a children's book higher ... | habedi/stack-exchange-dataset |
14,158 | How hard is factoring a complex number? | <p>Given complex number $C=a+ib$, I want to find two complex numbers $C_1=x+iy$ and $C_2=z+iw$ such that $C=C_1*C_2$ (a,b,x,y, z and w are all non zero integers). This problem is at least as hard as Integer factoring. Prime complex number has one as its only factor.</p>

<p>Does this problem reduce to integer f... | complexity theory number theory factoring | 1 | How hard is factoring a complex number? -- (complexity theory number theory factoring)
<p>Given complex number $C=a+ib$, I want to find two complex numbers $C_1=x+iy$ and $C_2=z+iw$ such that $C=C_1*C_2$ (a,b,x,y, z and w are all non zero integers). This problem is at least as hard as Integer factoring. Prime complex n... | habedi/stack-exchange-dataset |
14,159 | Determine if this language is regular | <p>Let $L = \{xyx \mid \text{ for some }x,y \in \{0,1\}^+\}$. Is this language regular?</p>

<p>So I was trying to construct a DFA, but I don't how to do this with this language.</p>
 | formal languages regular languages | 1 | Determine if this language is regular -- (formal languages regular languages)
<p>Let $L = \{xyx \mid \text{ for some }x,y \in \{0,1\}^+\}$. Is this language regular?</p>

<p>So I was trying to construct a DFA, but I don't how to do this with this language.</p>
 | habedi/stack-exchange-dataset |
14,165 | Showing NP-hardness of HALF-SAT | <p>Yesterday I wrote my undergraduate exam in complexity theory. I had to leave off one question, which bugs me since then. Consider:
$$ HALF-SAT = \{ \varphi \mid \varphi \text{ is a formula which is satisfied by at least half of all assignments }\} $$
I'd like to know how I can prove NP-hardness.</p>

... | complexity theory reductions np hard | 1 | Showing NP-hardness of HALF-SAT -- (complexity theory reductions np hard)
<p>Yesterday I wrote my undergraduate exam in complexity theory. I had to leave off one question, which bugs me since then. Consider:
$$ HALF-SAT = \{ \varphi \mid \varphi \text{ is a formula which is satisfied by at least half of all assignm... | habedi/stack-exchange-dataset |
14,180 | Decide if L is regular or not and argue it. Trying to use Pumping Lemma | <p>Part (a): Let $L = \{x \in \{0,1\}^* \mid \#0(x) \neq 4\times\#1(x)\}$, where $\#0(x)$ means the number of 0 in string $x$ and $\#1(x)$ means the number of 1 in string $x$.</p>

<p>So I want to use the pumping lemma. But I'm having a hard time choosing a string so that I can show that it is not regular.</p>... | formal languages regular languages pumping lemma | 1 | Decide if L is regular or not and argue it. Trying to use Pumping Lemma -- (formal languages regular languages pumping lemma)
<p>Part (a): Let $L = \{x \in \{0,1\}^* \mid \#0(x) \neq 4\times\#1(x)\}$, where $\#0(x)$ means the number of 0 in string $x$ and $\#1(x)$ means the number of 1 in string $x$.</p>

<p>S... | habedi/stack-exchange-dataset |
14,191 | Where are back edges in a DFS tree? | <p>As I understand it when doing a DFS run when every new node is discovered and edge is added to the DFS tree from the parent of the new node to the new node. If that's the case how are back edges are created?</p>
 | terminology graphs | 1 | Where are back edges in a DFS tree? -- (terminology graphs)
<p>As I understand it when doing a DFS run when every new node is discovered and edge is added to the DFS tree from the parent of the new node to the new node. If that's the case how are back edges are created?</p>
 | habedi/stack-exchange-dataset |
14,192 | Is $L_{half} = \{w : \text{for some } z \in L, x \in \Sigma^*, z = wx \wedge |w| = |x| \} $ regular? | <p>Suppose we have some regular language $L$, then can we say that $$L_{half} = \{w : \text{for some } z \in L, x \in \Sigma^*, z = wx \wedge |w| = |x| \} $$ 
is also regular? </p>

<p>I have a 'feeling' that it is, but I can't sketch a proof for it.</p>
 | regular languages automata | 1 | Is $L_{half} = \{w : \text{for some } z \in L, x \in \Sigma^*, z = wx \wedge |w| = |x| \} $ regular? -- (regular languages automata)
<p>Suppose we have some regular language $L$, then can we say that $$L_{half} = \{w : \text{for some } z \in L, x \in \Sigma^*, z = wx \wedge |w| = |x| \} $$ 
is also regular? </p>&#x... | habedi/stack-exchange-dataset |
14,198 | Sort algorithm input probabilities | <p>Suppose that there is an algorithm which sorts a sequence of $n$ elements</p>

<p>$$a_1, a_2, ..., a_n$$</p>

<p>Each of the $a_i$ is chosen with probability $1/k$ from a set of $k$ distinct integer numbers. </p>

<p>Is it true, given that $k \to \infty$, that:</p>

<ol>
<li>The p... | probability theory sorting | 1 | Sort algorithm input probabilities -- (probability theory sorting)
<p>Suppose that there is an algorithm which sorts a sequence of $n$ elements</p>

<p>$$a_1, a_2, ..., a_n$$</p>

<p>Each of the $a_i$ is chosen with probability $1/k$ from a set of $k$ distinct integer numbers. </p>

<p>Is it tru... | habedi/stack-exchange-dataset |
14,200 | Splay tree with odd number of rotations | <p>When inserting an item into a splay tree, rotations are performed in pairs based on either a zig-zag or zig-zig pattern. When there is an odd number of rotations to be performed, one could either do the extra rotation beginning at the leaf or save the extra rotation and do it at the root. Does it matter?</p>
&#x... | data structures binary trees splay trees | 1 | Splay tree with odd number of rotations -- (data structures binary trees splay trees)
<p>When inserting an item into a splay tree, rotations are performed in pairs based on either a zig-zag or zig-zig pattern. When there is an odd number of rotations to be performed, one could either do the extra rotation beginning at ... | habedi/stack-exchange-dataset |
14,208 | Set combination data structure (And storage complexity) | <p>I have already posted this question on <a href="https://stackoverflow.com/questions/18669727/set-combination-data-structure-and-storage-complexity">Stackoverflow</a>, but I'm starting to think that this is the right place.</p>

<p>I have a problem where I am required to associate unique combinations from a s... | data structures space complexity sets | 1 | Set combination data structure (And storage complexity) -- (data structures space complexity sets)
<p>I have already posted this question on <a href="https://stackoverflow.com/questions/18669727/set-combination-data-structure-and-storage-complexity">Stackoverflow</a>, but I'm starting to think that this is the right pl... | habedi/stack-exchange-dataset |
14,209 | Probability that a uniformly random sequence is already sorted | <p>Now I tried tackling this question from different perspectives (and already asked a couple of questions here and there), but perhaps only now can I formulate it well and ask you (since I have no good ideas).</p>

<p>Let there be $k, n \in\mathbb{Z_+}$. These are fixed.</p>

<p>Consider a set of $k$ i... | combinatorics probability theory sorting | 1 | Probability that a uniformly random sequence is already sorted -- (combinatorics probability theory sorting)
<p>Now I tried tackling this question from different perspectives (and already asked a couple of questions here and there), but perhaps only now can I formulate it well and ask you (since I have no good ideas).<... | habedi/stack-exchange-dataset |
14,215 | Machines in P undecidable? | <p>Given a Turing machine $M$, we say that $L(M) \in P$ if the language decided by the machine can be decided by some machine in polynomial time. We say that $M \in P$ if the machine runs in polynomial time. Note that there can be machines that run needlessly long but still decide a language in $P$. By Rice's theorem, ... | computability time complexity turing machines | 1 | Machines in P undecidable? -- (computability time complexity turing machines)
<p>Given a Turing machine $M$, we say that $L(M) \in P$ if the language decided by the machine can be decided by some machine in polynomial time. We say that $M \in P$ if the machine runs in polynomial time. Note that there can be machines th... | habedi/stack-exchange-dataset |
14,223 | Time Complexity for Creating a Graph from a File | <p>Assume that I have a file that consists of pairs of numbers separated by a space. These numbers are the labels for vertices in my graph. For example:</p>

<pre><code>0 5
0 7
2 3
4 5
1 5
.
.
.
</code></pre>

<p>I want to create a graph (adjacency list) by reading this f... | algorithms graphs algorithm analysis runtime analysis | 1 | Time Complexity for Creating a Graph from a File -- (algorithms graphs algorithm analysis runtime analysis)
<p>Assume that I have a file that consists of pairs of numbers separated by a space. These numbers are the labels for vertices in my graph. For example:</p>

<pre><code>0 5
0 7
2 3
4 5
1 5... | habedi/stack-exchange-dataset |
14,226 | Fundamental Boolean Functions | <p>I can define any boolean function (I think) using <strong>and</strong> and <strong>not</strong>, or using <strong>or</strong> and <strong>not</strong> (plus a constant 0 or 1). And I can define <strong>or</strong> in terms of <strong>xor</strong>. And then there are <strong>nor</strong> and <strong>nand</strong>. ... | logic | 1 | Fundamental Boolean Functions -- (logic)
<p>I can define any boolean function (I think) using <strong>and</strong> and <strong>not</strong>, or using <strong>or</strong> and <strong>not</strong> (plus a constant 0 or 1). And I can define <strong>or</strong> in terms of <strong>xor</strong>. And then there are <strong... | habedi/stack-exchange-dataset |
14,233 | Why is compression ratio using bzip2 for a sequence of "a"s so jumpy? | <pre><code>library(ggplot2)

compress <- function(str) {
 length(memCompress(paste(rep("a", str), collapse=""), type="bzip2"))
 / nchar(paste(rep("a", str), collapse=""))
}

cr <- data.frame(i = 1:10000, r = sapply(1:10000, compress))

ggplot(cr[cr$i>=5000 & cr$i<=1... | data compression | 1 | Why is compression ratio using bzip2 for a sequence of "a"s so jumpy? -- (data compression)
<pre><code>library(ggplot2)

compress <- function(str) {
 length(memCompress(paste(rep("a", str), collapse=""), type="bzip2"))
 / nchar(paste(rep("a", str), collapse=""))
}

cr <- data.frame(i... | habedi/stack-exchange-dataset |
14,234 | Pattern bonding problem | <blockquote>
 <p>Let $\Sigma = {1,2,3,4}$ . We say that symbol $\sigma $ bonds with
 symbol $\tau$ if $\sigma = \tau$ of $\sigma = \tau +1$ for even
 $\sigma$ and $\sigma = \tau -1$ for odd $\sigma$ . In other words , 1
 and 2 bond , and 3 and 4 bond (in addition to every number bonding
 w... | algorithms pattern recognition | 1 | Pattern bonding problem -- (algorithms pattern recognition)
<blockquote>
 <p>Let $\Sigma = {1,2,3,4}$ . We say that symbol $\sigma $ bonds with
 symbol $\tau$ if $\sigma = \tau$ of $\sigma = \tau +1$ for even
 $\sigma$ and $\sigma = \tau -1$ for odd $\sigma$ . In other words , 1
 and 2 bond , a... | habedi/stack-exchange-dataset |
14,239 | Deriving the Sobel equations from derivatives | <p>Many sites give the <a href="http://en.wikipedia.org/wiki/Sobel_operator">Sobel operators</a> as the convolution mask for smoothing an image. However, I haven't found a single site that describes how you can derive the operators from partial first derivatives. If anyone can explain the derivation, I would highly app... | image processing computer vision | 1 | Deriving the Sobel equations from derivatives -- (image processing computer vision)
<p>Many sites give the <a href="http://en.wikipedia.org/wiki/Sobel_operator">Sobel operators</a> as the convolution mask for smoothing an image. However, I haven't found a single site that describes how you can derive the operators from... | habedi/stack-exchange-dataset |
14,240 | Why do you have to worry about cache coherence if you are using shared memory? | <p>Wikipedia says that <a href="https://en.wikipedia.org/wiki/Shared_memory" rel="nofollow">shared memory</a> comes with lots of costs associated with cache coherence costs. But I thought the whole idea of shared memory is that all the CPUs access the same memory? So if one CPU changes that memory then other CPUs would... | computer architecture distributed systems parallel computing | 1 | Why do you have to worry about cache coherence if you are using shared memory? -- (computer architecture distributed systems parallel computing)
<p>Wikipedia says that <a href="https://en.wikipedia.org/wiki/Shared_memory" rel="nofollow">shared memory</a> comes with lots of costs associated with cache coherence costs. B... | habedi/stack-exchange-dataset |
14,248 | What is the significance of negative weight edges in a graph? | <p>I was doing dynamic programming exercises and found the Floyd-Warshall algorithm. Apparently it finds all-pairs shortest paths for a graph which can have negative weight edges, but no negative cycles.</p>

<p>So, I wonder what's the real world significance of negative weight edges? A plain English explanatio... | algorithms graphs | 1 | What is the significance of negative weight edges in a graph? -- (algorithms graphs)
<p>I was doing dynamic programming exercises and found the Floyd-Warshall algorithm. Apparently it finds all-pairs shortest paths for a graph which can have negative weight edges, but no negative cycles.</p>

<p>So, I wonder wh... | habedi/stack-exchange-dataset |
14,250 | Runtime of various versions of binary search | <p>I was given the following code and was told to find the best and worst case running times in big theta notation. (Below is in python)</p>

<pre><code>def find(a, target):
 x = 0
 y = len(a)
 while x < y:
 m = (x+y)/2
 if a[m] < target:
 x = m+1&... | algorithm analysis runtime analysis | 1 | Runtime of various versions of binary search -- (algorithm analysis runtime analysis)
<p>I was given the following code and was told to find the best and worst case running times in big theta notation. (Below is in python)</p>

<pre><code>def find(a, target):
 x = 0
 y = len(a)
 while x <... | habedi/stack-exchange-dataset |
14,251 | Which problems are hard for P^NP? | <p>Quantified Boolean formulae are the prime examples of problems that are hard for the polynomial hierarchy, i.e., for the $\Pi$ and $\Sigma$ versions of it. However, there is also the $\Delta$ version, defined as $\Delta_{i+1}^{\rm P} := {\rm P}^{\Sigma_i^{\rm P}}$. In particular, $\Delta_2^{\rm P} = {\rm P}^{\rm NP}... | complexity theory oracle machines | 1 | Which problems are hard for P^NP? -- (complexity theory oracle machines)
<p>Quantified Boolean formulae are the prime examples of problems that are hard for the polynomial hierarchy, i.e., for the $\Pi$ and $\Sigma$ versions of it. However, there is also the $\Delta$ version, defined as $\Delta_{i+1}^{\rm P} := {\rm P}... | habedi/stack-exchange-dataset |
14,264 | Tight asymptotic bound for recursive algorithm | <p>I have this algorithm where:</p>

<p>$$
T(n) =
\begin{cases}
 1 & \text{if}\; n \le 1 \\
 T(n/2) + 1 & \text{otherwise} \\
\end{cases}
$$</p>

<p>So, evaluating for $T(0), T(1), T(2), T(3), \ldots, T(n)$, I'm getting values like:
$$ 1, 1, 2, 2, 3, 3, \ldots, n, n... | algorithm analysis asymptotics recursion | 1 | Tight asymptotic bound for recursive algorithm -- (algorithm analysis asymptotics recursion)
<p>I have this algorithm where:</p>

<p>$$
T(n) =
\begin{cases}
 1 & \text{if}\; n \le 1 \\
 T(n/2) + 1 & \text{otherwise} \\
\end{cases}
$$</p>

<p>So, evaluating for $T(0), T(... | habedi/stack-exchange-dataset |
14,275 | Do different variants of Mergesort have different runtime? | <p>One of my courses introduced the following question:</p>
<blockquote>
<p>Given the recurrence relation for mergesort:</p>
<p><span class="math-container">$T(n) = 2T(n/2) + n$</span></p>
<p>How would the following parameter passing strategies influence the relation and running time of the algorithm:</... | algorithms algorithm analysis runtime analysis recurrence relation sorting | 1 | Do different variants of Mergesort have different runtime? -- (algorithms algorithm analysis runtime analysis recurrence relation sorting)
<p>One of my courses introduced the following question:</p>
<blockquote>
<p>Given the recurrence relation for mergesort:</p>
<p><span class="math-container">$T(n) = 2T(n... | habedi/stack-exchange-dataset |
14,278 | $\mathsf{co\text{-}NP}$ and Cook reductions | <p>Can someone help me understand the steps in this argument? There is a decision problem that is in $\mathsf{co\text{-}NP}$ (under standard Karp reductions) and is $\mathsf{NP}$-hard with respect to Cook reductions. Does this imply that if it is in $\mathsf{NP}$ then $\mathsf{NP} = \mathsf{co\text{-}NP}$ and if so, wh... | complexity theory reductions np hard | 1 | $\mathsf{co\text{-}NP}$ and Cook reductions -- (complexity theory reductions np hard)
<p>Can someone help me understand the steps in this argument? There is a decision problem that is in $\mathsf{co\text{-}NP}$ (under standard Karp reductions) and is $\mathsf{NP}$-hard with respect to Cook reductions. Does this imply t... | habedi/stack-exchange-dataset |
14,280 | Name for concept: each pair of sets is either nested or disjoint | <p>Does this property have a name?</p>

<blockquote>
 <p>Given a collection of sets $\mathcal{P}$, for all pairs $A, B\in\mathcal{P}$, either $A\cap B=\emptyset$ or $A\subseteq B$ or $B\subseteq A$.</p>
</blockquote>

<p>This concept could equally apply to monoids, groups, partial orders or o... | terminology sets | 1 | Name for concept: each pair of sets is either nested or disjoint -- (terminology sets)
<p>Does this property have a name?</p>

<blockquote>
 <p>Given a collection of sets $\mathcal{P}$, for all pairs $A, B\in\mathcal{P}$, either $A\cap B=\emptyset$ or $A\subseteq B$ or $B\subseteq A$.</p>
</blockquot... | habedi/stack-exchange-dataset |
14,289 | High maths for game theory | <p>I am a starting Ph.D. student in computer science, and I am trying to understand some classic game-theory papers, such as those by Nash, Kalai and Smorodinsky. But I find it hard to understand the mathematical parts. It seems that these papers were written by mathematicians, for mathematicians.</p>

<p>Can... | reference request game theory mathematical analysis | 1 | High maths for game theory -- (reference request game theory mathematical analysis)
<p>I am a starting Ph.D. student in computer science, and I am trying to understand some classic game-theory papers, such as those by Nash, Kalai and Smorodinsky. But I find it hard to understand the mathematical parts. It seems that ... | habedi/stack-exchange-dataset |
14,291 | finger search on a red black tree | <p>I'm having trouble finding materials on what 'finger search' is, in the context of a red black tree.</p>

<p>Even Wikipedia has a very short page about that, could you refer me or explain what kind of search is that.</p>
 | terminology data structures search trees | 1 | finger search on a red black tree -- (terminology data structures search trees)
<p>I'm having trouble finding materials on what 'finger search' is, in the context of a red black tree.</p>

<p>Even Wikipedia has a very short page about that, could you refer me or explain what kind of search is that.</p>
 | habedi/stack-exchange-dataset |
14,295 | Why does the map function in MapReduce take two parameters? | <p>I am playing around with MapReduce and wanted to ask why the <code>map</code> function takes two inputs <code>(key, value)</code>? Why not just pass along the value? </p>

<p>Specifically, if you look at the <a href="http://en.wikipedia.org/wiki/MapReduce#Examples" rel="nofollow">word count example on Wikipe... | terminology programming languages parallel computing | 1 | Why does the map function in MapReduce take two parameters? -- (terminology programming languages parallel computing)
<p>I am playing around with MapReduce and wanted to ask why the <code>map</code> function takes two inputs <code>(key, value)</code>? Why not just pass along the value? </p>

<p>Specifically, if... | habedi/stack-exchange-dataset |
14,298 | Time Complexity of Algorithm | <p>I need help with finding out the time complexity of the following algorithm:</p>

<pre><code>procedure VeryOdd(integer n):
for i from 1 to n do
 if i is odd then
 for j from i to n do
 x = x + 1
 for j from 1 to i do
 y = y + 1
</code></pre>

<p>This is my... | algorithms algorithm analysis runtime analysis | 1 | Time Complexity of Algorithm -- (algorithms algorithm analysis runtime analysis)
<p>I need help with finding out the time complexity of the following algorithm:</p>

<pre><code>procedure VeryOdd(integer n):
for i from 1 to n do
 if i is odd then
 for j from i to n do
 x = x + 1
 ... | habedi/stack-exchange-dataset |
14,308 | If someone was designing a computer language, why would they require static members to be defined outside the class? | <p>I am new to C++ and just <a href="http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/cplr038.htm" rel="nofollow">learned</a> that "The declaration of a static data member in the member list of a class is not a definition. You must define the static member outsi... | programming languages | 1 | If someone was designing a computer language, why would they require static members to be defined outside the class? -- (programming languages)
<p>I am new to C++ and just <a href="http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/language/ref/cplr038.htm" rel="nofollow">lear... | habedi/stack-exchange-dataset |
14,311 | Find all intervals that overlap with a given interval | <p>Note: I moved this question from <a href="https://stackoverflow.com/questions/18804045/find-all-intervals-s-e-where-s-e-in-n-0-and-s-e-that-overlap-with-another-gi">stackoverflow.com</a></p>

<p>I have an algorithmic problem where I would like to see if it can be solved in better than $O(n)$:</p>

<p... | algorithms search algorithms | 1 | Find all intervals that overlap with a given interval -- (algorithms search algorithms)
<p>Note: I moved this question from <a href="https://stackoverflow.com/questions/18804045/find-all-intervals-s-e-where-s-e-in-n-0-and-s-e-that-overlap-with-another-gi">stackoverflow.com</a></p>

<p>I have an algorithmic prob... | habedi/stack-exchange-dataset |
14,323 | Prove or disprove whether L is regular | <p>Let $\Sigma = \{0,1\}$. For every word $w \in \Sigma^*$, let $|w|_0$ and $|w|_1$ denote the count of 0's and 1's, respectively, in $w$. Let $L$ be the language
$$L = \{ w \in \Sigma^* \mid |w|_0 \gt |w|_1 + 2 \text{ or } |w|_1 \gt |w|_0 + 2\}$$
Prove or disprove whether $L$ is regular.</p>
 | formal languages regular languages | 1 | Prove or disprove whether L is regular -- (formal languages regular languages)
<p>Let $\Sigma = \{0,1\}$. For every word $w \in \Sigma^*$, let $|w|_0$ and $|w|_1$ denote the count of 0's and 1's, respectively, in $w$. Let $L$ be the language
$$L = \{ w \in \Sigma^* \mid |w|_0 \gt |w|_1 + 2 \text{ or } |w|_1 \gt |w|... | habedi/stack-exchange-dataset |
14,326 | Trouble understanding how to pick constants to prove big theta | <p>So I'm reading Introductions to Algorithms and sometimes I wish it would be a little bit more friendly with how it explains topics. One of these topics is proving big-theta. </p>

<p>I understand that the definition of $\Theta$ is as follows: </p>

<blockquote>
 <p>$\Theta(g(n)) = f(n)$ if there... | complexity theory asymptotics | 1 | Trouble understanding how to pick constants to prove big theta -- (complexity theory asymptotics)
<p>So I'm reading Introductions to Algorithms and sometimes I wish it would be a little bit more friendly with how it explains topics. One of these topics is proving big-theta. </p>

<p>I understand that the defini... | habedi/stack-exchange-dataset |
14,339 | Is $\Theta$ symmetric? | <p>For example if 
$$ f(x)= \Theta (g(x)) $$</p>

<p>from the definition of the theta notation, there exist c1 and c2 constants such that</p>

<p>$$c_1 g(x) \le f(x) \le c_2 g(x)$$</p>

<p>then if only we took the constants $1/c_1$ and $1/c_2$ we could say from the definition that </p>
&... | asymptotics landau notation | 1 | Is $\Theta$ symmetric? -- (asymptotics landau notation)
<p>For example if 
$$ f(x)= \Theta (g(x)) $$</p>

<p>from the definition of the theta notation, there exist c1 and c2 constants such that</p>

<p>$$c_1 g(x) \le f(x) \le c_2 g(x)$$</p>

<p>then if only we took the constants $1/c_1$ and ... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.