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
32,421
Is it possible to obtain a total function by composition of partial functions?
<p>This statement is Theorem 1.1 (page 39) of <em>Computability, Complexity and languages</em> by Martin Davis:</p>&#xA;&#xA;<blockquote>&#xA; <p>If function $h$ is obtained from the (partially) computable functions $f$, $g_1$, $g_2$, ..., $g_k$ by composition then $h$ is (partially) computable.</p>&#xA;</blockquote>&...
terminology computability semi decidability
1
Is it possible to obtain a total function by composition of partial functions? -- (terminology computability semi decidability) <p>This statement is Theorem 1.1 (page 39) of <em>Computability, Complexity and languages</em> by Martin Davis:</p>&#xA;&#xA;<blockquote>&#xA; <p>If function $h$ is obtained from the (partial...
habedi/stack-exchange-dataset
32,435
Is Binary Search Related to Binary Search Tree?
<p>I was reading binary search and suddenly realized that it would be very difficult for a binary search tree to find the middle value and then split in two. Are these related at all?</p>&#xA;
search algorithms
1
Is Binary Search Related to Binary Search Tree? -- (search algorithms) <p>I was reading binary search and suddenly realized that it would be very difficult for a binary search tree to find the middle value and then split in two. Are these related at all?</p>&#xA;
habedi/stack-exchange-dataset
32,439
Pumping lemma for 0^n and n>0
<p>When applying the pumping lemma to $L = \{ 0^n \mid n&gt;0\}$ I do the following:</p>&#xA;&#xA;<p>$S = 0^p$<br>&#xA;$x = \varepsilon$<br>&#xA;$y = 0^p$<br>&#xA;$z = \varepsilon$</p>&#xA;&#xA;<p>so $S = xyz = (\varepsilon)0^p(\varepsilon)$</p>&#xA;&#xA;<p>For $x y^i z$ if i choose $i = 0$ (pumping down)&#xA;i get $S ...
formal languages regular languages pumping lemma
1
Pumping lemma for 0^n and n>0 -- (formal languages regular languages pumping lemma) <p>When applying the pumping lemma to $L = \{ 0^n \mid n&gt;0\}$ I do the following:</p>&#xA;&#xA;<p>$S = 0^p$<br>&#xA;$x = \varepsilon$<br>&#xA;$y = 0^p$<br>&#xA;$z = \varepsilon$</p>&#xA;&#xA;<p>so $S = xyz = (\varepsilon)0^p(\varepsi...
habedi/stack-exchange-dataset
32,452
Difference between a lambda term and a lambda expression
<p>Is there any difference between a $\lambda$-term and a $\lambda$-expression? </p>&#xA;&#xA;<p>Looking at the recursive definitions on Wikipedia of &#xA;<a href="http://en.wikipedia.org/wiki/Lambda_calculus#Lambda_terms" rel="nofollow">$\lambda$-term</a> and <a href="http://en.wikipedia.org/wiki/Lambda_calculus#Defin...
terminology lambda calculus
1
Difference between a lambda term and a lambda expression -- (terminology lambda calculus) <p>Is there any difference between a $\lambda$-term and a $\lambda$-expression? </p>&#xA;&#xA;<p>Looking at the recursive definitions on Wikipedia of &#xA;<a href="http://en.wikipedia.org/wiki/Lambda_calculus#Lambda_terms" rel="no...
habedi/stack-exchange-dataset
32,462
Do Karnaugh maps yield the simplest solution possible?
<p>I'm learning to use a Karnaugh map, but I'm not sure if I obtained the simplest expression possible. Have a look at this example:</p>&#xA;&#xA;<p>Truth table (inputs are A B C; output is F):</p>&#xA;&#xA;<pre><code>A B C | F&#xA;0 0 0 | 1&#xA;0 0 1 | 0&#xA;0 1 0 | 1&#xA;1 0 0 | ...
logic boolean algebra digital circuits karnaugh map
1
Do Karnaugh maps yield the simplest solution possible? -- (logic boolean algebra digital circuits karnaugh map) <p>I'm learning to use a Karnaugh map, but I'm not sure if I obtained the simplest expression possible. Have a look at this example:</p>&#xA;&#xA;<p>Truth table (inputs are A B C; output is F):</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
32,466
compressing a set of binary strings with fixed length
<p>I'm looking for a data structure / algorithm to store an unordered set <code>S</code> of binary strings of a fixed length <code>n</code> (i.e. all matching the following regular expression: <code>[01]{n}</code>).</p>&#xA;&#xA;<p>Insertion and lookup ("Is element <code>x</code> in the <code>S</code>?") should maximal...
data structures strings sets
1
compressing a set of binary strings with fixed length -- (data structures strings sets) <p>I'm looking for a data structure / algorithm to store an unordered set <code>S</code> of binary strings of a fixed length <code>n</code> (i.e. all matching the following regular expression: <code>[01]{n}</code>).</p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
32,470
Ambiguous Grammar to Unambiguous Grammar
<p>I'm wondering if somebody can please help me to understand how I go about converting this grammar to an unambiguous grammar. If you can point me in the right direction, I would greatly appreciate it.</p>&#xA;&#xA;<p>S -> AB | aaB</p>&#xA;&#xA;<p>A -> a | Aa</p>&#xA;&#xA;<p>B -> b</p>&#xA;
formal grammars ambiguity
1
Ambiguous Grammar to Unambiguous Grammar -- (formal grammars ambiguity) <p>I'm wondering if somebody can please help me to understand how I go about converting this grammar to an unambiguous grammar. If you can point me in the right direction, I would greatly appreciate it.</p>&#xA;&#xA;<p>S -> AB | aaB</p>&#xA;&#xA;<p...
habedi/stack-exchange-dataset
32,479
Is $AlwaysHalt$ recursively enumerable?
<p>I was doing some complexity theory exercices and I came over this one:</p>&#xA;&#xA;<p>$AlwaysHalt = \{R(M) | M$ halts with all $x \in \{0,1\}^*\}$</p>&#xA;&#xA;<p>Is $AlwaysHalt$ recursively enumerable?</p>&#xA;&#xA;<p>I would say YES and construct the following TM that accepts this language:</p>&#xA;&#xA;<p>Enumer...
computability halting problem semi decidability
1
Is $AlwaysHalt$ recursively enumerable? -- (computability halting problem semi decidability) <p>I was doing some complexity theory exercices and I came over this one:</p>&#xA;&#xA;<p>$AlwaysHalt = \{R(M) | M$ halts with all $x \in \{0,1\}^*\}$</p>&#xA;&#xA;<p>Is $AlwaysHalt$ recursively enumerable?</p>&#xA;&#xA;<p>I wo...
habedi/stack-exchange-dataset
32,482
Given two sequences of the same size, how many longest common subsequences can they have?
<p>For simplicity assume that both have the same size N.</p>&#xA;&#xA;<p>the lengh of this subsequence can be at most N, so maybe it's</p>&#xA;&#xA;<p><code>max(C(N,1), C(N,2), ... , C(N,N))</code>?</p>&#xA;
combinatorics
1
Given two sequences of the same size, how many longest common subsequences can they have? -- (combinatorics) <p>For simplicity assume that both have the same size N.</p>&#xA;&#xA;<p>the lengh of this subsequence can be at most N, so maybe it's</p>&#xA;&#xA;<p><code>max(C(N,1), C(N,2), ... , C(N,N))</code>?</p>&#xA;
habedi/stack-exchange-dataset
32,495
Why having a simple multiplication loop and very good avalanche isn't enough to produce well-distributed hash values?
<p>Modern non-cryptographic 32- and 64-bit valued hash functions, for example, lookup3, MurmurHash3 and CityHash, have quite sophisticated loops, each iteration of which include many multiplications, XORs and rotates. Why this is needed, since there are good avalanche procedures (32 -> 32 and 64 -> 64 bits), which mix ...
hash
1
Why having a simple multiplication loop and very good avalanche isn't enough to produce well-distributed hash values? -- (hash) <p>Modern non-cryptographic 32- and 64-bit valued hash functions, for example, lookup3, MurmurHash3 and CityHash, have quite sophisticated loops, each iteration of which include many multiplic...
habedi/stack-exchange-dataset
32,497
Does the Y combinator contradict the Curry-Howard correspondence?
<p>The Y combinator has the type $(a \rightarrow a) \rightarrow a$. By the Curry-Howard Correspondence, because the type $(a \rightarrow a) \rightarrow a$ is inhabited, it must correspond to a true theorem. However $a \rightarrow a$ is always true, so it appears as if the Y combinator's type corresponds to the theorem ...
logic recursion type theory combinatory logic curry howard
1
Does the Y combinator contradict the Curry-Howard correspondence? -- (logic recursion type theory combinatory logic curry howard) <p>The Y combinator has the type $(a \rightarrow a) \rightarrow a$. By the Curry-Howard Correspondence, because the type $(a \rightarrow a) \rightarrow a$ is inhabited, it must correspond to...
habedi/stack-exchange-dataset
32,506
Is a secondary TM sufficient to detect all loops?
<p>Procedure: Start a secondary TM in parallel with the first, but have the second perform exactly 1 step each 2 steps the first TM performs (i.e. it runs at half speed). If the second machine ever reaches the same configuration as the first, a loop was detected (obviously). </p>&#xA;&#xA;<p>Claim: <em>All</em> infinit...
computability turing machines busy beaver
1
Is a secondary TM sufficient to detect all loops? -- (computability turing machines busy beaver) <p>Procedure: Start a secondary TM in parallel with the first, but have the second perform exactly 1 step each 2 steps the first TM performs (i.e. it runs at half speed). If the second machine ever reaches the same configur...
habedi/stack-exchange-dataset
32,509
Kleene positive closure - help in proofing this claim
<p>I just started a course called 'Automata and Formal Languages'. &#xA;I'm having difficulty in proofing\disproofing this equality. </p>&#xA;&#xA;<p>$ (L_{1} \circ L_{2})^{+} = L_{1}^{+} \circ L_{2}^{+}&#xA; $</p>&#xA;&#xA;<p>Where:</p>&#xA;&#xA;<p>$ L_{1} $, $L_{2}$ are Languages.</p>&#xA;&#xA;<p>$\circ$ is the conca...
formal languages closure properties
1
Kleene positive closure - help in proofing this claim -- (formal languages closure properties) <p>I just started a course called 'Automata and Formal Languages'. &#xA;I'm having difficulty in proofing\disproofing this equality. </p>&#xA;&#xA;<p>$ (L_{1} \circ L_{2})^{+} = L_{1}^{+} \circ L_{2}^{+}&#xA; $</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
32,510
Recursive methods with stacks
<p>I'm doing some practice papers for revision for my finals and I came across this question:</p>&#xA;&#xA;<blockquote>&#xA; <p>"This question is about recursion. A recursive method can always be implemented by an iterative method that uses a stack to keep track of intermediate values. Could the stack be replaced by, ...
computation models recursion stacks
1
Recursive methods with stacks -- (computation models recursion stacks) <p>I'm doing some practice papers for revision for my finals and I came across this question:</p>&#xA;&#xA;<blockquote>&#xA; <p>"This question is about recursion. A recursive method can always be implemented by an iterative method that uses a stack...
habedi/stack-exchange-dataset
32,514
How is a Turing Test defined?
<p>Turing Test definition taken from <a href="http://en.wikipedia.org/wiki/Turing_test" rel="noreferrer">wikipedia</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>The Turing test is a test of a machine's ability to exhibit&#xA; intelligent behavior equivalent to, or indistinguishable from, that of&#xA; a human. In the origin...
artificial intelligence turing test
1
How is a Turing Test defined? -- (artificial intelligence turing test) <p>Turing Test definition taken from <a href="http://en.wikipedia.org/wiki/Turing_test" rel="noreferrer">wikipedia</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>The Turing test is a test of a machine's ability to exhibit&#xA; intelligent behavior equival...
habedi/stack-exchange-dataset
32,522
Why can't we search lexicographicaly ordered programs to compute Kolmogrov complexity?
<p>Kolmogrov complexity is known to be uncomputable. Why can't we enumerate all programs of size i = 0 in lexicographical order - if any produce string s, that is the Kolmogrov complexity; if not, increment i and iterate? Won't that prove that no program of length &lt; i generates string s?</p>&#xA;
computability kolmogorov complexity
1
Why can't we search lexicographicaly ordered programs to compute Kolmogrov complexity? -- (computability kolmogorov complexity) <p>Kolmogrov complexity is known to be uncomputable. Why can't we enumerate all programs of size i = 0 in lexicographical order - if any produce string s, that is the Kolmogrov complexity; if...
habedi/stack-exchange-dataset
32,534
Find a collection of sets where each number from a given list is contained in a different set
<p>I have a set of numbers S of cardinality N, and a collection of sets each containing some subset of S. The cardinality of each of these sets can be anywhere from 1 to N. The number of sets is variable, but is necessarily at least N.</p>&#xA;&#xA;<p>e.g.</p>&#xA;&#xA;<p>$S = \{1, 2, 3, 4, 5, 6, 7, 8, 9\}$</p>&#xA;&...
algorithms sets
1
Find a collection of sets where each number from a given list is contained in a different set -- (algorithms sets) <p>I have a set of numbers S of cardinality N, and a collection of sets each containing some subset of S. The cardinality of each of these sets can be anywhere from 1 to N. The number of sets is variable...
habedi/stack-exchange-dataset
32,550
Find all $k$ local maximums in an array of length $n$ in $O(n \log k)$ time
<p>Given a sequence of numbers $a_1, a_2, ..., a_n$, a number $a_i$ is called the $k$ local maximum $\iff i &gt; k$ and $a_i$ is the largest number among the $(k+1)$ numbers $a_{i-k}, a_{i-k+1}, ..., a_i$. Given a sequence of $n$ numbers $a_1, a_2, ..., a_n$, and an integer $k$, I am requested to find all $k$ local max...
algorithms algorithm analysis runtime analysis search algorithms
1
Find all $k$ local maximums in an array of length $n$ in $O(n \log k)$ time -- (algorithms algorithm analysis runtime analysis search algorithms) <p>Given a sequence of numbers $a_1, a_2, ..., a_n$, a number $a_i$ is called the $k$ local maximum $\iff i &gt; k$ and $a_i$ is the largest number among the $(k+1)$ numbers ...
habedi/stack-exchange-dataset
32,554
Is Differential Evolution a genetic algorithm?
<p>I am trying to classify the Differential Evolution algorithm according to the framework <a href="http://rads.stackoverflow.com/amzn/click/3540401849" rel="noreferrer">in the book</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Introduction to Evolutionary Computing</p>&#xA;</blockquote>&#xA;&#xA;<p>The authors classify the ...
optimization genetic algorithms evolutionary computing
1
Is Differential Evolution a genetic algorithm? -- (optimization genetic algorithms evolutionary computing) <p>I am trying to classify the Differential Evolution algorithm according to the framework <a href="http://rads.stackoverflow.com/amzn/click/3540401849" rel="noreferrer">in the book</a>:</p>&#xA;&#xA;<blockquote>&...
habedi/stack-exchange-dataset
32,557
Calculating the runtime for a recursive algorithm
<p>If the runtime of a recursive algorithm could be expressed as </p>&#xA;&#xA;<p>$T(n) = \begin{cases}O(1) &amp; n \leq c \\ k * T\left(\frac{n}{k}\right) + \left(k + n * k \right)\end{cases}$</p>&#xA;&#xA;<p>what would be the result of the asymptotic analysis (the Landau class)? $k \in \mathbb{N}, k \neq 0 $ is a con...
algorithm analysis runtime analysis landau notation
1
Calculating the runtime for a recursive algorithm -- (algorithm analysis runtime analysis landau notation) <p>If the runtime of a recursive algorithm could be expressed as </p>&#xA;&#xA;<p>$T(n) = \begin{cases}O(1) &amp; n \leq c \\ k * T\left(\frac{n}{k}\right) + \left(k + n * k \right)\end{cases}$</p>&#xA;&#xA;<p>wha...
habedi/stack-exchange-dataset
32,558
Algorithm to find smallest difference in array
<p>We want an algorithm that, given an array of length $n$ of integers, find the minimum difference between two integers in the array.</p>&#xA;&#xA;<p>One such algorithm is to sort the array and check adjacent pairs of numbers. This takes time $O(n\log n)$.</p>&#xA;&#xA;<p>Is there a faster way, e.g., an $O(n)$ algorit...
algorithms arrays
1
Algorithm to find smallest difference in array -- (algorithms arrays) <p>We want an algorithm that, given an array of length $n$ of integers, find the minimum difference between two integers in the array.</p>&#xA;&#xA;<p>One such algorithm is to sort the array and check adjacent pairs of numbers. This takes time $O(n\l...
habedi/stack-exchange-dataset
32,563
Generating all factorials up to $n$: faster than naive approach?
<p>I'm aware of prime decomposition and parallel approaches to calculating one factorial; however, if I want the factorials of all numbers up to $n$, is there anything more efficient than the naive approach? As far as I can tell, at least the prime decomposition algorithms aren't any more useful here than the naive app...
complexity theory enumeration factorial
1
Generating all factorials up to $n$: faster than naive approach? -- (complexity theory enumeration factorial) <p>I'm aware of prime decomposition and parallel approaches to calculating one factorial; however, if I want the factorials of all numbers up to $n$, is there anything more efficient than the naive approach? As...
habedi/stack-exchange-dataset
32,565
Algorithm to maximize $j-i$ subject to $A[j]>A[i]$
<p>We want an algorithm that, given an array $A$ of length $n$ of integers (indexed by $A[0],A[1],\ldots,A[n-1]$, determine values $i&lt;j$ that maximizes $j-i $ subject to $A[j]&gt;A[i]$ (if such values $i,j$ exist.)</p>&#xA;&#xA;<p>One possibility is as follows: First check whether the array is non-increasing. If so,...
algorithms arrays
1
Algorithm to maximize $j-i$ subject to $A[j]>A[i]$ -- (algorithms arrays) <p>We want an algorithm that, given an array $A$ of length $n$ of integers (indexed by $A[0],A[1],\ldots,A[n-1]$, determine values $i&lt;j$ that maximizes $j-i $ subject to $A[j]&gt;A[i]$ (if such values $i,j$ exist.)</p>&#xA;&#xA;<p>One possibil...
habedi/stack-exchange-dataset
32,566
Average Case runtime for random choice search
<p>Assuming we have an array with $n$ Elements and want to find an unique element by randomly (uniformly) choosing. What would be the average case runtime?</p>&#xA;&#xA;<p><strong>My thoughts so far:</strong></p>&#xA;&#xA;<p>The chance to find the element is $\frac{1}{n}$ in every step. Thus, to find the element after ...
algorithms algorithm analysis runtime analysis randomized algorithms
1
Average Case runtime for random choice search -- (algorithms algorithm analysis runtime analysis randomized algorithms) <p>Assuming we have an array with $n$ Elements and want to find an unique element by randomly (uniformly) choosing. What would be the average case runtime?</p>&#xA;&#xA;<p><strong>My thoughts so far:<...
habedi/stack-exchange-dataset
32,594
Prove the upper bound on $T\left(n\right)=T\left(\log_{2}n\right)+O\left(\sqrt{n}\right)$
<p>I need some help with the following recursion:</p>&#xA;&#xA;<p>$T\left(n\right)=T\left(\log_{2}n\right)+O\left(\sqrt{n}\right)$</p>&#xA;&#xA;<p>More specifically I wish to find and prove the upper bound on it.</p>&#xA;&#xA;<p>I have a hunch it is $O\left(\sqrt{n}\right)$ but have gotten stuck proving it really is th...
asymptotics recurrence relation
1
Prove the upper bound on $T\left(n\right)=T\left(\log_{2}n\right)+O\left(\sqrt{n}\right)$ -- (asymptotics recurrence relation) <p>I need some help with the following recursion:</p>&#xA;&#xA;<p>$T\left(n\right)=T\left(\log_{2}n\right)+O\left(\sqrt{n}\right)$</p>&#xA;&#xA;<p>More specifically I wish to find and prove the...
habedi/stack-exchange-dataset
32,598
What is the lower bound for finding the third largest in a set of $n$ distinct elements?
<blockquote>&#xA; <p>What is the lower bound for finding the third largest in a set of $n$ distinct elements? </p>&#xA;</blockquote>&#xA;&#xA;<p>For the case of finding the second largest, we have the tight lower bound of $n + \lceil \lg n \rceil -2$. The adversary argument can be found <a href="http://www.cs...
complexity theory reference request time complexity lower bounds search problem
1
What is the lower bound for finding the third largest in a set of $n$ distinct elements? -- (complexity theory reference request time complexity lower bounds search problem) <blockquote>&#xA; <p>What is the lower bound for finding the third largest in a set of $n$ distinct elements? </p>&#xA;</blockquote>&#xA...
habedi/stack-exchange-dataset
32,599
difference between lzw and huffman coding technique
<p>What is the difference between the LZW and Huffman's coding of text compression ?</p>&#xA;&#xA;<p>I've read <a href="http://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch" rel="nofollow">this</a> and&#xA;<a href="http://en.wikipedia.org/wiki/Huffman_coding" rel="nofollow">this</a> , but I'm not able to disti...
data compression
1
difference between lzw and huffman coding technique -- (data compression) <p>What is the difference between the LZW and Huffman's coding of text compression ?</p>&#xA;&#xA;<p>I've read <a href="http://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Welch" rel="nofollow">this</a> and&#xA;<a href="http://en.wikipedia.or...
habedi/stack-exchange-dataset
32,618
Show that a regular language L contains only palindromes if and only if all words of length at most 3n are palindromes
<p>This is an extension of a <a href="https://cs.stackexchange.com/q/32583/98">previous question asked by a different user</a> earlier:</p>&#xA;<blockquote>&#xA;<p>Let <span class="math-container">$x, u, v, w, y, x', u', v', w', y'$</span> be words satisfying</p>&#xA;<ol>&#xA;<li><span class="math-container">$y'x' = xy...
formal languages regular languages
1
Show that a regular language L contains only palindromes if and only if all words of length at most 3n are palindromes -- (formal languages regular languages) <p>This is an extension of a <a href="https://cs.stackexchange.com/q/32583/98">previous question asked by a different user</a> earlier:</p>&#xA;<blockquote>&#xA;...
habedi/stack-exchange-dataset
32,627
If L is context-free, must FH(L) be context-free?
<blockquote>&#xA;<p>Define <span class="math-container">$FH(L) = \{x \in \Sigma^* : \exists y \in \Sigma^* \text{ with } |x| = |y| \text{ such that } xy \in L\}$</span>. In other words, <span class="math-container">$FH(L)$</span> is the set of first halves of even length strings in <span class="math-container">$L$</s...
formal languages context free closure properties
1
If L is context-free, must FH(L) be context-free? -- (formal languages context free closure properties) <blockquote>&#xA;<p>Define <span class="math-container">$FH(L) = \{x \in \Sigma^* : \exists y \in \Sigma^* \text{ with } |x| = |y| \text{ such that } xy \in L\}$</span>. In other words, <span class="math-container"...
habedi/stack-exchange-dataset
32,629
A Black Box Algorithm
<p>I'm taking an introductory quantum computations class and I am attempting to solve the following question(s), but we haven't touched on black box algorithms like this in class, and I honestly don't know how to solve the question at all. Would it be possible to help me through the steps?</p>&#xA;&#xA;<p><strong>Ques...
algorithms quantum computing
1
A Black Box Algorithm -- (algorithms quantum computing) <p>I'm taking an introductory quantum computations class and I am attempting to solve the following question(s), but we haven't touched on black box algorithms like this in class, and I honestly don't know how to solve the question at all. Would it be possible to...
habedi/stack-exchange-dataset
32,633
What is the complexity of finding the two prime numbers a composite number (used in RSA Protocol) is made of?
<p>I am aware that as the number increases in Digits the process of locating the two prime numbers that when multiplied produce the given number is increased as well. </p>&#xA;&#xA;<p>I also know that is it somewhat exponential or even more and with current machines it is rendered impossible to do in less than a year t...
time complexity cryptography integers factoring
1
What is the complexity of finding the two prime numbers a composite number (used in RSA Protocol) is made of? -- (time complexity cryptography integers factoring) <p>I am aware that as the number increases in Digits the process of locating the two prime numbers that when multiplied produce the given number is increased...
habedi/stack-exchange-dataset
32,635
Semantic information collections on the web. (Semantic Wikipedia)
<p>There are lots of technologies supporting semantic information markup even as wiki software.</p>&#xA;&#xA;<p>I am wondering if there is any kind of broad information collection project like Wikipedia which features semantic markup of those information.</p>&#xA;&#xA;<p>Google didn't bring up a project like this (only...
reference request semantics data sets knowledge representation ontologies
1
Semantic information collections on the web. (Semantic Wikipedia) -- (reference request semantics data sets knowledge representation ontologies) <p>There are lots of technologies supporting semantic information markup even as wiki software.</p>&#xA;&#xA;<p>I am wondering if there is any kind of broad information collec...
habedi/stack-exchange-dataset
32,637
Understanding a proof in the sweep line algorithm when finding all line segment intersections
<p>You have a set of line segments and you want to find all intersections.</p>&#xA;&#xA;<p><strong>First sweep line approach:</strong></p>&#xA;&#xA;<p>Use a priority queue <code>Q</code> for the events as they come, where each event is just an end point of a line segment.</p>&#xA;&#xA;<p>Use an unordered list <code>L<...
algorithms proof techniques correctness proof
1
Understanding a proof in the sweep line algorithm when finding all line segment intersections -- (algorithms proof techniques correctness proof) <p>You have a set of line segments and you want to find all intersections.</p>&#xA;&#xA;<p><strong>First sweep line approach:</strong></p>&#xA;&#xA;<p>Use a priority queue <c...
habedi/stack-exchange-dataset
32,643
Finding vertices of a maximum clique in polynomial time
<p>Say you were given a black box that solves a clique problem in constant time.</p>&#xA;&#xA;<p>You give the black box an undirected graph G with a bound k and it outputs either "Yes" or "No" that the graph G has a clique with at least k vertices.</p>&#xA;&#xA;<p>How would you use this black box to find the vertices o...
np complete clique
1
Finding vertices of a maximum clique in polynomial time -- (np complete clique) <p>Say you were given a black box that solves a clique problem in constant time.</p>&#xA;&#xA;<p>You give the black box an undirected graph G with a bound k and it outputs either "Yes" or "No" that the graph G has a clique with at least k v...
habedi/stack-exchange-dataset
32,651
Prove the existence of a proposition logical formula so that following conditions are fulfilled
<p>For two proposition logical formulas $\phi$ and $\chi$ so that $\phi\implies\chi$ is generally valid. How can I prove that there is a formular $\psi$ with $var(\psi )\subseteq var(\phi )\cap var(\chi )$ so that $\phi\implies\psi$ and $\psi\implies\chi$ are generally valid?</p>&#xA;
logic propositional logic
1
Prove the existence of a proposition logical formula so that following conditions are fulfilled -- (logic propositional logic) <p>For two proposition logical formulas $\phi$ and $\chi$ so that $\phi\implies\chi$ is generally valid. How can I prove that there is a formular $\psi$ with $var(\psi )\subseteq var(\phi )\cap...
habedi/stack-exchange-dataset
32,659
Is the maximum coverage variant of Vertex Cover also NP-hard?
<p>In Chapter 3 of "Approximation Algorithms for NP Hard Problems" edited by Prof. Dorit S. Hochbaum, there is such a sentence that "Maximum Coverage Problem is clearly NP-hard, as Set Cover is reducible to it" in p.135.</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a set system G and a parameter k, Maximum Coverage Problem...
complexity theory graphs reductions np hard
1
Is the maximum coverage variant of Vertex Cover also NP-hard? -- (complexity theory graphs reductions np hard) <p>In Chapter 3 of "Approximation Algorithms for NP Hard Problems" edited by Prof. Dorit S. Hochbaum, there is such a sentence that "Maximum Coverage Problem is clearly NP-hard, as Set Cover is reducible to it...
habedi/stack-exchange-dataset
32,668
Could two decidable languages ever not have a mapping reduction?
<p>Is it ever the case that two decidable languages $L_1$ and $L_2$ that cannot be reduced to one another (in either or both directions)? Intuitively, I would not expect there to be, but rigorously, are there extreme examples that prove otherwise? </p>&#xA;
computability reductions
1
Could two decidable languages ever not have a mapping reduction? -- (computability reductions) <p>Is it ever the case that two decidable languages $L_1$ and $L_2$ that cannot be reduced to one another (in either or both directions)? Intuitively, I would not expect there to be, but rigorously, are there extreme examples...
habedi/stack-exchange-dataset
32,678
Is the Weighted Maximum Coverage Problem with frequency weights NP-hard?
<p>I want to prove the following case of Weighted Maximum Coverage problem with special weights is NP-hard. But I have no idea. So I am here seeking for help.</p>&#xA;&#xA;<p>The Weighted Maximum Coverage problem is formulated as follows (known to be NP-hard): </p>&#xA;&#xA;<p>Given a set <em>I</em> of <em>m</em> eleme...
complexity theory np hard
1
Is the Weighted Maximum Coverage Problem with frequency weights NP-hard? -- (complexity theory np hard) <p>I want to prove the following case of Weighted Maximum Coverage problem with special weights is NP-hard. But I have no idea. So I am here seeking for help.</p>&#xA;&#xA;<p>The Weighted Maximum Coverage problem is ...
habedi/stack-exchange-dataset
32,679
Is the Source Coding Theorem straightforward for uniformly distributed random variables?
<p>Shannon's source coding theorem states the following:</p>&#xA;&#xA;<blockquote>&#xA; <p>$n$ i.i.d. random variables $X_1,\dots,X_n$ each with entropy H(x) can be compressed into more than n⋅H(x) bits with negligible risk of information loss, as n→∞; conversely if they are compressed into fewer than n⋅H(x) bits it i...
probability theory information theory coding theory
1
Is the Source Coding Theorem straightforward for uniformly distributed random variables? -- (probability theory information theory coding theory) <p>Shannon's source coding theorem states the following:</p>&#xA;&#xA;<blockquote>&#xA; <p>$n$ i.i.d. random variables $X_1,\dots,X_n$ each with entropy H(x) can be compress...
habedi/stack-exchange-dataset
32,688
Which permutations can not be obtained by moving elements through two stacks?
<p>I have a Stack1 which has the entries a,b,c ( with a on the Top) and Stack2 which is empty.The condition is.</p>&#xA;&#xA;<blockquote>&#xA; <p>An entry pooped out of the stack1 can be printed immediatly or pushed to stack2. An Entry popped out of the stack2 can only be printed. </p>&#xA;</blockquote>&#xA;&#xA;<p>...
data structures combinatorics stacks
1
Which permutations can not be obtained by moving elements through two stacks? -- (data structures combinatorics stacks) <p>I have a Stack1 which has the entries a,b,c ( with a on the Top) and Stack2 which is empty.The condition is.</p>&#xA;&#xA;<blockquote>&#xA; <p>An entry pooped out of the stack1 can be printed im...
habedi/stack-exchange-dataset
32,703
Is Bin-Packing with only 2 types of objects polynomial?
<p><strong>Is the following problem polynomial ? Or NP-Complete ?</strong></p>&#xA;&#xA;<p><strong>Problem:</strong> Bin packing with 2 types of objects.</p>&#xA;&#xA;<p><strong>Input:</strong> $C$, the capacity of each bin, $N_a, N_b$ the numbers of objects $a$ and $b$, $w_a,w_b$ the weight of the objects, $k$, the ma...
complexity theory np complete
1
Is Bin-Packing with only 2 types of objects polynomial? -- (complexity theory np complete) <p><strong>Is the following problem polynomial ? Or NP-Complete ?</strong></p>&#xA;&#xA;<p><strong>Problem:</strong> Bin packing with 2 types of objects.</p>&#xA;&#xA;<p><strong>Input:</strong> $C$, the capacity of each bin, $N_a...
habedi/stack-exchange-dataset
32,713
Black box with O(n) calls
<p>Let's say a procedure called 'decision(x,q)' is available as a 'black box' &#xA;X is the input set and Q is a real number Q.</p>&#xA;&#xA;<p>I need to design an algorithm that reports "yes" if there exists a subset of X whose total sum is = Q&#xA;otherwise, it reports "no". </p>&#xA;&#xA;<p>Running time is not an is...
algorithms dynamic programming
1
Black box with O(n) calls -- (algorithms dynamic programming) <p>Let's say a procedure called 'decision(x,q)' is available as a 'black box' &#xA;X is the input set and Q is a real number Q.</p>&#xA;&#xA;<p>I need to design an algorithm that reports "yes" if there exists a subset of X whose total sum is = Q&#xA;otherwis...
habedi/stack-exchange-dataset
32,723
Unlimited Knapsack Problem
<p>How would I solve the unbounded knapsack problem, only this time aiming to maximize the weight instead of the value?</p>&#xA;
knapsack problems
1
Unlimited Knapsack Problem -- (knapsack problems) <p>How would I solve the unbounded knapsack problem, only this time aiming to maximize the weight instead of the value?</p>&#xA;
habedi/stack-exchange-dataset
32,726
Prove Σ* is decidable
<p>I see that Σ* is claimed to be decidable in many documents, but I have never seen an example or easy demostration that it is decidable.</p>&#xA;&#xA;<p>What is the proof that Σ* is decidable?</p>&#xA;
computability
1
Prove Σ* is decidable -- (computability) <p>I see that Σ* is claimed to be decidable in many documents, but I have never seen an example or easy demostration that it is decidable.</p>&#xA;&#xA;<p>What is the proof that Σ* is decidable?</p>&#xA;
habedi/stack-exchange-dataset
32,727
Simulate a regular Turing Machine with one that cannot write blanks
<p>Consider a Turing machine that cannot write blanks. How does one show that such a machine can simulate a standard Turing machine? </p>&#xA;
turing machines computation models simulation
1
Simulate a regular Turing Machine with one that cannot write blanks -- (turing machines computation models simulation) <p>Consider a Turing machine that cannot write blanks. How does one show that such a machine can simulate a standard Turing machine? </p>&#xA;
habedi/stack-exchange-dataset
32,728
Are the complements of $NP$-languages with only $n$ words of length $n$ also in $NP$?
<p>Assuming $\Sigma = \{ 0, 1\}$..</p>&#xA;&#xA;<p>Given a language $L$, such that for each $n\in \mathbb{N}$ we have $n$ words of length $n$ in $L$ and assuming $L\in NP$, can we prove also that $L\in Co-NP$?</p>&#xA;&#xA;<p>So it is the same as showing that $\overline{L}\in NP$, but I'm not really sure on how to pr...
complexity theory closure properties np
1
Are the complements of $NP$-languages with only $n$ words of length $n$ also in $NP$? -- (complexity theory closure properties np) <p>Assuming $\Sigma = \{ 0, 1\}$..</p>&#xA;&#xA;<p>Given a language $L$, such that for each $n\in \mathbb{N}$ we have $n$ words of length $n$ in $L$ and assuming $L\in NP$, can we prove a...
habedi/stack-exchange-dataset
32,730
Designing a prefix code for integers?
<p>trying to figure out how to approach this problem.</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose a sender in a network wanted to communicate the length n of the block it will be using in a subsequent transmission. If there were not limits on the value of n, there would be a problem to simply send the number in binary, ...
algorithms data compression encoding scheme
1
Designing a prefix code for integers? -- (algorithms data compression encoding scheme) <p>trying to figure out how to approach this problem.</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose a sender in a network wanted to communicate the length n of the block it will be using in a subsequent transmission. If there were not l...
habedi/stack-exchange-dataset
32,736
Shouldn't complexity theory consider the time taken for different operations?
<p>I have read the answer found <a href="https://cs.stackexchange.com/questions/1643/how-can-we-assume-that-basic-operations-on-numbers-take-constant-time">here</a> which considers the size of integers when doing comparisons and how that affects on the basic cost of comparison.</p>&#xA;&#xA;<p>I am trying to understand...
complexity theory time complexity
1
Shouldn't complexity theory consider the time taken for different operations? -- (complexity theory time complexity) <p>I have read the answer found <a href="https://cs.stackexchange.com/questions/1643/how-can-we-assume-that-basic-operations-on-numbers-take-constant-time">here</a> which considers the size of integers w...
habedi/stack-exchange-dataset
32,749
Recursive descent parser with backtracking for the grammar $S \rightarrow aSa\ |\ aa$
<p>Can someone enlighten me why a recursive descent parser with backtracking that tries the productions $S \rightarrow aSa$ and $S \rightarrow aa$ (in that order) does not recognize the language formed by the grammar $S \rightarrow aSa\ |\ aa$.</p>&#xA;&#xA;<p>It appears to only parse words from the language $\{a^{2^n}...
context free formal grammars compilers parsers
1
Recursive descent parser with backtracking for the grammar $S \rightarrow aSa\ |\ aa$ -- (context free formal grammars compilers parsers) <p>Can someone enlighten me why a recursive descent parser with backtracking that tries the productions $S \rightarrow aSa$ and $S \rightarrow aa$ (in that order) does not recognize ...
habedi/stack-exchange-dataset
32,766
Is the identity function a many-one reduction from a language to super-set?
<p>I need help with a question.</p>&#xA;&#xA;<p>Prove or disprove the following claim:</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $f\colon \Sigma^* \to \Sigma^*$ be the identity function, i.e., $f(w) = w$ for all $w \in \Sigma^*$. Let $L_1$ and $L_2$ be two languages such that $L_1 \subseteq L_2$. Then $f$ is a many-to-one...
computability reductions
1
Is the identity function a many-one reduction from a language to super-set? -- (computability reductions) <p>I need help with a question.</p>&#xA;&#xA;<p>Prove or disprove the following claim:</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $f\colon \Sigma^* \to \Sigma^*$ be the identity function, i.e., $f(w) = w$ for all $w \i...
habedi/stack-exchange-dataset
32,773
Proving equivelance of a multijump turing machine and a turing machine
<p>I'm having trouble getting started on this proof, and I was hoping you guys could give me a couple hints/point me in the direction of where to start? Here's the problem:</p>&#xA;&#xA;<p>Consider a multijump Turing machine, which is like an ordinary Turing machine except the transition function is&#xA;δ : Q × Γ → Q ×...
turing machines computation models simulation
1
Proving equivelance of a multijump turing machine and a turing machine -- (turing machines computation models simulation) <p>I'm having trouble getting started on this proof, and I was hoping you guys could give me a couple hints/point me in the direction of where to start? Here's the problem:</p>&#xA;&#xA;<p>Consider ...
habedi/stack-exchange-dataset
32,781
Why does lower integer represent higher priority in scheduling literature?
<p>I'm studying Real Time Systems, and in the textbook most of the focus is on scheduling algorithms. (Textbook: Real-Time Systems by Jane W. S. Liu)</p>&#xA;&#xA;<p>In the algorithms that involve priorities, it is said that smaller integer represents higher priority (e.g. a process with priority 1 has more priority th...
algorithms scheduling
1
Why does lower integer represent higher priority in scheduling literature? -- (algorithms scheduling) <p>I'm studying Real Time Systems, and in the textbook most of the focus is on scheduling algorithms. (Textbook: Real-Time Systems by Jane W. S. Liu)</p>&#xA;&#xA;<p>In the algorithms that involve priorities, it is sai...
habedi/stack-exchange-dataset
32,800
Product with floating point
<p>I was studying the product with floating point and I saw this example. I made the translation, sorry if something is not grammatically correct.</p>&#xA;&#xA;<p>![enter image description here][1]</p>&#xA;
floating point
1
Product with floating point -- (floating point) <p>I was studying the product with floating point and I saw this example. I made the translation, sorry if something is not grammatically correct.</p>&#xA;&#xA;<p>![enter image description here][1]</p>&#xA;
habedi/stack-exchange-dataset
32,804
What's the big deal with the knapsack problem?
<p>In my CS course, we are covering things from one topic to another in sort of a sensible manner. For example, binary search tree -> 234-tree -> red-black tree -> heap -> greedy algorithms -> dynamic programming.</p>&#xA;&#xA;<p>And all the sudden, bam, there is this whole chapter on the knapsack problem. How is this ...
complexity theory education knapsack problems didactics
1
What's the big deal with the knapsack problem? -- (complexity theory education knapsack problems didactics) <p>In my CS course, we are covering things from one topic to another in sort of a sensible manner. For example, binary search tree -> 234-tree -> red-black tree -> heap -> greedy algorithms -> dynamic programming...
habedi/stack-exchange-dataset
32,808
Which algorithms have runtime recurrences like $T(n) = \sqrt{n}\,T(\sqrt{n}) + O(n)$?
<p>The algorithms using the <a href="https://en.wikipedia.org/wiki/Divide_and_conquer_algorithms" rel="nofollow">"divide and conquer" (wiki)</a> design strategy often have the time complexity of the form $T(n) = aT(n/b) + f(n)$, where $n$ is the problem size. Classic examples are binary search ($T(n) = T(n/2) + O(1)$) ...
algorithms algorithm analysis reference request runtime analysis recurrence relation
1
Which algorithms have runtime recurrences like $T(n) = \sqrt{n}\,T(\sqrt{n}) + O(n)$? -- (algorithms algorithm analysis reference request runtime analysis recurrence relation) <p>The algorithms using the <a href="https://en.wikipedia.org/wiki/Divide_and_conquer_algorithms" rel="nofollow">"divide and conquer" (wiki)</a>...
habedi/stack-exchange-dataset
32,814
When using the Pumping lemma, how do I deal with different cases of y?
<p>I want to prove L is not regular:$$L={\{www|w \in \Sigma^*\}}$$ $$\Sigma=\{a,b\}$$</p>&#xA;&#xA;<p>I am sure I can do so using pumping lemma. I used $$ab^pab^pab^p$$as my chosen string but I am stuck. I do not know how to handle different cases of y in pumping lemma.</p>&#xA;
formal languages regular languages pumping lemma
1
When using the Pumping lemma, how do I deal with different cases of y? -- (formal languages regular languages pumping lemma) <p>I want to prove L is not regular:$$L={\{www|w \in \Sigma^*\}}$$ $$\Sigma=\{a,b\}$$</p>&#xA;&#xA;<p>I am sure I can do so using pumping lemma. I used $$ab^pab^pab^p$$as my chosen string but I ...
habedi/stack-exchange-dataset
32,818
Aggregate Rate and Poisson Process in Aloha
<p>I'm having a hard time understanding what is mean't by the aggregrate rate $\lambda$ and what it means for throughput in unslotted and slotted Aloha protocols. The more I seem to read about poission process the more confused I get.</p>&#xA;&#xA;<p>I understand that the probability a packet is transmitted in a time i...
computer networks communication protocols
1
Aggregate Rate and Poisson Process in Aloha -- (computer networks communication protocols) <p>I'm having a hard time understanding what is mean't by the aggregrate rate $\lambda$ and what it means for throughput in unslotted and slotted Aloha protocols. The more I seem to read about poission process the more confused I...
habedi/stack-exchange-dataset
32,826
Characterizing cycles in a directed graph with optional edges
<p>Consider a directed graph in which some edges are marked as "optional". A graph with $N$ optional edges induces a family of $2^N$ graphs depending on which edges are removed. In some cases, some of these graphs may be acyclic while others contain cycles.</p>&#xA;&#xA;<p>For example, consider the graph with vertices ...
graphs
1
Characterizing cycles in a directed graph with optional edges -- (graphs) <p>Consider a directed graph in which some edges are marked as "optional". A graph with $N$ optional edges induces a family of $2^N$ graphs depending on which edges are removed. In some cases, some of these graphs may be acyclic while others cont...
habedi/stack-exchange-dataset
32,828
Bakery algorithm: what is the choosing[] boolean array for?
<p>I'm studying the <a href="http://en.wikipedia.org/wiki/Lamport&#39;s_bakery_algorithm" rel="nofollow">bakery algorithm</a>.</p>&#xA;&#xA;<pre><code>do { &#xA; choosing[i] = true; &#xA; number[i] = max(number[0], number[1], …, number [n – 1])+1; &#xA; choosing[i] = false; &#xA; for (j = 0; j &lt; n; j...
algorithms concurrency synchronization
1
Bakery algorithm: what is the choosing[] boolean array for? -- (algorithms concurrency synchronization) <p>I'm studying the <a href="http://en.wikipedia.org/wiki/Lamport&#39;s_bakery_algorithm" rel="nofollow">bakery algorithm</a>.</p>&#xA;&#xA;<pre><code>do { &#xA; choosing[i] = true; &#xA; number[i] = max(numb...
habedi/stack-exchange-dataset
32,831
Shannon-Fano puzzle
<p>I was playing around with Shannon-Fano (SF) entropy encoding when I ran into this issue. </p>&#xA;&#xA;<p>I am aware that the compression that can be achieved with SF is sometimes inferior to that of Huffman encoding, but I just though it meant that code lengths were sometimes sub-optimal in the sense that an encodi...
data compression
1
Shannon-Fano puzzle -- (data compression) <p>I was playing around with Shannon-Fano (SF) entropy encoding when I ran into this issue. </p>&#xA;&#xA;<p>I am aware that the compression that can be achieved with SF is sometimes inferior to that of Huffman encoding, but I just though it meant that code lengths were sometim...
habedi/stack-exchange-dataset
32,837
Proof that a node N balanced binary search tree has $2^i - 1$ children where $i$ is the position of the first 1-bit in N, starting from 0
<p>I was binary indexed trees and I came across this <a href="http://codinghighway.com/?p=1312" rel="nofollow">article</a>. One part of the justification was the following:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given that the (binary search tree) tree is perfectly balanced, a node N will have exactly&#xA; $2^{i}-1$ child...
proof techniques binary trees search trees
1
Proof that a node N balanced binary search tree has $2^i - 1$ children where $i$ is the position of the first 1-bit in N, starting from 0 -- (proof techniques binary trees search trees) <p>I was binary indexed trees and I came across this <a href="http://codinghighway.com/?p=1312" rel="nofollow">article</a>. One part o...
habedi/stack-exchange-dataset
32,839
Solving a Variation of knapsack
<p>I'm working on a problem which to me, seems very similar to a knapsack problem:</p>&#xA;<blockquote>&#xA;<p>A furniture store is having sale: Purchase two items at the price of the more expensive one. David went to the store and bought <span class="math-container">$2k$</span> items: <span class="math-container">$f_1...
algorithms complexity theory knapsack problems
1
Solving a Variation of knapsack -- (algorithms complexity theory knapsack problems) <p>I'm working on a problem which to me, seems very similar to a knapsack problem:</p>&#xA;<blockquote>&#xA;<p>A furniture store is having sale: Purchase two items at the price of the more expensive one. David went to the store and boug...
habedi/stack-exchange-dataset
32,845
Why, really, is the Halting Problem so important?
<p>I don't understand why the <a href="https://en.wikipedia.org/wiki/Halting_problem" rel="nofollow noreferrer">Halting Problem</a> is so often used to dismiss the possibility of determining whether a program halts. The <a href="https://en.wikipedia.org/wiki/Halting_problem" rel="nofollow noreferrer">Wikipedia article<...
computability halting problem
1
Why, really, is the Halting Problem so important? -- (computability halting problem) <p>I don't understand why the <a href="https://en.wikipedia.org/wiki/Halting_problem" rel="nofollow noreferrer">Halting Problem</a> is so often used to dismiss the possibility of determining whether a program halts. The <a href="https:...
habedi/stack-exchange-dataset
32,861
How do deal with the following situations using Prim's algorithm?
<p>Consider the following Graph</p>&#xA;&#xA;<p>We want to generate the MST using Prim's algorithm. </p>&#xA;&#xA;<p>Starting from node A, suppose we pick B as our next node, we see a self-loop that has less weight than the two other alternatives.</p>&#xA;&#xA;<ol>&#xA;<li>Do we ever take the self loop? Why not?</li>&#...
graphs minimum spanning tree spanning trees
1
How do deal with the following situations using Prim's algorithm? -- (graphs minimum spanning tree spanning trees) <p>Consider the following Graph</p>&#xA;&#xA;<p>We want to generate the MST using Prim's algorithm. </p>&#xA;&#xA;<p>Starting from node A, suppose we pick B as our next node, we see a self-loop that has le...
habedi/stack-exchange-dataset
32,863
Given $T(n) = \sum_{i = 0}^{\log n} i 2^i$, what is $O(T(n))$?
<p>I'm trying to perform an asymptotic analysis on a function:</p>&#xA;&#xA;<p>$T(n) = \sum_{i = 0}^{\log n} i 2^i$</p>&#xA;&#xA;<p>The above expression came about when I began with:</p>&#xA;&#xA;<p>$T(n) = \sum_{i = 0}^{\log n} 2^i \log (2^i)$</p>&#xA;&#xA;<p>Is there a tight, closed-form expression for $O(T(n))$?</p>...
asymptotics
1
Given $T(n) = \sum_{i = 0}^{\log n} i 2^i$, what is $O(T(n))$? -- (asymptotics) <p>I'm trying to perform an asymptotic analysis on a function:</p>&#xA;&#xA;<p>$T(n) = \sum_{i = 0}^{\log n} i 2^i$</p>&#xA;&#xA;<p>The above expression came about when I began with:</p>&#xA;&#xA;<p>$T(n) = \sum_{i = 0}^{\log n} 2^i \log (2...
habedi/stack-exchange-dataset
32,866
Inferring Shannon Capacity of pentagon
<p>Can we infer from the fact that the number of independent sets in product of $5$-cycle two times is $5$ and in product of $5$-cycle four times is $25$, that the capacity of pentagon is $\sqrt{5}$? That is does $\alpha(C_5 \boxtimes C_5)=5$ and $\alpha(C_5 \boxtimes C_5\boxtimes C_5 \boxtimes C_5)=25$ imply $\theta(C...
information theory
1
Inferring Shannon Capacity of pentagon -- (information theory) <p>Can we infer from the fact that the number of independent sets in product of $5$-cycle two times is $5$ and in product of $5$-cycle four times is $25$, that the capacity of pentagon is $\sqrt{5}$? That is does $\alpha(C_5 \boxtimes C_5)=5$ and $\alpha(C_...
habedi/stack-exchange-dataset
32,867
How can I make sense of amortized accounting method?
<p>Amortized accounting method has to be one of the most abstract analysis technique I have ever seen in my life (maybe aside from the potential method which I haven't read).</p>&#xA;&#xA;<p>In the example of the Stack with Multiple Pops (From CLRS, for reference: <a href="http://chuck.ferzle.com/Notes/Notes/AlgorithmA...
algorithm analysis proof techniques amortized analysis
1
How can I make sense of amortized accounting method? -- (algorithm analysis proof techniques amortized analysis) <p>Amortized accounting method has to be one of the most abstract analysis technique I have ever seen in my life (maybe aside from the potential method which I haven't read).</p>&#xA;&#xA;<p>In the example o...
habedi/stack-exchange-dataset
32,875
How do I use induction to show that the language of a grammar is contained in a given set?
<p>Given that I have the grammar</p>&#xA;&#xA;<p>$\qquad\displaystyle G_1 = (\{a, b, c, d\}, \{S, X, Y \}, S, \{S → XY, X → aXb, X → ab, Y → cYd, Y → cd\})$,</p>&#xA;&#xA;<p>how am I supposed to prove that</p>&#xA;&#xA;<p>$\qquad\displaystyle S(G1) ⊆ \{a^{n+1} b^{n+1} c^{m+1} d^{m+1} \mid n, m ≥ 0\}$</p>&#xA;&#xA;<p>by...
formal grammars proof techniques induction
1
How do I use induction to show that the language of a grammar is contained in a given set? -- (formal grammars proof techniques induction) <p>Given that I have the grammar</p>&#xA;&#xA;<p>$\qquad\displaystyle G_1 = (\{a, b, c, d\}, \{S, X, Y \}, S, \{S → XY, X → aXb, X → ab, Y → cYd, Y → cd\})$,</p>&#xA;&#xA;<p>how am ...
habedi/stack-exchange-dataset
32,876
Minimizing total distance to a point from a set of points
<p>I've read about a problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>There are $n$ houses that are placed randomly. Place a parking lot so that the (straight-line) distance to all houses is minimal.</p>&#xA;</blockquote>&#xA;&#xA;<p>I've written a Monte-Carlo algorithm, but that can't be the optimal approach.</p>&#xA;&#xA;...
computational geometry shortest path monte carlo
1
Minimizing total distance to a point from a set of points -- (computational geometry shortest path monte carlo) <p>I've read about a problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>There are $n$ houses that are placed randomly. Place a parking lot so that the (straight-line) distance to all houses is minimal.</p>&#xA;</blo...
habedi/stack-exchange-dataset
32,882
Complexity of variation of partition problem
<p>I want to know whats the complexity of the following variant of the partition problem:</p>&#xA;&#xA;<p>Partition problem:</p>&#xA;&#xA;<p><a href="http://en.wikipedia.org/wiki/Partition_problem" rel="nofollow">http://en.wikipedia.org/wiki/Partition_problem</a></p>&#xA;&#xA;<p>Suppose we have one set formed by intege...
complexity theory np partitions
1
Complexity of variation of partition problem -- (complexity theory np partitions) <p>I want to know whats the complexity of the following variant of the partition problem:</p>&#xA;&#xA;<p>Partition problem:</p>&#xA;&#xA;<p><a href="http://en.wikipedia.org/wiki/Partition_problem" rel="nofollow">http://en.wikipedia.org/w...
habedi/stack-exchange-dataset
32,883
Loop invariant: decreasing a variable and swapping it
<p>As an example exercise, we were asked to find the loop invariant for this bit of code. </p>&#xA;&#xA;<pre><code>def mystery(a,b):&#xA; # Precondition: a &gt;= 0 and b &gt;= 0&#xA; while a &gt;= 0 and b &gt;= 0:&#xA; if a &lt; b:&#xA; a, b = b, a&#xA; else:&#xA; a = a - 1&#x...
algorithm analysis loops loop invariants imperative programming
1
Loop invariant: decreasing a variable and swapping it -- (algorithm analysis loops loop invariants imperative programming) <p>As an example exercise, we were asked to find the loop invariant for this bit of code. </p>&#xA;&#xA;<pre><code>def mystery(a,b):&#xA; # Precondition: a &gt;= 0 and b &gt;= 0&#xA; while a...
habedi/stack-exchange-dataset
32,892
How was counted one second in computers
<p>I would like to know how was counted 1 second in computers. I mean how machine can understand period of 1 second. Who and when resolved this problem, and more important how ?</p>&#xA;
computer architecture clocks
1
How was counted one second in computers -- (computer architecture clocks) <p>I would like to know how was counted 1 second in computers. I mean how machine can understand period of 1 second. Who and when resolved this problem, and more important how ?</p>&#xA;
habedi/stack-exchange-dataset
32,897
What to expect in a Computer Science and Mathematics course?
<p>I'm a high school student. I'm really into programming and mathematics and planning to study CS and mathematics when finished with high school.</p>&#xA;&#xA;<p>I have a couple of questions concerning this issue:</p>&#xA;&#xA;<p>Firstly, from maths point of view, what are the prerequisites and what subjects do I get ...
education books
1
What to expect in a Computer Science and Mathematics course? -- (education books) <p>I'm a high school student. I'm really into programming and mathematics and planning to study CS and mathematics when finished with high school.</p>&#xA;&#xA;<p>I have a couple of questions concerning this issue:</p>&#xA;&#xA;<p>Firstly...
habedi/stack-exchange-dataset
32,904
Is complexity of $GI_{di}$ same as $GI_{un}$?
<p>Does the graph isomorphism problem for directed graphs($GI_{di}$) reduce to the graph isomorphism problem for directed graphs($GI_{un}$)?</p>&#xA;&#xA;<p>It is clear $$GI_{un}\leq GI_{di}$$ since the set of undirected graphs is subset of set of directed graphs. Does the converse hold true? That is, can an algorithm ...
complexity theory reductions graph isomorphism
1
Is complexity of $GI_{di}$ same as $GI_{un}$? -- (complexity theory reductions graph isomorphism) <p>Does the graph isomorphism problem for directed graphs($GI_{di}$) reduce to the graph isomorphism problem for directed graphs($GI_{un}$)?</p>&#xA;&#xA;<p>It is clear $$GI_{un}\leq GI_{di}$$ since the set of undirected g...
habedi/stack-exchange-dataset
32,906
Binary Indexed Trees: Why does i & -i work?
<p>I already read <a href="https://cs.stackexchange.com/questions/10538/bit-what-is-the-intuition-behind-a-binary-indexed-tree-and-how-was-it-thought-a">this</a> related question on the intuition behind binary indexed trees, and while the answer explains how the tree structure works, it does not really explain how this...
data structures binary trees correctness proof arithmetic
1
Binary Indexed Trees: Why does i & -i work? -- (data structures binary trees correctness proof arithmetic) <p>I already read <a href="https://cs.stackexchange.com/questions/10538/bit-what-is-the-intuition-behind-a-binary-indexed-tree-and-how-was-it-thought-a">this</a> related question on the intuition behind binary ind...
habedi/stack-exchange-dataset
32,912
Dynamic programming to find the least possible balance of a full binary tree
<p>I am given $n$ positive integers $x_1,x_2,\cdots,x_n$ as input. These are the weights of the leaves in a full binary tree, $x_1$ being the leftmost leaf and $x_n$ the rightmost leaf. The weight of an internal node $v$ is defined as the sum of weights of the leaves in the subtree rooted at $v$. The balance of an inte...
algorithms dynamic programming binary trees
1
Dynamic programming to find the least possible balance of a full binary tree -- (algorithms dynamic programming binary trees) <p>I am given $n$ positive integers $x_1,x_2,\cdots,x_n$ as input. These are the weights of the leaves in a full binary tree, $x_1$ being the leftmost leaf and $x_n$ the rightmost leaf. The weig...
habedi/stack-exchange-dataset
32,929
Efficient simulation of an NFA, while preserving the paths to the accept states
<p>The standard way of simulating an NFA on a computer (for implementing regex engines etc) is to construct a DFA that accepts the same language. Otherwise you get problems like exponential blowup.</p>&#xA;&#xA;<p>However, for my purpose I need to know which paths the NFA went through for accepted words. This is obviou...
automata finite automata simulation
1
Efficient simulation of an NFA, while preserving the paths to the accept states -- (automata finite automata simulation) <p>The standard way of simulating an NFA on a computer (for implementing regex engines etc) is to construct a DFA that accepts the same language. Otherwise you get problems like exponential blowup.</...
habedi/stack-exchange-dataset
32,939
Balancing a Binary Search Tree
<p>I was reading about binary search trees on it's Wikipedia <a href="http://en.wikipedia.org/wiki/Binary_search_tree" rel="nofollow">article</a>. I was a little confused by this <a href="http://en.wikipedia.org/wiki/File:Binary_search_tree.svg" rel="nofollow">image</a>. Why is it that the right branch to the head node...
data structures search trees balanced search trees
1
Balancing a Binary Search Tree -- (data structures search trees balanced search trees) <p>I was reading about binary search trees on it's Wikipedia <a href="http://en.wikipedia.org/wiki/Binary_search_tree" rel="nofollow">article</a>. I was a little confused by this <a href="http://en.wikipedia.org/wiki/File:Binary_sear...
habedi/stack-exchange-dataset
32,941
Composition for Functional Depedencies
<p>Suppose I have the following Functional Dependencies for a Relational Model:</p>&#xA;<blockquote>&#xA;<p><span class="math-container">$A \to C$</span></p>&#xA;<p><span class="math-container">$B \to C$</span></p>&#xA;</blockquote>&#xA;<p>According to the composition rule for functional dependencies we have:</p>&#xA;<...
database theory
1
Composition for Functional Depedencies -- (database theory) <p>Suppose I have the following Functional Dependencies for a Relational Model:</p>&#xA;<blockquote>&#xA;<p><span class="math-container">$A \to C$</span></p>&#xA;<p><span class="math-container">$B \to C$</span></p>&#xA;</blockquote>&#xA;<p>According to the com...
habedi/stack-exchange-dataset
32,944
Does a coin tossing algorithm terminate?
<p>Suppose we have an algorithm like:</p>&#xA;&#xA;<pre><code>n = 0&#xA;REPEAT&#xA; c = randomInt(0,1)&#xA; n = n + 1&#xA;UNTIL (c == 0)&#xA;RETURN n&#xA;</code></pre>&#xA;&#xA;<p>(Assumuing the random number generator produces "good" random numbers in the mathematical sense.)</p>&#xA;&#xA;<p>I understand that there ...
algorithms randomized algorithms
1
Does a coin tossing algorithm terminate? -- (algorithms randomized algorithms) <p>Suppose we have an algorithm like:</p>&#xA;&#xA;<pre><code>n = 0&#xA;REPEAT&#xA; c = randomInt(0,1)&#xA; n = n + 1&#xA;UNTIL (c == 0)&#xA;RETURN n&#xA;</code></pre>&#xA;&#xA;<p>(Assumuing the random number generator produces "good" rand...
habedi/stack-exchange-dataset
32,950
If P = NP, then is NP = FNP?
<p>I read</p>&#xA;&#xA;<blockquote>&#xA; <p>FP = FNP iff P = NP</p>&#xA;</blockquote>&#xA;&#xA;<p>which makes sense.</p>&#xA;&#xA;<p>But if P = NP, does it mean FNP = NP?</p>&#xA;&#xA;<p>Intuitively, I think no because P = NP would mean that decision problems in NP would become decision problems in P. But I don't see ...
complexity theory complexity classes np
1
If P = NP, then is NP = FNP? -- (complexity theory complexity classes np) <p>I read</p>&#xA;&#xA;<blockquote>&#xA; <p>FP = FNP iff P = NP</p>&#xA;</blockquote>&#xA;&#xA;<p>which makes sense.</p>&#xA;&#xA;<p>But if P = NP, does it mean FNP = NP?</p>&#xA;&#xA;<p>Intuitively, I think no because P = NP would mean that dec...
habedi/stack-exchange-dataset
32,952
If all infinite r.e. languages have an infinite recursive subset, then do co-r.e. languages not have such subsets?
<p>If all infinite r.e. languages have an infinite recursive subset, then can we logically take co-r.e. languages to not have such subsets by complemence?</p>&#xA;
computability
1
If all infinite r.e. languages have an infinite recursive subset, then do co-r.e. languages not have such subsets? -- (computability) <p>If all infinite r.e. languages have an infinite recursive subset, then can we logically take co-r.e. languages to not have such subsets by complemence?</p>&#xA;
habedi/stack-exchange-dataset
32,957
Where does the terminology of open addressing resp. closed hashing come from?
<p>One of the basic methods of hashing is called "Open addressing, or closed hashing" according to <a href="http://en.wikipedia.org/wiki/Open_addressing" rel="nofollow">wikipadia</a> (and several books).</p>&#xA;&#xA;<p>Why the names "open" and "closed", and why these seemingly contradictory names for the same method?<...
terminology data structures reference request hash tables
1
Where does the terminology of open addressing resp. closed hashing come from? -- (terminology data structures reference request hash tables) <p>One of the basic methods of hashing is called "Open addressing, or closed hashing" according to <a href="http://en.wikipedia.org/wiki/Open_addressing" rel="nofollow">wikipadia<...
habedi/stack-exchange-dataset
32,990
Type checking relation to logic
<p>I am learning <strong>logic and functional programming</strong> and there is a topic called <strong>Type checking and their relationship to logic</strong> , I am unable to find any source that can help me in understanding this topic. Please help .</p>&#xA;
logic type checking
1
Type checking relation to logic -- (logic type checking) <p>I am learning <strong>logic and functional programming</strong> and there is a topic called <strong>Type checking and their relationship to logic</strong> , I am unable to find any source that can help me in understanding this topic. Please help .</p>&#xA;
habedi/stack-exchange-dataset
32,998
Is the infinite union of computable sets computable?
<p>My intuition is telling me that this is untrue. But I am having trouble formulating a proof for this. Can anyone point me in the right direction? I've seen a proof by contradiction involving the union of all singletons in an infinite language but I am needing a to look at this from a different angle. </p>&#xA;&#xA;<...
computability
1
Is the infinite union of computable sets computable? -- (computability) <p>My intuition is telling me that this is untrue. But I am having trouble formulating a proof for this. Can anyone point me in the right direction? I've seen a proof by contradiction involving the union of all singletons in an infinite language bu...
habedi/stack-exchange-dataset
33,002
Applying Brewer's theorem (CAP) to a single node
<p>I'm going through Brewer's theorem and its proof by Nancy Lynch and Seth Gilbert. But the paper left me with one question. What prevents the theorem from being applicable to a single node?</p>&#xA;&#xA;<p>I haven’t encountered any explicit definition of network partition that restricts its applicability to a network...
computer networks database theory
1
Applying Brewer's theorem (CAP) to a single node -- (computer networks database theory) <p>I'm going through Brewer's theorem and its proof by Nancy Lynch and Seth Gilbert. But the paper left me with one question. What prevents the theorem from being applicable to a single node?</p>&#xA;&#xA;<p>I haven’t encountered an...
habedi/stack-exchange-dataset
33,014
Range update + range query with binary indexed trees
<p>I am trying to understand how binary indexed trees (fenwick trees) can be modified to handle both range queries and range updates.</p>&#xA;&#xA;<p>I found the following sources:</p>&#xA;&#xA;<p><a href="http://kartikkukreja.wordpress.com/2013/12/02/range-updates-with-bit-fenwick-tree/" rel="noreferrer">http://kartik...
data structures binary trees search trees
1
Range update + range query with binary indexed trees -- (data structures binary trees search trees) <p>I am trying to understand how binary indexed trees (fenwick trees) can be modified to handle both range queries and range updates.</p>&#xA;&#xA;<p>I found the following sources:</p>&#xA;&#xA;<p><a href="http://kartikk...
habedi/stack-exchange-dataset
33,018
How to XOR automata?
<p>Say we have 3 DFAs. We know how to OR, AND, or NOT them. But how does one XOR them? There is not one single mention of this online.</p>&#xA;&#xA;<p>$x\; \mathrm{XOR} \;y\; \mathrm{XOR} \;z = ((x|y)(\neg x|y)|z) (\neg ((x|y)(\neg x|y))|z)$. This is way too complicated and time consuming to draw. Isn't there another w...
automata finite automata closure properties
1
How to XOR automata? -- (automata finite automata closure properties) <p>Say we have 3 DFAs. We know how to OR, AND, or NOT them. But how does one XOR them? There is not one single mention of this online.</p>&#xA;&#xA;<p>$x\; \mathrm{XOR} \;y\; \mathrm{XOR} \;z = ((x|y)(\neg x|y)|z) (\neg ((x|y)(\neg x|y))|z)$. This is...
habedi/stack-exchange-dataset
33,031
Why is the consensus number for test-and-set, 2?
<p>According to <a href="https://en.wikipedia.org/wiki/Test-and-set">Wikipedia</a>,</p>&#xA;&#xA;<blockquote>&#xA; <p>The test-and-set operation can solve the wait-free consensus problem for no more than two concurrent processes.</p>&#xA;</blockquote>&#xA;&#xA;<p>Why can't it solve the problem for more than two proces...
concurrency consensus
1
Why is the consensus number for test-and-set, 2? -- (concurrency consensus) <p>According to <a href="https://en.wikipedia.org/wiki/Test-and-set">Wikipedia</a>,</p>&#xA;&#xA;<blockquote>&#xA; <p>The test-and-set operation can solve the wait-free consensus problem for no more than two concurrent processes.</p>&#xA;</blo...
habedi/stack-exchange-dataset
33,034
Concatenation of languages in NP
<p>I have a hard time to understand why the concatenation of two languages over an alphabet (concatenation is in NP), doesn't imply that each of the languages for themselves are in NP. I talked with my Prof about the problem today, but I can't wrap my head around it. Can you help me out? </p>&#xA;
complexity theory closure properties np
1
Concatenation of languages in NP -- (complexity theory closure properties np) <p>I have a hard time to understand why the concatenation of two languages over an alphabet (concatenation is in NP), doesn't imply that each of the languages for themselves are in NP. I talked with my Prof about the problem today, but I can'...
habedi/stack-exchange-dataset
33,036
Dividing large numbers modulo m
<p>I have numbers $a$, $b$ and $m$, and I need to get the result of $\ \dfrac{a}{b} \mod m$. </p>&#xA;&#xA;<p>The catch is that while $m \leq 10^9$, $a$ and $b$ can get extremely large ($2^{100,000}$), so I'm keeping them as a multiset of their prime factors.</p>&#xA;&#xA;<p>I read about <a href="http://en.wikipedia.or...
modular arithmetic
1
Dividing large numbers modulo m -- (modular arithmetic) <p>I have numbers $a$, $b$ and $m$, and I need to get the result of $\ \dfrac{a}{b} \mod m$. </p>&#xA;&#xA;<p>The catch is that while $m \leq 10^9$, $a$ and $b$ can get extremely large ($2^{100,000}$), so I'm keeping them as a multiset of their prime factors.</p>&...
habedi/stack-exchange-dataset
33,037
Can we prove that all CFLs can be recognized by a Turing Machine in polynomial time?
<p>This question came up while a group of students at my school were studying for our qualifying exams. The question on an old exam was,</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider the following six classes of languages: Context free (CFL), Regular(REG), P, NP, Recursive(R), and Recursively enumerable(RE). (1) indicat...
formal languages context free parsing
1
Can we prove that all CFLs can be recognized by a Turing Machine in polynomial time? -- (formal languages context free parsing) <p>This question came up while a group of students at my school were studying for our qualifying exams. The question on an old exam was,</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider the follow...
habedi/stack-exchange-dataset
33,050
Can a DPDA be created for a Language which includes the null string?
<p>Can a DPDA be created for a Language which includes the null string?</p>&#xA;&#xA;<p>The way I understand it, in a DPDA, you can have at most 1 move from any instantaneous description Delta(q,a,Z) where q is a state, a is some input, and Z is a stack-character.</p>&#xA;&#xA;<p>Also, if you have a transition Delta(q,...
automata pushdown automata
1
Can a DPDA be created for a Language which includes the null string? -- (automata pushdown automata) <p>Can a DPDA be created for a Language which includes the null string?</p>&#xA;&#xA;<p>The way I understand it, in a DPDA, you can have at most 1 move from any instantaneous description Delta(q,a,Z) where q is a state,...
habedi/stack-exchange-dataset
33,052
Is it necessary to traverse every letter in the tape of a Turing Machine?
<p>Say I want to make a very simple Turing Machine that accepts only strings that contain one or more a's. Can I simply send have the machine move a HALT state once it reads one <em>a</em>, even if there are many letters after that first a? Or would this be bad practice or unacceptable for a Turing Machine?</p>&#xA;
turing machines
1
Is it necessary to traverse every letter in the tape of a Turing Machine? -- (turing machines) <p>Say I want to make a very simple Turing Machine that accepts only strings that contain one or more a's. Can I simply send have the machine move a HALT state once it reads one <em>a</em>, even if there are many letters afte...
habedi/stack-exchange-dataset
33,053
Turing-recognizable languages closed under star operation
<p>I'm tasked with demonstrating that the class of Turing-recognizable languages is closed under the operation of star, but I'm confused about how this is true. For example, I have a TM to recognize a language A = { a<sup>2<sup>n</sup></sup>: <em>n</em> >= 0 }, all strings of a's which length is a power of 2. So here's...
turing machines closure properties
1
Turing-recognizable languages closed under star operation -- (turing machines closure properties) <p>I'm tasked with demonstrating that the class of Turing-recognizable languages is closed under the operation of star, but I'm confused about how this is true. For example, I have a TM to recognize a language A = { a<sup>...
habedi/stack-exchange-dataset
33,056
Dijkstra's Algorithm with different color nodes
<p>You are given a directed graph G = (V, E) and nodes s, t. Nodes are colored red, white, and blue. A path from s to t is called colorful if it contains both a red node and a blue node. The task is to determine if a colorful path exists, and if so, find one that contains a minimum number of white nodes.</p>&#xA;&#xA;<...
algorithms shortest path
1
Dijkstra's Algorithm with different color nodes -- (algorithms shortest path) <p>You are given a directed graph G = (V, E) and nodes s, t. Nodes are colored red, white, and blue. A path from s to t is called colorful if it contains both a red node and a blue node. The task is to determine if a colorful path exists, and...
habedi/stack-exchange-dataset
33,063
Conversion from Decimal form to BCD
<p>I have seen a way how to convert a decimal number to BCD (packed &amp; unpacked) using 8,4,2,1 weighing forms but how to do it using 4,2,2,1 and 7,4,2,1 ? Any method please.Suggestions</p>&#xA;
computer architecture digital circuits
1
Conversion from Decimal form to BCD -- (computer architecture digital circuits) <p>I have seen a way how to convert a decimal number to BCD (packed &amp; unpacked) using 8,4,2,1 weighing forms but how to do it using 4,2,2,1 and 7,4,2,1 ? Any method please.Suggestions</p>&#xA;
habedi/stack-exchange-dataset
33,067
Simulate NPDAs with DTMs using only polynomial overhead
<p>We know by polynomial-time parsing algorithms like the classical <a href="https://en.wikipedia.org/wiki/Cyk_algorithm" rel="nofollow noreferrer">CYK algorithm</a> that $\mathrm{CFL} \subseteq \mathrm{P}$.</p>&#xA;&#xA;<p>Furthermore, it is easy to show by direct simulation that $\mathrm{DCFL} \subseteq \mathrm{P}$ a...
turing machines automata pushdown automata polynomial time simulation
1
Simulate NPDAs with DTMs using only polynomial overhead -- (turing machines automata pushdown automata polynomial time simulation) <p>We know by polynomial-time parsing algorithms like the classical <a href="https://en.wikipedia.org/wiki/Cyk_algorithm" rel="nofollow noreferrer">CYK algorithm</a> that $\mathrm{CFL} \sub...
habedi/stack-exchange-dataset
33,074
Can subtracting o(1) from the parameter of a function change its Θ-class?
<p>I would like to know if it is possible that two functions $f(n), g(n)$ can exist such that both of the following conditions are met:</p>&#xA;&#xA;<ol>&#xA;<li><p>$g(n) = o(1)$ </p></li>&#xA;<li><p>$f(n-g(n)) \neq \Theta (f(n))$</p></li>&#xA;</ol>&#xA;&#xA;<p>I though I found $1/n$ and $1/n^2$ but I think I got it al...
asymptotics
1
Can subtracting o(1) from the parameter of a function change its Θ-class? -- (asymptotics) <p>I would like to know if it is possible that two functions $f(n), g(n)$ can exist such that both of the following conditions are met:</p>&#xA;&#xA;<ol>&#xA;<li><p>$g(n) = o(1)$ </p></li>&#xA;<li><p>$f(n-g(n)) \neq \Theta (f(n))...
habedi/stack-exchange-dataset
33,078
Simple Pushdown Automaton
<p>I'm currently learning about PDAs and their power when constructing them from Context-Free Grammars, however I'm still unsure of how to properly construct a CFG, and then a PDA from that CFG.</p>&#xA;&#xA;<p>In the book, Formal Languages, Automata, and Complexity, by J. Glenn Brookshear, there are a few exercises re...
automata pushdown automata
1
Simple Pushdown Automaton -- (automata pushdown automata) <p>I'm currently learning about PDAs and their power when constructing them from Context-Free Grammars, however I'm still unsure of how to properly construct a CFG, and then a PDA from that CFG.</p>&#xA;&#xA;<p>In the book, Formal Languages, Automata, and Comple...
habedi/stack-exchange-dataset