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 |
|---|---|---|---|---|---|---|
42,511 | Time complexity of a classical version of Shor's algorithm | <p>I'm sorry if this question seems too naive.
I've read the Shor's algorithm of factoring big number using quantum computer on Wikipedia. It says,the key step is to find the cycle of the function defined on positive integers:f(x)=a^x mod N, where a and N are positive integer,and N is very large. </p>

<p>W... | algorithm analysis | 1 | Time complexity of a classical version of Shor's algorithm -- (algorithm analysis)
<p>I'm sorry if this question seems too naive.
I've read the Shor's algorithm of factoring big number using quantum computer on Wikipedia. It says,the key step is to find the cycle of the function defined on positive integers:f(x)=a^... | habedi/stack-exchange-dataset |
42,523 | algorithms, number of instructions in the code | <p>How many instructions as a function of the input size N?</p>

<pre><code>int count=0;
for (int i=0; i<N; i++)
 for(int j=i+1; j<N; j++)
 if(a[i] + a[j] ==0)
 count++;
</code></pre>

<p># of "less than" compare instructions = 1/2(N+1)(N+2) Can someone pl. explain... | algorithm analysis | 1 | algorithms, number of instructions in the code -- (algorithm analysis)
<p>How many instructions as a function of the input size N?</p>

<pre><code>int count=0;
for (int i=0; i<N; i++)
 for(int j=i+1; j<N; j++)
 if(a[i] + a[j] ==0)
 count++;
</code></pre>

<p># of "les... | habedi/stack-exchange-dataset |
42,534 | How many Turing machines are there with $c$ characters and $n$ states? | <p>By $c$ character I mean the numbers $0,\dots,c-1$ and the blank symbol $b$, and by $n$ states I mean $n$ non-accepting states, reject and accept.</p>

<p>We can assume every $n$-state Turing machine has $(c+1)n$ transitions going to either another non-accepting state, reject, or accept, that is that it has a... | turing machines | 1 | How many Turing machines are there with $c$ characters and $n$ states? -- (turing machines)
<p>By $c$ character I mean the numbers $0,\dots,c-1$ and the blank symbol $b$, and by $n$ states I mean $n$ non-accepting states, reject and accept.</p>

<p>We can assume every $n$-state Turing machine has $(c+1)n$ trans... | habedi/stack-exchange-dataset |
42,540 | Why don't modern SAT solvers use the notion of a "watched clause", in the same way they use the notion of a "watched literal"? | <p>Modern SAT solvers use the notion of "watched literals": when a value is chosen for a literal $l$, the solver only checks whether that falsifies clauses with $l$ in them if $l$ is one of the watched literals in the clause. This prevents checking every clause for every newly assigned literal.</p>

<p>The corr... | satisfiability sat solvers constraint satisfaction | 1 | Why don't modern SAT solvers use the notion of a "watched clause", in the same way they use the notion of a "watched literal"? -- (satisfiability sat solvers constraint satisfaction)
<p>Modern SAT solvers use the notion of "watched literals": when a value is chosen for a literal $l$, the solver only checks whether that... | habedi/stack-exchange-dataset |
42,544 | Why does Schaefer's theorem not prove that P=NP? | <p>This is probably a stupid question, but I just don't understand. In another <a href="https://cs.stackexchange.com/questions/42502/is-2-sat-with-xor-relations-np-complete/42537">question</a> they came up with <a href="http://en.wikipedia.org/wiki/Schaefer%27s_dichotomy_theorem" rel="noreferrer">Schaefer's dichotomy t... | np complete satisfiability p vs np | 1 | Why does Schaefer's theorem not prove that P=NP? -- (np complete satisfiability p vs np)
<p>This is probably a stupid question, but I just don't understand. In another <a href="https://cs.stackexchange.com/questions/42502/is-2-sat-with-xor-relations-np-complete/42537">question</a> they came up with <a href="http://en.w... | habedi/stack-exchange-dataset |
42,547 | The initial NP-complete problem | <p>It is always claimed that Cook and Levin gives the very first NP-complete problem and proof of it.</p>

<p>But when I look at the actual proof I think what Cook and Levin did was reduced (or transformed) SAT to "P-bound NTM acceptance" problem.</p>

<p>Formally, we define</p>

<blockquote>&#x... | np complete satisfiability | 1 | The initial NP-complete problem -- (np complete satisfiability)
<p>It is always claimed that Cook and Levin gives the very first NP-complete problem and proof of it.</p>

<p>But when I look at the actual proof I think what Cook and Levin did was reduced (or transformed) SAT to "P-bound NTM acceptance" problem.<... | habedi/stack-exchange-dataset |
42,550 | What's wrong here, or, is CNF to DNF conversion in o(exp(n))? | <p>I've been thinking about conversion from CNF to DNF. Assume a "worst case" CNF formula with $k$ disjunctions, each containing exactly $l$ elements and no variable is used twice. Example with $k=3$ and $l=2$:</p>

<p>$(a \lor b) \land (c \lor d) \land (e \lor f)$</p>

<p>Obviously, this will result in... | complexity theory complexity classes | 1 | What's wrong here, or, is CNF to DNF conversion in o(exp(n))? -- (complexity theory complexity classes)
<p>I've been thinking about conversion from CNF to DNF. Assume a "worst case" CNF formula with $k$ disjunctions, each containing exactly $l$ elements and no variable is used twice. Example with $k=3$ and $l=2$:</p>&#... | habedi/stack-exchange-dataset |
42,555 | Infinite Memory | <p>It seems to me that any problem whose solution requires finite memory can be emulated on a Finite State Machine . This would make those problems that can't be solved by a Finite State Machine to require infinite memory ( like general multiplication of integers ).<br>
My question is what "infinite memory" reall... | turing machines finite automata | 1 | Infinite Memory -- (turing machines finite automata)
<p>It seems to me that any problem whose solution requires finite memory can be emulated on a Finite State Machine . This would make those problems that can't be solved by a Finite State Machine to require infinite memory ( like general multiplication of integers )... | habedi/stack-exchange-dataset |
42,568 | Thompson's Construction Algorithm produces a different NFA | <p>My teacher asked me to convert the regular expression $(a | b)^*$ to an NFA using <a href="https://en.wikipedia.org/wiki/Thompson%27s_construction_algorithm" rel="nofollow noreferrer">Thompson's algorithm</a> – well, I'm well aware of how this algorithm works, but since I'm not good at memorising details, I produced... | automata finite automata regular expressions simulation | 1 | Thompson's Construction Algorithm produces a different NFA -- (automata finite automata regular expressions simulation)
<p>My teacher asked me to convert the regular expression $(a | b)^*$ to an NFA using <a href="https://en.wikipedia.org/wiki/Thompson%27s_construction_algorithm" rel="nofollow noreferrer">Thompson's al... | habedi/stack-exchange-dataset |
42,572 | SCC of a Directed Acyclic Graph | <p>My instructor asked me to prove that strongly connected component of a DAG is also a DAG. I don't get it. How can a graph be DAG and strongly connected at the same time? </p>

<p>Consider a graph on two vertices "u" and "v" and assume that it is strongly connected as well as a DAG. A path from u to v exists ... | graphs dag | 1 | SCC of a Directed Acyclic Graph -- (graphs dag)
<p>My instructor asked me to prove that strongly connected component of a DAG is also a DAG. I don't get it. How can a graph be DAG and strongly connected at the same time? </p>

<p>Consider a graph on two vertices "u" and "v" and assume that it is strongly connec... | habedi/stack-exchange-dataset |
42,579 | m-functions in Turing's paper "On Computable Numbers and applications..." | <p>I was reading Alan Turing's paper "<a href="http://www.cs.virginia.edu/~robins/Turing_Paper_1936.pdf" rel="nofollow">On Computable Numbers with an Application to the Entscheidungsproblem</a>".</p>

<p>I was reading well until I encountered "4. Abbreviated Tables", page 235-236, where Turing uses a new way of... | computability turing machines logic decision problem | 1 | m-functions in Turing's paper "On Computable Numbers and applications..." -- (computability turing machines logic decision problem)
<p>I was reading Alan Turing's paper "<a href="http://www.cs.virginia.edu/~robins/Turing_Paper_1936.pdf" rel="nofollow">On Computable Numbers with an Application to the Entscheidungsproble... | habedi/stack-exchange-dataset |
42,581 | Entropy based progress bar | <p>Would it be possible to build a progress bar that estimates progress using entropy?</p>

<p>Consider a web browser that is downloading a large file (for instance), which displays a progress bar indicating the amount of progress in the download. Let $X$ denote the value of the complete file; it is not known ... | information theory | 1 | Entropy based progress bar -- (information theory)
<p>Would it be possible to build a progress bar that estimates progress using entropy?</p>

