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 |
|---|---|---|---|---|---|---|
33,685 | Prove existence of different programs printing each other code | <p>How to prove that there exist two different programs A and B such that A printing code of B and B printing code of A without giving actual examples of such programs?</p>
 | computability | 1 | Prove existence of different programs printing each other code -- (computability)
<p>How to prove that there exist two different programs A and B such that A printing code of B and B printing code of A without giving actual examples of such programs?</p>
 | habedi/stack-exchange-dataset |
33,696 | Minimize sum of squared error | <p>I have an array of real numbers, I want to partition them into k sets. In each set, I calculate the sum of squared error. Then, I add up all the sum of squared error for all the set. I want to minimize this number. For example:</p>

<p>1 3 5 9</p>

<p>if k=2, I would partition them into (1 3 5) and (... | algorithms optimization sets partitions real numbers | 1 | Minimize sum of squared error -- (algorithms optimization sets partitions real numbers)
<p>I have an array of real numbers, I want to partition them into k sets. In each set, I calculate the sum of squared error. Then, I add up all the sum of squared error for all the set. I want to minimize this number. For example:</... | habedi/stack-exchange-dataset |
33,697 | Partition partition with constraint of equal size | <p>I see the problem <a href="https://math.stackexchange.com/questions/216865/polynomial-complexity-algorithm-of-partition-problem-with-sets-of-equal-size">here</a> which is the well know partition problem but with constraint that the size of both sets must be equal.</p>

<p>I look at the answer and I don't und... | algorithms partition problem pseudo polynomial | 1 | Partition partition with constraint of equal size -- (algorithms partition problem pseudo polynomial)
<p>I see the problem <a href="https://math.stackexchange.com/questions/216865/polynomial-complexity-algorithm-of-partition-problem-with-sets-of-equal-size">here</a> which is the well know partition problem but with con... | habedi/stack-exchange-dataset |
33,703 | Making a conjecture of a closed form | <p>There's a formula given $$
 T(m,n) = \left\{ 
 \begin{array}{l l}
 1 & \quad \text{if $m=0$}\\
 1+T(n \mod m, m) & \quad \text{if $m>0$}
 \end{array} \right.$$
We're told to use repeated substitution to make a conjecture about a closed form for $T(F(n),F(n+1))$, where $F(k)... | recurrence relation | 1 | Making a conjecture of a closed form -- (recurrence relation)
<p>There's a formula given $$
 T(m,n) = \left\{ 
 \begin{array}{l l}
 1 & \quad \text{if $m=0$}\\
 1+T(n \mod m, m) & \quad \text{if $m>0$}
 \end{array} \right.$$
We're told to use repeated substitution to make a co... | habedi/stack-exchange-dataset |
33,705 | Show that the following family of hash functions is $2$-wise independent but not $3$-wise independent | <p>I've really been thinking about and working on this problem for a while, and I would appreciate if someone could offer any help towards the solution.</p>

<blockquote>
 <p>Consider the following family of hash functions that map $w$-bit
 numbers to $l$-bit numbers (i.e. the range is $\{0,...,m-1\}$... | data structures probability theory hash hash tables | 1 | Show that the following family of hash functions is $2$-wise independent but not $3$-wise independent -- (data structures probability theory hash hash tables)
<p>I've really been thinking about and working on this problem for a while, and I would appreciate if someone could offer any help towards the solution.</p>
... | habedi/stack-exchange-dataset |
33,712 | The communication complexity of non-equality | <p>I'm familiar with the fooling set technique to obtain lower bounds for communication complexity protocols. The most basic example is the equality function for which the <a href="http://en.wikipedia.org/wiki/Communication_complexity#Example:_EQ" rel="nofollow">diagonal matrix</a> gives the fooling set of size $2^n$, ... | algorithms nondeterminism communication complexity | 1 | The communication complexity of non-equality -- (algorithms nondeterminism communication complexity)
<p>I'm familiar with the fooling set technique to obtain lower bounds for communication complexity protocols. The most basic example is the equality function for which the <a href="http://en.wikipedia.org/wiki/Communica... | habedi/stack-exchange-dataset |
33,715 | Why is Steiner Tree trivially in NP? | <p>I'm learning about NP-completeness, and many reduction proofs start off by stating that a problem is triviallyin NP. But I can't seem to wrap my head around this.</p>

<p>Why is this so?</p>
 | np complete np | 1 | Why is Steiner Tree trivially in NP? -- (np complete np)
<p>I'm learning about NP-completeness, and many reduction proofs start off by stating that a problem is triviallyin NP. But I can't seem to wrap my head around this.</p>

<p>Why is this so?</p>
 | habedi/stack-exchange-dataset |
33,719 | Why do relational databases use 2PC for distributed transactions over the likes of Paxos? | <p>Paxos is more powerful and in the famous writing "Consensus on Transaction Commit" : <a href="http://research.microsoft.com/pubs/64636/tr-2003-96.pdf">http://research.microsoft.com/pubs/64636/tr-2003-96.pdf</a>, Jim Gray and Leslie Lamport describe 2PC as a special case of Paxos.</p>

<p>Why do relational da... | distributed systems database theory | 1 | Why do relational databases use 2PC for distributed transactions over the likes of Paxos? -- (distributed systems database theory)
<p>Paxos is more powerful and in the famous writing "Consensus on Transaction Commit" : <a href="http://research.microsoft.com/pubs/64636/tr-2003-96.pdf">http://research.microsoft.com/pubs/... | habedi/stack-exchange-dataset |
33,730 | Cache Direct Map (Index, tag, hit/miss) | <p>Alright, I thought I understood this concept but now I am confused. I looked up similar problems and their solutions to practice, and that's what threw me off. The question is a homework problem which says: </p>

<p>Below is a list of 32-bit memory address references, given as word addresses. </p>

<... | computer architecture cpu cache | 1 | Cache Direct Map (Index, tag, hit/miss) -- (computer architecture cpu cache)
<p>Alright, I thought I understood this concept but now I am confused. I looked up similar problems and their solutions to practice, and that's what threw me off. The question is a homework problem which says: </p>

<p>Below is a list ... | habedi/stack-exchange-dataset |
33,735 | The name for this genetic algorithm variant | <p>What is the name for this variant of genetic algorithm. I'm sure I have read about this in Wikipedia, but now I could not find it:</p>

<p>There in no thing as sequential population. The phenotypes lives and dies just like people. The death comes after random period of time. During life phenotypes can have c... | terminology genetic algorithms evolutionary computing | 1 | The name for this genetic algorithm variant -- (terminology genetic algorithms evolutionary computing)
<p>What is the name for this variant of genetic algorithm. I'm sure I have read about this in Wikipedia, but now I could not find it:</p>

<p>There in no thing as sequential population. The phenotypes lives an... | habedi/stack-exchange-dataset |
33,736 | Output of well-known algorithms for the Subset sum problem | <p>According to <a href="http://en.wikipedia.org/wiki/Subset_sum_problem" rel="nofollow">Wikipedia</a>:</p>

<blockquote>
 <p>In computer science, the subset sum problem is an important problem in complexity theory and cryptography. The problem is this: given a set (or multiset) of integers, is there a non... | algorithms knapsack problems | 1 | Output of well-known algorithms for the Subset sum problem -- (algorithms knapsack problems)
<p>According to <a href="http://en.wikipedia.org/wiki/Subset_sum_problem" rel="nofollow">Wikipedia</a>:</p>

<blockquote>
 <p>In computer science, the subset sum problem is an important problem in complexity theory... | habedi/stack-exchange-dataset |
33,743 | Feature values range | <p>Suppose I am about to use SVM for learning a classification or ranking function. Suppose that my feature vectors are two dimensional and that values for one dimension are, say, natural numbers and the values for the other dimension are real numbers in $[0,1]$. Can this difference in magnitudes somehow negatively aff... | machine learning features svm | 1 | Feature values range -- (machine learning features svm)
<p>Suppose I am about to use SVM for learning a classification or ranking function. Suppose that my feature vectors are two dimensional and that values for one dimension are, say, natural numbers and the values for the other dimension are real numbers in $[0,1]$. ... | habedi/stack-exchange-dataset |
33,744 | How to represent whitespace in a context-free grammar? | <p>Say we want to support: xx</p>

<p>The following grammar does accept it:</p>

<ul>
<li>S -> xAx</li>
<li>A -> ε.</li>
</ul>

<p>because S => xAx => xx.</p>

<p>But what about supporting: x x </p>

<p>I realize this might be a stupid question but I'm really unable t... | formal languages context free formal grammars | 1 | How to represent whitespace in a context-free grammar? -- (formal languages context free formal grammars)
<p>Say we want to support: xx</p>

<p>The following grammar does accept it:</p>

<ul>
<li>S -> xAx</li>
<li>A -> ε.</li>
</ul>

<p>because S => xAx => xx.</p>

<p>But wha... | habedi/stack-exchange-dataset |
33,753 | How to apply "verification" and "decision" for the SUBSET SUM problem? | <p>The SUBSET SUM problem states that:</p>

<pre><code>Given finite set S of integers, is there a subset whose sum is exactly t?
</code></pre>

<p>Can someone show me why verification is simpler than decision for this problem?</p>
 | complexity theory formal languages sets | 1 | How to apply "verification" and "decision" for the SUBSET SUM problem? -- (complexity theory formal languages sets)
<p>The SUBSET SUM problem states that:</p>

<pre><code>Given finite set S of integers, is there a subset whose sum is exactly t?
</code></pre>

<p>Can someone show me why verification ... | habedi/stack-exchange-dataset |
33,754 | What is the implication of the sentence: "if any NP complete problem is p time solvable, then all problems in NP are p time solvable" | <p>I find this quote <a href="http://www.cs.princeton.edu/courses/archive/spr11/cos423/Lectures/NP-completeness.pdf" rel="nofollow">here</a> on page 13 </p>

<blockquote>
 <p>Does it mean that out of all different problems that are NP complete, if any problem is found to have a p time solution, then all th... | complexity theory np p vs np | 1 | What is the implication of the sentence: "if any NP complete problem is p time solvable, then all problems in NP are p time solvable" -- (complexity theory np p vs np)
<p>I find this quote <a href="http://www.cs.princeton.edu/courses/archive/spr11/cos423/Lectures/NP-completeness.pdf" rel="nofollow">here</a> on page 13 ... | habedi/stack-exchange-dataset |
33,756 | How does "language" relate to "problem" in complexity theory? | <p>I am looking up the meaning of reduction in complexity theory:</p>

<p>On Wikipedia it says: reduction is an algorithm for transforming one problem into another problem</p>

<p>On the Princeton's notes on <a href="http://www.cs.princeton.edu/courses/archive/spr11/cos423/Lectures/NP-completeness.pdf" ... | complexity theory | 1 | How does "language" relate to "problem" in complexity theory? -- (complexity theory)
<p>I am looking up the meaning of reduction in complexity theory:</p>

<p>On Wikipedia it says: reduction is an algorithm for transforming one problem into another problem</p>

<p>On the Princeton's notes on <a href="ht... | habedi/stack-exchange-dataset |
33,761 | Is this time complexity quasi-polynomial? | <p>I have been working in the time analysis for an algorithm and finally I got a curve that fits:</p>

<p>$O(2^{(\log_2(N)^{2.01})})$</p>

<p>N is the number of elements.</p>

<p>I'm right to say the above time complexity is quasi-polynomial?</p>
 | terminology asymptotics landau notation | 1 | Is this time complexity quasi-polynomial? -- (terminology asymptotics landau notation)
<p>I have been working in the time analysis for an algorithm and finally I got a curve that fits:</p>

<p>$O(2^{(\log_2(N)^{2.01})})$</p>

<p>N is the number of elements.</p>

<p>I'm right to say the above tim... | habedi/stack-exchange-dataset |
33,763 | Can someone explain in a simple way what "reducible" mean in complexity theory? | <p>I find the word "reducible" used in complexity theory not very intuitive, and too general taken on a face value.</p>

<p>What does it exactly mean by problem A reducible to B? </p>

<ul>
<li><p>Does it mean that A can be reworded into B? 
i.e. Finding Vertex Set is actually the same as findin... | complexity theory terminology reductions | 1 | Can someone explain in a simple way what "reducible" mean in complexity theory? -- (complexity theory terminology reductions)
<p>I find the word "reducible" used in complexity theory not very intuitive, and too general taken on a face value.</p>

<p>What does it exactly mean by problem A reducible to B? </p>&#x... | habedi/stack-exchange-dataset |
33,769 | Is there a physical analogy to the Turing Machine? | <p>Recently in my CS class I've been introduced to the Turing Machine. </p>

<p>After the class, I spent over 2 hours trying to figure out what is the relationship between a tape and a machine. </p>

<p>I was completely unaware of the existence of computer tapes or how tapes and machines interacted unti... | turing machines computation models | 1 | Is there a physical analogy to the Turing Machine? -- (turing machines computation models)
<p>Recently in my CS class I've been introduced to the Turing Machine. </p>

<p>After the class, I spent over 2 hours trying to figure out what is the relationship between a tape and a machine. </p>

<p>I was comp... | habedi/stack-exchange-dataset |
33,772 | Does the normal form theorem imply that every partially computabe function is primitive recursive? | <p>This is <strong>Normal Form Theorem</strong> (Second Edition of Computability, Complexity, and Languages written by Martin Davis page 75):</p>
<blockquote>
<p>Let <span class="math-container">$f(x_1,...,x_n)$</span> be a partially computable function. Then there is a primitive recursive predicate <span class... | computability normal forms primitive recursion mu recursion | 1 | Does the normal form theorem imply that every partially computabe function is primitive recursive? -- (computability normal forms primitive recursion mu recursion)
<p>This is <strong>Normal Form Theorem</strong> (Second Edition of Computability, Complexity, and Languages written by Martin Davis page 75):</p>
<block... | habedi/stack-exchange-dataset |
33,776 | Can someone provide an introductory example of a certificate in complexity theory? | <p>Just stepping into complexity theory, I am befuddled by this notion of a certificate and can't find any utility of this concept. </p>

<p>From my understanding, a certificate is used when you are trying to ascertain whether a problem is NP...a problem is NP if you can verify a p-time solution exist or not (c... | complexity theory np complete | 1 | Can someone provide an introductory example of a certificate in complexity theory? -- (complexity theory np complete)
<p>Just stepping into complexity theory, I am befuddled by this notion of a certificate and can't find any utility of this concept. </p>

<p>From my understanding, a certificate is used when you... | habedi/stack-exchange-dataset |
33,783 | Use AVL trees instead of Chord algorithm for Distributed Peer to peer Hash tables | <p>In distributed systems we use the Chord algorithm to create a p2p distributed hash table. While this algorithm is very useful and efficient wouldn't it be better if we used an AVL tree? Chord algorithm relies a lot to the hash function (in order for the nodes to be distributed evenly). </p>

<p>An AVL tree o... | algorithms data structures distributed systems search trees peer to peer | 1 | Use AVL trees instead of Chord algorithm for Distributed Peer to peer Hash tables -- (algorithms data structures distributed systems search trees peer to peer)
<p>In distributed systems we use the Chord algorithm to create a p2p distributed hash table. While this algorithm is very useful and efficient wouldn't it be be... | habedi/stack-exchange-dataset |
33,789 | Is a grammar that accepts function declarations, function calls and expressions (at any order!) necessarily cyclic? | <p>As the title suggests, assume a grammar which has to recognize function declarations, function calls, and expressions, at <em>any order</em>. Does that mean it has to be cyclic, and therefore ambiguous?</p>

<p>I mean, it would have to look something like:</p>

<ul>
<li>S -> function_declaration ... | context free formal grammars ambiguity | 1 | Is a grammar that accepts function declarations, function calls and expressions (at any order!) necessarily cyclic? -- (context free formal grammars ambiguity)
<p>As the title suggests, assume a grammar which has to recognize function declarations, function calls, and expressions, at <em>any order</em>. Does that mean ... | habedi/stack-exchange-dataset |
33,796 | Find a MST such that it's mostly red (original graph's edges are colored red and blue) | <p>Consider the following problem:
Given a simple, strongly-connected, weighted graph G=(V,E), of which every edge is colored either red or blue (in addition to having a numeric weight).
Find an efficient algorithm to find an MST which is mostly red (meaning, has the most red edges possible).</p>

<p>I ... | algorithms graphs optimization spanning trees | 1 | Find a MST such that it's mostly red (original graph's edges are colored red and blue) -- (algorithms graphs optimization spanning trees)
<p>Consider the following problem:
Given a simple, strongly-connected, weighted graph G=(V,E), of which every edge is colored either red or blue (in addition to having a numeric ... | habedi/stack-exchange-dataset |
33,798 | Sensitivity and Block sensitivity | <p>May be this question is really silly and obvious but I am missing something subtle. I am reading on Sensitivity and Block sensitivity.</p>

<p>Let $f:\{0,1\}^n\rightarrow \{0,1\}$ be a Boolean function.</p>

<p>Let $[n]=\{1,2,\dots,n\}$.</p>

<p>If $i\in[n]$, let $\Bbb 1_i$ be length $n$ vect... | complexity theory boolean algebra | 1 | Sensitivity and Block sensitivity -- (complexity theory boolean algebra)
<p>May be this question is really silly and obvious but I am missing something subtle. I am reading on Sensitivity and Block sensitivity.</p>

<p>Let $f:\{0,1\}^n\rightarrow \{0,1\}$ be a Boolean function.</p>

<p>Let $[n]=\{1,2,\d... | habedi/stack-exchange-dataset |
33,807 | Prove that this family of hash function is $3$-wise independent, but not $4$-wise independent | <blockquote>
 <p>Consider the hash function mapping $w$-bit keys to hash values in
 $\{0,...,m-1\}$. Suppose $w=cr$. Interpret a $w$-bit key $x$ as a
 vector $(x_1,...,x_c)$ of $c$ $r$-bit keys.</p>
 
 <p>Consider the hash family:</p>
 
 <p>$$H = \{h_{T_1,...,T_c}:T_i \in \{0,...,m-1\... | algorithms algorithm analysis data structures probability theory hash tables | 1 | Prove that this family of hash function is $3$-wise independent, but not $4$-wise independent -- (algorithms algorithm analysis data structures probability theory hash tables)
<blockquote>
 <p>Consider the hash function mapping $w$-bit keys to hash values in
 $\{0,...,m-1\}$. Suppose $w=cr$. Interpret a $w$-b... | habedi/stack-exchange-dataset |
33,813 | Asymptotic expected runtime of Randomized Algorithm | <p>I am analyzing the asymptotic runtime of a randomized algorithm in expectation. The algorithm has the following properties:</p>

<ul>
<li>Given input size $n$, with probability $3/4$ it moves on to solve an instance of size $n-1$</li>
<li>With probability $1/8$ it moves on to solve an instance of siz... | algorithms algorithm analysis runtime analysis randomized algorithms average case | 1 | Asymptotic expected runtime of Randomized Algorithm -- (algorithms algorithm analysis runtime analysis randomized algorithms average case)
<p>I am analyzing the asymptotic runtime of a randomized algorithm in expectation. The algorithm has the following properties:</p>

<ul>
<li>Given input size $n$, with p... | habedi/stack-exchange-dataset |
33,819 | Using SMT solvers to generate random solutions to given predicate | <p>I am interested in generating random solutions to predicates. I only need SMT for integers with the following predicates/functions <, >, <=, >=, ==, !=, +, *</p>

<p>The algorithm I want should produce a random assignment of variables to values (a substitution) such that applying the substitution to th... | functional programming nondeterminism smt solvers | 1 | Using SMT solvers to generate random solutions to given predicate -- (functional programming nondeterminism smt solvers)
<p>I am interested in generating random solutions to predicates. I only need SMT for integers with the following predicates/functions <, >, <=, >=, ==, !=, +, *</p>

<p>The algorithm I ... | habedi/stack-exchange-dataset |
33,822 | prove decidability and recognizability | <p>I want to prove that for any language $L_1$ described by a Turing machine and any regular language $L_2$, $L_1 \cap L_2$ is described by a Turing machine that its recognizability and decidability is same as $L_1$. </p>

<p>I thought so far that I can describe $L_2$ with a Turing machine. So I can next find ... | formal languages computability regular languages closure properties | 1 | prove decidability and recognizability -- (formal languages computability regular languages closure properties)
<p>I want to prove that for any language $L_1$ described by a Turing machine and any regular language $L_2$, $L_1 \cap L_2$ is described by a Turing machine that its recognizability and decidability is same a... | habedi/stack-exchange-dataset |
33,828 | NP completeness of closest vector problem | <p>Let $\mathcal{B} = \{v_1,v_2,\ldots,v_k\} \in \mathbb{R}^n$ be linearly independent vectors. </p>

<p>Recall that the <em>integer lattice</em> of $\mathcal{B}$ is the set $L(\mathcal{B})$ of all linear combinations of elements of $\mathcal{B}$ using only integers as coefficients. That is $$L(\mathcal{B}) = \... | complexity theory reference request np complete reductions | 1 | NP completeness of closest vector problem -- (complexity theory reference request np complete reductions)
<p>Let $\mathcal{B} = \{v_1,v_2,\ldots,v_k\} \in \mathbb{R}^n$ be linearly independent vectors. </p>

<p>Recall that the <em>integer lattice</em> of $\mathcal{B}$ is the set $L(\mathcal{B})$ of all linear c... | habedi/stack-exchange-dataset |
33,839 | Constructing a random Hamiltonian Cycle (Secret Santa) | <p>I was programming a little Secret Santa tool for my extended family's gift exchange. We had a few constraints:</p>

<ul>
<li>No recipients within the immediate family</li>
<li>Nobody should get who they got last year</li>
<li>The whole thing should be a cycle (Sandy gives to George, George to To... | algorithms graphs randomized algorithms sampling hamiltonian path | 1 | Constructing a random Hamiltonian Cycle (Secret Santa) -- (algorithms graphs randomized algorithms sampling hamiltonian path)
<p>I was programming a little Secret Santa tool for my extended family's gift exchange. We had a few constraints:</p>

<ul>
<li>No recipients within the immediate family</li>
<l... | habedi/stack-exchange-dataset |
33,842 | What's the definition of a (deterministic) formal language? | <p><strong>Definitions</strong></p>

<p>According to my UML teacher formal means strictly according to rules, officially and how it's supposed to be. He says a formal language = syntax + symbols + spelling. Another term he uses is deterministic. According to him it means "strictly predictable", which means its ... | formal languages terminology | 1 | What's the definition of a (deterministic) formal language? -- (formal languages terminology)
<p><strong>Definitions</strong></p>

<p>According to my UML teacher formal means strictly according to rules, officially and how it's supposed to be. He says a formal language = syntax + symbols + spelling. Another ter... | habedi/stack-exchange-dataset |
33,854 | Is there a method for automatic runtime analysis of algorithms? | <p>I am wondering, is there a method for automatic runtime analysis that works at least on a relevant subset of algorithms (algorithms that can be analyzed)?</p>

<p>I googled "Automatic algorithm analysis" which gave me <a href="http://www2.imm.dtu.dk/~fnie/Papers/NNS02_AA.pdf" rel="noreferrer">this</a> but it... | algorithms algorithm analysis reference request runtime analysis | 1 | Is there a method for automatic runtime analysis of algorithms? -- (algorithms algorithm analysis reference request runtime analysis)
<p>I am wondering, is there a method for automatic runtime analysis that works at least on a relevant subset of algorithms (algorithms that can be analyzed)?</p>

<p>I googled "A... | habedi/stack-exchange-dataset |
33,859 | All but Five Three Colorable | <p>An NP Problem Named All But Five Three Colorable(AB53C) is defined as follows :- Input : Connected Graph G(V,E) The Connected Graph is AB53C, iff the Given Graph is 3-Colorable by leaving UPTO 5 Vertices Uncolored.</p>

<p>Question:- The Problem is in NP. Show the reduction from 3-Colorable Problem.</p>
... | complexity theory graphs np complete reductions colorings | 1 | All but Five Three Colorable -- (complexity theory graphs np complete reductions colorings)
<p>An NP Problem Named All But Five Three Colorable(AB53C) is defined as follows :- Input : Connected Graph G(V,E) The Connected Graph is AB53C, iff the Given Graph is 3-Colorable by leaving UPTO 5 Vertices Uncolored.</p>
&#... | habedi/stack-exchange-dataset |
33,864 | Function with minimum sensitivity | <p>Let sensitivity be defined as in <a href="https://cs.stackexchange.com/questions/33798/sensitivity-and-block-sensitivity">Sensitivity and Block sensitivity</a></p>

<p>Is there an example of a boolean function in $n$ variables that depends on all $n$ inputs whose sensitivity is $O(\log n)$?</p>

<p>I... | complexity theory boolean algebra | 1 | Function with minimum sensitivity -- (complexity theory boolean algebra)
<p>Let sensitivity be defined as in <a href="https://cs.stackexchange.com/questions/33798/sensitivity-and-block-sensitivity">Sensitivity and Block sensitivity</a></p>

<p>Is there an example of a boolean function in $n$ variables that depe... | habedi/stack-exchange-dataset |
33,871 | 3 dimensionnal matching to partition transformation | <p>We want to transform $3DM$ to $PARTITION$, I am reading Garey and Johnson book and I really don't understand how they do the transformation, I know how they create elements $a_i$ from triples of set $M = W \times X \times Y$, but I don't know why they add two other elements $b_1$ and $b_2$ with definition
$$
... | complexity theory np complete reductions partition problem | 1 | 3 dimensionnal matching to partition transformation -- (complexity theory np complete reductions partition problem)
<p>We want to transform $3DM$ to $PARTITION$, I am reading Garey and Johnson book and I really don't understand how they do the transformation, I know how they create elements $a_i$ from triples of set $M... | habedi/stack-exchange-dataset |
33,881 | How should I choose the neighborhood structure for simulated annealing for my problem? | <p>There are $n$ students and $m$ courses. Each student $i$ wants to attend a subset $C_i \subseteq \{1,\ldots,m\}$ of the courses. There are $k$ time slots on a weekly schedule. The goal is to select a time slot for each course such that the students can attend as many courses as possible, that is, find a mapping $f: ... | algorithms optimization | 1 | How should I choose the neighborhood structure for simulated annealing for my problem? -- (algorithms optimization)
<p>There are $n$ students and $m$ courses. Each student $i$ wants to attend a subset $C_i \subseteq \{1,\ldots,m\}$ of the courses. There are $k$ time slots on a weekly schedule. The goal is to select a t... | habedi/stack-exchange-dataset |
33,892 | Complexity Classes (P, NP) vs Language Hierarchies (REC, RE) | <h2>NOTE: The statement of this question has a LOT of misconceptions.</h2>

<hr>

<p>Is there any relation between the Complexity Classes <em>(like P or NP)</em> and Language hierarchies <em>(like REC or RE)</em> ?</p>

<blockquote>
 <p><strong>Form what I understand</strong>: (<em>easy</em... | complexity theory formal languages complexity classes | 1 | Complexity Classes (P, NP) vs Language Hierarchies (REC, RE) -- (complexity theory formal languages complexity classes)
<h2>NOTE: The statement of this question has a LOT of misconceptions.</h2>

<hr>

<p>Is there any relation between the Complexity Classes <em>(like P or NP)</em> and Language hierarchi... | habedi/stack-exchange-dataset |
33,894 | How does the Program Counter work? | <p>I think it stores the address of the current instruction. And if this instruction is completed the program counter is incremented by 1, to get the next instruction.
But now my question is, how do you increment the program counter by 1? It would mean you increment an address by 1, how does this work? </p>
 | computer architecture | 1 | How does the Program Counter work? -- (computer architecture)
<p>I think it stores the address of the current instruction. And if this instruction is completed the program counter is incremented by 1, to get the next instruction.
But now my question is, how do you increment the program counter by 1? It would mean y... | habedi/stack-exchange-dataset |
33,895 | Finding the values of x and y using base 8 | <p>In finding the values of x and y, if <code>(x567) + (2yx5) = (71yx)</code> ( all in base 8) I proceeded as under.</p>

<p>I assumed <code>x=abc</code> and <code>y=def</code> and followed.</p>

<pre><code> (abc+010 def+101 110+abc 111+101)=(111 001 def abc) //adding ()+()=() and equating LHS=RHS.&#x... | number theory base conversion | 1 | Finding the values of x and y using base 8 -- (number theory base conversion)
<p>In finding the values of x and y, if <code>(x567) + (2yx5) = (71yx)</code> ( all in base 8) I proceeded as under.</p>

<p>I assumed <code>x=abc</code> and <code>y=def</code> and followed.</p>

<pre><code> (abc+010 def+101... | habedi/stack-exchange-dataset |
33,900 | $T(n) = \sqrt{n}\,T(\sqrt{n}) + n\log n$ | <p>I tried to solve the recurrence $T(n) = \sqrt{n}\,T(\sqrt{n}) + n\log n$ with the master theorem but I can't get it to work.</p>

<p>How many arrays exist in each step in the recursion tree?</p>

<p>Or can I solve this problem some other way?</p>

<p>Thanks.</p>
 | data structures time complexity recursion | 1 | $T(n) = \sqrt{n}\,T(\sqrt{n}) + n\log n$ -- (data structures time complexity recursion)
<p>I tried to solve the recurrence $T(n) = \sqrt{n}\,T(\sqrt{n}) + n\log n$ with the master theorem but I can't get it to work.</p>

<p>How many arrays exist in each step in the recursion tree?</p>

<p>Or can I solve... | habedi/stack-exchange-dataset |
33,901 | Amortized analysis of virtual, dynamic array using potential function | <p>You often want to implement an array $A$ where the length fluctuates over time. If at some point $A$ has length $n$, then you would like to use space $O(n)$. Consider the following: At all moments, a virtual array $A[0...n-1]$ is simulated by an actual array $B[0...m-1]$ where $m\ge n\ge 1$. Initially, $m=n=1$.</p>&... | data structures runtime analysis arrays amortized analysis | 1 | Amortized analysis of virtual, dynamic array using potential function -- (data structures runtime analysis arrays amortized analysis)
<p>You often want to implement an array $A$ where the length fluctuates over time. If at some point $A$ has length $n$, then you would like to use space $O(n)$. Consider the following: A... | habedi/stack-exchange-dataset |
33,903 | Reducing context-free languages with polynomial-time reductions | <p>So, let's say we have two languages $L$ (which is any context-free language) and $M$ which is the basic CFL $\{0^n1^n: n\geq 0\}$.</p>

<p>Can $L \le_p M$ ? Why or why not? How do polynomial time reductions even work with CFLs in general?</p>
 | formal languages context free reductions | 1 | Reducing context-free languages with polynomial-time reductions -- (formal languages context free reductions)
<p>So, let's say we have two languages $L$ (which is any context-free language) and $M$ which is the basic CFL $\{0^n1^n: n\geq 0\}$.</p>

<p>Can $L \le_p M$ ? Why or why not? How do polynomial time red... | habedi/stack-exchange-dataset |
33,908 | If the Halting Problem was solvable, and we solved it, what would be its implications? | <p>Perhaps a way to better understand the Halting Problem's importance is to know what would happen or what could be possible if this was solved.</p>
<p>What would be the Halting Problem's implications in today's technology, mathematics and its practical applications, if it was somehow solved?</p>
 | computability halting problem philosophy | 1 | If the Halting Problem was solvable, and we solved it, what would be its implications? -- (computability halting problem philosophy)
<p>Perhaps a way to better understand the Halting Problem's importance is to know what would happen or what could be possible if this was solved.</p>
<p>What would be the Halting Prob... | habedi/stack-exchange-dataset |
33,911 | Is Dijkstras algorithm used in modern route-finding systems? | <p>Is Dijkstra's algorithm used in modern route-finding systems such as Google maps or the satnav in your car? If not, then what is?</p>
 | algorithms graphs shortest path applied theory | 1 | Is Dijkstras algorithm used in modern route-finding systems? -- (algorithms graphs shortest path applied theory)
<p>Is Dijkstra's algorithm used in modern route-finding systems such as Google maps or the satnav in your car? If not, then what is?</p>
 | habedi/stack-exchange-dataset |
33,913 | Can every context free language written as a intersection of another context free language and a regular language? | <p>I'm preparing an Formal language exam, One question from previous year's final is:</p>

<p>Prove or disprove:If L is a context free language, then there exists a language P that is generated by a pure context-free grammar and a regular language R so that $L = P \cap R$.</p>

<p>My solution to this qu... | formal languages context free | 1 | Can every context free language written as a intersection of another context free language and a regular language? -- (formal languages context free)
<p>I'm preparing an Formal language exam, One question from previous year's final is:</p>

<p>Prove or disprove:If L is a context free language, then there exists... | habedi/stack-exchange-dataset |
33,914 | What is a naive method? | <p>I was <a href="http://en.wikipedia.org/wiki/Dynamic_programming">researching dynamic programming</a> and read the following:</p>

<blockquote>
 <p>Often when using a more naive method, many of the subproblems are
 generated and solved many times.</p>
</blockquote>

<p>What is a naive me... | terminology dynamic programming | 1 | What is a naive method? -- (terminology dynamic programming)
<p>I was <a href="http://en.wikipedia.org/wiki/Dynamic_programming">researching dynamic programming</a> and read the following:</p>

<blockquote>
 <p>Often when using a more naive method, many of the subproblems are
 generated and solved man... | habedi/stack-exchange-dataset |
33,918 | algorithm time analysis "input size" vs "input elements" | <p>I'm still a bit confused with the terms "input length" and "input size" when used to analyze and describe the asymptomatic upper bound for an algorithm</p>

<p>Seems that input length for the algorithm depends a lot of the kind of data and the algorithm you are talking about.</p>

<p>Some authors ref... | complexity theory terminology algorithm analysis time complexity runtime analysis | 1 | algorithm time analysis "input size" vs "input elements" -- (complexity theory terminology algorithm analysis time complexity runtime analysis)
<p>I'm still a bit confused with the terms "input length" and "input size" when used to analyze and describe the asymptomatic upper bound for an algorithm</p>

<p>Seems... | habedi/stack-exchange-dataset |
33,923 | Vertex degree in De Bruijn graphs | <p>How can I find the degree of a vertex in a De Bruijn graph? Also, given a vertex, is there an easy way to find which other vertices it is connected to?</p>
 | algorithms graphs | 1 | Vertex degree in De Bruijn graphs -- (algorithms graphs)
<p>How can I find the degree of a vertex in a De Bruijn graph? Also, given a vertex, is there an easy way to find which other vertices it is connected to?</p>
 | habedi/stack-exchange-dataset |
33,924 | Is Myhill-Nerode equivalence class of a language which contains all palindrome pairwise distinct? | <p>In my formal language class, we define a language called PAL, which is on a alphabet set $\Sigma = \{0,1\}$. $PAL = \{w \in \{0,1\}^* : w = w^R\}$. We have proved that every string in this language will be pairwise inequivalent, i.e. every string is in its own Myhill-Nerode equivalence class.</p>

<p>However... | formal languages context free | 1 | Is Myhill-Nerode equivalence class of a language which contains all palindrome pairwise distinct? -- (formal languages context free)
<p>In my formal language class, we define a language called PAL, which is on a alphabet set $\Sigma = \{0,1\}$. $PAL = \{w \in \{0,1\}^* : w = w^R\}$. We have proved that every string in ... | habedi/stack-exchange-dataset |
33,929 | Context-free grammars and priority | <p>This grammar is supposed to give priority to multiplication:</p>

<ul>
<li>E -> E + T | T.</li>
<li>T -> T * F | F.</li>
<li>F -> x.</li>
</ul>

<p>A derivation for "x + x * x" would be (unless I'm wrong):</p>

<p>E => E + T => T + T => F + T => x + T => x + T * F => x + F * F... | context free formal grammars ambiguity | 1 | Context-free grammars and priority -- (context free formal grammars ambiguity)
<p>This grammar is supposed to give priority to multiplication:</p>

<ul>
<li>E -> E + T | T.</li>
<li>T -> T * F | F.</li>
<li>F -> x.</li>
</ul>

<p>A derivation for "x + x * x" would be (unless I'm wrong):<... | habedi/stack-exchange-dataset |
33,935 | FM-index - print all patterns | <p>How is it possible to print all patterns of length <span class="math-container">$k$</span> contained in a string, using the FM-index and Burrows-Wheeler transform?</p>

<p>PROBLEM DETAIL:<br>
The input I have is:</p>

<ul>
<li>the text encoded with the Burrows-Wheeler Transform </li>
<li>... | algorithms strings pattern recognition | 1 | FM-index - print all patterns -- (algorithms strings pattern recognition)
<p>How is it possible to print all patterns of length <span class="math-container">$k$</span> contained in a string, using the FM-index and Burrows-Wheeler transform?</p>

<p>PROBLEM DETAIL:<br>
The input I have is:</p>

<ul>&... | habedi/stack-exchange-dataset |
33,943 | Find the coins required which sum to S | <p>Given a list of $N$ coins, their values $V_1, V_2, \cdots , V_N$, and a parameter of a total sum $S$. Find the coins the sum of which is S (we can use each coin at most once).</p>

<p>I was recently studying the very same problem from topcoder.com but there "we can use each coin any number of times". I am ju... | algorithms dynamic programming greedy algorithms | 1 | Find the coins required which sum to S -- (algorithms dynamic programming greedy algorithms)
<p>Given a list of $N$ coins, their values $V_1, V_2, \cdots , V_N$, and a parameter of a total sum $S$. Find the coins the sum of which is S (we can use each coin at most once).</p>

<p>I was recently studying the very... | habedi/stack-exchange-dataset |
33,949 | Assign undirected edges in a mixed graph to make graph cyclic/acyclic | <p>What is the complexity of the following problem?</p>

<p>Given a mixed (some edges directed, some undirected) graph, assign a direction to all the undirected edges to make the graph contain a cycle.</p>

<p>It doesn't "feel" like an NP-hard problem, but I can't think of an easy poly-time algorithm.</... | complexity theory graphs graph algorithms | 1 | Assign undirected edges in a mixed graph to make graph cyclic/acyclic -- (complexity theory graphs graph algorithms)
<p>What is the complexity of the following problem?</p>

<p>Given a mixed (some edges directed, some undirected) graph, assign a direction to all the undirected edges to make the graph contain a ... | habedi/stack-exchange-dataset |
33,953 | How does the use of oracle Turing machines not lead to contradictions? | <p>How can we ensure that we are continuing to make sound and valid statements about complexity classes when using oracle Turing Machines? According to my understanding (based on the definitions given in introductory textbooks on the subject) oracle Turing machines can determine the membership status of a string with... | complexity theory oracle machines | 1 | How does the use of oracle Turing machines not lead to contradictions? -- (complexity theory oracle machines)
<p>How can we ensure that we are continuing to make sound and valid statements about complexity classes when using oracle Turing Machines? According to my understanding (based on the definitions given in intro... | habedi/stack-exchange-dataset |
33,955 | Why is And-Or-Graph-Search called a search algorithm? | <p>An algorithm in <em>Artificial Intelligence: A Modern Approach</em> for planning in stochastic, fully observable environments is called And-Or-Graph-Search, implying that it's a search algorithm. However, I don't see how it is one. Wikipedia defines search algorithms as, "an algorithm for finding an item with specif... | terminology artificial intelligence search algorithms | 1 | Why is And-Or-Graph-Search called a search algorithm? -- (terminology artificial intelligence search algorithms)
<p>An algorithm in <em>Artificial Intelligence: A Modern Approach</em> for planning in stochastic, fully observable environments is called And-Or-Graph-Search, implying that it's a search algorithm. However,... | habedi/stack-exchange-dataset |
33,964 | If A is in P and B is non-trivial, then A ≤p B | <p>On wikipedia's article on <a href="http://en.wikipedia.org/wiki/Polynomial-time_reduction#Completeness" rel="nofollow noreferrer">Polynomial-time reduction</a> it states:</p>

<blockquote>
 <p>Every nontrivial decision problem in P (the class of polynomial-time
 decision problems, where nontrivial ... | complexity theory time complexity reductions polynomial time | 1 | If A is in P and B is non-trivial, then A ≤p B -- (complexity theory time complexity reductions polynomial time)
<p>On wikipedia's article on <a href="http://en.wikipedia.org/wiki/Polynomial-time_reduction#Completeness" rel="nofollow noreferrer">Polynomial-time reduction</a> it states:</p>

<blockquote>
 <... | habedi/stack-exchange-dataset |
33,965 | Help me find the ambiguity in this grammar | <p>I've been sitting on this for 20+ minutes and can't seem to generate a string that is ambiguous. Can anyone help me? The grammar is:</p>

<p>$$S \xrightarrow{} SS \mid T$$
$$T \xrightarrow{} aTb \mid ab $$</p>

<p>Strings I have attempted to generate and failed are:</p>

<ol>
<li>abab... | context free formal grammars ambiguity | 1 | Help me find the ambiguity in this grammar -- (context free formal grammars ambiguity)
<p>I've been sitting on this for 20+ minutes and can't seem to generate a string that is ambiguous. Can anyone help me? The grammar is:</p>

<p>$$S \xrightarrow{} SS \mid T$$
$$T \xrightarrow{} aTb \mid ab $$</p>

... | habedi/stack-exchange-dataset |
33,968 | Can a schedule with cyclic precedence graph still be serialisable? | <p>We know Every conflict serializable schedule is serializable, but not all serializable schedules conflict-serializable. (*) so it means there is at least one serializable schedule that not conflict serializable. </p>

<p>One way of Testing conflict serializability is using Directed graph as mentioned <a href... | concurrency database theory databases | 1 | Can a schedule with cyclic precedence graph still be serialisable? -- (concurrency database theory databases)
<p>We know Every conflict serializable schedule is serializable, but not all serializable schedules conflict-serializable. (*) so it means there is at least one serializable schedule that not conflict serializa... | habedi/stack-exchange-dataset |
33,975 | Is the difference of a non-recursive and recursive set recursive? | <p>I have two sets B which is recursively enumerable and is not recursive, and A which is recursive. Is $A-B$ recursive and / or recursively enumerable? What about $B-A$?</p>

<p>$B-A$ is obviously recursively enumerable (to generate its elements, I can generate B's elements and check if they are in A).</p>
... | computability undecidability semi decidability | 1 | Is the difference of a non-recursive and recursive set recursive? -- (computability undecidability semi decidability)
<p>I have two sets B which is recursively enumerable and is not recursive, and A which is recursive. Is $A-B$ recursive and / or recursively enumerable? What about $B-A$?</p>

<p>$B-A$ is obviou... | habedi/stack-exchange-dataset |
33,978 | Supporting queries for finding how many intervals in a dynamic set of 1D intervals contain a given point | <p>You want to create a data structure that can store 1 dimensional intervals and also support the query for finding the total amount of intervals intersecting a given point.</p>

<p>One solution would be for each query to scan through every interval and see if it is contained in this interval or not, this woul... | data structures search trees intervals | 1 | Supporting queries for finding how many intervals in a dynamic set of 1D intervals contain a given point -- (data structures search trees intervals)
<p>You want to create a data structure that can store 1 dimensional intervals and also support the query for finding the total amount of intervals intersecting a given poi... | habedi/stack-exchange-dataset |
33,981 | Direct Cache Mapping - Determine Tag Size | <p>In the following direct cache map, there is a list of 32-bit memory address references, given as word addresses. I gathered that the index size is 3 bit and there is no offset.</p>

<p>However, I used 4 bits to determine the tag--is this correct?
When does the tag bits change? How many bits are typically... | computer architecture cpu cache memory hardware | 1 | Direct Cache Mapping - Determine Tag Size -- (computer architecture cpu cache memory hardware)
<p>In the following direct cache map, there is a list of 32-bit memory address references, given as word addresses. I gathered that the index size is 3 bit and there is no offset.</p>

<p>However, I used 4 bits to det... | habedi/stack-exchange-dataset |
33,989 | Confusion about the Time Hierarchy Theorem and relativization | <p>I know that $\mathsf{P}^A = \mathsf{EXP}$ 
for any $\mathsf{EXPTIME}$-complete language $A$.</p>

<p>Is it true that $\mathsf{DTIME}^A(n^k) = \mathsf{EXP}$ 
for any fixed $k$ and any $\mathsf{EXPTIME}$-complete oracle $A$?<br>
If not, what do these complexity classes equal and why? </p>

... | complexity theory time complexity oracle machines relativization | 1 | Confusion about the Time Hierarchy Theorem and relativization -- (complexity theory time complexity oracle machines relativization)
<p>I know that $\mathsf{P}^A = \mathsf{EXP}$ 
for any $\mathsf{EXPTIME}$-complete language $A$.</p>

<p>Is it true that $\mathsf{DTIME}^A(n^k) = \mathsf{EXP}$ 
for any fixe... | habedi/stack-exchange-dataset |
33,998 | Difference between edges in Depth First Trees | <p>I have a directed graph, where each node has an alphabetical value. The graph is to be traversed with topological DFS by descending alphabetical values (Z-A). </p>

<p>The result is $M,N,P,O,Q,S,R,T$ (after reversing). Several DFS trees are created during this traversal, and it's the edges between the trees ... | algorithms graphs terminology graph traversal | 1 | Difference between edges in Depth First Trees -- (algorithms graphs terminology graph traversal)
<p>I have a directed graph, where each node has an alphabetical value. The graph is to be traversed with topological DFS by descending alphabetical values (Z-A). </p>

<p>The result is $M,N,P,O,Q,S,R,T$ (after rever... | habedi/stack-exchange-dataset |
33,999 | LALR(1) parsers and the epsilon transition | <p>I am having trouble getting my head wrapped around epsilon transitions while creating an LALR(1) parse table.</p>

<p>Here's a grammar that recognizes any number of 'a' followed by a 'b'. 'S' is an artificial start state. '$' is an artificial 'EOS' token.</p>

<pre>
0. S -> A $
1. A -> ... | formal grammars parsers | 1 | LALR(1) parsers and the epsilon transition -- (formal grammars parsers)
<p>I am having trouble getting my head wrapped around epsilon transitions while creating an LALR(1) parse table.</p>

<p>Here's a grammar that recognizes any number of 'a' followed by a 'b'. 'S' is an artificial start state. '$' is an artif... | habedi/stack-exchange-dataset |
34,002 | Parikh's Theorem: CFL's "contain" regular languages? | <p>The first sentence of <a href="https://en.wikipedia.org/wiki/Parikh%27s_theorem" rel="nofollow noreferrer">the Wikipedia article for Parikh's Theorem</a> states: </p>

<blockquote>
 <p>"Parikh's theorem in theoretical computer science says that if one looks only at the relative number of occurrences of ... | formal languages regular languages context free | 1 | Parikh's Theorem: CFL's "contain" regular languages? -- (formal languages regular languages context free)
<p>The first sentence of <a href="https://en.wikipedia.org/wiki/Parikh%27s_theorem" rel="nofollow noreferrer">the Wikipedia article for Parikh's Theorem</a> states: </p>

<blockquote>
 <p>"Parikh's the... | habedi/stack-exchange-dataset |
34,005 | Why are non-relativizing proofs preferred to relativizing ones? | <p>I apologize, but even after these two other posts: <a href="https://cs.stackexchange.com/questions/33953/how-does-the-use-of-oracle-turing-machines-not-lead-to-contradictions">here</a> and <a href="https://cs.stackexchange.com/questions/33989/why-does-the-time-hierarchy-theorem-not-relativize">here</a>
I'm still... | complexity theory proof techniques oracle machines relativization | 1 | Why are non-relativizing proofs preferred to relativizing ones? -- (complexity theory proof techniques oracle machines relativization)
<p>I apologize, but even after these two other posts: <a href="https://cs.stackexchange.com/questions/33953/how-does-the-use-of-oracle-turing-machines-not-lead-to-contradictions">here</... | habedi/stack-exchange-dataset |
34,015 | Necessary and sufficient condition for unique minimum spanning tree | <p>This is an exercise problem (Ex.3) from the excellent lecture note by Jeff Erickson <a href="http://web.engr.illinois.edu/~jeffe/teaching/algorithms/notes/20-mst.pdf" rel="noreferrer">Lecture 20: Minimum Spanning Trees [Fa’13]
</a>. </p>

<blockquote>
 <p>Prove that an edge-weighted graph $G$ has a ... | graphs spanning trees | 1 | Necessary and sufficient condition for unique minimum spanning tree -- (graphs spanning trees)
<p>This is an exercise problem (Ex.3) from the excellent lecture note by Jeff Erickson <a href="http://web.engr.illinois.edu/~jeffe/teaching/algorithms/notes/20-mst.pdf" rel="noreferrer">Lecture 20: Minimum Spanning Trees [Fa... | habedi/stack-exchange-dataset |
34,019 | Genetic Algorithm Minimum Population Size | <p>Is there a minimum limit to a pool (population) size when using the genetic algorithm to solve an optimization problem? For example a population of size 2.</p>
 | algorithms optimization randomized algorithms genetic algorithms | 1 | Genetic Algorithm Minimum Population Size -- (algorithms optimization randomized algorithms genetic algorithms)
<p>Is there a minimum limit to a pool (population) size when using the genetic algorithm to solve an optimization problem? For example a population of size 2.</p>
 | habedi/stack-exchange-dataset |
34,035 | Turing Machine for strings without bbb | <p>I am trying to generate a transition graph for a turing machine that accepts the languages of all strings that do not contain the substring $bbb$ with the input alphabet $\Sigma = \{a, b\}$. </p>

<p>When I implement this graph in <a href="http://www.jflap.org" rel="nofollow noreferrer">JFLAP</a>, I'm receiv... | formal languages turing machines | 1 | Turing Machine for strings without bbb -- (formal languages turing machines)
<p>I am trying to generate a transition graph for a turing machine that accepts the languages of all strings that do not contain the substring $bbb$ with the input alphabet $\Sigma = \{a, b\}$. </p>

<p>When I implement this graph in <... | habedi/stack-exchange-dataset |
34,038 | Why does the principle of locality of computation not relativize? | <p>Although I have trouble understanding oracle TMs, I appreciate that non-relativizing techniques will be needed to resolve P vs. NP (as well as most other open problems in TCS). However, one of the techniques I've read about that does <strong><em>not</em></strong> relativize is using the fact that all of a Turing ma... | proof techniques oracle machines relativization | 1 | Why does the principle of locality of computation not relativize? -- (proof techniques oracle machines relativization)
<p>Although I have trouble understanding oracle TMs, I appreciate that non-relativizing techniques will be needed to resolve P vs. NP (as well as most other open problems in TCS). However, one of the ... | habedi/stack-exchange-dataset |
34,039 | Function that is not Space Constructible | <p>I'm reading Sipser's <em>Introduction to the Theory of Computation</em>, and I'm reading about space-constructible functions. He gives the following definition:</p>

<blockquote>
 <p>A function $f: \mathbb{N} \to \mathbb{N}$ is <em>space constructible</em> if the function that maps the string $1^n$ to t... | complexity theory space complexity | 1 | Function that is not Space Constructible -- (complexity theory space complexity)
<p>I'm reading Sipser's <em>Introduction to the Theory of Computation</em>, and I'm reading about space-constructible functions. He gives the following definition:</p>

<blockquote>
 <p>A function $f: \mathbb{N} \to \mathbb{N}... | habedi/stack-exchange-dataset |
34,050 | Why is the running time of edit distance with memoization $O(mn)$? | <p>I understand without memoization it is going to be $O(3^{\max\,\{m,n\}})$ because every call results in extra three calls: thus we end up having a call tree with three children for each node, with height $\max\,\{m,n\}$, m and n being lengths of two given strings.</p>

<p>However I am not getting why it is $... | algorithm analysis runtime analysis dynamic programming edit distance | 1 | Why is the running time of edit distance with memoization $O(mn)$? -- (algorithm analysis runtime analysis dynamic programming edit distance)
<p>I understand without memoization it is going to be $O(3^{\max\,\{m,n\}})$ because every call results in extra three calls: thus we end up having a call tree with three childre... | habedi/stack-exchange-dataset |
34,054 | Distribution of cycles length in a graph | <p>Given a random <strong>directed</strong> Graph G:</p>

<p>$$
 G=(V,E) \\
 \lvert V \rvert = n , \lvert E \rvert = k
$$</p>

<p>where for each vertex, <strong>either</strong>:
$$
 d_{incoming}(v) = 1 , d_{outgoing}(v) = 1
$$
meaning - for each incoming (outgoing) edge to v... | graphs combinatorics | 1 | Distribution of cycles length in a graph -- (graphs combinatorics)
<p>Given a random <strong>directed</strong> Graph G:</p>

<p>$$
 G=(V,E) \\
 \lvert V \rvert = n , \lvert E \rvert = k
$$</p>

<p>where for each vertex, <strong>either</strong>:
$$
 d_{incoming}(v) = 1 , d_{outgoing}... | habedi/stack-exchange-dataset |
34,059 | Do an ambiguous grammar and its corresponding unambiguous version generate the same language? | <p>If I have an ambiguous grammar G and its disambiguated version D.
Then which one is true <strong>L(D) ⊂ L(G)</strong> , <strong>L(G) ⊂ L(D)</strong> or <strong>L(G)=L(D)</strong>?</p>

<p>As I tried with some examples to transform a grammar to it unambiguous version but i found that both are equivalent.... | formal languages context free formal grammars | 1 | Do an ambiguous grammar and its corresponding unambiguous version generate the same language? -- (formal languages context free formal grammars)
<p>If I have an ambiguous grammar G and its disambiguated version D.
Then which one is true <strong>L(D) ⊂ L(G)</strong> , <strong>L(G) ⊂ L(D)</strong> or <strong>L(G)=L(... | habedi/stack-exchange-dataset |
34,064 | Papadimitrou and standard landau notation | <p><em>This is a homework. I'd appreciate if you didn't give away answer straightaway but instead pointed me to the right direction.</em></p>

<p>From huge majority of sources the definition of $\mathcal{O}(n)$ is:</p>

<p>$f, g : N \to R^+$</p>

<p>$f \in \mathcal{O}(g) \Leftrightarrow \exists{... | asymptotics landau notation | 1 | Papadimitrou and standard landau notation -- (asymptotics landau notation)
<p><em>This is a homework. I'd appreciate if you didn't give away answer straightaway but instead pointed me to the right direction.</em></p>

<p>From huge majority of sources the definition of $\mathcal{O}(n)$ is:</p>

<p>$f, g ... | habedi/stack-exchange-dataset |
34,065 | Why $\theta/2$ in common qubit representation? | <p>If we take angle names as shown on the Bloch sphere below and a typical qubit representation written as $\cos(\theta/2)|0\rangle + \mathrm{e}^{-\mathrm{i}\phi}\sin(\theta/2)|1\rangle$, why do we divide $\theta$ by $2$ in the cosine and sine parameters?</p>

<p><img src="https://i.stack.imgur.com/ftp5w.png" a... | quantum computing | 1 | Why $\theta/2$ in common qubit representation? -- (quantum computing)
<p>If we take angle names as shown on the Bloch sphere below and a typical qubit representation written as $\cos(\theta/2)|0\rangle + \mathrm{e}^{-\mathrm{i}\phi}\sin(\theta/2)|1\rangle$, why do we divide $\theta$ by $2$ in the cosine and sine parame... | habedi/stack-exchange-dataset |
34,067 | Is Morse code without spaces uniquely decipherable? | <p>Are all Morse code strings uniquely decipherable? Without the spaces, </p>

<pre><code>......-...-..---.-----.-..-..-..
</code></pre>

<p>could be <code>Hello World</code> but perhaps the first letter is a <code>5</code> -- in fact it looks very unlikely an arbitrary sequence of dots and dashes ... | information theory coding theory | 1 | Is Morse code without spaces uniquely decipherable? -- (information theory coding theory)
<p>Are all Morse code strings uniquely decipherable? Without the spaces, </p>

<pre><code>......-...-..---.-----.-..-..-..
</code></pre>

<p>could be <code>Hello World</code> but perhaps the first letter is a ... | habedi/stack-exchange-dataset |
34,085 | How to apply a 1-qubit gate to a single qubit from an entangled pair? | <p>Reading about superdense coding I came upon a calculation I can not understand.</p>

<p>We have an EPR entangled pair of qubits $\frac{1}{\sqrt2}(|00\rangle + |11\rangle)$ and we want to apply a Pauli X gate to the first of the entangled qubits. On <a href="http://en.wikipedia.org/wiki/Superdense_coding" rel... | quantum computing | 1 | How to apply a 1-qubit gate to a single qubit from an entangled pair? -- (quantum computing)
<p>Reading about superdense coding I came upon a calculation I can not understand.</p>

<p>We have an EPR entangled pair of qubits $\frac{1}{\sqrt2}(|00\rangle + |11\rangle)$ and we want to apply a Pauli X gate to the f... | habedi/stack-exchange-dataset |
34,088 | Analog of PP for computability rather than complexity? | <p>The complexity class <strong><a href="http://en.wikipedia.org/wiki/PP_%28complexity%29%5C">PP</a></strong> can be defined in many ways, one of which involves randomness - a language $L$ is in <strong>PP</strong> if there is a polynomial-time, randomized TM $M$ such that $w \in L$ if and only if the probability that ... | complexity theory computability complexity classes randomness | 1 | Analog of PP for computability rather than complexity? -- (complexity theory computability complexity classes randomness)
<p>The complexity class <strong><a href="http://en.wikipedia.org/wiki/PP_%28complexity%29%5C">PP</a></strong> can be defined in many ways, one of which involves randomness - a language $L$ is in <st... | habedi/stack-exchange-dataset |
34,098 | Is it axiomatic that the Time Hierarchy Theorem holds true in all relativized worlds? | <p>I learned from <a href="https://cs.stackexchange.com/questions/33989/why-does-the-time-hierarchy-theorem-not-relativize">this post</a> that ${\sf DTIME}^{\text{EXP}}(n^k) \neq \text{EXP}$ for a fixed $k$ for otherwise the Time Hierarchy Theorem would fail in that relativized world. However, is it possible to prove ... | complexity theory time complexity oracle machines relativization | 1 | Is it axiomatic that the Time Hierarchy Theorem holds true in all relativized worlds? -- (complexity theory time complexity oracle machines relativization)
<p>I learned from <a href="https://cs.stackexchange.com/questions/33989/why-does-the-time-hierarchy-theorem-not-relativize">this post</a> that ${\sf DTIME}^{\text{E... | habedi/stack-exchange-dataset |
34,099 | Count-Min sketch: dyadic ranges | <p>Can anyone give me a proof as to why </p>

<blockquote>
 <p>Any range over a unviverse {1...n} can be reduced to at most $2log_2n$ 
 disjoint dyadic ranges?</p>
</blockquote>

<p>Where a dyadic range is a range of the form $[x2^y+1....(x+1)2^y]$.</p>

<p>This is in reference to... | sets streaming algorithm | 1 | Count-Min sketch: dyadic ranges -- (sets streaming algorithm)
<p>Can anyone give me a proof as to why </p>

<blockquote>
 <p>Any range over a unviverse {1...n} can be reduced to at most $2log_2n$ 
 disjoint dyadic ranges?</p>
</blockquote>

<p>Where a dyadic range is a range of the form $... | habedi/stack-exchange-dataset |
34,116 | Voronoi diagram algorithm with non-euclidean metric | <p>Do you know any easy to implement algorithm for constructing a Voronoi diagram from a given set of points on a surface, using some different metric (taxicab, for instance)?
It can be some modification of Fortune's algorithm.</p>
 | algorithms computational geometry | 1 | Voronoi diagram algorithm with non-euclidean metric -- (algorithms computational geometry)
<p>Do you know any easy to implement algorithm for constructing a Voronoi diagram from a given set of points on a surface, using some different metric (taxicab, for instance)?
It can be some modification of Fortune's algorith... | habedi/stack-exchange-dataset |
35,129 | Finite Automata -- Determine if a set is regular | <p>I have been at this for hours. The question is:</p>
<blockquote>
<p>Prove that the language <span class="math-container">$A = \{0^kx \mid k > 0, x \in \{0,1\}^*, \text{ and } \#(0,x) \geq k\}$</span> is regular,</p>
<p>where <span class="math-container">$\#(n, x)$</span> denotes the number of <span cl... | formal languages regular languages finite automata | 1 | Finite Automata -- Determine if a set is regular -- (formal languages regular languages finite automata)
<p>I have been at this for hours. The question is:</p>
<blockquote>
<p>Prove that the language <span class="math-container">$A = \{0^kx \mid k > 0, x \in \{0,1\}^*, \text{ and } \#(0,x) \geq k\}$</span> i... | habedi/stack-exchange-dataset |
35,136 | How a reduction can help up solve a problem? | <p>I am studying the basics of Computation Theory and I came up with an example I can't understand.</p>

<p>Let's have a language $L = \{\langle M\rangle \mid L(M) = \Sigma^{\ast} \}$, so $L$ contains codes of all Turing machines which generate all the words from $\Sigma^{\ast}$. It's been said that we can redu... | turing machines reductions halting problem | 1 | How a reduction can help up solve a problem? -- (turing machines reductions halting problem)
<p>I am studying the basics of Computation Theory and I came up with an example I can't understand.</p>

<p>Let's have a language $L = \{\langle M\rangle \mid L(M) = \Sigma^{\ast} \}$, so $L$ contains codes of all Turin... | habedi/stack-exchange-dataset |
35,146 | Turing machine working only with 1's and blanks - how to encode input? | <p>Let's say we have a Turing machine which head can only write 1 or blank to the tape (although it can read all symbols from any input alphabet correctly). Can we operate with it on any input?</p>

<p>My approach was that we can rewrite our input tape with unary coding and symbol-codings separated with blanks.... | turing machines encoding scheme | 1 | Turing machine working only with 1's and blanks - how to encode input? -- (turing machines encoding scheme)
<p>Let's say we have a Turing machine which head can only write 1 or blank to the tape (although it can read all symbols from any input alphabet correctly). Can we operate with it on any input?</p>

<p>My... | habedi/stack-exchange-dataset |
35,147 | How many satisfying assignments are there in a set of 3-CNF clauses where no clause share the same variable? | <p>Say I have a set of 3-CNF clauses
$$\mathcal{S} = \{ x_1 \vee x_2 \vee \bar{x_3}, ~~x_4 \vee x_5 \vee x_6\}$$</p>

<p>where $\bar{x}$ is the negation of $x$. Each variable range over $\mathbb{Z}^2$.</p>

<p>How many satisfying assginments are there for $S$? In general, how many satisfying assignm... | satisfiability 3 sat | 1 | How many satisfying assignments are there in a set of 3-CNF clauses where no clause share the same variable? -- (satisfiability 3 sat)
<p>Say I have a set of 3-CNF clauses
$$\mathcal{S} = \{ x_1 \vee x_2 \vee \bar{x_3}, ~~x_4 \vee x_5 \vee x_6\}$$</p>

<p>where $\bar{x}$ is the negation of $x$. Each variabl... | habedi/stack-exchange-dataset |
35,155 | Is 0* decidable? | <p>I found a statement (without explanation) that a language $A = 0^*$ is decidable. How is that possible? I mean, how would we build a Turing machine that would accept (or reject) a possibly infinite string of 0's? I also thought that maybe we could create an enumerator that would create all words from $0^*$ with incr... | formal languages computability | 1 | Is 0* decidable? -- (formal languages computability)
<p>I found a statement (without explanation) that a language $A = 0^*$ is decidable. How is that possible? I mean, how would we build a Turing machine that would accept (or reject) a possibly infinite string of 0's? I also thought that maybe we could create an enumer... | habedi/stack-exchange-dataset |
35,164 | How again do certain sorting methods use $o(n \log n)$ time? | <p>I hope this question isn't too 'soft' for here. It's been a while $\tiny{\text{an eternity for some people's standards}}$ since I've touched this stuff, and I had a convincing explanation to this question eight minutes ago but must have misplaced it, so please help me find it again:</p>

<p>Most classical s... | algorithms sorting efficiency | 1 | How again do certain sorting methods use $o(n \log n)$ time? -- (algorithms sorting efficiency)
<p>I hope this question isn't too 'soft' for here. It's been a while $\tiny{\text{an eternity for some people's standards}}$ since I've touched this stuff, and I had a convincing explanation to this question eight minutes a... | habedi/stack-exchange-dataset |
35,166 | PDA recognising all strings with a $1$ in the second half | <p>My professor gave us an old exam to look over for our final exam and I am having a hard time understanding the push down automata problem he gave. In the problem it says:</p>

<blockquote>
 <p>Let $\Sigma = \{0,1\}$ and $B$ is the collection of all strings that contain at least one $1$ in the second hal... | formal languages context free pushdown automata | 1 | PDA recognising all strings with a $1$ in the second half -- (formal languages context free pushdown automata)
<p>My professor gave us an old exam to look over for our final exam and I am having a hard time understanding the push down automata problem he gave. In the problem it says:</p>

<blockquote>
 <p>... | habedi/stack-exchange-dataset |
35,170 | Automata for languages derived from an automaton by number of state visits | <p>My question in response to <a href="https://cs.stackexchange.com/a/18614/22902">this answer</a>: what would the finite automata look like for $L_1$ and $L_0$ in the answer? </p>

<p>I get how the languages are formed; however, since $M_L$ cannot remember how many times it has looped, how does $q$ branch off ... | regular languages automata finite automata | 1 | Automata for languages derived from an automaton by number of state visits -- (regular languages automata finite automata)
<p>My question in response to <a href="https://cs.stackexchange.com/a/18614/22902">this answer</a>: what would the finite automata look like for $L_1$ and $L_0$ in the answer? </p>

<p>I ge... | habedi/stack-exchange-dataset |
35,175 | Counting inversion pairs - $n^2$ results in $n \log n$ time? | <p>The number of possible inversions in an array is bounded by $\binom{n}{2}$, i.e $\frac{n(n-1)}{2} \in O(n^2)$. How it is possible to calculate $O(n^2)$ results in $O(n\log n)$ time using something like modified merge sort? (sample algo : <a href="http://www.geeksforgeeks.org/counting-inversions/" rel="nofollow">http... | algorithms algorithm analysis | 1 | Counting inversion pairs - $n^2$ results in $n \log n$ time? -- (algorithms algorithm analysis)
<p>The number of possible inversions in an array is bounded by $\binom{n}{2}$, i.e $\frac{n(n-1)}{2} \in O(n^2)$. How it is possible to calculate $O(n^2)$ results in $O(n\log n)$ time using something like modified merge sort... | habedi/stack-exchange-dataset |
35,183 | Proving a function is uncomputable | <p>I am trying to solve the following problem:</p>

<p>For each Turing machine $M_k$ and each string $x$ in $\{$0,1$\}$$^\ast$ let </p>

<p>$time_k(x)$ = $\{$the number of steps executed by $M_k(x)$ if $M_k(x)$$\downarrow$ (halts), and $\infty$ if $M_k(x)$$\uparrow$ (does not halt)$\}$</p>

<p>P... | computability reductions undecidability halting problem | 1 | Proving a function is uncomputable -- (computability reductions undecidability halting problem)
<p>I am trying to solve the following problem:</p>

<p>For each Turing machine $M_k$ and each string $x$ in $\{$0,1$\}$$^\ast$ let </p>

<p>$time_k(x)$ = $\{$the number of steps executed by $M_k(x)$ if $M_k(x... | habedi/stack-exchange-dataset |
35,189 | Relation between CLR Grammar and Ambiguity | <p>I am studying CLR Parser and have a query about Grammar. If a Grammar can't be parsed using CLR(1) Parser ( i.e LR(1)) parser is it necessarily ambiguous?</p>

<p>Is it possible that a grammar which is unambiguous can't be parsed using CLR Parser?</p>
 | formal grammars parsers ambiguity | 1 | Relation between CLR Grammar and Ambiguity -- (formal grammars parsers ambiguity)
<p>I am studying CLR Parser and have a query about Grammar. If a Grammar can't be parsed using CLR(1) Parser ( i.e LR(1)) parser is it necessarily ambiguous?</p>

<p>Is it possible that a grammar which is unambiguous can't be pars... | habedi/stack-exchange-dataset |
35,190 | Understanding reductions: Would a polynomial time algorithm for one NP-complete problem mean a polynomial time algorithm for all NP-complete problems? | <p>To prove that some decision problem $A$ is NP-complete, my understanding is that it suffices to show that the problem is in NP (i.e. that one can verify or reject all statements in polynomial time), and to demonstrate that some known NP-complete problem $B$ can be reduced to $A$ (such that we can write $B \leq_p A$)... | complexity theory np complete reductions | 1 | Understanding reductions: Would a polynomial time algorithm for one NP-complete problem mean a polynomial time algorithm for all NP-complete problems? -- (complexity theory np complete reductions)
<p>To prove that some decision problem $A$ is NP-complete, my understanding is that it suffices to show that the problem is... | habedi/stack-exchange-dataset |
35,200 | Finding three factors of a number with minimal sum | <p>Suppose that we have a number $x \in \mathbb{Z}^+$.</p>

<p>I am seeking an algorithm to find three numbers $a, b, c \in \mathbb{Z}^+$ such that $a \times b \times c = x$ and $a + b + c$ is minimum.</p>

<p>Is this problem a variant of subset sum? Am I stuck with an exponential time algorithm?</p>&#x... | algorithms factoring | 1 | Finding three factors of a number with minimal sum -- (algorithms factoring)
<p>Suppose that we have a number $x \in \mathbb{Z}^+$.</p>

<p>I am seeking an algorithm to find three numbers $a, b, c \in \mathbb{Z}^+$ such that $a \times b \times c = x$ and $a + b + c$ is minimum.</p>

<p>Is this problem a... | habedi/stack-exchange-dataset |
35,206 | Transforming the sorting problem into Dijkstra | <p>To get a lower bound of nlogn I am taking the sorting algorithm, which is well known to have that, and transforming/adapting it to Dijkstra's single source shortest path problem.</p>

<p>I know you need to do create a graph based on the numeric values and that Dijkstra will traverse it in order, any help wit... | shortest path | 1 | Transforming the sorting problem into Dijkstra -- (shortest path)
<p>To get a lower bound of nlogn I am taking the sorting algorithm, which is well known to have that, and transforming/adapting it to Dijkstra's single source shortest path problem.</p>

<p>I know you need to do create a graph based on the numeri... | habedi/stack-exchange-dataset |
35,208 | Programs for artificial system design? | <p>Are there program systems that can discover the need of routines - and then design them, code them and use them as parts of the system?</p>

<hr>

<p>Any group of humans trying to pursue an activity has to develop in a developed system, to solve their problems by formulating the issues, search for kn... | artificial intelligence code generation | 1 | Programs for artificial system design? -- (artificial intelligence code generation)
<p>Are there program systems that can discover the need of routines - and then design them, code them and use them as parts of the system?</p>

<hr>

<p>Any group of humans trying to pursue an activity has to develop in ... | habedi/stack-exchange-dataset |
35,209 | Which CNF boolean formulas blow up exponentially at conversion to DNF? | <p>If I'm correct, some boolean formulas in CNF require exponential size when being converted to an equivalent DNF version (and vice versa).</p>

<p>But what is an example of such a formula (and is there a general way to capture their structure - if the first question is too easy, and I'm just too stupid to se... | space complexity boolean algebra | 1 | Which CNF boolean formulas blow up exponentially at conversion to DNF? -- (space complexity boolean algebra)
<p>If I'm correct, some boolean formulas in CNF require exponential size when being converted to an equivalent DNF version (and vice versa).</p>

<p>But what is an example of such a formula (and is ther... | habedi/stack-exchange-dataset |
35,214 | What is the overhead of Virtual Memory? | <p>What is the price paid for the vast virtual address space provided to
programmers for their applications? Or in other words, what is the overhead due to virtual memory?</p>

<p>Is there any other overhead from implementing virtual memory, beyond memory consumed by the kernel?</p>
 | operating systems virtual memory | 1 | What is the overhead of Virtual Memory? -- (operating systems virtual memory)
<p>What is the price paid for the vast virtual address space provided to
programmers for their applications? Or in other words, what is the overhead due to virtual memory?</p>

<p>Is there any other overhead from implementing virt... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.