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
7,331
Does the DFS algorithm differentiate between an ancestor and a parent while computing back edges?
<p>Below is the general code for DFS with logic for marking back edges and tree edges. My doubt is that back edges from a vertex go back and point to an ancestor and those which point to the parent are not back edges (lets assume undirected graph). In an undirected graph we have an edge back and forth between 2 vertice...
algorithms graphs
1
Does the DFS algorithm differentiate between an ancestor and a parent while computing back edges? -- (algorithms graphs) <p>Below is the general code for DFS with logic for marking back edges and tree edges. My doubt is that back edges from a vertex go back and point to an ancestor and those which point to the parent a...
habedi/stack-exchange-dataset
7,332
For what values of A and B is the gap-VC-[A,B] problem NP-HARD?
<p>For which values $A,B$ is the problem $\mathsf{gap\mathord-VC}\mathord-[A,B]$ NP-hard? VC is the <a href="http://en.wikipedia.org/wiki/Vertex_cover" rel="nofollow">vertex cover</a> problem. I am given three options: $B=\frac{3}{4},A=\frac{1}{2}$ or $B=\frac{3}{4},A=\frac{1}{4}$ or none.</p>&#xA;&#xA;<p>I would to r...
complexity theory graphs approximation
1
For what values of A and B is the gap-VC-[A,B] problem NP-HARD? -- (complexity theory graphs approximation) <p>For which values $A,B$ is the problem $\mathsf{gap\mathord-VC}\mathord-[A,B]$ NP-hard? VC is the <a href="http://en.wikipedia.org/wiki/Vertex_cover" rel="nofollow">vertex cover</a> problem. I am given three op...
habedi/stack-exchange-dataset
7,334
Theoretical CS and Math - self-study recommendations
<p>I am a non-CS grad and my field of study is unrelated to CS. However, as part of a larger plan to become a computer scientist, I want to obtain a solid background in theoretical computer science and math as it relates to CS. I did a plenty of research and selected the following best/really good books on the topic of...
books
1
Theoretical CS and Math - self-study recommendations -- (books) <p>I am a non-CS grad and my field of study is unrelated to CS. However, as part of a larger plan to become a computer scientist, I want to obtain a solid background in theoretical computer science and math as it relates to CS. I did a plenty of research a...
habedi/stack-exchange-dataset
7,340
Why does every member $f(n) \in \Theta(g(n))$, and $g(n)$ have to be asymptotically non-negative?
<p>The following is an excerpt from <a href="http://www.amazon.ca/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844" rel="nofollow noreferrer">CLRS</a>:</p>&#xA;<blockquote>&#xA;<p>The definition of <span class="math-container">$\Theta (g(n))$</span> requires that every member <span class="math-container">$f(n) \in...
complexity theory algorithm analysis asymptotics
1
Why does every member $f(n) \in \Theta(g(n))$, and $g(n)$ have to be asymptotically non-negative? -- (complexity theory algorithm analysis asymptotics) <p>The following is an excerpt from <a href="http://www.amazon.ca/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844" rel="nofollow noreferrer">CLRS</a>:</p>&#xA;<bl...
habedi/stack-exchange-dataset
7,341
Clarification with Kuhn-Munkres/Hungarian Algorithm
<p>I have been attempting to get my mind around the <a href="http://en.wikipedia.org/wiki/Hungarian_algorithm" rel="nofollow noreferrer">Kuhn-Munkres/Hungarian Algorithm</a>. I have been using the following statement of the algorithm which I found <a href="http://www.math.uwo.ca/~mdawes/courses/344/kuhn-munkres.pdf" re...
algorithms bipartite matching
1
Clarification with Kuhn-Munkres/Hungarian Algorithm -- (algorithms bipartite matching) <p>I have been attempting to get my mind around the <a href="http://en.wikipedia.org/wiki/Hungarian_algorithm" rel="nofollow noreferrer">Kuhn-Munkres/Hungarian Algorithm</a>. I have been using the following statement of the algorithm...
habedi/stack-exchange-dataset
7,346
Calculating traversal position of a node in a full binary tree, given its path
<p>Given a path down a <em>full</em> binary tree to a node (for example, a sequence of $1$s and $0$s, $0$ representing "go left" and $1$ representing "go right"), how would one find the position of the node in the preorder traversal. In other words the $i$th node in the preorder traversal will end up with at this node....
binary trees trees graph traversal
1
Calculating traversal position of a node in a full binary tree, given its path -- (binary trees trees graph traversal) <p>Given a path down a <em>full</em> binary tree to a node (for example, a sequence of $1$s and $0$s, $0$ representing "go left" and $1$ representing "go right"), how would one find the position of the...
habedi/stack-exchange-dataset
7,349
Proofs based on narrowing down sets of possibilities
<p>Consider the argument made in <a href="https://cs.stackexchange.com/questions/6562/generalizing-the-comparison-sorting-lower-bound-proof">this question</a> based on the comparison sorting lower-bounds proof, which runs as follows. </p>&#xA;&#xA;<p>First, the comparison sorting lower-bounds proof was recited:</p>&#xA...
proof techniques lower bounds
1
Proofs based on narrowing down sets of possibilities -- (proof techniques lower bounds) <p>Consider the argument made in <a href="https://cs.stackexchange.com/questions/6562/generalizing-the-comparison-sorting-lower-bound-proof">this question</a> based on the comparison sorting lower-bounds proof, which runs as follows...
habedi/stack-exchange-dataset
7,359
Finding the greatest $k$ numbers with a certainty of $p$
<p>Given $n \in \mathbb{N}$ pairwise distinct numbers. I want to do as few comparisons per number as possible - and every number should experience roughly the same amount of comparisons as another number - and find the greatest $k \leq n$ numbers, e.g. $k = \frac{n}{10}$. In order to minimise the number of comparisons ...
algorithms
1
Finding the greatest $k$ numbers with a certainty of $p$ -- (algorithms) <p>Given $n \in \mathbb{N}$ pairwise distinct numbers. I want to do as few comparisons per number as possible - and every number should experience roughly the same amount of comparisons as another number - and find the greatest $k \leq n$ numbers,...
habedi/stack-exchange-dataset
7,367
Looking for a dictionary of math/CS notation
<p>There is an at-times dizzying array of symbols used in math and CS papers. Yet many assume basic familiarity that seems rarely taught in one place. I am looking for a dictionary something like the following, especially from a CS perspective. </p>&#xA;&#xA;<ul>&#xA;<li>It would list all the basic mathematical symbols...
terminology reference request education
1
Looking for a dictionary of math/CS notation -- (terminology reference request education) <p>There is an at-times dizzying array of symbols used in math and CS papers. Yet many assume basic familiarity that seems rarely taught in one place. I am looking for a dictionary something like the following, especially from a C...
habedi/stack-exchange-dataset
7,372
Space complexity below $\log\log$
<p>Show that for $l(n) = \log \log n$, it holds that $\text{DSPACE}(o(l)) = \text{DSPACE}(O(1))$.</p>&#xA;&#xA;<p>It's well known fact in Space Complexity, but how to show it explicitly?</p>&#xA;
complexity theory regular languages space complexity lower bounds
1
Space complexity below $\log\log$ -- (complexity theory regular languages space complexity lower bounds) <p>Show that for $l(n) = \log \log n$, it holds that $\text{DSPACE}(o(l)) = \text{DSPACE}(O(1))$.</p>&#xA;&#xA;<p>It's well known fact in Space Complexity, but how to show it explicitly?</p>&#xA;
habedi/stack-exchange-dataset
7,373
How many edges must a graph with N vertices have in order to guarantee that it is connected?
<blockquote>&#xA; <p><strong>Possible Duplicate:</strong><br>&#xA; <a href="https://cs.stackexchange.com/questions/6801/every-simple-undirected-graph-with-more-than-n-1n-2-2-edges-is-connected">Every simple undirected graph with more than $(n-1)(n-2)/2$ edges is connected</a> </p>&#xA;</blockquote>&#xA;&#xA;&#xA;&#x...
graphs
1
How many edges must a graph with N vertices have in order to guarantee that it is connected? -- (graphs) <blockquote>&#xA; <p><strong>Possible Duplicate:</strong><br>&#xA; <a href="https://cs.stackexchange.com/questions/6801/every-simple-undirected-graph-with-more-than-n-1n-2-2-edges-is-connected">Every simple undire...
habedi/stack-exchange-dataset
7,383
LTL: Show $\neg(aUb) \Leftrightarrow \neg b U (\neg a \land \neg b) \lor G \neg b$
<p>I got as far as&#xA;\begin{align}&#xA;w \vDash \neg (a U b) &amp;\Leftrightarrow \neg (w \vDash a U b) &#xA;\Leftrightarrow \neg (\exists_{i\geq0} : w^i \vDash b \land \forall_{0\leq k &lt; i} : w^k \vDash a) \\&#xA;&amp;\Leftrightarrow \forall_{i\geq0} : \neg(w^i \vDash b) \lor \exists_{0\leq k &lt; i} : \neg(w^...
logic linear temporal logic
1
LTL: Show $\neg(aUb) \Leftrightarrow \neg b U (\neg a \land \neg b) \lor G \neg b$ -- (logic linear temporal logic) <p>I got as far as&#xA;\begin{align}&#xA;w \vDash \neg (a U b) &amp;\Leftrightarrow \neg (w \vDash a U b) &#xA;\Leftrightarrow \neg (\exists_{i\geq0} : w^i \vDash b \land \forall_{0\leq k &lt; i} : w^k \...
habedi/stack-exchange-dataset
7,385
Equality of NSpace and coNSpace classes
<p>I'm trying to decide which of the following statements are true:</p>&#xA;&#xA;<ol>&#xA;<li><p>$\mathsf{NSpace}(\log \log n) = \mathsf{coNSpace}(\log \log n )$</p></li>&#xA;<li><p>$\mathsf{NSpace}(\lg^2n) = \mathsf{coNSpace}(\lg^2n)$</p></li>&#xA;<li><p>$\mathsf{NSpace}(\sqrt n) = \mathsf{coNSpace}(\sqrt n)$</p></li>...
complexity theory space complexity
1
Equality of NSpace and coNSpace classes -- (complexity theory space complexity) <p>I'm trying to decide which of the following statements are true:</p>&#xA;&#xA;<ol>&#xA;<li><p>$\mathsf{NSpace}(\log \log n) = \mathsf{coNSpace}(\log \log n )$</p></li>&#xA;<li><p>$\mathsf{NSpace}(\lg^2n) = \mathsf{coNSpace}(\lg^2n)$</p><...
habedi/stack-exchange-dataset
7,392
$\ell_1$ Minimization of Probability Distribution and KL-Divergence
<p>Suppose through $\ell_1$ minimization I obtained two sparse probability distributions $P, Q$ which may contain many zero terms. Then I would like to compute the KL-Divergence of them $D(P || Q) = \sum_i {p_i\log(\frac{p_i}{q_i})}$. However, since the probability distribution is sparse, it might occur that $p_i \not...
machine learning information theory
1
$\ell_1$ Minimization of Probability Distribution and KL-Divergence -- (machine learning information theory) <p>Suppose through $\ell_1$ minimization I obtained two sparse probability distributions $P, Q$ which may contain many zero terms. Then I would like to compute the KL-Divergence of them $D(P || Q) = \sum_i {p_i\...
habedi/stack-exchange-dataset
7,398
How come this turing machine running time is $O(n^{1+\log_2 2006}\cdot \log_2n)$
<p>Given a deterministic Turing machine with an input tape and a work tape. The work tape is restricted to $\log_2 n+100$ cells ($n$ represents the input length) and its tape alphabet is of size $2006$. Moreover, the Turing machine has $27$ states.</p>&#xA;&#xA;<p>I wonder how come the running time of such machine is ...
complexity theory time complexity turing machines
1
How come this turing machine running time is $O(n^{1+\log_2 2006}\cdot \log_2n)$ -- (complexity theory time complexity turing machines) <p>Given a deterministic Turing machine with an input tape and a work tape. The work tape is restricted to $\log_2 n+100$ cells ($n$ represents the input length) and its tape alphabet ...
habedi/stack-exchange-dataset
7,400
For what special cases does this vertex cover algorithm fail or work?
<p>I'm trying to find a polynomial time algorithm for finding the minimum vertex cover for a graph. I've written the algorithm below; I know this problem is $\mathsf{NP}$-hard, which means there are probably some graphs for which this algorithm will not work.</p>&#xA;&#xA;<p>I need some help in finding the flaw in this...
algorithms graphs np complete np hard
1
For what special cases does this vertex cover algorithm fail or work? -- (algorithms graphs np complete np hard) <p>I'm trying to find a polynomial time algorithm for finding the minimum vertex cover for a graph. I've written the algorithm below; I know this problem is $\mathsf{NP}$-hard, which means there are probably...
habedi/stack-exchange-dataset
7,405
Concluding $SPACE(n^2) \neq SPACE(n^7)$ from universal turing machine running time
<p>Let $M_U$ be an universal Turing machine which fulfills the following condition:</p>&#xA;&#xA;<blockquote>&#xA; <p>If $M$ running $x$ takes $f(x)$ space, then $M_U$ running on $\langle \langle M\rangle,x\rangle$ takes $(f(|x|))^3+2\cdot|x|+|\langle M\rangle|$ space.</p>&#xA;</blockquote>&#xA;&#xA;<p>Why can we conc...
complexity theory space complexity
1
Concluding $SPACE(n^2) \neq SPACE(n^7)$ from universal turing machine running time -- (complexity theory space complexity) <p>Let $M_U$ be an universal Turing machine which fulfills the following condition:</p>&#xA;&#xA;<blockquote>&#xA; <p>If $M$ running $x$ takes $f(x)$ space, then $M_U$ running on $\langle \langle ...
habedi/stack-exchange-dataset
7,406
Intuitive meaning of modal $\mu$-calculus formula
<p>I am solving one of the past exams and I am not certain with my solution to one of the exercises. The exercise is asking to give intuitive meaning to modal $\mu$-calculus formula:</p>&#xA;&#xA;<p>$$ \phi = \mu Z. \langle - \rangle tt \wedge [-a]Z $$</p>&#xA;&#xA;<p>According to an article <em>Modal logics and mu-cal...
modal logic mu calculus
1
Intuitive meaning of modal $\mu$-calculus formula -- (modal logic mu calculus) <p>I am solving one of the past exams and I am not certain with my solution to one of the exercises. The exercise is asking to give intuitive meaning to modal $\mu$-calculus formula:</p>&#xA;&#xA;<p>$$ \phi = \mu Z. \langle - \rangle tt \wed...
habedi/stack-exchange-dataset
7,409
Count unique increasing subsequences of length 3 in $O(n\log n)$
<p><strong>Problem</strong>: Given an array of $n$ integers, $A[1 \dots n]$, such that any integer occurs <em>at most</em> 2 times in the array, we have to find the number of <em>unique</em> increasing subsequences of length 3 (duplicate subsequences must be counted only once). In other words, we have to count the numb...
algorithms arrays subsequences
1
Count unique increasing subsequences of length 3 in $O(n\log n)$ -- (algorithms arrays subsequences) <p><strong>Problem</strong>: Given an array of $n$ integers, $A[1 \dots n]$, such that any integer occurs <em>at most</em> 2 times in the array, we have to find the number of <em>unique</em> increasing subsequences of l...
habedi/stack-exchange-dataset
7,416
How do we prove that $L_E = \{ \langle A, B \rangle : L(A) = L(B) \}$ is neither regular nor context-free?
<p>Let $A$ and $B$ be two deterministic finite automata. How do we prove that $L_E = \{ \langle A, B \rangle : L(A) = L(B) \}$ is neither regular nor context-free?</p>&#xA;&#xA;<p>Intuitively, I feel that $L_E$ should not be context-free because we must try each string $\in \Sigma^*$ (where $\Sigma$ is the alphabet) an...
formal languages context free
1
How do we prove that $L_E = \{ \langle A, B \rangle : L(A) = L(B) \}$ is neither regular nor context-free? -- (formal languages context free) <p>Let $A$ and $B$ be two deterministic finite automata. How do we prove that $L_E = \{ \langle A, B \rangle : L(A) = L(B) \}$ is neither regular nor context-free?</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
7,420
Why is the clique problem NP-complete?
<blockquote>&#xA; <p><strong>Possible Duplicate:</strong><br>&#xA; <a href="https://cs.stackexchange.com/questions/6847/is-the-k-clique-problem-np-complete">Is the k-clique problem NP-complete?</a> </p>&#xA;</blockquote>&#xA;&#xA;&#xA;&#xA;<p>I've been lately reading about the <a href="http://en.wikipedia.org/wiki/C...
np complete
1
Why is the clique problem NP-complete? -- (np complete) <blockquote>&#xA; <p><strong>Possible Duplicate:</strong><br>&#xA; <a href="https://cs.stackexchange.com/questions/6847/is-the-k-clique-problem-np-complete">Is the k-clique problem NP-complete?</a> </p>&#xA;</blockquote>&#xA;&#xA;&#xA;&#xA;<p>I've been lately r...
habedi/stack-exchange-dataset
7,429
Does this DFA have a solution?
<p>I am trying to create a DFA that can recognize strings with alphabet $\{a,b,c\}$ where $a$ and $c$ appear even number of times and where $b$ appears odd number of times.</p>&#xA;&#xA;<p>I am wondering that this may only be expressed with other methods such as Turing machine or context-free languages.</p>&#xA;&#xA;<p...
formal languages regular languages finite automata
1
Does this DFA have a solution? -- (formal languages regular languages finite automata) <p>I am trying to create a DFA that can recognize strings with alphabet $\{a,b,c\}$ where $a$ and $c$ appear even number of times and where $b$ appears odd number of times.</p>&#xA;&#xA;<p>I am wondering that this may only be express...
habedi/stack-exchange-dataset
7,433
Mean number of edges between two equal partitions
<p>For a random undirected graph with $n$ nodes, where each node has $k$ incident edges ($nk/2$ edges in total), the vertex set is partitioned into two sets each having $n/2$ nodes. </p>&#xA;&#xA;<blockquote>&#xA; <p>What is the order of the number of edges that start in one partition and end in the other? </p>&#xA...
graphs random graphs
1
Mean number of edges between two equal partitions -- (graphs random graphs) <p>For a random undirected graph with $n$ nodes, where each node has $k$ incident edges ($nk/2$ edges in total), the vertex set is partitioned into two sets each having $n/2$ nodes. </p>&#xA;&#xA;<blockquote>&#xA; <p>What is the order of the...
habedi/stack-exchange-dataset
7,438
Implications of polynomial time reductions
<p>I'm reviewing for finals and have a sample problem that I <strong>think</strong> I understand, but would like someone to bless my understanding or smack me and tell me why I'm wrong.</p>&#xA;&#xA;<p>I'm presented with a problem $\Pi$ of unknown complexity class. If I can transform $\Pi$ to some problem $X$, where ...
complexity theory reductions complexity classes p vs np
1
Implications of polynomial time reductions -- (complexity theory reductions complexity classes p vs np) <p>I'm reviewing for finals and have a sample problem that I <strong>think</strong> I understand, but would like someone to bless my understanding or smack me and tell me why I'm wrong.</p>&#xA;&#xA;<p>I'm presented ...
habedi/stack-exchange-dataset
7,441
Myhill-Nerode and closure properties
<p>It is well known that regular languages are characterized by the Myhill-Nerode equivalence. For language $L$ over $\Sigma^*$ define the equivalence $x\sim_L y$ over $\Sigma^*$ iff for all $z\in\Sigma^*$ we have $xz\in L \iff yz\in L$. Then $L$ is regular iff $\sim_L$ is of finite index, i.e., has a finite number of ...
regular languages closure properties
1
Myhill-Nerode and closure properties -- (regular languages closure properties) <p>It is well known that regular languages are characterized by the Myhill-Nerode equivalence. For language $L$ over $\Sigma^*$ define the equivalence $x\sim_L y$ over $\Sigma^*$ iff for all $z\in\Sigma^*$ we have $xz\in L \iff yz\in L$. The...
habedi/stack-exchange-dataset
7,444
Coloring a Unicyclic Graph
<p>I am trying to design an efficienct algorithm to color a unicyclic graph. I know if a graph does not contain any cycles (it's a tree) then it is 2-colorable. But cycles are either 2 (is even number of vertices) or 3 (is odd number of vertices) colorable. So if there contains just one cycle then the chromatic number ...
graphs
1
Coloring a Unicyclic Graph -- (graphs) <p>I am trying to design an efficienct algorithm to color a unicyclic graph. I know if a graph does not contain any cycles (it's a tree) then it is 2-colorable. But cycles are either 2 (is even number of vertices) or 3 (is odd number of vertices) colorable. So if there contains ju...
habedi/stack-exchange-dataset
7,445
How to find recurrences where Master formula cannot be applied
<p>Given: $T(n) = T(\sqrt{n}) + 1$ (base case $T(x) = 1$ for $x&lt;=2$) </p>&#xA;&#xA;<p>How do you solve such a recurrence?</p>&#xA;
complexity theory algorithms
1
How to find recurrences where Master formula cannot be applied -- (complexity theory algorithms) <p>Given: $T(n) = T(\sqrt{n}) + 1$ (base case $T(x) = 1$ for $x&lt;=2$) </p>&#xA;&#xA;<p>How do you solve such a recurrence?</p>&#xA;
habedi/stack-exchange-dataset
7,446
Running Time of Modular Exponentiation
<p>I am trying to understand why the modular exponentiation algorithm has a running time of about $\log(n)$ where $n$ is the exponent. Here is the algorithm:</p>&#xA;&#xA;<pre><code>function modular_pow(base, exponent, modulus)&#xA; result := 1&#xA; while exponent &gt; 0&#xA; if (exponent mod 2 == 1):&#xA;...
algorithms
1
Running Time of Modular Exponentiation -- (algorithms) <p>I am trying to understand why the modular exponentiation algorithm has a running time of about $\log(n)$ where $n$ is the exponent. Here is the algorithm:</p>&#xA;&#xA;<pre><code>function modular_pow(base, exponent, modulus)&#xA; result := 1&#xA; while exp...
habedi/stack-exchange-dataset
7,459
Distributed 6-color Vertex Coloring
<p>I am trying to understand the <a href="http://disco.ethz.ch/lectures/podc_allstars/lecture/chapter1.pdf" rel="nofollow">distributed 6-color algorithm for vertex coloring</a> (on page 10).</p>&#xA;&#xA;<p>Here is a short description</p>&#xA;&#xA;<p>Idea of the algorithm: We start with color labels that have $\log n$ ...
algorithms distributed systems colorings
1
Distributed 6-color Vertex Coloring -- (algorithms distributed systems colorings) <p>I am trying to understand the <a href="http://disco.ethz.ch/lectures/podc_allstars/lecture/chapter1.pdf" rel="nofollow">distributed 6-color algorithm for vertex coloring</a> (on page 10).</p>&#xA;&#xA;<p>Here is a short description</p>...
habedi/stack-exchange-dataset
7,466
Are Turing-recognizable languages closed under intersection?
<p>Let $A$ and $B$ be Turing-recognizable languages. Must language $C = A \cap B$ be Turing-recognizable too?</p>&#xA;&#xA;<p>I have a hunch that it should be because we can construct an enumerator for $C$ by enumerating all the languages in $A$ and then all the languages in $B$.</p>&#xA;&#xA;<p>However, I also know th...
formal languages
1
Are Turing-recognizable languages closed under intersection? -- (formal languages) <p>Let $A$ and $B$ be Turing-recognizable languages. Must language $C = A \cap B$ be Turing-recognizable too?</p>&#xA;&#xA;<p>I have a hunch that it should be because we can construct an enumerator for $C$ by enumerating all the language...
habedi/stack-exchange-dataset
7,469
Why is $L = \{ \langle M \rangle : L(M) = \{ \langle M \rangle \} \}$ not Turing-recognizable?
<p>In other words, $L$ is the language of Turing machines that recognize the language consisting of only themselves.</p>&#xA;&#xA;<p>Why is $L$ not Turing-recognizable? $L$ is clearly not decidable by Rice's Theorem, but how do I go one step further and also prove that no machine can enumerate $L$?</p>&#xA;
formal languages
1
Why is $L = \{ \langle M \rangle : L(M) = \{ \langle M \rangle \} \}$ not Turing-recognizable? -- (formal languages) <p>In other words, $L$ is the language of Turing machines that recognize the language consisting of only themselves.</p>&#xA;&#xA;<p>Why is $L$ not Turing-recognizable? $L$ is clearly not decidable by Ri...
habedi/stack-exchange-dataset
7,473
Propositional formula in DNF can be decided in polynomial time?
<p>For a given propositional formula f in DNF, one can decide in polynomial time, if the formula is satisfiable:&#xA;Just walk through all subformulas (l_1 and ... and l_k) and check, wheter it has NO complementary pair of literals. Formula f is satisfiable iff such subformula exists.</p>&#xA;&#xA;<p>Is my approach abo...
logic polynomial time
1
Propositional formula in DNF can be decided in polynomial time? -- (logic polynomial time) <p>For a given propositional formula f in DNF, one can decide in polynomial time, if the formula is satisfiable:&#xA;Just walk through all subformulas (l_1 and ... and l_k) and check, wheter it has NO complementary pair of litera...
habedi/stack-exchange-dataset
7,479
Summation of $O(n)$ from $1\le k\le n$
<p>Summation of $O(n)$ from $1\le k\le n$.</p>&#xA;&#xA;<p>I think it should be $O(n)$ only. Because we are addition $O(k)$ and maximum order will be $O(n)$. But answer is given as $O(n^2)$.</p>&#xA;&#xA;<p>Correct me if I'm wrong.</p>&#xA;
algorithms time complexity
1
Summation of $O(n)$ from $1\le k\le n$ -- (algorithms time complexity) <p>Summation of $O(n)$ from $1\le k\le n$.</p>&#xA;&#xA;<p>I think it should be $O(n)$ only. Because we are addition $O(k)$ and maximum order will be $O(n)$. But answer is given as $O(n^2)$.</p>&#xA;&#xA;<p>Correct me if I'm wrong.</p>&#xA;
habedi/stack-exchange-dataset
7,480
Asymptotic Analysis for two variables?
<p>How is asymptotic analysis (big o, little o, big theta, big theta etc.) defined for functions with multiple variables?</p>&#xA;&#xA;<p>I know that the Wikipedia article has a section on it, but it uses a lot of mathematical notation which I am unfamiliar with it. I also found the following paper: <a href="http://peo...
asymptotics landau notation
1
Asymptotic Analysis for two variables? -- (asymptotics landau notation) <p>How is asymptotic analysis (big o, little o, big theta, big theta etc.) defined for functions with multiple variables?</p>&#xA;&#xA;<p>I know that the Wikipedia article has a section on it, but it uses a lot of mathematical notation which I am u...
habedi/stack-exchange-dataset
7,486
Is this a regular grammar?
<p>I went through a question asking me to categorize the following grammar.</p>&#xA;&#xA;<p>$$S → AA, S → AB, A → a, A→BB, B → b, B → e$$</p>&#xA;&#xA;<p>From the production rules, clearly it is Context-Free. But it accepts a finite set of strings.&#xA;$\{e, a, aa, ab, abb, ba, bba, b, bb, bbb, bbbb\}$&#xA;which is reg...
regular languages formal grammars context free
1
Is this a regular grammar? -- (regular languages formal grammars context free) <p>I went through a question asking me to categorize the following grammar.</p>&#xA;&#xA;<p>$$S → AA, S → AB, A → a, A→BB, B → b, B → e$$</p>&#xA;&#xA;<p>From the production rules, clearly it is Context-Free. But it accepts a finite set of s...
habedi/stack-exchange-dataset
7,488
Is the intersection of two regular languages regular?
<p>Trivially decidable problem is one in which the problem is a known property of the language/grammar. So <strong>intersection of two regular languages is regular should be trivially decidable</strong>? But it is given as not trivially decidable.</p>&#xA;
regular languages undecidability decision problem
1
Is the intersection of two regular languages regular? -- (regular languages undecidability decision problem) <p>Trivially decidable problem is one in which the problem is a known property of the language/grammar. So <strong>intersection of two regular languages is regular should be trivially decidable</strong>? But it...
habedi/stack-exchange-dataset
7,490
Recursive function calculating number of ways to sum $a + 2 b + 3 c = x$
<p>Using python need to code a recursive function with one input and no global integers that calculates the number of options to get $x$ using $a*1+b*2+c*3$.</p>&#xA;&#xA;<p>Say $x=3$, there are four options: $\lbrace (1,1,1),(1,2),(2,1),(3)\rbrace$.</p>&#xA;
combinatorics recursion
1
Recursive function calculating number of ways to sum $a + 2 b + 3 c = x$ -- (combinatorics recursion) <p>Using python need to code a recursive function with one input and no global integers that calculates the number of options to get $x$ using $a*1+b*2+c*3$.</p>&#xA;&#xA;<p>Say $x=3$, there are four options: $\lbrace ...
habedi/stack-exchange-dataset
7,491
Algorithm for getting the outer boundary of a large graph
<p>I am trying to create an <a href="http://en.wikipedia.org/wiki/Isochrone_map" rel="nofollow noreferrer">isochrone</a> based on the OpenStreetMap data set. Everything works fine, I extracted data, processed it into a DAG, ran a Dijkstra algorithm over it. The result is a subset of the complete graph. This is an impre...
algorithms computational geometry graph traversal
1
Algorithm for getting the outer boundary of a large graph -- (algorithms computational geometry graph traversal) <p>I am trying to create an <a href="http://en.wikipedia.org/wiki/Isochrone_map" rel="nofollow noreferrer">isochrone</a> based on the OpenStreetMap data set. Everything works fine, I extracted data, processe...
habedi/stack-exchange-dataset
7,495
How to recognize a STRIPS planning problem has no solution?
<blockquote>&#xA; <p>Strips –Stands for STanford Research Institute Problem Solver (1971).</p>&#xA;</blockquote>&#xA;&#xA;<p><strong>STRIPS Pseudo code -</strong></p>&#xA;&#xA;<pre><code>STRIPS(stateListstart, stateListgoals)&#xA;1.Set state = start&#xA;2.Set plan = []&#xA;3.Set stack = goals&#xA;4.while stack is not ...
algorithms artificial intelligence
1
How to recognize a STRIPS planning problem has no solution? -- (algorithms artificial intelligence) <blockquote>&#xA; <p>Strips –Stands for STanford Research Institute Problem Solver (1971).</p>&#xA;</blockquote>&#xA;&#xA;<p><strong>STRIPS Pseudo code -</strong></p>&#xA;&#xA;<pre><code>STRIPS(stateListstart, stateList...
habedi/stack-exchange-dataset
7,505
What is the purpose of Mark field in Fibonacci Heaps?
<p>In <a href="http://en.wikipedia.org/wiki/Fibonacci_heap" rel="noreferrer">Fibonacci heaps</a>, we keep a mark field for every node in the heap. Initially all the nodes are unmarked. Once a node is deleted, its parent is marked. If a node is deleted and its parent is already marked, the parent will be cut and inserte...
data structures heaps amortized analysis
1
What is the purpose of Mark field in Fibonacci Heaps? -- (data structures heaps amortized analysis) <p>In <a href="http://en.wikipedia.org/wiki/Fibonacci_heap" rel="noreferrer">Fibonacci heaps</a>, we keep a mark field for every node in the heap. Initially all the nodes are unmarked. Once a node is deleted, its parent ...
habedi/stack-exchange-dataset
7,509
Data structures for general (non-tetrahedral) cell complexes
<p>For 2D polygonal meshes, the QuadEdge and HalfEdge data structure representations are sufficient to store and enable efficient query of all topological and incidence information. Are there compact and efficient data structures for 3D polyhedral meshes? I know there has been some recent work on compact representation...
data structures computational geometry
1
Data structures for general (non-tetrahedral) cell complexes -- (data structures computational geometry) <p>For 2D polygonal meshes, the QuadEdge and HalfEdge data structure representations are sufficient to store and enable efficient query of all topological and incidence information. Are there compact and efficient d...
habedi/stack-exchange-dataset
7,511
Power of Double - Logarithmic Space
<p>I try to solve exercise "on the power of double - logarithmic space" from the great textbook <a href="http://books.google.com/books?id=EuguvA-w5OEC&amp;pg=PA176&amp;lpg=PA176&amp;redir_esc=y#v=onepage&amp;q&amp;f=false" rel="nofollow">Computational Complexity by Oded Goldreich. </a>&#xA;The goal is to show that the ...
complexity theory space complexity
1
Power of Double - Logarithmic Space -- (complexity theory space complexity) <p>I try to solve exercise "on the power of double - logarithmic space" from the great textbook <a href="http://books.google.com/books?id=EuguvA-w5OEC&amp;pg=PA176&amp;lpg=PA176&amp;redir_esc=y#v=onepage&amp;q&amp;f=false" rel="nofollow">Comput...
habedi/stack-exchange-dataset
7,512
Looking for some more details on "Turing" devices
<p>I've been reading a lot of computer science literature in the recent past but haven't ran across an explanation of Turing machines, the different types, and why they seem to come up so often (I understand they are a sort of a basis for CS topics). </p>&#xA;&#xA;<p>I've also seen comments by some members mentioning ...
terminology turing machines computation models turing completeness
1
Looking for some more details on "Turing" devices -- (terminology turing machines computation models turing completeness) <p>I've been reading a lot of computer science literature in the recent past but haven't ran across an explanation of Turing machines, the different types, and why they seem to come up so often (I u...
habedi/stack-exchange-dataset
7,518
How to show that given language is unambiguous
<p>Given following grammar:</p>&#xA;&#xA;<p>$$&#xA;\begin{align}&#xA;S \rightarrow &amp;A1B \\&#xA;A \rightarrow &amp; 0A \mid \varepsilon \\&#xA;B \rightarrow &amp; 0B \mid 1B \mid \varepsilon \\&#xA;\end{align}&#xA;$$</p>&#xA;&#xA;<p>How can I show that this grammar is unambiguous? I need to find a grammar for the sa...
formal languages formal grammars context free proof techniques ambiguity
1
How to show that given language is unambiguous -- (formal languages formal grammars context free proof techniques ambiguity) <p>Given following grammar:</p>&#xA;&#xA;<p>$$&#xA;\begin{align}&#xA;S \rightarrow &amp;A1B \\&#xA;A \rightarrow &amp; 0A \mid \varepsilon \\&#xA;B \rightarrow &amp; 0B \mid 1B \mid \varepsilon \...
habedi/stack-exchange-dataset
7,523
Find $\epsilon'$ s.t $L_\epsilon$ is $\mathsf{NP}$-hard for any $\epsilon<\epsilon'$
<p>Let $L_\epsilon$ be the language of all $2$-CNF formulas $\varphi$, such that at least $(\frac{1}{2}+\epsilon)$ of $\varphi$'s clauses can be satisfied.</p>&#xA;&#xA;<p>I need to prove that there exists $\epsilon'$ s.t $L_\epsilon$ is $\mathsf{NP}$-hard for any $\epsilon&lt;\epsilon'$.</p>&#xA;&#xA;<p>We know that $...
complexity theory satisfiability approximation
1
Find $\epsilon'$ s.t $L_\epsilon$ is $\mathsf{NP}$-hard for any $\epsilon<\epsilon'$ -- (complexity theory satisfiability approximation) <p>Let $L_\epsilon$ be the language of all $2$-CNF formulas $\varphi$, such that at least $(\frac{1}{2}+\epsilon)$ of $\varphi$'s clauses can be satisfied.</p>&#xA;&#xA;<p>I need to p...
habedi/stack-exchange-dataset
7,525
Number of digits in a binary product
<p>Assume i have 2 numbers in binary form (or, more precisely, assume to know the number of their digits, DF1, DF2):</p>&#xA;&#xA;<p>101010101001010101010101010111111111111111111111010101&#xA;10101111111111111111010101</p>&#xA;&#xA;<p>Is there a formula for the exact number of binary digits (DP) of the product?</p>&#xA...
factoring
1
Number of digits in a binary product -- (factoring) <p>Assume i have 2 numbers in binary form (or, more precisely, assume to know the number of their digits, DF1, DF2):</p>&#xA;&#xA;<p>101010101001010101010101010111111111111111111111010101&#xA;10101111111111111111010101</p>&#xA;&#xA;<p>Is there a formula for the exact ...
habedi/stack-exchange-dataset
7,531
No compression algorithm can compress all input messages?
<p>I just started reading a book called Introduction to Data Compression, by Guy E. Blelloch. On page one, he states:</p>&#xA;<blockquote>&#xA;<p>The truth is that if any one message is shortened by an algorithm, then some other message needs to be lengthened. You can verify this in practice by running GZIP on a GIF fi...
data compression coding theory
1
No compression algorithm can compress all input messages? -- (data compression coding theory) <p>I just started reading a book called Introduction to Data Compression, by Guy E. Blelloch. On page one, he states:</p>&#xA;<blockquote>&#xA;<p>The truth is that if any one message is shortened by an algorithm, then some oth...
habedi/stack-exchange-dataset
7,535
Characteristic path length
<p>I am unable to understand that what the characteristic path length (CPL) of a graph is.</p>&#xA;&#xA;<p>In one of its definitions, it is written that</p>&#xA;&#xA;<blockquote>&#xA; <p>it is defined as the median of the means&#xA; of the shortest path lengths connecting each vertex to all other vertices.</p>&#xA;</...
graphs
1
Characteristic path length -- (graphs) <p>I am unable to understand that what the characteristic path length (CPL) of a graph is.</p>&#xA;&#xA;<p>In one of its definitions, it is written that</p>&#xA;&#xA;<blockquote>&#xA; <p>it is defined as the median of the means&#xA; of the shortest path lengths connecting each v...
habedi/stack-exchange-dataset
7,545
The stable marriage algorithm with asymmetric arrays
<p>I have a question about the stable marriage algorithm, for what I know it can only be used when I have arrays with the same number of elements for building the preference and the ranking matrices.</p>&#xA;&#xA;<p>For example if we have 10 students that should be assigned to 10 dorms, then I can build the preference ...
algorithms optimization bipartite matching matching
1
The stable marriage algorithm with asymmetric arrays -- (algorithms optimization bipartite matching matching) <p>I have a question about the stable marriage algorithm, for what I know it can only be used when I have arrays with the same number of elements for building the preference and the ranking matrices.</p>&#xA;&#...
habedi/stack-exchange-dataset
7,560
Is this grammar really LL(1) while not being LR(1)?
<p>$S \rightarrow S$, $L(G) = \{\}$</p>&#xA;&#xA;<p><strong>LL(1) analysis:</strong></p>&#xA;&#xA;<p>We estabilish $FIRST(S)$ to be empty and $FOLLOW(S)$ to be $\{\$\}$.&#xA;$FIRST(S)$ doesn't contain &epsilon;, so the parse table looks like this:</p>&#xA;&#xA;<pre><code>+---+---+&#xA;| | $ |&#xA;+---+---+&#xA;| S | ...
formal grammars context free parsers
1
Is this grammar really LL(1) while not being LR(1)? -- (formal grammars context free parsers) <p>$S \rightarrow S$, $L(G) = \{\}$</p>&#xA;&#xA;<p><strong>LL(1) analysis:</strong></p>&#xA;&#xA;<p>We estabilish $FIRST(S)$ to be empty and $FOLLOW(S)$ to be $\{\$\}$.&#xA;$FIRST(S)$ doesn't contain &epsilon;, so the parse t...
habedi/stack-exchange-dataset
7,561
About complexity of a language
<p>I have a language which is made out of and has a grammar only operating on well parenthesized words or words of one symbol. I want to know if the problem of belonging to this language is decidable.</p>&#xA;&#xA;<p><strong>Example.</strong> Consider the following grammar:&#xA;$$a \to a(aa) \\ a \to b \\a (a(a(ab))) \...
formal languages computability
1
About complexity of a language -- (formal languages computability) <p>I have a language which is made out of and has a grammar only operating on well parenthesized words or words of one symbol. I want to know if the problem of belonging to this language is decidable.</p>&#xA;&#xA;<p><strong>Example.</strong> Consider t...
habedi/stack-exchange-dataset
7,566
Finding the grammar type of the programming language
<p>How can someone find what type of grammar for a given programming language?</p>&#xA;&#xA;<p>Formerly I'm looking for a grammar type for most popular programming languages: C, C++, C#, Java, List, OCaml, Haskell etc.</p>&#xA;
formal grammars programming languages
1
Finding the grammar type of the programming language -- (formal grammars programming languages) <p>How can someone find what type of grammar for a given programming language?</p>&#xA;&#xA;<p>Formerly I'm looking for a grammar type for most popular programming languages: C, C++, C#, Java, List, OCaml, Haskell etc.</p>&#...
habedi/stack-exchange-dataset
7,574
Which languages are recognized by one-counter machines?
<p><strong><a href="http://en.wikipedia.org/wiki/Counter_machine">Counter machines</a></strong> with two or more counters are typically shown to be equivalent to Turing machines in courses on the theory of computation. However, I have not seen a formal analysis of which languages can be recognized by a one-counter mac...
computability automata
1
Which languages are recognized by one-counter machines? -- (computability automata) <p><strong><a href="http://en.wikipedia.org/wiki/Counter_machine">Counter machines</a></strong> with two or more counters are typically shown to be equivalent to Turing machines in courses on the theory of computation. However, I have ...
habedi/stack-exchange-dataset
7,578
Multisets of a given set
<p>A multiset is an unordered collection of elements where elements may repeat any&#xA;number of times. The size of a multiset is the number of elements in it counting&#xA;repetitions.</p>&#xA;&#xA;<p>(a) What is the number of multisets of size $4$ that can be constructed from $n$&#xA;distinct elements so that at least...
combinatorics sets
1
Multisets of a given set -- (combinatorics sets) <p>A multiset is an unordered collection of elements where elements may repeat any&#xA;number of times. The size of a multiset is the number of elements in it counting&#xA;repetitions.</p>&#xA;&#xA;<p>(a) What is the number of multisets of size $4$ that can be constructe...
habedi/stack-exchange-dataset
7,582
What is the advantage of Randomized Quicksort?
<p>In their book <a href="http://www.amazon.co.uk/Randomized-Algorithms-Cambridge-International-Computation/dp/0521474655/ref=sr_1_1?ie=UTF8&amp;qid=1356380410&amp;sr=8-1"><em>Randomized Algorithms</em>,</a> Motwani and Raghavan open the introduction with a description of their RandQS function -- Randomized quicksort -...
algorithm analysis sorting randomized algorithms
1
What is the advantage of Randomized Quicksort? -- (algorithm analysis sorting randomized algorithms) <p>In their book <a href="http://www.amazon.co.uk/Randomized-Algorithms-Cambridge-International-Computation/dp/0521474655/ref=sr_1_1?ie=UTF8&amp;qid=1356380410&amp;sr=8-1"><em>Randomized Algorithms</em>,</a> Motwani and...
habedi/stack-exchange-dataset
7,585
Recursive and recursively enumerable language definition for a layman
<p>I've come across many definitions of recursive and recursively enumerable languages. But I couldn't quite understand what they are .</p>&#xA;&#xA;<p>Can some one please tell me what they are in simple words?</p>&#xA;
formal languages computability turing machines
1
Recursive and recursively enumerable language definition for a layman -- (formal languages computability turing machines) <p>I've come across many definitions of recursive and recursively enumerable languages. But I couldn't quite understand what they are .</p>&#xA;&#xA;<p>Can some one please tell me what they are in s...
habedi/stack-exchange-dataset
7,587
What are handles in parsing?
<p>I have read a few algorithms for $LR(k)$ parser, in which there is a frequent mention of selecting a handle from the grammar given.&#xA;For example, one document said - <em>"the essence of LR parsing is identifying the handle on top of stack"</em></p>&#xA;&#xA;<p>Please help me understand, what are handles in parsi...
compilers parsers
1
What are handles in parsing? -- (compilers parsers) <p>I have read a few algorithms for $LR(k)$ parser, in which there is a frequent mention of selecting a handle from the grammar given.&#xA;For example, one document said - <em>"the essence of LR parsing is identifying the handle on top of stack"</em></p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
7,588
Regularity of “middles” of words from regular language
<p>I need some help with the following problem. Let $L \subseteq \Sigma^*$ be a regular language. I have to prove that the language $P = \{\alpha \mid \beta\alpha\gamma \in L, \beta,\gamma \in \Sigma^*\}$ is regular, where $\Sigma$ is the alphabet. In other words $P$ is the language of all substrings of words from $L$....
formal languages regular languages closure properties
1
Regularity of “middles” of words from regular language -- (formal languages regular languages closure properties) <p>I need some help with the following problem. Let $L \subseteq \Sigma^*$ be a regular language. I have to prove that the language $P = \{\alpha \mid \beta\alpha\gamma \in L, \beta,\gamma \in \Sigma^*\}$ i...
habedi/stack-exchange-dataset
7,600
Discrepancy between heads and tails
<p>Consider a sequence of $n$ flips of an unbiased coin. Let $H_i$ denote the absolute value of the excess of the number of heads over tails seen in the first $i$ flips. Define $H=\text{max}_i H_i$. Show that $E[H_i]=\Theta ( \sqrt{i} )$ and $E[H]=\Theta( \sqrt{n} )$. </p>&#xA;&#xA;<p>This problem appears in the first ...
probability theory randomized algorithms
1
Discrepancy between heads and tails -- (probability theory randomized algorithms) <p>Consider a sequence of $n$ flips of an unbiased coin. Let $H_i$ denote the absolute value of the excess of the number of heads over tails seen in the first $i$ flips. Define $H=\text{max}_i H_i$. Show that $E[H_i]=\Theta ( \sqrt{i} )$ ...
habedi/stack-exchange-dataset
7,602
k-armed bandit - index policies vs. Q-learning
<p>I am interested in the stateless k-armed bandit problem, where an agent repeatedly chooses one of k independent arms, each with a different distribution of rewards, and tries to maximize its total reward.</p>&#xA;&#xA;<p>I read many papers about this subject, but I am still confused, as there are two types of soluti...
machine learning
1
k-armed bandit - index policies vs. Q-learning -- (machine learning) <p>I am interested in the stateless k-armed bandit problem, where an agent repeatedly chooses one of k independent arms, each with a different distribution of rewards, and tries to maximize its total reward.</p>&#xA;&#xA;<p>I read many papers about th...
habedi/stack-exchange-dataset
7,604
What can be said about Θ-classes in m and n if we know that m < n?
<p>A function in $\Theta(m + n^2)$ and $0 &lt; m &lt; n^2$, is in $\Theta(n^2)$. Does a function in $\Theta(m\log n)$ and $0 &lt; m &lt; n^2$, imply that it is $\Theta(n^2\log n)$?</p>&#xA;
asymptotics landau notation
1
What can be said about Θ-classes in m and n if we know that m < n? -- (asymptotics landau notation) <p>A function in $\Theta(m + n^2)$ and $0 &lt; m &lt; n^2$, is in $\Theta(n^2)$. Does a function in $\Theta(m\log n)$ and $0 &lt; m &lt; n^2$, imply that it is $\Theta(n^2\log n)$?</p>&#xA;
habedi/stack-exchange-dataset
7,607
alphabet of a single tape turing machine that simulates a multitape TM
<p>First of all sorry, if this question already exists, in that case, pointing to the right direction will be appreciated.</p>&#xA;&#xA;<p>Secondly, sorry, if the question is below the expected level of Niveau, but all help appreciated.</p>&#xA;&#xA;<p>In the textbook by J. Hromkovic, named "Theoretical Computer Scienc...
turing machines
1
alphabet of a single tape turing machine that simulates a multitape TM -- (turing machines) <p>First of all sorry, if this question already exists, in that case, pointing to the right direction will be appreciated.</p>&#xA;&#xA;<p>Secondly, sorry, if the question is below the expected level of Niveau, but all help appr...
habedi/stack-exchange-dataset
7,610
XOR-like behavior in flow networks
<p><em>XOR is not the correct name, but I am looking for some kind of exclusive behavior.</em></p>&#xA;&#xA;<p>I am currently solving a set of different (assignment) problems by modeling flow networks and running a min-cost-max-flow algorithm. Flow networks are quite handy because a lot of problems can be reduced to th...
algorithms graphs network flow assignment problem
1
XOR-like behavior in flow networks -- (algorithms graphs network flow assignment problem) <p><em>XOR is not the correct name, but I am looking for some kind of exclusive behavior.</em></p>&#xA;&#xA;<p>I am currently solving a set of different (assignment) problems by modeling flow networks and running a min-cost-max-fl...
habedi/stack-exchange-dataset
7,613
Derive some strings
<p>G=({S,A,B},{0,1},P,S)</p>&#xA;&#xA;<p>Where P:</p>&#xA;&#xA;<ul>&#xA;<li>S→A1B</li>&#xA;<li>A→0A|ε </li>&#xA;<li>B→0B|1B|ε</li>&#xA;</ul>&#xA;&#xA;<p>I have to list the first 25 strings from L(G). So far I've made the tree, but I'm not sure that it's correct. </p>&#xA;&#xA;<p><img src="https://i.stack.imgur.co...
context free
1
Derive some strings -- (context free) <p>G=({S,A,B},{0,1},P,S)</p>&#xA;&#xA;<p>Where P:</p>&#xA;&#xA;<ul>&#xA;<li>S→A1B</li>&#xA;<li>A→0A|ε </li>&#xA;<li>B→0B|1B|ε</li>&#xA;</ul>&#xA;&#xA;<p>I have to list the first 25 strings from L(G). So far I've made the tree, but I'm not sure that it's correct. </p>&#xA;&#xA...
habedi/stack-exchange-dataset
7,617
LU decomposition with pivoting
<p>I have to solve system of linear algebraic equations $AX=B$, where $A$ is a two-dimensional matrix with all elements of main diagonal equal to zero.</p>&#xA;&#xA;<p>How to solve this problem? Iterational methods are not applied in this case.</p>&#xA;&#xA;<p>One way is <a href="http://en.wikipedia.org/wiki/LU_decompo...
matrices linear algebra
1
LU decomposition with pivoting -- (matrices linear algebra) <p>I have to solve system of linear algebraic equations $AX=B$, where $A$ is a two-dimensional matrix with all elements of main diagonal equal to zero.</p>&#xA;&#xA;<p>How to solve this problem? Iterational methods are not applied in this case.</p>&#xA;&#xA;<p...
habedi/stack-exchange-dataset
7,622
Finding maximum and minimum of consecutive XOR values
<p>Given an integer array (maximum size 50000), I have to find the minimum and maximum $X$ such that $X = a_p \oplus a_{p+1} \oplus \dots \oplus a_q$ for some $p$, $q$ with $p \leq q$.</p>&#xA;&#xA;<p>I have tried this process: $\text{sum}_i = a_0 \oplus a_1 \oplus \dots \oplus a_i$ for all $i$. I pre-calculated it in...
algorithms algorithm analysis performance binary arithmetic arithmetic
1
Finding maximum and minimum of consecutive XOR values -- (algorithms algorithm analysis performance binary arithmetic arithmetic) <p>Given an integer array (maximum size 50000), I have to find the minimum and maximum $X$ such that $X = a_p \oplus a_{p+1} \oplus \dots \oplus a_q$ for some $p$, $q$ with $p \leq q$.</p>&#...
habedi/stack-exchange-dataset
7,624
Computing the clustering coefficient
<p>I saw in <a href="http://www.youtube.com/watch?v=7ayAEHS1-F8" rel="nofollow">this</a> video that computing clustering coefficient of central node of a star graph using the following algorithm is $\Theta(n^2)$ and for a clique it is $\Theta(n^3)$. is that correct?</p>&#xA;&#xA;<pre><code>def clustering_coefficient(G...
graphs algorithm analysis runtime analysis
1
Computing the clustering coefficient -- (graphs algorithm analysis runtime analysis) <p>I saw in <a href="http://www.youtube.com/watch?v=7ayAEHS1-F8" rel="nofollow">this</a> video that computing clustering coefficient of central node of a star graph using the following algorithm is $\Theta(n^2)$ and for a clique it is...
habedi/stack-exchange-dataset
7,625
SSTF disk scheduling algorithm? What if lowest seek times are equal in either direction?
<p>Using the Shortest-Seek-Time-First (SSTF) disk scheduling algorithm (where we select a request with a minimum seek time from the current head position), what happens if the requests in both directions from the current head position are equal? </p>&#xA;&#xA;<p>For example, if the head position is at 25, and the neare...
algorithms operating systems storage
1
SSTF disk scheduling algorithm? What if lowest seek times are equal in either direction? -- (algorithms operating systems storage) <p>Using the Shortest-Seek-Time-First (SSTF) disk scheduling algorithm (where we select a request with a minimum seek time from the current head position), what happens if the requests in b...
habedi/stack-exchange-dataset
7,628
Bellman-Ford: shortest path
<p>my assumption:<br/>&#xA;- we have an undirected graph with only positive edges<br/>&#xA;- the edges are sorted alphabetically: <br/>&#xA;&nbsp;&nbsp;&nbsp;&nbsp;e.g A-B, A-C, B-D <br/>&#xA;&nbsp;&nbsp;&nbsp;&nbsp;and e.g not C-A, D-B, A-B </p>&#xA;&#xA;<p>I do not understand, why we need the first loop (line 1) here...
algorithms graphs shortest path
1
Bellman-Ford: shortest path -- (algorithms graphs shortest path) <p>my assumption:<br/>&#xA;- we have an undirected graph with only positive edges<br/>&#xA;- the edges are sorted alphabetically: <br/>&#xA;&nbsp;&nbsp;&nbsp;&nbsp;e.g A-B, A-C, B-D <br/>&#xA;&nbsp;&nbsp;&nbsp;&nbsp;and e.g not C-A, D-B, A-B </p>&#xA;&#xA...
habedi/stack-exchange-dataset
7,629
Random graph model
<p>When we say that in random graph we add an edge with a certain fixed probability, what do we actually mean?</p>&#xA;&#xA;<p>For example if probability is 0.5, does that mean that we can just add two edges in a graph because 0.5+0.5=1.</p>&#xA;
graphs probability theory
1
Random graph model -- (graphs probability theory) <p>When we say that in random graph we add an edge with a certain fixed probability, what do we actually mean?</p>&#xA;&#xA;<p>For example if probability is 0.5, does that mean that we can just add two edges in a graph because 0.5+0.5=1.</p>&#xA;
habedi/stack-exchange-dataset
7,637
Is it possible to use plants as a medium to store data? By what data structure?
<p>my question is simple.&#xA;Is it possible to use plants as a medium to store data?</p>&#xA;&#xA;<p>My opinion is: Possible, but we need to solve, how to distinguish 2 states. &#xA;Duplication and CRC of stored DATA is quiet simple. Growing new plants is easiest possibility, but we need to create unit, which will tak...
data structures graphs
1
Is it possible to use plants as a medium to store data? By what data structure? -- (data structures graphs) <p>my question is simple.&#xA;Is it possible to use plants as a medium to store data?</p>&#xA;&#xA;<p>My opinion is: Possible, but we need to solve, how to distinguish 2 states. &#xA;Duplication and CRC of stored...
habedi/stack-exchange-dataset
7,641
randomized algorithm for checking the satisfiability of s-formulas, that outputs the correct answer with probability at least $\frac{2}{3}$
<p>I'm trying to practice myself with random algorithms.</p>&#xA;&#xA;<p>Lets call a CNF formula over n variables s-formula if it is either unsatisable or it has at&#xA;least $\frac{2^n}{n^{10}}$ satisfying assignments.</p>&#xA;&#xA;<p>I would like your help with show a randomized algorithm for checking the&#xA;satisfi...
complexity theory time complexity randomized algorithms
1
randomized algorithm for checking the satisfiability of s-formulas, that outputs the correct answer with probability at least $\frac{2}{3}$ -- (complexity theory time complexity randomized algorithms) <p>I'm trying to practice myself with random algorithms.</p>&#xA;&#xA;<p>Lets call a CNF formula over n variables s-for...
habedi/stack-exchange-dataset
7,644
What is the fastest algorithm for finding all shortest paths in a sparse graph?
<p>In an unweighted, undirected graph with $V$ vertices and $E$ edges such that $2V \gt E$, what is the fastest way to find all shortest paths in a graph? Can it be done in faster than Floyd-Warshall which is $O(V^3)$ but very fast per iteration?</p>&#xA;&#xA;<p>How about if the graph is weighted?</p>&#xA;
algorithms graphs shortest path
1
What is the fastest algorithm for finding all shortest paths in a sparse graph? -- (algorithms graphs shortest path) <p>In an unweighted, undirected graph with $V$ vertices and $E$ edges such that $2V \gt E$, what is the fastest way to find all shortest paths in a graph? Can it be done in faster than Floyd-Warshall whi...
habedi/stack-exchange-dataset
7,647
RDT2.1 - does the Sender listener to "ack" even though state=ready?
<blockquote>&#xA; <p>Computer Networking:&#xA; A Top Down Approach&#xA; Featuring the Internet,&#xA; Jim Kurose, Keith Ross&#xA; Addison-Wesley 4nd edition , page -223.</p>&#xA;</blockquote>&#xA;&#xA;<p>Also <a href="https://sites.google.com/site/amirherzberg/introductiontocommunicationnetworks89-35/89-350-introdu...
computer networks
1
RDT2.1 - does the Sender listener to "ack" even though state=ready? -- (computer networks) <blockquote>&#xA; <p>Computer Networking:&#xA; A Top Down Approach&#xA; Featuring the Internet,&#xA; Jim Kurose, Keith Ross&#xA; Addison-Wesley 4nd edition , page -223.</p>&#xA;</blockquote>&#xA;&#xA;<p>Also <a href="https:/...
habedi/stack-exchange-dataset
7,649
Dijkstra's algorithm for undirected graphs with negative edges
<p>INPUT: "an undirected, weighted graph (negative weights allowed)"</p>&#xA;&#xA;<p>Could someone give an example for an undirected graph with negative edges where Dijkstra's algorithm doesn't work?&#xA;As far as i understood it only fails by directed graphs in case of negative edges.<br/>&#xA;Am i right ?</p>&#xA;
graphs shortest path
1
Dijkstra's algorithm for undirected graphs with negative edges -- (graphs shortest path) <p>INPUT: "an undirected, weighted graph (negative weights allowed)"</p>&#xA;&#xA;<p>Could someone give an example for an undirected graph with negative edges where Dijkstra's algorithm doesn't work?&#xA;As far as i understood it o...
habedi/stack-exchange-dataset
7,671
How to understand the reduction from 3-Coloring problem to general $k$-Coloring problem?
<p>3-Coloring problem can be proved NP-Complete making use of the reduction from 3SAT <a href="http://www.ic.unicamp.br/~rezende/ensino/mo417/2010s2/notas/16-nphard.pdf" rel="nofollow">Graph Coloring (from 3SAT)</a>. As a consequence, 4-Coloring problem is NP-Complete using the reduction from 3-Coloring:</p>&#xA;&#xA;<...
complexity theory graphs terminology np complete
1
How to understand the reduction from 3-Coloring problem to general $k$-Coloring problem? -- (complexity theory graphs terminology np complete) <p>3-Coloring problem can be proved NP-Complete making use of the reduction from 3SAT <a href="http://www.ic.unicamp.br/~rezende/ensino/mo417/2010s2/notas/16-nphard.pdf" rel="no...
habedi/stack-exchange-dataset
7,674
terminology for grouping words in a string?
<p>We commonly create sub-groups of strings in one particular algorithm implementation. I just want to know in CS literature is there any standard name for such kind of grouping. For e.g.</p>&#xA;&#xA;<pre><code>Hello World! This is May from the dairy farm.&#xA;</code></pre>&#xA;&#xA;<p>Strings with sub-groups of two:<...
terminology strings substrings
1
terminology for grouping words in a string? -- (terminology strings substrings) <p>We commonly create sub-groups of strings in one particular algorithm implementation. I just want to know in CS literature is there any standard name for such kind of grouping. For e.g.</p>&#xA;&#xA;<pre><code>Hello World! This is May fro...
habedi/stack-exchange-dataset
7,679
Names of Softwares used for modeling
<p>Which tools or softwares are mostly used for the purpose of modeling a computer network?</p>&#xA;
computer networks
1
Names of Softwares used for modeling -- (computer networks) <p>Which tools or softwares are mostly used for the purpose of modeling a computer network?</p>&#xA;
habedi/stack-exchange-dataset
7,682
Formal Languages - Expressive power of Formalisms
<p>I need help with the following question:</p>&#xA;&#xA;<p>Order the following formalisms according to their expressive power:&#xA;placing A before B means that any language definable by A is definable&#xA;by B. Also state which, if any, of them are equivalent.</p>&#xA;&#xA;<pre><code>• Turing Machines (TM)&#xA;• Regu...
formal languages regular languages context free regular expressions pushdown automata
1
Formal Languages - Expressive power of Formalisms -- (formal languages regular languages context free regular expressions pushdown automata) <p>I need help with the following question:</p>&#xA;&#xA;<p>Order the following formalisms according to their expressive power:&#xA;placing A before B means that any language defi...
habedi/stack-exchange-dataset
7,687
Standard notation for the language of the universal Turing machine?
<p>The <a href="http://en.wikipedia.org/wiki/Universal_Turing_machine" rel="nofollow">universal Turing machine</a> $U_{TM}$ is a TM that takes in as input an encoding of a TM and a string, then runs the TM on the string and does whatever the simulated TM does. The language of the universal TM is the set of all encodin...
computability terminology turing machines
1
Standard notation for the language of the universal Turing machine? -- (computability terminology turing machines) <p>The <a href="http://en.wikipedia.org/wiki/Universal_Turing_machine" rel="nofollow">universal Turing machine</a> $U_{TM}$ is a TM that takes in as input an encoding of a TM and a string, then runs the TM...
habedi/stack-exchange-dataset
7,690
Why we do isomorphism, automorphism and homomorphism?
<p>What are the key differences between these three terms isomorphism, automorphism and homomorphism in simple layman language and why we do isomorphism, automorphism and homomorphism ?</p>&#xA;
graphs
1
Why we do isomorphism, automorphism and homomorphism? -- (graphs) <p>What are the key differences between these three terms isomorphism, automorphism and homomorphism in simple layman language and why we do isomorphism, automorphism and homomorphism ?</p>&#xA;
habedi/stack-exchange-dataset
7,691
Simplify complexity of n multichoose k
<p>I have a recursive algorithm with time complexity equivalent to choosing k elements from n with repetition, and I was wondering whether I could get a more simplified big-O expression. In my case, <span class="math-container">$k$</span> may be greater than <span class="math-container">$n$</span> and they grow indepe...
asymptotics combinatorics runtime analysis
1
Simplify complexity of n multichoose k -- (asymptotics combinatorics runtime analysis) <p>I have a recursive algorithm with time complexity equivalent to choosing k elements from n with repetition, and I was wondering whether I could get a more simplified big-O expression. In my case, <span class="math-container">$k$<...
habedi/stack-exchange-dataset
7,702
"Applicative order" and "Normal order" in lambda-calculus
<blockquote>&#xA; <p><strong>Applicative order:</strong> Always fully evaluate the arguments of a function&#xA; before evaluating the function itself , like -</p>&#xA; &#xA; <p>$(\lambda x. x^2(\lambda x.(x+1) \ \ 2))) \rightarrow (\lambda x.&#xA; x^2(2+1))\rightarrow \ (\lambda x. x^2(3)) \rightarrow \ 3^2 \&#xA...
logic lambda calculus normal forms
1
"Applicative order" and "Normal order" in lambda-calculus -- (logic lambda calculus normal forms) <blockquote>&#xA; <p><strong>Applicative order:</strong> Always fully evaluate the arguments of a function&#xA; before evaluating the function itself , like -</p>&#xA; &#xA; <p>$(\lambda x. x^2(\lambda x.(x+1) \ \ 2)))...
habedi/stack-exchange-dataset
7,708
Turing machine and coming up with an idea
<p>I read many things about the Turing machine and understand how it works but what I can't get the grasp of (and what none of the books seem to try to teach) is how should I approach a problem I am given to solve? I mean: checking if a word is a palindrome, for example, consists of 11 states in the book I'm learning f...
turing machines
1
Turing machine and coming up with an idea -- (turing machines) <p>I read many things about the Turing machine and understand how it works but what I can't get the grasp of (and what none of the books seem to try to teach) is how should I approach a problem I am given to solve? I mean: checking if a word is a palindrome...
habedi/stack-exchange-dataset
7,714
What factors must one consider choosing an NN structure?
<p>Suppose we have a classification problem and we wish to solve the problem by Neural Network. What factors must one consider choosing an NN structure? e.g Feed Forward, Recurrent and other available structures. </p>&#xA;
artificial intelligence neural networks neural computing
1
What factors must one consider choosing an NN structure? -- (artificial intelligence neural networks neural computing) <p>Suppose we have a classification problem and we wish to solve the problem by Neural Network. What factors must one consider choosing an NN structure? e.g Feed Forward, Recurrent and other available ...
habedi/stack-exchange-dataset
7,716
Can someone give a simple but non-toy example of a context-sensitive grammar?
<p>I'm trying to understand context-sensitive grammars.</p>&#xA;&#xA;<p>I understand why languages like</p>&#xA;&#xA;<blockquote>&#xA; <ol>&#xA; <li>$\{ww \mid w \in A^*\}$</li>&#xA; <li>$\{a^n b^n c^n \mid n\in\mathbb{N}\}$</li>&#xA; </ol>&#xA;</blockquote>&#xA;&#xA;<p>are not context free, but what I'd like to kn...
formal grammars programming languages lambda calculus context sensitive
1
Can someone give a simple but non-toy example of a context-sensitive grammar? -- (formal grammars programming languages lambda calculus context sensitive) <p>I'm trying to understand context-sensitive grammars.</p>&#xA;&#xA;<p>I understand why languages like</p>&#xA;&#xA;<blockquote>&#xA; <ol>&#xA; <li>$\{ww \mid w \...
habedi/stack-exchange-dataset
7,720
What does big O mean as a term of an approximation ratio?
<p>I'm trying to understand the approximation ratio for the <a href="http://mor.journal.informs.org/content/25/4/645.full.pdf" rel="nofollow">Kenyon-Remila</a> algorithm for the 2D cutting stock problem.</p>&#xA;&#xA;<p>The ratio in question is $(1 + \varepsilon) \text{Opt}(L) + O(1/\varepsilon^2)$.</p>&#xA;&#xA;<p>The...
algorithms asymptotics approximation
1
What does big O mean as a term of an approximation ratio? -- (algorithms asymptotics approximation) <p>I'm trying to understand the approximation ratio for the <a href="http://mor.journal.informs.org/content/25/4/645.full.pdf" rel="nofollow">Kenyon-Remila</a> algorithm for the 2D cutting stock problem.</p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
7,726
Proving P = NP without mathematical statements / computer program
<p>This is my first post after being a passive user for some time now.&#xA;I wish to ask some questions if I may. I am not a mathematician but my question relates to the field of maths/computer science. In particular, the P vs NP problem. I am aware that this is a problem that elite professionals have not yet been a...
complexity theory p vs np
1
Proving P = NP without mathematical statements / computer program -- (complexity theory p vs np) <p>This is my first post after being a passive user for some time now.&#xA;I wish to ask some questions if I may. I am not a mathematician but my question relates to the field of maths/computer science. In particular, the...
habedi/stack-exchange-dataset
7,729
How can it be detected that a number generator is not really random?
<p>I heard that random number generation in computers isn't really random, but there is no efficient algorithm to detect it. How can it be detected at all ? </p>&#xA;
randomness random number generator
1
How can it be detected that a number generator is not really random? -- (randomness random number generator) <p>I heard that random number generation in computers isn't really random, but there is no efficient algorithm to detect it. How can it be detected at all ? </p>&#xA;
habedi/stack-exchange-dataset
7,734
Demonstrating that for every monotonic grammar there is an equivalent context-sensitive grammar
<p>I'm trying to understand the equivalence in expressive power of formal grammars whose rules take the form:</p>&#xA;&#xA;<p>$$ \alpha \rightarrow \beta $$ where $ |\alpha| \leq |\beta| $ (called a <em>monotonic</em> grammar), and grammars whose rules take the form:</p>&#xA;&#xA;<p>$$ \alpha B \gamma \rightarrow \alph...
formal grammars context sensitive
1
Demonstrating that for every monotonic grammar there is an equivalent context-sensitive grammar -- (formal grammars context sensitive) <p>I'm trying to understand the equivalence in expressive power of formal grammars whose rules take the form:</p>&#xA;&#xA;<p>$$ \alpha \rightarrow \beta $$ where $ |\alpha| \leq |\beta...
habedi/stack-exchange-dataset
7,737
Is it $\mathsf{NP}$-hard to decide whether $\mathsf{P}=\mathsf{NP}$?
<blockquote>&#xA; <p>Is it $\mathsf{NP}$-hard to decide whether $\mathsf{P}=\mathsf{NP}$ ?</p>&#xA;</blockquote>&#xA;&#xA;<p>If so, what are the implications ? Is there result suggesting that it is the case ?</p>&#xA;
complexity theory
1
Is it $\mathsf{NP}$-hard to decide whether $\mathsf{P}=\mathsf{NP}$? -- (complexity theory) <blockquote>&#xA; <p>Is it $\mathsf{NP}$-hard to decide whether $\mathsf{P}=\mathsf{NP}$ ?</p>&#xA;</blockquote>&#xA;&#xA;<p>If so, what are the implications ? Is there result suggesting that it is the case ?</p>&#xA;
habedi/stack-exchange-dataset
7,740
Pumping lemma for Context-Free Languages
<p>I have a question about a specific pumping lemma problem for Context-Free Languages.</p>&#xA;&#xA;<p>Suppose we have the following Language:</p>&#xA;&#xA;<blockquote>&#xA; <p>$L = \{a^{i}b^{j}c^{k}d^{l} \mid 0 &lt; i &lt; k \wedge j &gt; l &gt; 0 \}$</p>&#xA;</blockquote>&#xA;&#xA;<p>Here is my attemp to prove that...
formal languages formal grammars context free pumping lemma
1
Pumping lemma for Context-Free Languages -- (formal languages formal grammars context free pumping lemma) <p>I have a question about a specific pumping lemma problem for Context-Free Languages.</p>&#xA;&#xA;<p>Suppose we have the following Language:</p>&#xA;&#xA;<blockquote>&#xA; <p>$L = \{a^{i}b^{j}c^{k}d^{l} \mid 0 ...
habedi/stack-exchange-dataset
7,743
How to work out physical address corresponding to logical address?
<p>I am looking to calculate the physical address corresponding to a logical address in a paging memory management scheme. I just want to make sure I am getting the calculation right, as I fear I could be wrong somewhere.</p>&#xA;&#xA;<p>So, the data I have is as follows: </p>&#xA;&#xA;<ul>&#xA;<li><p>The logical addre...
operating systems memory management paging
1
How to work out physical address corresponding to logical address? -- (operating systems memory management paging) <p>I am looking to calculate the physical address corresponding to a logical address in a paging memory management scheme. I just want to make sure I am getting the calculation right, as I fear I could be ...
habedi/stack-exchange-dataset
7,746
Generating a adjacency matrix representing a DAG
<p>Does anyone have a pointer to a resource or, even better, a tip to provide on how to efficiently generate a very large matrix representing a connected graph.</p>&#xA;&#xA;<p>Graph can be randomly created although I would ideally generate a graph of desired size and topology similar to what one can do with <a href="h...
graphs adjacency matrix
1
Generating a adjacency matrix representing a DAG -- (graphs adjacency matrix) <p>Does anyone have a pointer to a resource or, even better, a tip to provide on how to efficiently generate a very large matrix representing a connected graph.</p>&#xA;&#xA;<p>Graph can be randomly created although I would ideally generate a...
habedi/stack-exchange-dataset
7,747
Progress of algorithms in problem spaces
<p>Continuing in the vein of two prior questions <a href="https://cs.stackexchange.com/questions/6562/generalizing-the-comparison-sorting-lower-bound-proof">(1)</a> and <a href="https://cs.stackexchange.com/questions/7349/proofs-based-on-narrowing-down-sets-of-possibilities">(2)</a>, we started with sorting, where we h...
proof techniques lower bounds
1
Progress of algorithms in problem spaces -- (proof techniques lower bounds) <p>Continuing in the vein of two prior questions <a href="https://cs.stackexchange.com/questions/6562/generalizing-the-comparison-sorting-lower-bound-proof">(1)</a> and <a href="https://cs.stackexchange.com/questions/7349/proofs-based-on-narrow...
habedi/stack-exchange-dataset
7,749
DFS - Proof of Correctness
<p>I'm currently studying the book "Introduction to Algorithms - Cormen". Although a proof of correctness for the BFS algorithm is given, there isn't one any for the DFS in the book. So I was courious about how it can be shown that DFS visits all the nodes.&#xA;I also googled for it. But it seems that every lecturer do...
algorithms graphs correctness proof
1
DFS - Proof of Correctness -- (algorithms graphs correctness proof) <p>I'm currently studying the book "Introduction to Algorithms - Cormen". Although a proof of correctness for the BFS algorithm is given, there isn't one any for the DFS in the book. So I was courious about how it can be shown that DFS visits all the n...
habedi/stack-exchange-dataset
7,751
Pumping lemma problem - Choosing the right string to pump
<p>I have a problem finding the right string to pump for the following language:</p>&#xA;&#xA;<p>$$L_1 = \{a^{p+q}b^rc^sd^{q+r}e^s \mid p, q, r, s \ge 0\}$$</p>&#xA;&#xA;<p>Which string should I choose to pump? The problem is that I don't know how to handle the fact that I have $p+q$ and $q+r$?</p>&#xA;&#xA;<p>Can I ch...
formal languages automata context free pumping lemma
1
Pumping lemma problem - Choosing the right string to pump -- (formal languages automata context free pumping lemma) <p>I have a problem finding the right string to pump for the following language:</p>&#xA;&#xA;<p>$$L_1 = \{a^{p+q}b^rc^sd^{q+r}e^s \mid p, q, r, s \ge 0\}$$</p>&#xA;&#xA;<p>Which string should I choose to...
habedi/stack-exchange-dataset
7,756
Non-deterministic algorithm for solving figure of 8
<p>I am struggling in trying to figure out a non-deterministic algorithm for the following problem.</p>&#xA;&#xA;<p>Consider the following problem, called the figure-of-eight problem (FOE). An instance is an undirected graph $G = (V,E)$ with vertices $V$ and edges $E$. $G$ is a yes-instance if there is a sequence of ver...
algorithms complexity theory graphs nondeterminism
1
Non-deterministic algorithm for solving figure of 8 -- (algorithms complexity theory graphs nondeterminism) <p>I am struggling in trying to figure out a non-deterministic algorithm for the following problem.</p>&#xA;&#xA;<p>Consider the following problem, called the figure-of-eight problem (FOE). An instance is an undir...
habedi/stack-exchange-dataset
7,759
Importance of recursion in computability theory
<p>It is said that computability theory is also called recursion theory. Why is it called like that? Why recursion has this much importance?</p>&#xA;
computability terminology history
1
Importance of recursion in computability theory -- (computability terminology history) <p>It is said that computability theory is also called recursion theory. Why is it called like that? Why recursion has this much importance?</p>&#xA;
habedi/stack-exchange-dataset
7,761
Explaining why a grammar is not LL(1)
<p>I need some help with explaining why a grammar is not LL(1).</p>&#xA;&#xA;<p>Let us take the following grammar:</p>&#xA;&#xA;<p>$$&#xA;\begin{align}&#xA;S \rightarrow &amp; aB \mid bA \mid \varepsilon \\&#xA;A \rightarrow &amp; aS \mid bAA \\&#xA;B \rightarrow &amp; b \\&#xA;\end{align}&#xA;$$</p>&#xA;&#xA;<p>This i...
formal languages regular languages context free pushdown automata
1
Explaining why a grammar is not LL(1) -- (formal languages regular languages context free pushdown automata) <p>I need some help with explaining why a grammar is not LL(1).</p>&#xA;&#xA;<p>Let us take the following grammar:</p>&#xA;&#xA;<p>$$&#xA;\begin{align}&#xA;S \rightarrow &amp; aB \mid bA \mid \varepsilon \\&#xA;...
habedi/stack-exchange-dataset