<p>Consider a web browser that is downloading a large file (for instance), which displays a progress bar indicating the amount of progress in the download. Let $X$ deno... | habedi/stack-exchange-dataset |
42,594 | Inventory Routing - Subtour Elimination | <p>I'm trying to implement a Inventory Routing Problem with Branch-and-Cut. But I'm facing with an issue regarding subtour elimination. (<a href="http://www.danflash.com/files/irp.pdf" rel="nofollow">http://www.danflash.com/files/irp.pdf</a>)</p>

<p>The paper describes the constraint like this:
$$\sum_{i \... | optimization linear programming traveling salesman | 1 | Inventory Routing - Subtour Elimination -- (optimization linear programming traveling salesman)
<p>I'm trying to implement a Inventory Routing Problem with Branch-and-Cut. But I'm facing with an issue regarding subtour elimination. (<a href="http://www.danflash.com/files/irp.pdf" rel="nofollow">http://www.danflash.com/... | habedi/stack-exchange-dataset |
42,595 | Handling dead state in NFA to DFA conversion | <p>I want to convert below NFA into DFA:</p>

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

<p>I prepared below tables and finally the NFA:</p>

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

<p><i... | formal languages regular languages automata finite automata | 1 | Handling dead state in NFA to DFA conversion -- (formal languages regular languages automata finite automata)
<p>I want to convert below NFA into DFA:</p>

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

<p>I prepared below tables and finally the NFA:</p>
... | habedi/stack-exchange-dataset |
42,604 | Paxos: Instances, Rounds, Phases | <p>In the paper, Paxos Made Simple, Lamport describes a round of Paxos as two phases: a $prepare$ phase, and an $accept$ phase. An instance of Paxos can have multiple rounds. Can a round have multiple proposers make proposals, or is it strictly one proposal per round?</p>

<p>In addition, I found a number of so... | distributed systems | 1 | Paxos: Instances, Rounds, Phases -- (distributed systems)
<p>In the paper, Paxos Made Simple, Lamport describes a round of Paxos as two phases: a $prepare$ phase, and an $accept$ phase. An instance of Paxos can have multiple rounds. Can a round have multiple proposers make proposals, or is it strictly one proposal per ... | habedi/stack-exchange-dataset |
42,605 | Counting the nodes in a network in a distributed way | <p>There is a network with $n$ nodes. Each node can contact only the neighbouring nodes (the degree of each node is bounded, if that matters).</p>

<p>One of the nodes, say $s$, wants to know $n$. How can it do this? </p>

<p>Each node has $O(\log n)$ memory bits, so it can hold a counter, but not a lis... | algorithms graphs reference request distributed systems | 1 | Counting the nodes in a network in a distributed way -- (algorithms graphs reference request distributed systems)
<p>There is a network with $n$ nodes. Each node can contact only the neighbouring nodes (the degree of each node is bounded, if that matters).</p>

<p>One of the nodes, say $s$, wants to know $n$. H... | habedi/stack-exchange-dataset |
42,609 | Algorithm to search substring in a circular string? | <p>I need an algorithm to search for substrings. I checked different resources, and it seems that the most known algorithms are the <a href="http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm" rel="nofollow noreferrer">Boyer–Moore</a> and the <a href="http://en.wikipedia.org/wiki/Knuth%E2%80%93Mor... | algorithms search algorithms strings substrings | 1 | Algorithm to search substring in a circular string? -- (algorithms search algorithms strings substrings)
<p>I need an algorithm to search for substrings. I checked different resources, and it seems that the most known algorithms are the <a href="http://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm" ... | habedi/stack-exchange-dataset |
42,613 | Parallel Algorithm for Donor/Recipient Matching - Graph Matching/Optimization | <p>I'm not certain I can accurately describe the problem using my knowledge of discrete math, so pardon any inaccuracies. Happy to clarify any part of the question which is unclear.</p>

<p>Given the following constraints: </p>

<ul>
<li>Two sets, each with 'n' elements: 'donors' and 'recipients'. $... | algorithms graphs optimization parallel computing | 1 | Parallel Algorithm for Donor/Recipient Matching - Graph Matching/Optimization -- (algorithms graphs optimization parallel computing)
<p>I'm not certain I can accurately describe the problem using my knowledge of discrete math, so pardon any inaccuracies. Happy to clarify any part of the question which is unclear.</p>&#... | habedi/stack-exchange-dataset |
42,616 | Can well-formed formulas in predicate logic for a given signature be recognized in LOGSPACE? | <p>I read that <a href="http://en.wikipedia.org/wiki/Nested_word" rel="nofollow noreferrer">visibly pushdown languages</a> are supposed to model the typical simple formal languages like XML better than deterministic context free languages. The visibly pushdown languages can be recognized in LOGSPACE. I wonder whether t... | complexity theory formal languages first order logic | 1 | Can well-formed formulas in predicate logic for a given signature be recognized in LOGSPACE? -- (complexity theory formal languages first order logic)
<p>I read that <a href="http://en.wikipedia.org/wiki/Nested_word" rel="nofollow noreferrer">visibly pushdown languages</a> are supposed to model the typical simple forma... | habedi/stack-exchange-dataset |
42,617 | Worst case bisection of binary tree | <p>My algorithm book states that any n-vertex binary tree T can be partitioned by just removing a single edge into two disconnected trees A and B where neither of them has more than 3/4 of the vertices.</p>

<p>It sounds like it should be simple to create such a tree, but I can't imagine one, my bisections are ... | binary trees | 1 | Worst case bisection of binary tree -- (binary trees)
<p>My algorithm book states that any n-vertex binary tree T can be partitioned by just removing a single edge into two disconnected trees A and B where neither of them has more than 3/4 of the vertices.</p>

<p>It sounds like it should be simple to create su... | habedi/stack-exchange-dataset |
42,621 | Hamiltonian circuit for a family of graphs | <p>For $\Sigma = \{a,b\}$, let $S_n = \{w\mid w \in \Sigma^{*} \land |w| = n\}$.</p>

<p>Let $C_n \subset \Sigma^{*}$ be the language of circular strings that contain as substrings all elements of $S_n$.
For instance, $bbaaaababaabbbba \in C_4$</p>

<p>I have formulated the problem of finding the s... | search algorithms strings hamiltonian path hamiltonian circuit | 1 | Hamiltonian circuit for a family of graphs -- (search algorithms strings hamiltonian path hamiltonian circuit)
<p>For $\Sigma = \{a,b\}$, let $S_n = \{w\mid w \in \Sigma^{*} \land |w| = n\}$.</p>

<p>Let $C_n \subset \Sigma^{*}$ be the language of circular strings that contain as substrings all elements of $S_n... | habedi/stack-exchange-dataset |
42,624 | Integer Knapsack Problem - No duplicates Allowed | <p>In the bounded Integer Knapsack problem, we are given N items of sizes S1 through SN, having values V1 through VN. The problem requires us to find the maximum value that can be attained for a given capacity C, provided we cannot use an already used item twice.</p>

<p>In their book, Introduction to Algorithm... | algorithms dynamic programming | 1 | Integer Knapsack Problem - No duplicates Allowed -- (algorithms dynamic programming)
<p>In the bounded Integer Knapsack problem, we are given N items of sizes S1 through SN, having values V1 through VN. The problem requires us to find the maximum value that can be attained for a given capacity C, provided we cannot use... | habedi/stack-exchange-dataset |
42,631 | Why is $\emptyset L = L\emptyset = \emptyset$ correct? | <p>I am taking a course on Automaton where I faced the algebraic laws of regular expressions.</p>
<p>First two were ok:</p>
<blockquote>
<ol>
<li><p><span class="math-container">$\emptyset + L = L + \emptyset = L$</span>: Union of a language <span class="math-container">$L$</span> with empty language gi... | formal languages | 1 | Why is $\emptyset L = L\emptyset = \emptyset$ correct? -- (formal languages)
<p>I am taking a course on Automaton where I faced the algebraic laws of regular expressions.</p>
<p>First two were ok:</p>
<blockquote>
<ol>
<li><p><span class="math-container">$\emptyset + L = L + \emptyset = L$</span>: Union... | habedi/stack-exchange-dataset |
42,634 | Complexity terminology | <p>What is the terminology used for speaking about complexity, when we don't study it asympotically (but exactly) ?</p>

<p>Thank you</p>
 | complexity theory runtime analysis | 1 | Complexity terminology -- (complexity theory runtime analysis)
<p>What is the terminology used for speaking about complexity, when we don't study it asympotically (but exactly) ?</p>

<p>Thank you</p>
 | habedi/stack-exchange-dataset |
42,637 | It is possible to implement insertion sort for sorting linked list ? | <p>it is possible to implement insertion sort for sorting linked lists ? will it have the same O(n^2) efficiency as the array version ? </p>
 | algorithms algorithm analysis sorting | 1 | It is possible to implement insertion sort for sorting linked list ? -- (algorithms algorithm analysis sorting)
<p>it is possible to implement insertion sort for sorting linked lists ? will it have the same O(n^2) efficiency as the array version ? </p>
 | habedi/stack-exchange-dataset |
42,640 | Mergesort with $O(n^2 \log n)$ runtime | <p>I have a task where i need to find a problem in which mergesort has to have a runtime of $O(n^2 \log n)$. In our lecture we said that the runtime is $O(n \log n)$ assuming that every comparison is $O(1)$. I think that I have to work with comparison-complexity but I dont know how to create a runtime of $O(n^2 \log n)... | algorithms asymptotics runtime analysis | 1 | Mergesort with $O(n^2 \log n)$ runtime -- (algorithms asymptotics runtime analysis)
<p>I have a task where i need to find a problem in which mergesort has to have a runtime of $O(n^2 \log n)$. In our lecture we said that the runtime is $O(n \log n)$ assuming that every comparison is $O(1)$. I think that I have to work ... | habedi/stack-exchange-dataset |
42,649 | Use Rice's theorem to prove the following is undecidable | <p>Given the language $L=\{\alpha \mid M_{\alpha}(x)=x^3$ for all $x\in\{0,1\}^*\}$. Prove using Rice's theorem that $L$ is undecidable.</p>

<p>Rice's theorem: Let $P$ be a set of all computable functions $f:\{0,1\}^*\rightarrow \{0,1\}^*$(i.e all functions which have a corresponding turing machine $M$, such ... | complexity theory undecidability rice theorem | 1 | Use Rice's theorem to prove the following is undecidable -- (complexity theory undecidability rice theorem)
<p>Given the language $L=\{\alpha \mid M_{\alpha}(x)=x^3$ for all $x\in\{0,1\}^*\}$. Prove using Rice's theorem that $L$ is undecidable.</p>

<p>Rice's theorem: Let $P$ be a set of all computable functio... | habedi/stack-exchange-dataset |
42,652 | What makes an MILP problem solvable? | <p>Knapsack problems, Assignment problems can all be expressed as (MILP) mixed integer linear programs. MILP is NP-complete. But Knapsack problem is solvable in pseudo-polynomial time using dynamic programming and 0-1 assignment problem can be solved using Hungarian algorithm in polynomial time. So what makes a MILP pr... | algorithms optimization discrete mathematics knapsack problems assignment problem | 1 | What makes an MILP problem solvable? -- (algorithms optimization discrete mathematics knapsack problems assignment problem)
<p>Knapsack problems, Assignment problems can all be expressed as (MILP) mixed integer linear programs. MILP is NP-complete. But Knapsack problem is solvable in pseudo-polynomial time using dynami... | habedi/stack-exchange-dataset |
42,660 | How to read $NC^1\subset L \subset NL \subset SAC^1$, $SAC^1=LOGCFL/poly$, and similar statements? | <p>The (complexity zoo) description of <a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:N#nc1" rel="nofollow">$NC^1$</a> says that it is contained in <a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:L#l" rel="nofollow">$L$</a>, i.e. $NC^1\subset L$. The description of <a href="https://complexityzoo.... | complexity theory circuits | 1 | How to read $NC^1\subset L \subset NL \subset SAC^1$, $SAC^1=LOGCFL/poly$, and similar statements? -- (complexity theory circuits)
<p>The (complexity zoo) description of <a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:N#nc1" rel="nofollow">$NC^1$</a> says that it is contained in <a href="https://complexityzo... | habedi/stack-exchange-dataset |
42,662 | Identity productions in regular grammar | <p>If a grammar is of the following form (i.e. all its productions are), is its language regular?</p>

<ol>
<li>$B → a$ - where $B$ is a non-terminal in $N$ and a is a terminal in $Σ$</li>
<li>$B → aC$ - where $B$ and $C$ are in $N$ and $a$ is in $Σ$</li>
<li>$B → ε$ - where $B$ is in $N$ and $ε$ de... | regular languages formal grammars | 1 | Identity productions in regular grammar -- (regular languages formal grammars)
<p>If a grammar is of the following form (i.e. all its productions are), is its language regular?</p>

<ol>
<li>$B → a$ - where $B$ is a non-terminal in $N$ and a is a terminal in $Σ$</li>
<li>$B → aC$ - where $B$ and $C$ are... | habedi/stack-exchange-dataset |
42,681 | Best pathfinding algorithm for undirected unweighted graph | <p>I have an unweighted undirected graph with every node connected with an average of two hundred other nodes (nodes are people from social network). What will be the fastest algorithm to find the shortest path from one node to another?</p>
 | algorithms graphs shortest path | 1 | Best pathfinding algorithm for undirected unweighted graph -- (algorithms graphs shortest path)
<p>I have an unweighted undirected graph with every node connected with an average of two hundred other nodes (nodes are people from social network). What will be the fastest algorithm to find the shortest path from one node... | habedi/stack-exchange-dataset |
42,685 | In what sense is the Mandelbrot set "computable"? | <p>The <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot set</a> is a beautiful creature in Mathematics.</p>

<p>There are a lot of beautiful images of this set created with high precision, so obviously this set is "computable" in some sense.</p>

<p>However, what concerns me is the fact ... | computability | 1 | In what sense is the Mandelbrot set "computable"? -- (computability)
<p>The <a href="http://en.wikipedia.org/wiki/Mandelbrot_set">Mandelbrot set</a> is a beautiful creature in Mathematics.</p>

<p>There are a lot of beautiful images of this set created with high precision, so obviously this set is "computable" ... | habedi/stack-exchange-dataset |
42,690 | How to improve my these specific math skills? | <p>I am student of CS. Problem is, I feel that I don't have enough math knowledge to solve mathematical problems. When some programming problems arises which needs some math skills to solve then despite of the fact that I know how to code I can't solve it. For example, if I don't know the formula for area of circle, I ... | algorithms complexity theory terminology data structures discrete mathematics | 1 | How to improve my these specific math skills? -- (algorithms complexity theory terminology data structures discrete mathematics)
<p>I am student of CS. Problem is, I feel that I don't have enough math knowledge to solve mathematical problems. When some programming problems arises which needs some math skills to solve t... | habedi/stack-exchange-dataset |
42,698 | Proving that f(N) = N lg N + O(N) implies f(N) = Θ(NlogN) | <p>How do you prove the following?</p>

<p>$$f(N)=N\space lg\space N + O(N) \implies f(N) = \Theta(N \space log \space N)$$</p>

<p>Here $lg\space N \equiv log_2\space N$, and $O$ stands for the big-O, and $\Theta$ stands for big-theta. And $log \space N \equiv log_e \space N$, i.e. natural logarithm</p... | asymptotics landau notation | 1 | Proving that f(N) = N lg N + O(N) implies f(N) = Θ(NlogN) -- (asymptotics landau notation)
<p>How do you prove the following?</p>

<p>$$f(N)=N\space lg\space N + O(N) \implies f(N) = \Theta(N \space log \space N)$$</p>

<p>Here $lg\space N \equiv log_2\space N$, and $O$ stands for the big-O, and $\Theta... | habedi/stack-exchange-dataset |
42,701 | How to state that a complexity bound does not depend on a given parameter size? | <p>I am often ill at ease with Landau (Big O) notation, because it seems
often to be abusing mathematical notation. The best example is the use
of the equal sign to express a set membership. And this can be
misleading.</p>

<p>I have an algorithm that is dependent on two parameters $n$ and $m$,
... | complexity theory terminology asymptotics landau notation notation | 1 | How to state that a complexity bound does not depend on a given parameter size? -- (complexity theory terminology asymptotics landau notation notation)
<p>I am often ill at ease with Landau (Big O) notation, because it seems
often to be abusing mathematical notation. The best example is the use
of the equal sig... | habedi/stack-exchange-dataset |
42,708 | What is a standard way to construct a turing machine for any function to compute | <p>I am new to turing machines, I am having problems with mapping a function to a turing maching that computes that particular function. for example: </p>

<ol>
<li>f(x) = 2x + 3 n>= 0 </li>
<li>MIN(x,y) leaves the smallest between x and y on the tape. e.g. x=2 y = 3 i.e. #aabaaa</li>
</ol>

... | computability turing machines | 1 | What is a standard way to construct a turing machine for any function to compute -- (computability turing machines)
<p>I am new to turing machines, I am having problems with mapping a function to a turing maching that computes that particular function. for example: </p>

<ol>
<li>f(x) = 2x + 3 n>= 0 </li>&#... | habedi/stack-exchange-dataset |
42,709 | Prove/ Disprove: If $L$ is a CFL then $A(L)$ is a CFL too | <p>Consider the operation $A(L)$:</p>

<p>$$A(L) = \{ w: w\in L \land w_R \notin L \}$$</p>

<p>where $w_R$ is the reverse of $w$.</p>

<blockquote>
 <p>Prove/ Disprove: if $L$ is a CFL language so does $A(L)$.</p>
</blockquote>

<p>I am almost certain there's a counter-example ... | formal languages context free closure properties | 1 | Prove/ Disprove: If $L$ is a CFL then $A(L)$ is a CFL too -- (formal languages context free closure properties)
<p>Consider the operation $A(L)$:</p>

<p>$$A(L) = \{ w: w\in L \land w_R \notin L \}$$</p>

<p>where $w_R$ is the reverse of $w$.</p>

<blockquote>
 <p>Prove/ Disprove: if $L$ is... | habedi/stack-exchange-dataset |
42,725 | Proof of $P^{\text{#}P} = P^{PP}$ | <p>I was reading <a href="http://blog.computationalcomplexity.org/2002/09/complexity-class-of-week-pp.html" rel="nofollow">this</a> <a href="http://blog.computationalcomplexity.org/2002/09/complexity-class-of-week-pp.html" rel="nofollow">article</a> on the complexity class $PP$.</p>

<p>In the fourth paragraph ... | complexity theory complexity classes counting | 1 | Proof of $P^{\text{#}P} = P^{PP}$ -- (complexity theory complexity classes counting)
<p>I was reading <a href="http://blog.computationalcomplexity.org/2002/09/complexity-class-of-week-pp.html" rel="nofollow">this</a> <a href="http://blog.computationalcomplexity.org/2002/09/complexity-class-of-week-pp.html" rel="nofollo... | habedi/stack-exchange-dataset |
42,736 | Spatial data structures are part of Computational Geometry? | <p>Are spatial data structures like BVH - Bounding Volume Hierarchy ,kD-Trees etc are part of Computational Geometry( <a href="http://graphics.stanford.edu/courses/cs268-14-fall/" rel="nofollow">http://graphics.stanford.edu/courses/cs268-14-fall/</a>) or of </p>

<p>Data structures and Algorithms( <a href="http... | data structures | 1 | Spatial data structures are part of Computational Geometry? -- (data structures)
<p>Are spatial data structures like BVH - Bounding Volume Hierarchy ,kD-Trees etc are part of Computational Geometry( <a href="http://graphics.stanford.edu/courses/cs268-14-fall/" rel="nofollow">http://graphics.stanford.edu/courses/cs268-1... | habedi/stack-exchange-dataset |
42,739 | Good introduction to Turing's work and complexity theory? | <p>I'm currently an undergrad whose been amazed by what Turing has done for the world. I know there are plenty of other amazing individuals, but Turing's work specifically has always sounded the most interesting to me and I'm finally at the point where I can understand some of it. So my question is, where do I really b... | complexity theory turing machines books | 1 | Good introduction to Turing's work and complexity theory? -- (complexity theory turing machines books)
<p>I'm currently an undergrad whose been amazed by what Turing has done for the world. I know there are plenty of other amazing individuals, but Turing's work specifically has always sounded the most interesting to me... | habedi/stack-exchange-dataset |
42,744 | Why are syntax trees used in genetic programming? | <p>Reading a course on genetic programming, the first chapter describes the syntax tree as the basic representation of programs in genetic programming.</p>

<p>What are the reasons leading to the choice of a syntax tree in genetic programming? Are there any particular assets in using this representation?</p>&#x... | algorithms semantics genetic algorithms syntax trees syntax | 1 | Why are syntax trees used in genetic programming? -- (algorithms semantics genetic algorithms syntax trees syntax)
<p>Reading a course on genetic programming, the first chapter describes the syntax tree as the basic representation of programs in genetic programming.</p>

<p>What are the reasons leading to the c... | habedi/stack-exchange-dataset |
42,751 | Show that regular languages are closed under Mix operations | <p>Let $L_1, L_2$, two regular languages and the operations:</p>

<p>$$Mix_1(L_1, L_2) =\{ a_1b_1a_2b_2\ldots a_nb_n | n\ge 0 \land a_1,a_2,\ldots ,a_n,b_1,b_2,\ldots ,b_n\in\Sigma\\ \land a_1a_2\ldots a_n\in L_1 , b_1b_2\ldots b_n\in L_2\}$$</p>

<p>$$Mix_2(L_1, L_2) = \{ x_1y_1x_2y_2\ldots x_ny_n | n\... | formal languages regular languages closure properties | 1 | Show that regular languages are closed under Mix operations -- (formal languages regular languages closure properties)
<p>Let $L_1, L_2$, two regular languages and the operations:</p>

<p>$$Mix_1(L_1, L_2) =\{ a_1b_1a_2b_2\ldots a_nb_n | n\ge 0 \land a_1,a_2,\ldots ,a_n,b_1,b_2,\ldots ,b_n\in\Sigma\\ \land a_1a... | habedi/stack-exchange-dataset |
42,752 | Prove that regular languages and context-free languages aren't closed under $Perm(L)$ | <p>Let the operation $$Perm(L) = \{ w | \exists u \in L \text{ such that } u \text{ is a permutation of } w \}$$</p>

<blockquote>
 <p>Prove that both regular languages and CFLs aren't closed under $Perm(L)$.</p>
</blockquote>

<p>I've tried to use several well-known languages (like $\{0^n1^n\}... | formal languages regular languages context free closure properties | 1 | Prove that regular languages and context-free languages aren't closed under $Perm(L)$ -- (formal languages regular languages context free closure properties)
<p>Let the operation $$Perm(L) = \{ w | \exists u \in L \text{ such that } u \text{ is a permutation of } w \}$$</p>

<blockquote>
 <p>Prove that bot... | habedi/stack-exchange-dataset |
42,765 | Advantage of byte addressable memory over word addressable memory | <p>What is the reason that almost all computers (besides some DSPs) use byte addressable memory? With byte addressable memory and a 32 bit address you can have 4GB while with word addressable memory you can have 4GB * wordsize. Are single bytes used that much that you can't use routines that filter out single bytes fro... | computer architecture memory hardware | 1 | Advantage of byte addressable memory over word addressable memory -- (computer architecture memory hardware)
<p>What is the reason that almost all computers (besides some DSPs) use byte addressable memory? With byte addressable memory and a 32 bit address you can have 4GB while with word addressable memory you can have... | habedi/stack-exchange-dataset |
42,766 | Updating the MST of a graph G = (V,E) when decreasing the weight of one of the edges that is not part of the MST | <p>You are given a weighted undirected graph G = (V,E). You have run Prim's algorithm and found the MST of this graph. Now you pick one edge that is not part of the MST and reduce its weight by some value. You now want to come up with a smart way to find the new MST of the graph.</p>

<p>My approach would be ... | algorithms greedy algorithms | 1 | Updating the MST of a graph G = (V,E) when decreasing the weight of one of the edges that is not part of the MST -- (algorithms greedy algorithms)
<p>You are given a weighted undirected graph G = (V,E). You have run Prim's algorithm and found the MST of this graph. Now you pick one edge that is not part of the MST and... | habedi/stack-exchange-dataset |
42,769 | What is the minimal states for the language DFA? | <blockquote>
 <p>Let the language $$L = \{ w: \text{ for any prefix } u \text{ of } w :
 \left|\#_o(u) - 2\cdot \#_1(u) \right| \le 2 \}$$</p>
 
 <p>What is the minimal number of states for a DFA, accepting $L$?</p>
 
 <ol>
 <li>$4$</li>
 <li>$5$</li>
 <li>$6$</li>
 <li>... | formal languages regular languages | 1 | What is the minimal states for the language DFA? -- (formal languages regular languages)
<blockquote>
 <p>Let the language $$L = \{ w: \text{ for any prefix } u \text{ of } w :
 \left|\#_o(u) - 2\cdot \#_1(u) \right| \le 2 \}$$</p>
 
 <p>What is the minimal number of states for a DFA, accepting $L$?<... | habedi/stack-exchange-dataset |
42,779 | Is a single tape Turing machine equal in power to a Turing machine that can only move right? | <p>I assume no, because a Turing machine that can only move right feels like it is not a Turing machine. But, I wonder if I can add a Reset to the right moving Turing machine that resets the what head is pointing at all the way to the left of the TM. However, doesn't this make it left moving??</p>

<p>hmm...<... | complexity theory | 1 | Is a single tape Turing machine equal in power to a Turing machine that can only move right? -- (complexity theory)
<p>I assume no, because a Turing machine that can only move right feels like it is not a Turing machine. But, I wonder if I can add a Reset to the right moving Turing machine that resets the what head is... | habedi/stack-exchange-dataset |
42,780 | How many restricted length strings are there without significant repetitions | <p>Let us fix an alphabet $\Sigma$ of size $c$, then we have the finite language $\Sigma^n$ which is the set of all $n$ length words. For each $N,M$ how many words are there in $\Sigma^n$ such that no sequence of $N$ characters repeats $M$ times in a row?</p>

<p>For instance with N=2 and M=3
<code>101010</... | formal languages word combinatorics | 1 | How many restricted length strings are there without significant repetitions -- (formal languages word combinatorics)
<p>Let us fix an alphabet $\Sigma$ of size $c$, then we have the finite language $\Sigma^n$ which is the set of all $n$ length words. For each $N,M$ how many words are there in $\Sigma^n$ such that no s... | habedi/stack-exchange-dataset |
42,789 | Assign numbers to letters with respect to lowest graph peaks | <p>I have string which is composed of letters. I want to assign each letter a unique number (letters that repeats should have assigned same number as first unique letter occurrence) and plot those numbers on graph. X-axis will represent the particular letters of string (read from left to right) and y-axis will represen... | substrings string metrics | 1 | Assign numbers to letters with respect to lowest graph peaks -- (substrings string metrics)
<p>I have string which is composed of letters. I want to assign each letter a unique number (letters that repeats should have assigned same number as first unique letter occurrence) and plot those numbers on graph. X-axis will r... | habedi/stack-exchange-dataset |
42,799 | Prove the language of numbers divisible by 3 is not regular using pumping lemma | <p>I have a language $L$ that I think is not regular:</p>

<p>$L = \{w\in \{0,1,...,9\}^* \; | \enspace w \enspace \text{is a decimal representation of a number divisible by 3}\}$</p>

<p>I'm using pumping lemma in my proof. My main main idea is the following. I choose $w = 3$, according to the pumping ... | formal languages regular languages pumping lemma | 1 | Prove the language of numbers divisible by 3 is not regular using pumping lemma -- (formal languages regular languages pumping lemma)
<p>I have a language $L$ that I think is not regular:</p>

<p>$L = \{w\in \{0,1,...,9\}^* \; | \enspace w \enspace \text{is a decimal representation of a number divisible by 3}\}... | habedi/stack-exchange-dataset |
42,804 | Does every infinite recursive language contain an infinite regular subset? | <p>My intuition is telling me that this is not the case. But I am having trouble formulating a proof for this.How do I prove it ?</p>
 | computability regular languages | 1 | Does every infinite recursive language contain an infinite regular subset? -- (computability regular languages)
<p>My intuition is telling me that this is not the case. But I am having trouble formulating a proof for this.How do I prove it ?</p>
 | habedi/stack-exchange-dataset |
42,807 | Deterministic processing on probabilistic input | <p>I've designed an algorithm, is which responsible to process some samples from normal distribution under aegis of some deterministic steps. In other words, the algorithm generate unique response to a unique set of the random set of input.</p>

<p>Now I am prone to plan a title for the corresponding paper and ... | algorithms terminology | 1 | Deterministic processing on probabilistic input -- (algorithms terminology)
<p>I've designed an algorithm, is which responsible to process some samples from normal distribution under aegis of some deterministic steps. In other words, the algorithm generate unique response to a unique set of the random set of input.</p>... | habedi/stack-exchange-dataset |
42,808 | union of two equivalence classes (Myhill–Nerode theorem) | <p>Let a language, $L$ such that the equivalence relation, as defined in Myhill–Nerode theorem has $4$ equivalence classes; $A_1, \ldots, A_4$.</p>

<p>Let $S = A_1 \cup A_2$. </p>

<blockquote>
 <ol>
 <li>Is $S$ always regular?</li>
 <li>How many equivalence classes does the relation $\s... | formal languages regular languages | 1 | union of two equivalence classes (Myhill–Nerode theorem) -- (formal languages regular languages)
<p>Let a language, $L$ such that the equivalence relation, as defined in Myhill–Nerode theorem has $4$ equivalence classes; $A_1, \ldots, A_4$.</p>

<p>Let $S = A_1 \cup A_2$. </p>

<blockquote>
 <ol>&#... | habedi/stack-exchange-dataset |
42,811 | What are the main ideas used in a Fenwick tree? | <p>While I was solving a programming competition question, I came across a technique advertised as suitable for the solution. A so called <strong>Fenwick tree</strong> (a.k.a <strong>binary indexed tree</strong>) was at the heart of this technique. So in an effort to understand Fenwick trees, I researched all online so... | data structures binary trees | 1 | What are the main ideas used in a Fenwick tree? -- (data structures binary trees)
<p>While I was solving a programming competition question, I came across a technique advertised as suitable for the solution. A so called <strong>Fenwick tree</strong> (a.k.a <strong>binary indexed tree</strong>) was at the heart of this ... | habedi/stack-exchange-dataset |
42,819 | Is there a more intuitive proof of the halting problem's undecidability than diagonalization? | <p>I understand the proof of the undecidability of the halting problem (given for example in Papadimitriou's textbook), based on diagonalization.</p>

<p>While the proof is <em>convincing</em> (I understand each step of it), it is not <em>intuitive</em> to me in the sense that I don't see how someone would deri... | computability proof techniques undecidability halting problem intuition | 1 | Is there a more intuitive proof of the halting problem's undecidability than diagonalization? -- (computability proof techniques undecidability halting problem intuition)
<p>I understand the proof of the undecidability of the halting problem (given for example in Papadimitriou's textbook), based on diagonalization.</p>... | habedi/stack-exchange-dataset |
42,834 | Proving a language isn't regular using the pumping lemma | <p>Let the language $$ L = \{ a^nb^m : m,n \text{ has the same integer-quotient, (ignoring the remainder) } \} $$</p>

<blockquote>
 <p>Show that $L$ isn't regular using the pumping-lemma.</p>
</blockquote>

<p>Let's assume by contradiction that $L$ is regular, then there's a constant $p$ whic... | formal languages regular languages pumping lemma | 1 | Proving a language isn't regular using the pumping lemma -- (formal languages regular languages pumping lemma)
<p>Let the language $$ L = \{ a^nb^m : m,n \text{ has the same integer-quotient, (ignoring the remainder) } \} $$</p>

<blockquote>
 <p>Show that $L$ isn't regular using the pumping-lemma.</p>&#x... | habedi/stack-exchange-dataset |
42,835 | TM recognizing $0^n1^n$ requires Ω(log n) space | <p>I am trying to prove that any deterministic 1-tape Turing Machine which recognizes the language $L = \lbrace{0^n1^n | n \geq 0 \rbrace}$ requires 
$\Omega(\text{log }n)$ space.</p>

<p>I believe this can be done using a <em>crossing sequence</em> argument.
I have been trying to imitate the <a href="h... | complexity theory context free space complexity lower bounds | 1 | TM recognizing $0^n1^n$ requires Ω(log n) space -- (complexity theory context free space complexity lower bounds)
<p>I am trying to prove that any deterministic 1-tape Turing Machine which recognizes the language $L = \lbrace{0^n1^n | n \geq 0 \rbrace}$ requires 
$\Omega(\text{log }n)$ space.</p>

<p>I beli... | habedi/stack-exchange-dataset |
42,853 | Maximum Flow with Binary Capacities | <p>Consider the problem of finding a maximum flow from node $s$ to node $t$ in a directed graph where each link has capacity either $0$ or $1$. What is the state of the art regarding how fast this flow can be found? </p>

<p>It seems that the <a href="http://www.cs.umd.edu/~gasarch/BLOGPAPERS/even-tarjan.pdf" r... | algorithms optimization network flow | 1 | Maximum Flow with Binary Capacities -- (algorithms optimization network flow)
<p>Consider the problem of finding a maximum flow from node $s$ to node $t$ in a directed graph where each link has capacity either $0$ or $1$. What is the state of the art regarding how fast this flow can be found? </p>

<p>It seems ... | habedi/stack-exchange-dataset |
42,860 | Optimizing iteration over all permutations of a bit array | <p><strong>edited for clarity:</strong></p>

<p>I have two functions–$f(x)$ which returns an integer and $T(x)$ which returns a boolean–that operate on a bit array of length $n$. I am trying to maximize $f(x)$ over all $x$ which satisfy the condition $T(x) = true$. I also know that if $b$ is a binary subset of ... | algorithms optimization | 1 | Optimizing iteration over all permutations of a bit array -- (algorithms optimization)
<p><strong>edited for clarity:</strong></p>

<p>I have two functions–$f(x)$ which returns an integer and $T(x)$ which returns a boolean–that operate on a bit array of length $n$. I am trying to maximize $f(x)$ over all $x$ wh... | habedi/stack-exchange-dataset |
42,861 | Who invented the state elimination algorithm for converting finite automata into regular expressions? | <p>The state elimination algorithm is an algorithm for converting finite automata into regular expressions. It's found in many textbooks, including Sipser's Introduction to the Theory of Computation. However, I can't seem to find any references to who first invented this algorithm.</p>

<p>Does anyone know who ... | reference request finite automata regular expressions | 1 | Who invented the state elimination algorithm for converting finite automata into regular expressions? -- (reference request finite automata regular expressions)
<p>The state elimination algorithm is an algorithm for converting finite automata into regular expressions. It's found in many textbooks, including Sipser's In... | habedi/stack-exchange-dataset |
42,867 | Regularity of unary languages with word lengths the sum of two resp. three squares | <p>I think about unary languages $L_k$, where $L_k$ is set of all words which length is the sum of $k$ squares. Formally:
$$L_k=\{a^n\mid n=\sum_{i=1}^k {n_i}^2,\;\;n_i\in\mathbb{N_0}\;(1\le i\le k)\} $$
It is easy to show that $L_1=\{a^{n^2}\mid n\in\mathbb{N_0}\}$ is not regular (e.g. with Pumping-Lemma).<br>... | formal languages regular languages | 1 | Regularity of unary languages with word lengths the sum of two resp. three squares -- (formal languages regular languages)
<p>I think about unary languages $L_k$, where $L_k$ is set of all words which length is the sum of $k$ squares. Formally:
$$L_k=\{a^n\mid n=\sum_{i=1}^k {n_i}^2,\;\;n_i\in\mathbb{N_0}\;(1\le i\... | habedi/stack-exchange-dataset |
42,874 | Dijsktra's algorithm example | <p>In the following example, how does Dijkstra's algorithm find the shortest path?</p>

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

<p>I think we'll get abedz, while the shortest should be acedz. </p>
 | algorithms | 1 | Dijsktra's algorithm example -- (algorithms)
<p>In the following example, how does Dijkstra's algorithm find the shortest path?</p>

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

<p>I think we'll get abedz, while the shortest should be acedz. </p>
 | habedi/stack-exchange-dataset |
42,875 | What usage is the delta defined in the polynomial hierarchy? | <p>At the <a href="http://en.wikipedia.org/wiki/Polynomial_hierarchy" rel="noreferrer">Wikipedia page</a>, the polynomial hierarchy also defines the following:</p>

<p>$\Delta_0^\text{P} = P$, $\Delta_i^\text{P} = \text{P}^{\Sigma_{i-1}^\text{P}}$</p>

<p>However, the only usage of this anywhere else on... | complexity theory | 1 | What usage is the delta defined in the polynomial hierarchy? -- (complexity theory)
<p>At the <a href="http://en.wikipedia.org/wiki/Polynomial_hierarchy" rel="noreferrer">Wikipedia page</a>, the polynomial hierarchy also defines the following:</p>

<p>$\Delta_0^\text{P} = P$, $\Delta_i^\text{P} = \text{P}^{\Sig... | habedi/stack-exchange-dataset |
42,883 | Draw a DFA that accepts ((aa*)*b)* | <p>A homework question asks me to a draw a DFA for the regular expression</p>

<p>$((aa^*)^*b)^*$</p>

<p>I'm having trouble with this because I'm not sure how to express the idea of $a$ followed by $0$ or many $a$'s many times, in terms of a DFA. </p>

<p>I would guess it that $(aa^*)^*$ should... | regular languages automata finite automata regular expressions | 1 | Draw a DFA that accepts ((aa*)*b)* -- (regular languages automata finite automata regular expressions)
<p>A homework question asks me to a draw a DFA for the regular expression</p>

<p>$((aa^*)^*b)^*$</p>

<p>I'm having trouble with this because I'm not sure how to express the idea of $a$ followed by $0... | habedi/stack-exchange-dataset |
42,886 | Use the pumping lemma to show that the language is not regular | <p>I am working on this problem : Use the pumping lemma to show that the language $\{0^n 1^{n} \mid n ≥ 1\}$ is not regular.
May someone give me some suggestion about how to solve this problem?</p>
 | regular languages pumping lemma | 1 | Use the pumping lemma to show that the language is not regular -- (regular languages pumping lemma)
<p>I am working on this problem : Use the pumping lemma to show that the language $\{0^n 1^{n} \mid n ≥ 1\}$ is not regular.
May someone give me some suggestion about how to solve this problem?</p>
 | habedi/stack-exchange-dataset |
42,894 | Prove/Disprove: $L_1, L_2 \in RE-R \implies L_1 \cup L_2 \notin R$ | <blockquote>
 <p>Prove/Disprove: $L_1, L_2 \in RE-R \implies L_1 \cup L_2 \notin R$</p>
</blockquote>

<p>My first intuition is "Yes", since we may look at $M_1, M_2$ which accepts $L_1, L_2$, respectively. Then, WLOG there's $w$ such that $M_1$ doesn't halt for, and so the machine $M$ which runs $M_1,... | formal languages | 1 | Prove/Disprove: $L_1, L_2 \in RE-R \implies L_1 \cup L_2 \notin R$ -- (formal languages)
<blockquote>
 <p>Prove/Disprove: $L_1, L_2 \in RE-R \implies L_1 \cup L_2 \notin R$</p>
</blockquote>

<p>My first intuition is "Yes", since we may look at $M_1, M_2$ which accepts $L_1, L_2$, respectively. Then, W... | habedi/stack-exchange-dataset |
42,897 | What happens when the words transfered on the bus are smaller than its width? | <p>So what happens if we're transfering lots of 8 bit words in a 32 bit bus? Does each bus cycle only transfers 8 bit at the time, wasting the other 24 lines of the bus? Or does it transfer 4 words in each bus cycle?</p>
 | computer architecture | 1 | What happens when the words transfered on the bus are smaller than its width? -- (computer architecture)
<p>So what happens if we're transfering lots of 8 bit words in a 32 bit bus? Does each bus cycle only transfers 8 bit at the time, wasting the other 24 lines of the bus? Or does it transfer 4 words in each bus cycl... | habedi/stack-exchange-dataset |
42,900 | Local Cache miss using MESI Coherence Protocol | <p>My notes on MESI state that there are a few courses of action when we experience a local cache miss on read, depending on the global state of the data (whether other copies already exist, and the state they exist in) <br>
I'm having some trouble understanding how we know the state of the data when we miss on a r... | cpu cache | 1 | Local Cache miss using MESI Coherence Protocol -- (cpu cache)
<p>My notes on MESI state that there are a few courses of action when we experience a local cache miss on read, depending on the global state of the data (whether other copies already exist, and the state they exist in) <br>
I'm having some trouble under... | habedi/stack-exchange-dataset |
42,901 | Can Circuit Value Problem or HORN-SAT be reduced to PATH problem? | <p>PATH = {(X,R,S,T) | exists an x in S that is admissible}
Where R is a relation of X x X x X, S is a unary relation of X and T is a unary relation of X aswell.
An x element of X is admissible if it is in T or if there is two elements y z both admissibles, where (x,y,z) is in R.</p>

<p>So, is there an... | complexity theory satisfiability | 1 | Can Circuit Value Problem or HORN-SAT be reduced to PATH problem? -- (complexity theory satisfiability)
<p>PATH = {(X,R,S,T) | exists an x in S that is admissible}
Where R is a relation of X x X x X, S is a unary relation of X and T is a unary relation of X aswell.
An x element of X is admissible if it is in T ... | habedi/stack-exchange-dataset |
42,904 | Unambiguous but nondeterministic context-free language? | <p>Whenever deterministic context-free languages are discussed, the webpage/textbook would always give a side note saying that although deterministic context-free languages are never ambiguous, unambiguous context-free languages may still be nondeterministic.</p>

<p>However, they never give an example. Is ther... | context free | 1 | Unambiguous but nondeterministic context-free language? -- (context free)
<p>Whenever deterministic context-free languages are discussed, the webpage/textbook would always give a side note saying that although deterministic context-free languages are never ambiguous, unambiguous context-free languages may still be nond... | habedi/stack-exchange-dataset |
42,905 | Intuition behind F-algebra | <p>I looked at <a href="http://en.wikipedia.org/wiki/F-algebra" rel="nofollow">here</a> for getting an intuition about F-algebra, but I am still left with some questions.</p>

<p>Suppose I have <a href="http://en.wikipedia.org/wiki/F-algebra" rel="nofollow">a group signature</a> as $\Sigma= (* : X \times X \rig... | logic functional programming category theory | 1 | Intuition behind F-algebra -- (logic functional programming category theory)
<p>I looked at <a href="http://en.wikipedia.org/wiki/F-algebra" rel="nofollow">here</a> for getting an intuition about F-algebra, but I am still left with some questions.</p>

<p>Suppose I have <a href="http://en.wikipedia.org/wiki/F-a... | habedi/stack-exchange-dataset |
42,917 | Average vs Worst-Case Hitting Time | <p>Consider a simple random walk on an undirected graph and let $H_{ij}$ be the hitting time from $i$ to $j$. How much bigger can 
$$ H_{\rm max} = \max_{i,j} H_{ij}, $$ be compared to 
$$ H_{\rm ave} = \frac{1}{n^2} \sum_{i=1}^n \sum_{j=1}^n H_{ij}.$$ For all the examples I can think of, these two quantities a... | probability theory markov chains random walks | 1 | Average vs Worst-Case Hitting Time -- (probability theory markov chains random walks)
<p>Consider a simple random walk on an undirected graph and let $H_{ij}$ be the hitting time from $i$ to $j$. How much bigger can 
$$ H_{\rm max} = \max_{i,j} H_{ij}, $$ be compared to 
$$ H_{\rm ave} = \frac{1}{n^2} \sum_{i=1... | habedi/stack-exchange-dataset |
42,924 | What is the difference between "strict schedule" and "cascadeless schedule"? | <p>In database transactions theory, what is the difference between a strict schedule and a schedule that is merely secured against cascade aborts? </p>

<p>Could you give an example of a schedule that is secured against cascade aborts but is not strict?</p>

<p>I found <a href="http://avid.cs.umass.edu/... | database theory | 1 | What is the difference between "strict schedule" and "cascadeless schedule"? -- (database theory)
<p>In database transactions theory, what is the difference between a strict schedule and a schedule that is merely secured against cascade aborts? </p>

<p>Could you give an example of a schedule that is secured ag... | habedi/stack-exchange-dataset |
42,929 | Hamming Distance, Bit message | <p>My professor told us to try and remember the equation used for an upcoming exam, however I'm struggling to fit the equation into the question:</p>

<p><a href="https://i.stack.imgur.com/RoPYG.png" rel="nofollow noreferrer">http://i.stack.imgur.com/RoPYG.png</a>
(need a high reputation to post image)</p>&... | discrete mathematics computer networks | 1 | Hamming Distance, Bit message -- (discrete mathematics computer networks)
<p>My professor told us to try and remember the equation used for an upcoming exam, however I'm struggling to fit the equation into the question:</p>

<p><a href="https://i.stack.imgur.com/RoPYG.png" rel="nofollow noreferrer">http://i.sta... | habedi/stack-exchange-dataset |
42,931 | How does augmenting linear bounded automata tape alphabets increase memory? | <p>A linear bounded automaton is a Turing machine that is restricted by memory.<br>
How would augmenting the tape alphabet of a linear bounded automaton 
increase its memory? While the memory that the automata can 
use is as size of the input?</p>
 | turing machines linear bounded automata | 1 | How does augmenting linear bounded automata tape alphabets increase memory? -- (turing machines linear bounded automata)
<p>A linear bounded automaton is a Turing machine that is restricted by memory.<br>
How would augmenting the tape alphabet of a linear bounded automaton 
increase its memory? While the memo... | habedi/stack-exchange-dataset |
42,932 | Is the language given by this CFG regular? | <pre><code> S → AB | C
 A → aAb | ab
 B → cBd | cd
 C → aCd | aDd
 D → bDc | bc
</code></pre>

<p>How can I prove that this language is regular or not? I need your help. It also has two leftmost derivations. Does this help me to prove it?</p>
 | formal languages regular languages context free | 1 | Is the language given by this CFG regular? -- (formal languages regular languages context free)
<pre><code> S → AB | C
 A → aAb | ab
 B → cBd | cd
 C → aCd | aDd
 D → bDc | bc
</code></pre>

<p>How can I prove that this language is regular or not? I need your help. It also has two leftmost d... | habedi/stack-exchange-dataset |
42,934 | Intuition for PH notation in Arora-Barak's Computational Complexity | <p>For the definition of polynomial hierarchy:</p>

<p>$x \in L \Leftrightarrow \exists u_1 \in \{0, 1\}^{q(|x|)}\forall u_2 \in \{0, 1\}^{q(|x|)} \cdots Q_i u_i \in \{0, 1\}^{q(|x|)} M(x, u_1, \ldots, u_i) = 1$</p>

<p>What does the notation of $M(x, u_1, \ldots, u_i)$ mean? The definition used for $\m... | complexity theory | 1 | Intuition for PH notation in Arora-Barak's Computational Complexity -- (complexity theory)
<p>For the definition of polynomial hierarchy:</p>

<p>$x \in L \Leftrightarrow \exists u_1 \in \{0, 1\}^{q(|x|)}\forall u_2 \in \{0, 1\}^{q(|x|)} \cdots Q_i u_i \in \{0, 1\}^{q(|x|)} M(x, u_1, \ldots, u_i) = 1$</p>
&... | habedi/stack-exchange-dataset |
42,942 | Efficiently enumerating all paths from i to j of given length in a graph | <p>I've been trying to efficiently solve this problem : given a integer p > 0 and a directed graph whose nodes are 0, ..., N-1, enumerate (not simply count) all the paths (not necessarily elementary) from a node i to a node j of length p. For instance, i->j is of length 2 if the edge i->j exists, i->k->j is of length 3... | algorithms graphs enumeration | 1 | Efficiently enumerating all paths from i to j of given length in a graph -- (algorithms graphs enumeration)
<p>I've been trying to efficiently solve this problem : given a integer p > 0 and a directed graph whose nodes are 0, ..., N-1, enumerate (not simply count) all the paths (not necessarily elementary) from a node ... | habedi/stack-exchange-dataset |
42,960 | Does Ford-Fulkerson always produce the left-most min-cut | <p>When using Ford-Fulkerson to find max-flow between s and t, the exact choice of flow-graph depends on which paths are found.</p>

<p>However, if you then use the left-over residual graph to produce a min-cut (by flood-filling outward from s along any edges or reverse edges with left-over capacity), it seems ... | algorithms graphs network flow ford fulkerson | 1 | Does Ford-Fulkerson always produce the left-most min-cut -- (algorithms graphs network flow ford fulkerson)
<p>When using Ford-Fulkerson to find max-flow between s and t, the exact choice of flow-graph depends on which paths are found.</p>

<p>However, if you then use the left-over residual graph to produce a m... | habedi/stack-exchange-dataset |
42,973 | Counter example to graph coloring heuristic using BFS | <p>I am considering the following heuristic for the graph coloring problem (i.e. to color a graph $G$ using a minimal number of colors so that no two adjacent vertices have the same color):</p>

<blockquote>
 <p>Explore the vertices of $G$ in the order that they would be explored by a BFS search (with arbi... | algorithms graphs correctness proof colorings | 1 | Counter example to graph coloring heuristic using BFS -- (algorithms graphs correctness proof colorings)
<p>I am considering the following heuristic for the graph coloring problem (i.e. to color a graph $G$ using a minimal number of colors so that no two adjacent vertices have the same color):</p>

<blockquote>... | habedi/stack-exchange-dataset |
42,976 | Checking a property of all of the cycles in a graph | <p>Suppose $G= (V,E)$ is a directed graph with weights on the edges. I would like to check if $G$ has the following property: if $C \subset E$ is the set of edges in a cycle of length at least $3$, then the weight of at least one of the edges in $C$ is zero. Can this be done in polynomial time?</p>
 | algorithms graphs weighted graphs | 1 | Checking a property of all of the cycles in a graph -- (algorithms graphs weighted graphs)
<p>Suppose $G= (V,E)$ is a directed graph with weights on the edges. I would like to check if $G$ has the following property: if $C \subset E$ is the set of edges in a cycle of length at least $3$, then the weight of at least one... | habedi/stack-exchange-dataset |
42,978 | Is this problem NP-hard? | <p>Good day.
Subset sum selection problem is NP-hard.</p>

<p>I trying to solve following problem:
Input: a grid NxN and subset size K and radius R. Every entry in grid contains a value. 
Solution: subset of size K, so that sum of all selected items and items within radius(when selected items is in ... | algorithms complexity theory optimization | 1 | Is this problem NP-hard? -- (algorithms complexity theory optimization)
<p>Good day.
Subset sum selection problem is NP-hard.</p>

<p>I trying to solve following problem:
Input: a grid NxN and subset size K and radius R. Every entry in grid contains a value. 
Solution: subset of size K, so that sum ... | habedi/stack-exchange-dataset |
42,980 | Terminology - the reason for symbol reuse in programming languages | <p>What is the term in programming language creation that is the rationale for symbol reuse? Though potentially confused with overloading, it is not so much the application of symbol reuse, but the logical result of a limited vocabulary in the world of common symbols. </p>

<p>I seem to recall running in to the... | terminology programming languages language design syntax | 1 | Terminology - the reason for symbol reuse in programming languages -- (terminology programming languages language design syntax)
<p>What is the term in programming language creation that is the rationale for symbol reuse? Though potentially confused with overloading, it is not so much the application of symbol reuse, b... | habedi/stack-exchange-dataset |
42,983 | Is the closure of P under e-free homomorphisms equal to NP? | <p>The context free languages can be obtained as the <a href="https://cs.stackexchange.com/questions/30026/constructing-all-context-free-languages-from-a-set-of-base-languages-and-closure/30027#30027">closure of the Dyck language under the cone operations</a>. The Dyck language $D_2$ is a deterministic context free lan... | complexity theory formal languages closure properties np | 1 | Is the closure of P under e-free homomorphisms equal to NP? -- (complexity theory formal languages closure properties np)
<p>The context free languages can be obtained as the <a href="https://cs.stackexchange.com/questions/30026/constructing-all-context-free-languages-from-a-set-of-base-languages-and-closure/30027#3002... | habedi/stack-exchange-dataset |
42,984 | How to expand 2D graphic and functions to 3D? | <p>So I have a program that enables the user to draw 2D-objects. To rotate them, to move them, and so on, all in 2D.</p>

<p>I want to expand the 2D objects and functions to 3D which I don't expect to be too difficult, but still difficult enough that I don't want to reinvent the wheel.</p>

<blockquote>... | terminology computational geometry discrete mathematics graphics mathematical foundations | 1 | How to expand 2D graphic and functions to 3D? -- (terminology computational geometry discrete mathematics graphics mathematical foundations)
<p>So I have a program that enables the user to draw 2D-objects. To rotate them, to move them, and so on, all in 2D.</p>

<p>I want to expand the 2D objects and functions ... | habedi/stack-exchange-dataset |
42,988 | What does "context" in "context-free grammar" refer to? | <p>There are lots of definitions online about what a Context-Free Grammar is, but nothing I find is satisfying my primary trouble:</p>

<p>What <em>context</em> is it free of?</p>

<p>To investigate, I Googled "context sensitive grammar" but I still failed to find what the "context" was all about.</p>&#... | terminology context free formal grammars | 1 | What does "context" in "context-free grammar" refer to? -- (terminology context free formal grammars)
<p>There are lots of definitions online about what a Context-Free Grammar is, but nothing I find is satisfying my primary trouble:</p>

<p>What <em>context</em> is it free of?</p>

<p>To investigate, I ... | habedi/stack-exchange-dataset |
42,994 | Isn't Domain of a variable nothing but a constraint? | <p>In Constraint programming we have Variables and their Domains and then all the constraints, but if you at the concept of a domain of a variable it is nothing but another type of constraint, you are saying that this variable can take all these values.
Is there any particular reason why domain is defined as a diff... | type theory typing constraint programming curry howard constraint satisfaction | 1 | Isn't Domain of a variable nothing but a constraint? -- (type theory typing constraint programming curry howard constraint satisfaction)
<p>In Constraint programming we have Variables and their Domains and then all the constraints, but if you at the concept of a domain of a variable it is nothing but another type of co... | habedi/stack-exchange-dataset |
43,000 | Probabilistic Analysis in real time network : Error in data and feedback channel. Two users communication | <p>I'm studying probabilistic analysis in real time network. We have learned how many attempts in average are required to transmit a packet when there is no error on the feedback channel. </p>

<h2>With no error in the feedback</h2>

<p><img src="https://i.stack.imgur.com/HDnwb.png" alt="enter image des... | probability theory computer networks real time network analysis | 1 | Probabilistic Analysis in real time network : Error in data and feedback channel. Two users communication -- (probability theory computer networks real time network analysis)
<p>I'm studying probabilistic analysis in real time network. We have learned how many attempts in average are required to transmit a packet when ... | habedi/stack-exchange-dataset |
43,008 | Tips for creating “Context Free Grammar” | <p>I am new to CFG's, Can someone give me tips in creating CFG that generates some language</p>

<p>For example</p>

<p>$L =\{ w v w^R \mid v,w\in \{a,b\}^*\wedge|v| \text{ is even } \}$, where $w^R$ is the reverse of
 string $w$.</p>

<p>I'm having trouble understanding the language ..... | formal languages context free formal grammars | 1 | Tips for creating “Context Free Grammar” -- (formal languages context free formal grammars)
<p>I am new to CFG's, Can someone give me tips in creating CFG that generates some language</p>

<p>For example</p>

<p>$L =\{ w v w^R \mid v,w\in \{a,b\}^*\wedge|v| \text{ is even } \}$, where $w^R$ is the reve... | habedi/stack-exchange-dataset |
43,013 | Why doesn't my object code/machine code contain 1's and 0's | <p>I know when I compile my C program to machine code it gets compiled into something that specific computer can understand</p>

<p>But I thought computers can only understand 1's and 0's (high/low) so why doesn't my program look like a bunch of strange symbols and not 1's and 0's?</p>

<p>ie: "UHâÂHÉÏH... | compilers | 1 | Why doesn't my object code/machine code contain 1's and 0's -- (compilers)
<p>I know when I compile my C program to machine code it gets compiled into something that specific computer can understand</p>

<p>But I thought computers can only understand 1's and 0's (high/low) so why doesn't my program look like a ... | habedi/stack-exchange-dataset |
43,027 | Conflict Driven Clause Learning backtracking clarification | <p>On the wikipedia page <a href="http://en.wikipedia.org/wiki/Conflict-Driven_Clause_Learning#CDCL_.28Conflict-Driven_Clause_Learning.29" rel="noreferrer">here</a> it describes pretty well the CDCL algorithm (and it seems the pictures were taken from slides created by Sharad Malik at Princeton). However when describin... | machine learning satisfiability sat solvers backtracking | 1 | Conflict Driven Clause Learning backtracking clarification -- (machine learning satisfiability sat solvers backtracking)
<p>On the wikipedia page <a href="http://en.wikipedia.org/wiki/Conflict-Driven_Clause_Learning#CDCL_.28Conflict-Driven_Clause_Learning.29" rel="noreferrer">here</a> it describes pretty well the CDCL ... | habedi/stack-exchange-dataset |
43,038 | Computer Programs and lambda terms without normal form | <p>λ-calculus an ideal mathematical model in which to interpret programs. A program can be interpreted as a lambda term, and the term can have or not have a normal form. What role the terms without normal form play when analyzing programs?</p>
 | terminology lambda calculus computation models | 1 | Computer Programs and lambda terms without normal form -- (terminology lambda calculus computation models)
<p>λ-calculus an ideal mathematical model in which to interpret programs. A program can be interpreted as a lambda term, and the term can have or not have a normal form. What role the terms without normal form pla... | habedi/stack-exchange-dataset |
43,041 | Time complexity of $\sim c \cdot n^3$ with a computer which is 10 times faster | <p>I am trying to solve the following question</p>

<blockquote>
 <p>There's an algorithm with time complexity $\sim c \cdot n^3$. Suppose
 there's another computer which is 10 times faster. How much bigger can
 our $n$ be to be solved in the same time?</p>
</blockquote>

<p>My answer... | algorithm analysis runtime analysis | 1 | Time complexity of $\sim c \cdot n^3$ with a computer which is 10 times faster -- (algorithm analysis runtime analysis)
<p>I am trying to solve the following question</p>

<blockquote>
 <p>There's an algorithm with time complexity $\sim c \cdot n^3$. Suppose
 there's another computer which is 10 times... | habedi/stack-exchange-dataset |
43,052 | Transitions triggered by sets of events | <p>In automata theory books, I always studied examples where a state transition from A to B occurs due to a single event $e$ (say, receiving a particular character). Is it theoretically possible that a transition could be triggered by a set of events, such as receiving any one of some set of characters?</p>
 | automata finite automata computation models | 1 | Transitions triggered by sets of events -- (automata finite automata computation models)
<p>In automata theory books, I always studied examples where a state transition from A to B occurs due to a single event $e$ (say, receiving a particular character). Is it theoretically possible that a transition could be triggered... | habedi/stack-exchange-dataset |
43,056 | Would it be possible to use the cloud for RAM? | <p>I'm not sure if this is the right place to ask but I had this idea. Since the cloud can be used for storing memory, would it be possible to use it for RAM too?</p>
 | virtual memory memory access memory allocation | 1 | Would it be possible to use the cloud for RAM? -- (virtual memory memory access memory allocation)
<p>I'm not sure if this is the right place to ask but I had this idea. Since the cloud can be used for storing memory, would it be possible to use it for RAM too?</p>
 | habedi/stack-exchange-dataset |
43,066 | Removing left-recursion in grammar while maintaining left-association of operator | <p>I have a problem with this exercise: </p>

<blockquote>
 <p>Let G be the following ambiguous grammar for the λ-calculus:</p>
 
 <p><code>E → v | λv.E | EE | (E)</code></p>
 
 <p>where E is the single non-terminal symbol, λv.E represents abstraction w.r.t. the variable v in E, and EE ... | context free formal grammars compilers parsers | 1 | Removing left-recursion in grammar while maintaining left-association of operator -- (context free formal grammars compilers parsers)
<p>I have a problem with this exercise: </p>

<blockquote>
 <p>Let G be the following ambiguous grammar for the λ-calculus:</p>
 
 <p><code>E → v | λv.E | EE | (E)... | habedi/stack-exchange-dataset |
43,074 | Assignment to make formula unsatisfiable | <p>Lets imagine we have a satisfiable formula $F(A_0, A_1,...A_k,S_0,...,S_n)$ The problem to solve is "Is there an assignment for variables $(S_0,...,S_n)$ which will make F unsatisfiable?". One way of solving is to find all solutions for F in terms of variables $S_0,...,S_n$ and if the count is < $2^n$, the missin... | logic satisfiability sat solvers | 1 | Assignment to make formula unsatisfiable -- (logic satisfiability sat solvers)
<p>Lets imagine we have a satisfiable formula $F(A_0, A_1,...A_k,S_0,...,S_n)$ The problem to solve is "Is there an assignment for variables $(S_0,...,S_n)$ which will make F unsatisfiable?". One way of solving is to find all solutions for F... | habedi/stack-exchange-dataset |
43,083 | Dijkstras Shortest Path with Distance and Quality | <p>I want to write up a shortest as well as optimal path program for indoor navigation for people with disabilities. For the initial part of the assignment i wish to test my program through graph traversal. My application is supposed to take in a user group then based on that give the appropriate path. The edges are su... | graphs | 1 | Dijkstras Shortest Path with Distance and Quality -- (graphs)
<p>I want to write up a shortest as well as optimal path program for indoor navigation for people with disabilities. For the initial part of the assignment i wish to test my program through graph traversal. My application is supposed to take in a user group ... | habedi/stack-exchange-dataset |
43,089 | Reduction and decidability | <p>Consider the following language: $$ L = \{ \langle M \rangle \ |\ M \text { accepts } w \text { whenever it accepts } w^R \}$$</p>

<p>I am trying to understand the following proof that this language $L$ is undecidable.</p>

<p>The proof proceeds by contradiction, by reducing to $L$ the language $A_... | formal languages turing machines reductions proof techniques undecidability | 1 | Reduction and decidability -- (formal languages turing machines reductions proof techniques undecidability)
<p>Consider the following language: $$ L = \{ \langle M \rangle \ |\ M \text { accepts } w \text { whenever it accepts } w^R \}$$</p>

<p>I am trying to understand the following proof that this language $... | habedi/stack-exchange-dataset |
43,100 | Binary tree node value maximization | <p>Given a binary tree, construct the set of nodes whose sum is maximum subject to the restriction: if a node is included, its parent and children must be excluded, but grandchildren, etc. may be included.</p>

<p>My intuition tells me dynamic programming (and possibly two-coloring) should be involved, but not ... | graphs search algorithms dynamic programming binary trees | 1 | Binary tree node value maximization -- (graphs search algorithms dynamic programming binary trees)
<p>Given a binary tree, construct the set of nodes whose sum is maximum subject to the restriction: if a node is included, its parent and children must be excluded, but grandchildren, etc. may be included.</p>

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