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
85,302
How do I find depth and height of all nodes in a bounded semilattice?
<p>I'm writing a program where I have a bounded semilattice (it has a root element at the top, all edges point downwards, and a node may have multiple parents). I need to precompute each node's depth (the max number of edges from the root node) and height (the max number of edges to any leaf). I have a naive implementa...
algorithms graphs lattices
1
How do I find depth and height of all nodes in a bounded semilattice? -- (algorithms graphs lattices) <p>I'm writing a program where I have a bounded semilattice (it has a root element at the top, all edges point downwards, and a node may have multiple parents). I need to precompute each node's depth (the max number of...
habedi/stack-exchange-dataset
85,310
Is there such a thing as an "or" case in a dependency graph?
<p>Suppose $A$ depends on $B$ or $C$, but not necessarily exclusively. Is it possible to model this in a dependency graph?</p>&#xA;&#xA;<p>Can we just link $A$ to $B$ and $C$ via a diamond (like in UML) (though I don't see how this can be represented mathematically)? Or do we have to condense $B$ and $C$ to a single no...
graphs
1
Is there such a thing as an "or" case in a dependency graph? -- (graphs) <p>Suppose $A$ depends on $B$ or $C$, but not necessarily exclusively. Is it possible to model this in a dependency graph?</p>&#xA;&#xA;<p>Can we just link $A$ to $B$ and $C$ via a diamond (like in UML) (though I don't see how this can be represen...
habedi/stack-exchange-dataset
85,364
Deterministic Nonfinite Automaton - Longest Block of Ones
<p>How to Think About Algorithms - Jeff Edmonds</p>&#xA;&#xA;<p>Exercise 2.2.2</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/Ho3zY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ho3zY.png" alt="Here is the code from the book"></a></p>&#xA;&#xA;<p>The problem asks to find $\sum$, Q, δ, s, and F...
automata finite automata loop invariants
1
Deterministic Nonfinite Automaton - Longest Block of Ones -- (automata finite automata loop invariants) <p>How to Think About Algorithms - Jeff Edmonds</p>&#xA;&#xA;<p>Exercise 2.2.2</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/Ho3zY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ho3zY.png" al...
habedi/stack-exchange-dataset
85,365
Why algorithms calculating non-tirivial zeros can't be used as proofs of Riemann Hypothesis?
<p>Recently I was reading again this propositions as types paper by Philip Wadler:</p>&#xA;&#xA;<p><a href="http://homepages.inf.ed.ac.uk/wadler/papers/propositions-as-types/propositions-as-types.pdf" rel="nofollow noreferrer">http://homepages.inf.ed.ac.uk/wadler/papers/propositions-as-types/propositions-as-types.pdf</...
proof techniques first order logic propositional logic mathematical foundations curry howard
1
Why algorithms calculating non-tirivial zeros can't be used as proofs of Riemann Hypothesis? -- (proof techniques first order logic propositional logic mathematical foundations curry howard) <p>Recently I was reading again this propositions as types paper by Philip Wadler:</p>&#xA;&#xA;<p><a href="http://homepages.inf....
habedi/stack-exchange-dataset
85,375
How memory remapping of physical address space that is above 4GB RAM works?
<p>I have a query regarding the below information in <a href="http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map/" rel="nofollow noreferrer">http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map/</a></p>&#xA;&#xA;<p><em>"In 64-bit mode it is possible to use physical addresses above the ...
computer architecture memory management
1
How memory remapping of physical address space that is above 4GB RAM works? -- (computer architecture memory management) <p>I have a query regarding the below information in <a href="http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map/" rel="nofollow noreferrer">http://duartes.org/gustavo/blog/post/mot...
habedi/stack-exchange-dataset
85,377
Church-Turing Thesis and computational power of neural networks
<p>The Church-Turing thesis states that everything that can physically be computed, can be computed on a Turing Machine.&#xA;The paper&#xA;"Analog computation via neural networks" (Siegelmannn and Sontag, <em>Theoretical Computer Science</em>, 131:331&ndash;360, 1994; <a href="http://research.cs.queensu.ca/home/akl/cis...
computability turing machines church turing thesis
1
Church-Turing Thesis and computational power of neural networks -- (computability turing machines church turing thesis) <p>The Church-Turing thesis states that everything that can physically be computed, can be computed on a Turing Machine.&#xA;The paper&#xA;"Analog computation via neural networks" (Siegelmannn and Son...
habedi/stack-exchange-dataset
85,383
Is a language containing set of binary numbers which are divisible by number N Regular?
<p>Let N be any positive integer, then is following language regular for every $N$? </p>&#xA;&#xA;<p>$L$ = { $B_n : B_n(modN) == 0$ } where $B_n$ is binary representation of a number. </p>&#xA;&#xA;<p>E.g, $L=\lbrace B_n : B_nmod31 == 0,B_n \ is \ a \ binary \ number \rbrace$ is regular? Will the language be regular fo...
regular languages
1
Is a language containing set of binary numbers which are divisible by number N Regular? -- (regular languages) <p>Let N be any positive integer, then is following language regular for every $N$? </p>&#xA;&#xA;<p>$L$ = { $B_n : B_n(modN) == 0$ } where $B_n$ is binary representation of a number. </p>&#xA;&#xA;<p>E.g, $L=...
habedi/stack-exchange-dataset
85,391
Isn't NP problems always also co-NP problems?
<p>I think I have a hard time understanding the definition for NP. It says: "All decision problem where every yes-instance can be verified in polynomial time". But doesn't this just mean that every possible solution can be verified to be yes or no in polynomial time? If co-NP then is verifying no-instances isn't NP alr...
np co np
1
Isn't NP problems always also co-NP problems? -- (np co np) <p>I think I have a hard time understanding the definition for NP. It says: "All decision problem where every yes-instance can be verified in polynomial time". But doesn't this just mean that every possible solution can be verified to be yes or no in polynomia...
habedi/stack-exchange-dataset
85,392
Computational Irreducibility
<p>Define $Tape_M(t, i)$ as the symbol in the $i$-th cell of the tape of Turing machine $M$ with empty input at step $t$.</p>&#xA;&#xA;<blockquote>&#xA; <p>Does there exist a Turing machine $M$ such that <em>no</em> algorithm can compute $Tape_M(t, i)$ within $o(t)$ (or $o(t/\log(t))$ ) time?</p>&#xA;</blockquote>&#xA...
complexity theory turing machines
1
Computational Irreducibility -- (complexity theory turing machines) <p>Define $Tape_M(t, i)$ as the symbol in the $i$-th cell of the tape of Turing machine $M$ with empty input at step $t$.</p>&#xA;&#xA;<blockquote>&#xA; <p>Does there exist a Turing machine $M$ such that <em>no</em> algorithm can compute $Tape_M(t, i)...
habedi/stack-exchange-dataset
85,399
Must algorithm for comparing numbers investigate all bits?
<p>Suppose algorithm $A$ on a digital computer takes as input integers $x$ and $y$ in binary. The algorithm outputs one if $x=y$, and zero if $x \neq y$. Is there a proof that for any input $x$ and $y$ in which $x=y$, there exists a one-to-one function $f: \mathbb Z \rightarrow \mathbb Z$ such that $A$ compares all of ...
logic proof techniques
1
Must algorithm for comparing numbers investigate all bits? -- (logic proof techniques) <p>Suppose algorithm $A$ on a digital computer takes as input integers $x$ and $y$ in binary. The algorithm outputs one if $x=y$, and zero if $x \neq y$. Is there a proof that for any input $x$ and $y$ in which $x=y$, there exists a ...
habedi/stack-exchange-dataset
85,409
On $NP=\Sigma_2^P$ from non-deterministic time?
<p>We know $NP=\bigcup_{k\in\Bbb N}NTIME(n^k)$ and $\Sigma_2^P=NP^{NP}$.</p>&#xA;&#xA;<ol>&#xA;<li><p>Does $\Sigma_2^P\subseteq\bigcup_{k\in\Bbb N}NTIME(n^k)$ also hold (we can do $O(n^k)$ queries to $NP$ oracle which runs in non-deterministic $O((n^k)^c)$ time which is non-deterministic $O(poly(n))$ time)?</p></li>&#...
complexity theory nondeterminism
1
On $NP=\Sigma_2^P$ from non-deterministic time? -- (complexity theory nondeterminism) <p>We know $NP=\bigcup_{k\in\Bbb N}NTIME(n^k)$ and $\Sigma_2^P=NP^{NP}$.</p>&#xA;&#xA;<ol>&#xA;<li><p>Does $\Sigma_2^P\subseteq\bigcup_{k\in\Bbb N}NTIME(n^k)$ also hold (we can do $O(n^k)$ queries to $NP$ oracle which runs in non-dete...
habedi/stack-exchange-dataset
85,413
Does the A* algorithm visit every node?
<p>I have been taught that the A* algorithm visits every node on the graph, like Dijkstra's does, prioritising nodes with the smallest cost. However, visualisations of the algorithm, such as this one, appear to show the algorithm stopping after finding the first path as the white blocks spreading out on the linked vide...
algorithms graphs algorithm analysis search algorithms shortest path
1
Does the A* algorithm visit every node? -- (algorithms graphs algorithm analysis search algorithms shortest path) <p>I have been taught that the A* algorithm visits every node on the graph, like Dijkstra's does, prioritising nodes with the smallest cost. However, visualisations of the algorithm, such as this one, appea...
habedi/stack-exchange-dataset
85,414
Is this a standard representation of a 'space' character?
<p>I recently came across a handwritten note with directions to push a string of text into a database. There was a strange character in the string I've never seen before, <strong>a lower case 'b' with a forward slash through it:</strong></p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/Thni9.png" rel="nofollow norefe...
strings notation
1
Is this a standard representation of a 'space' character? -- (strings notation) <p>I recently came across a handwritten note with directions to push a string of text into a database. There was a strange character in the string I've never seen before, <strong>a lower case 'b' with a forward slash through it:</strong></p...
habedi/stack-exchange-dataset
85,416
Why does substitution terminate?
<p>I'm formalizing some properties of lambda calculus in Coq and I have some problems proving termination of substitution. My terms are defined as:</p>&#xA;&#xA;<pre><code>Inductive Term :=&#xA; TVar: nat -&gt; Term&#xA;| TAbs: nat -&gt; Term -&gt; Term&#xA;| TApp: Term -&gt; Term -&gt; Term.&#xA;</code></pre>&#xA;&#x...
programming languages lambda calculus semantics coq termination
1
Why does substitution terminate? -- (programming languages lambda calculus semantics coq termination) <p>I'm formalizing some properties of lambda calculus in Coq and I have some problems proving termination of substitution. My terms are defined as:</p>&#xA;&#xA;<pre><code>Inductive Term :=&#xA; TVar: nat -&gt; Term&#...
habedi/stack-exchange-dataset
85,426
What is the relation between countability and recursive enumeration?
<p>Does recursive enumeration implies countability?&#xA;Does countability implies recursive enumeration?</p>&#xA;&#xA;<p>I believe the first implication holds but not sure about the second. A good example would suffice.</p>&#xA;
uncountability
1
What is the relation between countability and recursive enumeration? -- (uncountability) <p>Does recursive enumeration implies countability?&#xA;Does countability implies recursive enumeration?</p>&#xA;&#xA;<p>I believe the first implication holds but not sure about the second. A good example would suffice.</p>&#xA;
habedi/stack-exchange-dataset
85,441
Proving $L = \{ w : w \neq w^R \}$ over $\Sigma = \{0,1\}$ is CFL
<p>I'm trying to prove $L = \{ w : w \neq w^R \}$ over $\Sigma = \{0,1\}$ is CFL.</p>&#xA;&#xA;<p>Define $G = ({S,T}, \Sigma, R, S)$ where $R = S \to 0S0|1S1|0T1|1T0, \; T \to 0T|1T|\varepsilon$.&#xA;Now I want to show that $\mathcal{L}(G) = L$.<br>&#xA;One direction is fine, where given $w\in \mathcal{L}(G)$, it must'...
formal languages context free formal grammars
1
Proving $L = \{ w : w \neq w^R \}$ over $\Sigma = \{0,1\}$ is CFL -- (formal languages context free formal grammars) <p>I'm trying to prove $L = \{ w : w \neq w^R \}$ over $\Sigma = \{0,1\}$ is CFL.</p>&#xA;&#xA;<p>Define $G = ({S,T}, \Sigma, R, S)$ where $R = S \to 0S0|1S1|0T1|1T0, \; T \to 0T|1T|\varepsilon$.&#xA;Now...
habedi/stack-exchange-dataset
85,445
Can a CD disk and the memory of a device have an infinite space storage?
<p>I’m asking this because, I’m thinking that it is possible to make a CD or ps vita cd to have an infinite space storage so that new updates will come. </p>&#xA;&#xA;<p>And, it is possible for the company Sony to make the new memory of ps vita to be infinite space storage?</p>&#xA;&#xA;<p>Can anyone tell me if it is p...
algorithms data structures
1
Can a CD disk and the memory of a device have an infinite space storage? -- (algorithms data structures) <p>I’m asking this because, I’m thinking that it is possible to make a CD or ps vita cd to have an infinite space storage so that new updates will come. </p>&#xA;&#xA;<p>And, it is possible for the company Sony to m...
habedi/stack-exchange-dataset
85,461
How to estimate how many assignments satisfy a given DNF formula using Monte Carlo?
<p>Admittedly, homework.</p>&#xA;&#xA;<p>For the purpose of this question: $\phi$ is a DNF formula similar to this one: $(x_1 \wedge \neg x_3 \wedge x_4) \vee (\neg x_1 \wedge x_2)$ Also $C_i$ is a clause in this formula, for example $C_1=x_1\wedge \neg x_3\wedge x_4$</p>&#xA;&#xA;<p>The tasks is to do this in a little...
algorithms np hard probability theory propositional logic monte carlo
1
How to estimate how many assignments satisfy a given DNF formula using Monte Carlo? -- (algorithms np hard probability theory propositional logic monte carlo) <p>Admittedly, homework.</p>&#xA;&#xA;<p>For the purpose of this question: $\phi$ is a DNF formula similar to this one: $(x_1 \wedge \neg x_3 \wedge x_4) \vee (\...
habedi/stack-exchange-dataset
85,464
Omission of smaller variables in Big-O Complexity
<p>I have an algorithm that:</p>&#xA;&#xA;<p><strong>1.</strong> takes in a book's text as a string.</p>&#xA;&#xA;<p><strong>2.</strong> splits that string into words and stores it in a list. </p>&#xA;&#xA;<p><strong>3.</strong> creates a hash table from this list by iterating over the elements of the list</p>&#xA;&#xA...
time complexity asymptotics
1
Omission of smaller variables in Big-O Complexity -- (time complexity asymptotics) <p>I have an algorithm that:</p>&#xA;&#xA;<p><strong>1.</strong> takes in a book's text as a string.</p>&#xA;&#xA;<p><strong>2.</strong> splits that string into words and stores it in a list. </p>&#xA;&#xA;<p><strong>3.</strong> creates ...
habedi/stack-exchange-dataset
85,477
Proving or disproving a set of total functions is countable
<blockquote>&#xA; <p>Let S be the set of total functions from $N \rightarrow M$, such that for each $f \in S$, there is $i &gt; 1$ such that for&#xA; all $j &lt; i$, $f(i)$ and $f(j)$ are not equivalent Turing machines. Prove or disprove that S is countable</p>&#xA;</blockquote>&#xA;&#xA;<p>I don't think this is actu...
complexity theory computability proof techniques counting
1
Proving or disproving a set of total functions is countable -- (complexity theory computability proof techniques counting) <blockquote>&#xA; <p>Let S be the set of total functions from $N \rightarrow M$, such that for each $f \in S$, there is $i &gt; 1$ such that for&#xA; all $j &lt; i$, $f(i)$ and $f(j)$ are not equ...
habedi/stack-exchange-dataset
85,481
Use the pumping lemma to show the language is not regular
<p>I can use the pumping lemma to prove simpler examples, but i'm finding this problem rather complex partly due to the notation.</p>&#xA;&#xA;<p>Can anyone explain how I would do this problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>For any string $s$ in $\{a, b\}^*$, let $n_a(s)$ be the number of a’s in s, and let $n_b(s)...
formal languages regular languages pumping lemma
1
Use the pumping lemma to show the language is not regular -- (formal languages regular languages pumping lemma) <p>I can use the pumping lemma to prove simpler examples, but i'm finding this problem rather complex partly due to the notation.</p>&#xA;&#xA;<p>Can anyone explain how I would do this problem:</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
85,486
Why not a $coNP$ hierarchy?
<p>In the polynomial hierarchy we have $\Sigma_2=NP^{NP}$ and $\Pi_2=co\Sigma_2$.</p>&#xA;&#xA;<p>So we have $\Pi_2=co(NP^{NP})$. </p>&#xA;&#xA;<p>Is it same as $(coNP)^{NP}$?</p>&#xA;&#xA;<p>I just wonder why not a hierarchy with $coNP$.</p>&#xA;
complexity theory complexity classes
1
Why not a $coNP$ hierarchy? -- (complexity theory complexity classes) <p>In the polynomial hierarchy we have $\Sigma_2=NP^{NP}$ and $\Pi_2=co\Sigma_2$.</p>&#xA;&#xA;<p>So we have $\Pi_2=co(NP^{NP})$. </p>&#xA;&#xA;<p>Is it same as $(coNP)^{NP}$?</p>&#xA;&#xA;<p>I just wonder why not a hierarchy with $coNP$.</p>&#xA;
habedi/stack-exchange-dataset
85,493
Limited oracle TM
<p>Let $M$ be a Turing machine with oracle to $B$ that can decide $B$ in polynomial time. In the general case it means nothing, since we can just pass the input as a query to the oracle of $B$ and accept/reject according to its answer.</p>&#xA;&#xA;<p>Now, we add the next limitation: given an input of length $n$, the q...
complexity theory turing machines reductions space complexity oracle machines
1
Limited oracle TM -- (complexity theory turing machines reductions space complexity oracle machines) <p>Let $M$ be a Turing machine with oracle to $B$ that can decide $B$ in polynomial time. In the general case it means nothing, since we can just pass the input as a query to the oracle of $B$ and accept/reject accordin...
habedi/stack-exchange-dataset
85,499
Does closure under union and concatenation imply closure under Kleene star?
<p>For decidable languages (or a particular subset of decidable languages, e.g., regular, context free) does closure under Kleene star follow from the proof of closure under union and concatenation? The only thing that the latter seems not able to produce is an empty string.</p>&#xA;
formal languages turing machines regular languages automata
1
Does closure under union and concatenation imply closure under Kleene star? -- (formal languages turing machines regular languages automata) <p>For decidable languages (or a particular subset of decidable languages, e.g., regular, context free) does closure under Kleene star follow from the proof of closure under union...
habedi/stack-exchange-dataset
85,510
Common parse tree for several formulas
<p>I have a large (~1k) number of boolean formulas like:</p>&#xA;&#xA;<pre><code>f1(x) = p1 AND p2&#xA;f2(x) = (p1 AND p2) OR p3&#xA;f3(x) = p4 OR !p5&#xA;</code></pre>&#xA;&#xA;<p>The argument x is a set, and the predicates (the p's) assert that a certain condition is met on the set (typically, that x contains a certa...
trees boolean algebra
1
Common parse tree for several formulas -- (trees boolean algebra) <p>I have a large (~1k) number of boolean formulas like:</p>&#xA;&#xA;<pre><code>f1(x) = p1 AND p2&#xA;f2(x) = (p1 AND p2) OR p3&#xA;f3(x) = p4 OR !p5&#xA;</code></pre>&#xA;&#xA;<p>The argument x is a set, and the predicates (the p's) assert that a certa...
habedi/stack-exchange-dataset
85,522
Typing by value
<p>I wondered if there was a generalized name for typing a variable by assigning a specific value to it. For instance</p>&#xA;&#xA;<pre><code> a = 4&#xA;</code></pre>&#xA;&#xA;<p>This would make the variable <code>a</code> an integer, since 4 is an integer. Likewise</p>&#xA;&#xA;<pre><code> b = 0.8&#xA;</code></pre>&...
programming languages typing type inference
1
Typing by value -- (programming languages typing type inference) <p>I wondered if there was a generalized name for typing a variable by assigning a specific value to it. For instance</p>&#xA;&#xA;<pre><code> a = 4&#xA;</code></pre>&#xA;&#xA;<p>This would make the variable <code>a</code> an integer, since 4 is an integ...
habedi/stack-exchange-dataset
85,540
Solving recurrence relation having square root
<p>T(n) = 2T(√n) + n.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>I tried putting n=2^m</p>&#xA;&#xA;<p>T(2^m) = 2T(2^(m/2)) + 2^m.</p>&#xA;&#xA;<p>If I subsitute T(2^m) = S(m) then,</p>&#xA;&#xA;<p>S(m) = 2S(m/2) + 2^m.</p>&#xA;&#xA;<p>This is same as (1*2^m) + (2*2^(m/2)) + (4*2^(m/4)) + ...</p>&#xA;&#xA;<p>Now I am stuck in this ...
recurrence relation
1
Solving recurrence relation having square root -- (recurrence relation) <p>T(n) = 2T(√n) + n.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>I tried putting n=2^m</p>&#xA;&#xA;<p>T(2^m) = 2T(2^(m/2)) + 2^m.</p>&#xA;&#xA;<p>If I subsitute T(2^m) = S(m) then,</p>&#xA;&#xA;<p>S(m) = 2S(m/2) + 2^m.</p>&#xA;&#xA;<p>This is same as (1*2^m) +...
habedi/stack-exchange-dataset
85,543
Computational Complexity and P vs. NP, A New Insight
<p>There is a preprint on arXiv that states (in my own words). </p>&#xA;&#xA;<p>If there are three numbers (digits) and task is to add all three numbers. First we well take two number to add, set aside third number. Then we will add third number in previous sum of two numbers. So, addition of three number requires two...
complexity theory turing machines np complete proof techniques p vs np
1
Computational Complexity and P vs. NP, A New Insight -- (complexity theory turing machines np complete proof techniques p vs np) <p>There is a preprint on arXiv that states (in my own words). </p>&#xA;&#xA;<p>If there are three numbers (digits) and task is to add all three numbers. First we well take two number to add,...
habedi/stack-exchange-dataset
85,557
Mathematical proofs implemented purely by Lambda Calculus
<p>I've seen often stated that Lambda Calculus can be used for mathematical proofing but I haven't yet seen any example how it is actually used for the task.</p>&#xA;&#xA;<p>Is there a simple example, lambda abstraction or application that can be shown to be a valid mathematical proof? For example what does it take to ...
proof techniques lambda calculus mathematical foundations
1
Mathematical proofs implemented purely by Lambda Calculus -- (proof techniques lambda calculus mathematical foundations) <p>I've seen often stated that Lambda Calculus can be used for mathematical proofing but I haven't yet seen any example how it is actually used for the task.</p>&#xA;&#xA;<p>Is there a simple example...
habedi/stack-exchange-dataset
85,571
Array with queries to decrement or find sum of range
<p>I have been given an array of integers of <strong><em>size n</em></strong> and <strong><em>q queries</em></strong> which can be of 2 types:<br>&#xA;1.Decrement all elements in the given range by some value<br>&#xA;2.Find sum of all elements in the given range<br>&#xA;<strong><em>1&lt;=n,q&lt;=10^5</em></strong><br>&...
algorithms complexity theory time complexity arrays
1
Array with queries to decrement or find sum of range -- (algorithms complexity theory time complexity arrays) <p>I have been given an array of integers of <strong><em>size n</em></strong> and <strong><em>q queries</em></strong> which can be of 2 types:<br>&#xA;1.Decrement all elements in the given range by some value<b...
habedi/stack-exchange-dataset
85,573
Recognizability of machines which halt in $n$ steps on some input
<p>We define the following language:</p>&#xA;<p><span class="math-container">$$L = \{M \mid \text{$M$ is a TM and there exists an input $x$ on which $M$ halts in at most $|x|$ steps}\}.$$</span></p>&#xA;<p>Following <a href="https://stackoverflow.com/questions/6641409/prove-that-this-language-is-undecidable">this quest...
undecidability
1
Recognizability of machines which halt in $n$ steps on some input -- (undecidability) <p>We define the following language:</p>&#xA;<p><span class="math-container">$$L = \{M \mid \text{$M$ is a TM and there exists an input $x$ on which $M$ halts in at most $|x|$ steps}\}.$$</span></p>&#xA;<p>Following <a href="https://s...
habedi/stack-exchange-dataset
85,576
Relation between $\sqrt{x^2+y^2}$ and $|x|+|y|$
<p>I have a problem in which I was given $n$ points and an integer $k$, and I need to find the $k$ points that are the closest to origin. My approach is to find the distances from origin of all points and sort them. Instead of using distances $\sqrt{x^2+y^2}$, can I use $|x|+|y|$ as my key? Also, I would like to find o...
time complexity discrete mathematics
1
Relation between $\sqrt{x^2+y^2}$ and $|x|+|y|$ -- (time complexity discrete mathematics) <p>I have a problem in which I was given $n$ points and an integer $k$, and I need to find the $k$ points that are the closest to origin. My approach is to find the distances from origin of all points and sort them. Instead of usi...
habedi/stack-exchange-dataset
85,583
Query regarding Integer factorization
<p>Let us consider a product $P$ (whose factors we do not know). Given a base $b$, such that all the Modulus Residues are calculated using powers of $b$ w.r.t. $P$.</p>&#xA;&#xA;<p>For some (unknown) power $x$ we know the corresponding residue ($R_x$), i.e.:</p>&#xA;&#xA;<p>$b^x\bmod P = R_x$. </p>&#xA;&#xA;<p>Query 1...
algorithms factoring
1
Query regarding Integer factorization -- (algorithms factoring) <p>Let us consider a product $P$ (whose factors we do not know). Given a base $b$, such that all the Modulus Residues are calculated using powers of $b$ w.r.t. $P$.</p>&#xA;&#xA;<p>For some (unknown) power $x$ we know the corresponding residue ($R_x$), i.e...
habedi/stack-exchange-dataset
85,598
rebalance red-black tree with many violations
<p>Every red-black tree implementation I've come across use a strategy that considers re-balancing the tree after each mutation (e.g. insert, delete, ...).</p>&#xA;&#xA;<p>I have a situation where I graft several sub-trees from one red-black tree onto another. After these grafts I would like to consider re-balancing th...
binary trees balanced search trees
1
rebalance red-black tree with many violations -- (binary trees balanced search trees) <p>Every red-black tree implementation I've come across use a strategy that considers re-balancing the tree after each mutation (e.g. insert, delete, ...).</p>&#xA;&#xA;<p>I have a situation where I graft several sub-trees from one re...
habedi/stack-exchange-dataset
85,637
Reduction — Do they work for unrelated problems?
<p>I think I understand that a P class problem is reducible to an NP class problem (P≤NP).</p>&#xA;&#xA;<p>I´d like to understand if I need to figure out a potential algorithm which could solve the NP class problem to know if it can be used as a subroutine for a P class problem. </p>&#xA;&#xA;<p>So for example, if I as...
complexity theory reductions
1
Reduction — Do they work for unrelated problems? -- (complexity theory reductions) <p>I think I understand that a P class problem is reducible to an NP class problem (P≤NP).</p>&#xA;&#xA;<p>I´d like to understand if I need to figure out a potential algorithm which could solve the NP class problem to know if it can be u...
habedi/stack-exchange-dataset
85,654
Pumping-Lemma regular languages: Consider multiple cases?
<p>The language $ L = \{ a^nb^mc^m : n,m \in \mathbb{N} \} $ is non regular. Suppose this needs to be proven using the pumping lemma for regular languages:<br>&#xA;Be $ z = ab^nc^n $ such that $ z=uvw, |v| \geq 1, |uv| \leq n $.<br>&#xA;Obviously $uv^2w \notin L $ with $ v=b^{k}$ and $ 1 \leq k \leq n-1$.<br>&#xA;Is th...
regular languages pumping lemma
1
Pumping-Lemma regular languages: Consider multiple cases? -- (regular languages pumping lemma) <p>The language $ L = \{ a^nb^mc^m : n,m \in \mathbb{N} \} $ is non regular. Suppose this needs to be proven using the pumping lemma for regular languages:<br>&#xA;Be $ z = ab^nc^n $ such that $ z=uvw, |v| \geq 1, |uv| \leq n...
habedi/stack-exchange-dataset
85,662
Finding a subset of objects with max value with constraints
<p>There are m people and n kinds of objects. Each person has exactly one instance of each kind of objects, but these objects have different values associated. Now I want to find a subset of objects from all those m*n objects satisfying the condition: it should have p objects of each kind (p &lt; m), and a person canno...
algorithms
1
Finding a subset of objects with max value with constraints -- (algorithms) <p>There are m people and n kinds of objects. Each person has exactly one instance of each kind of objects, but these objects have different values associated. Now I want to find a subset of objects from all those m*n objects satisfying the con...
habedi/stack-exchange-dataset
85,675
Colouring the graph
<p>We have a directed simple graph $G$. Out-degree of any vertex is at most $k$ in $G$. We need to show that $G$ is $2k+1$-partite.</p>&#xA;
graphs colorings
1
Colouring the graph -- (graphs colorings) <p>We have a directed simple graph $G$. Out-degree of any vertex is at most $k$ in $G$. We need to show that $G$ is $2k+1$-partite.</p>&#xA;
habedi/stack-exchange-dataset
85,677
Highly colored vertices in greedy coloring imply existence of subtrees
<p>I have a graph $G$ on which I try greedy coloring; i.e. I order the vertices and then start coloring them according to their order and I assign each vertex the smallest possible color available to it. (It is easy to see that this might not be the optimal coloring possible)</p>&#xA;&#xA;<p>So after the coloring, we s...
graphs trees colorings
1
Highly colored vertices in greedy coloring imply existence of subtrees -- (graphs trees colorings) <p>I have a graph $G$ on which I try greedy coloring; i.e. I order the vertices and then start coloring them according to their order and I assign each vertex the smallest possible color available to it. (It is easy to se...
habedi/stack-exchange-dataset
85,681
Converting between (standard) primal to dual forms (LP)
<p>I'm working on a HW assignment as follows:</p>&#xA;&#xA;<p>Given the primal canonical problem: $$min \langle c,x \rangle \text{ s.t. } Ax \geq b, x \geq 0$$&#xA;and the canonical dual problem: $$ max \langle b,y \rangle \text{ s.t. } A^Ty \leq c, y \geq 0$$</p>&#xA;&#xA;<p>Show that converting PC (primal canonical) ...
linear programming
1
Converting between (standard) primal to dual forms (LP) -- (linear programming) <p>I'm working on a HW assignment as follows:</p>&#xA;&#xA;<p>Given the primal canonical problem: $$min \langle c,x \rangle \text{ s.t. } Ax \geq b, x \geq 0$$&#xA;and the canonical dual problem: $$ max \langle b,y \rangle \text{ s.t. } A^T...
habedi/stack-exchange-dataset
85,684
RNG: removing bias by counting bits
<p>I have a hardware RNG that sends me some random bits. Due to nature of that RNG, the source is biased. Then, the bitstream is processed in a following way to remove the bias:<br>&#xA;two counters are used, which count amounts of 1's and 0's in the stream and when the difference is above the threshold, the next bit o...
randomness random number generator
1
RNG: removing bias by counting bits -- (randomness random number generator) <p>I have a hardware RNG that sends me some random bits. Due to nature of that RNG, the source is biased. Then, the bitstream is processed in a following way to remove the bias:<br>&#xA;two counters are used, which count amounts of 1's and 0's ...
habedi/stack-exchange-dataset
85,690
Divide sequence of numbers from 1 to n into 2 groups with minimum difference
<p>Let's say for some $n$ we have the sequence $1, 2, 3, \dots , n$, what we want with this sequence is to divide it in two sets such that each element of the sequence will be in only one set, and the difference in sums of the two sets will be minimum possible.</p>&#xA;&#xA;<p><strong>Example</strong></p>&#xA;&#xA;<p>L...
discrete mathematics
1
Divide sequence of numbers from 1 to n into 2 groups with minimum difference -- (discrete mathematics) <p>Let's say for some $n$ we have the sequence $1, 2, 3, \dots , n$, what we want with this sequence is to divide it in two sets such that each element of the sequence will be in only one set, and the difference in su...
habedi/stack-exchange-dataset
85,694
Solving recurrence relation with square n
<p>I have the following recursive function:</p>&#xA;&#xA;<p>$$&#xA;T(n) = &#xA;\begin{cases}&#xA;\theta (1) &amp; \text{if $n$ = 1;}\\&#xA;T(\sqrt{n}) + \theta (log(n)) &amp; \text{if n $\geq$ 2}\\&#xA;\end{cases}&#xA;$$</p>&#xA;&#xA;<p>I tried:</p>&#xA;&#xA;<p>\begin{eqnarray*}&#xA;T(n)&amp;=&amp;T(\sqrt{n}) + log(n)\...
asymptotics recurrence relation
1
Solving recurrence relation with square n -- (asymptotics recurrence relation) <p>I have the following recursive function:</p>&#xA;&#xA;<p>$$&#xA;T(n) = &#xA;\begin{cases}&#xA;\theta (1) &amp; \text{if $n$ = 1;}\\&#xA;T(\sqrt{n}) + \theta (log(n)) &amp; \text{if n $\geq$ 2}\\&#xA;\end{cases}&#xA;$$</p>&#xA;&#xA;<p>I tr...
habedi/stack-exchange-dataset
85,699
An algorithm to generate all connectible pair combinations
<p>In this thread I am seeking for an advice or a starting point on how to solve the following riddle. I need to come up with an algorithm which will generate all possible combinations, but I don't know where to start. In this example let's assume that we have 3 value pairs</p>&#xA;&#xA;<pre><code>1 2&#xA;&#xA;2 3&#xA;...
algorithms enumeration
1
An algorithm to generate all connectible pair combinations -- (algorithms enumeration) <p>In this thread I am seeking for an advice or a starting point on how to solve the following riddle. I need to come up with an algorithm which will generate all possible combinations, but I don't know where to start. In this exampl...
habedi/stack-exchange-dataset
85,702
Subset Sum for {1,...,n}
<p>In general, the subset sum problem is NP-Complete. However, what if we say that our set is $\{1,...,n\}$? Is there a formula/combinatorial calculation that says how many subsets of $\{1,...,n\}$ have their sum equal to $k$?</p>&#xA;
complexity theory time complexity subset sum
1
Subset Sum for {1,...,n} -- (complexity theory time complexity subset sum) <p>In general, the subset sum problem is NP-Complete. However, what if we say that our set is $\{1,...,n\}$? Is there a formula/combinatorial calculation that says how many subsets of $\{1,...,n\}$ have their sum equal to $k$?</p>&#xA;
habedi/stack-exchange-dataset
85,706
What happens when all reference bits set to 1 in Second Chance Page Replacement Algorithm?
<p>I have a sequence like 5577334... and there are 3 frames available.</p>&#xA;&#xA;<p>After the 6th clock, all pages (5, 7 and 3) will have their reference bits set to 1. &#xA;Now, when 4 comes in, 5 will go even though its reference bit is 1 because of the FIFO rule but what happens 7 and 3' referance bits? Do they s...
algorithms paging
1
What happens when all reference bits set to 1 in Second Chance Page Replacement Algorithm? -- (algorithms paging) <p>I have a sequence like 5577334... and there are 3 frames available.</p>&#xA;&#xA;<p>After the 6th clock, all pages (5, 7 and 3) will have their reference bits set to 1. &#xA;Now, when 4 comes in, 5 will ...
habedi/stack-exchange-dataset
85,707
Analysis of brute force decoder in a $q$-ary erasure channel
<p>Consider the $q$-ary erasure channel with erasure probability $\alpha$, i.e. given $x\in\mathbb{F}_q$ with probability $\alpha$ it outputs $?$ and with probability $1-\alpha$ outputs $x$.</p>&#xA;&#xA;<p>For a linear code $\mathcal{C}$ generated by an $n\times k$ matrix $G$ over $\mathbb{F}_q$, we take a decoder $D:...
information theory error correcting codes
1
Analysis of brute force decoder in a $q$-ary erasure channel -- (information theory error correcting codes) <p>Consider the $q$-ary erasure channel with erasure probability $\alpha$, i.e. given $x\in\mathbb{F}_q$ with probability $\alpha$ it outputs $?$ and with probability $1-\alpha$ outputs $x$.</p>&#xA;&#xA;<p>For a...
habedi/stack-exchange-dataset
85,722
Using closure properties to show that $L_1=\{a^lb^mc^m|l,m\ge 0\} \cup L(b^*c^*)$ is regular or not
<p>i'm trying to figure out whether this Union $\left [ L_1=\{a^lb^mc^m|l,m\ge 0\} \cup L(b^*c^*)\right]=K$ is regular or not, now since regular languages are closed under intersection, so i assume $K$ is regular then its intersection with $L(a^*b^*)$ should be regular which is $K\cap L(a^*b^*)=L(a^*)\cup L(b^*)$ righ...
formal languages closure properties
1
Using closure properties to show that $L_1=\{a^lb^mc^m|l,m\ge 0\} \cup L(b^*c^*)$ is regular or not -- (formal languages closure properties) <p>i'm trying to figure out whether this Union $\left [ L_1=\{a^lb^mc^m|l,m\ge 0\} \cup L(b^*c^*)\right]=K$ is regular or not, now since regular languages are closed under inters...
habedi/stack-exchange-dataset
85,724
Reception of numerical infinities
<p>A group of computer scientists associated with numerical analyst Yaroslav Sergeyev have published numerous publications recently on a scheme proposed by Sergeyev that uses terms like <em>Infinity Computer</em>, <em>numerical infinitesimal</em> and <em>numerical infinity</em>, claiming that the approach facilitates t...
terminology numerical analysis
1
Reception of numerical infinities -- (terminology numerical analysis) <p>A group of computer scientists associated with numerical analyst Yaroslav Sergeyev have published numerous publications recently on a scheme proposed by Sergeyev that uses terms like <em>Infinity Computer</em>, <em>numerical infinitesimal</em> and...
habedi/stack-exchange-dataset
85,731
Intersection of languages using closure properties
<ol>&#xA;<li><p>$L_1 \in \mathrm{CFL} \cap L_2\in \mathrm{CSL}$ is $\mathrm{CSL}$ because every $\mathrm{CFL}$ is $\mathrm{CSL}$ and by applying closure property of $\mathrm{CSL}$ under intersection, it's $\mathrm{CSL}$.</p></li>&#xA;<li><p>$L_1 \in \mathrm{ RL} \cap L_2 \in \mathrm{CFL}$ is same as $\mathrm{CFL} \cap ...
formal languages regular languages
1
Intersection of languages using closure properties -- (formal languages regular languages) <ol>&#xA;<li><p>$L_1 \in \mathrm{CFL} \cap L_2\in \mathrm{CSL}$ is $\mathrm{CSL}$ because every $\mathrm{CFL}$ is $\mathrm{CSL}$ and by applying closure property of $\mathrm{CSL}$ under intersection, it's $\mathrm{CSL}$.</p></li>...
habedi/stack-exchange-dataset
85,733
Definition of "idempotence" of a function?
<p>Currently there are two things that may change between invocations of a function: the return value, and the external states. I understand that if the external states changes, the function is not idempotent. However, it seems controversial whether the return value is required to stay the same. For example, is the bel...
terminology imperative programming
1
Definition of "idempotence" of a function? -- (terminology imperative programming) <p>Currently there are two things that may change between invocations of a function: the return value, and the external states. I understand that if the external states changes, the function is not idempotent. However, it seems controver...
habedi/stack-exchange-dataset
85,735
What is the time complexity of the following loop?
<pre><code>function (n)&#xA; i = 1&#xA; s = 1&#xA; while (s &lt;= n)&#xA; i = i+1&#xA; s = s*i&#xA; print "*"&#xA;end&#xA;</code></pre>&#xA;
time complexity asymptotics
1
What is the time complexity of the following loop? -- (time complexity asymptotics) <pre><code>function (n)&#xA; i = 1&#xA; s = 1&#xA; while (s &lt;= n)&#xA; i = i+1&#xA; s = s*i&#xA; print "*"&#xA;end&#xA;</code></pre>&#xA;
habedi/stack-exchange-dataset
85,771
How do we define a tree in a directed graph?
<p>I am trying to solve the exercise 3.3 in <em>Approximation Algorithms</em> by Vazirani, pg 34. It states </p>&#xA;&#xA;<blockquote>&#xA; <p><strong>3.3</strong> Give an approximation factor preserving reduction from the set cover&#xA; problem to the following problem, thereby showing that it is unlikely to have a ...
graphs terminology
1
How do we define a tree in a directed graph? -- (graphs terminology) <p>I am trying to solve the exercise 3.3 in <em>Approximation Algorithms</em> by Vazirani, pg 34. It states </p>&#xA;&#xA;<blockquote>&#xA; <p><strong>3.3</strong> Give an approximation factor preserving reduction from the set cover&#xA; problem to ...
habedi/stack-exchange-dataset
85,785
Minimum number of states in the DFA
<p>I am trying to solve following problem but unable to solve this. Can anyone tell me how to approach this kind of problems where it is not easy to make DFA.</p>&#xA;&#xA;<blockquote>&#xA; <p>The minimum number of states required to construct a DFA that recognizes the language of strings over the alphabet ${a,b}$ who...
finite automata
1
Minimum number of states in the DFA -- (finite automata) <p>I am trying to solve following problem but unable to solve this. Can anyone tell me how to approach this kind of problems where it is not easy to make DFA.</p>&#xA;&#xA;<blockquote>&#xA; <p>The minimum number of states required to construct a DFA that recogni...
habedi/stack-exchange-dataset
85,791
Neural Network: Why can't we calculate derivatives during forward prop itself?
<p>I have been studying Andrew Ng's Coursera course about Deep Learning. In that he mentions that we calculate the activation functions during the forward pass, and the derivatives $\dfrac{dL}{dz} \ $, $\dfrac{dL}{dw} \ $, and $\dfrac{dL}{db} \ $ during the backward pass.</p>&#xA;&#xA;<p>Consider a single neural node&#...
neural networks backtracking
1
Neural Network: Why can't we calculate derivatives during forward prop itself? -- (neural networks backtracking) <p>I have been studying Andrew Ng's Coursera course about Deep Learning. In that he mentions that we calculate the activation functions during the forward pass, and the derivatives $\dfrac{dL}{dz} \ $, $\dfr...
habedi/stack-exchange-dataset
85,795
A $log(k)$ algorithm for the matroid secretary problem
<p>I'm reading the <a href="https://www.google.co.il/url?sa=t&amp;source=web&amp;rct=j&amp;url=https://www.cs.cornell.edu/~rdk/papers/matsec.pdf&amp;ved=0ahUKEwi0tKTZhp3YAhWFJVAKHauQDvkQFggmMAE&amp;usg=AOvVaw3NOwiyYB5huK7OEDIo73Ls" rel="nofollow noreferrer">following</a> article that presents a $log(k)$ algorithm for y...
equality matroids
1
A $log(k)$ algorithm for the matroid secretary problem -- (equality matroids) <p>I'm reading the <a href="https://www.google.co.il/url?sa=t&amp;source=web&amp;rct=j&amp;url=https://www.cs.cornell.edu/~rdk/papers/matsec.pdf&amp;ved=0ahUKEwi0tKTZhp3YAhWFJVAKHauQDvkQFggmMAE&amp;usg=AOvVaw3NOwiyYB5huK7OEDIo73Ls" rel="nofol...
habedi/stack-exchange-dataset
85,807
Perspective-Three-Point Questions
<p>I'm following <a href="http://iplimage.com/blog/p3p-perspective-point-overview/" rel="nofollow noreferrer">this</a> explanation on the P3P problem and have a few questions.</p>&#xA;&#xA;<ol>&#xA;<li><p>In the heading labeled <strong>Section 1</strong> they project the image plane points onto a <em>unit sphere</em>. ...
computer vision
1
Perspective-Three-Point Questions -- (computer vision) <p>I'm following <a href="http://iplimage.com/blog/p3p-perspective-point-overview/" rel="nofollow noreferrer">this</a> explanation on the P3P problem and have a few questions.</p>&#xA;&#xA;<ol>&#xA;<li><p>In the heading labeled <strong>Section 1</strong> they proje...
habedi/stack-exchange-dataset
85,810
Check if there is only one simple path in graph between nodes x and y`
<p>Let's say we have given simple undirected graph $G$ having $N$ nodes and $M$ bidirectional edges. For given $x$ and $y$ we want to check if in the graph there is only one simple path between them.</p>&#xA;&#xA;<p>What I was thinking for, is that we should find all the cycles in the graph and run bfs from $x$ to $y$,...
algorithms graphs shortest path
1
Check if there is only one simple path in graph between nodes x and y` -- (algorithms graphs shortest path) <p>Let's say we have given simple undirected graph $G$ having $N$ nodes and $M$ bidirectional edges. For given $x$ and $y$ we want to check if in the graph there is only one simple path between them.</p>&#xA;&#xA...
habedi/stack-exchange-dataset
85,821
Get a fixed-size family of k-element subsets
<p>I have an n-element set, and I want to consider families of its k-element subsets of fixed size s. For example, if n = 3, k = 1, s = 2, we have these families:</p>&#xA;&#xA;<pre><code>{{1}, {2}}, {{1}, {3}}, {{2}, {3}}&#xA;</code></pre>&#xA;&#xA;<p>In my problem n, k, s are not so small, e.g. s = n = 50, k = 20.</p>...
algorithms combinatorics
1
Get a fixed-size family of k-element subsets -- (algorithms combinatorics) <p>I have an n-element set, and I want to consider families of its k-element subsets of fixed size s. For example, if n = 3, k = 1, s = 2, we have these families:</p>&#xA;&#xA;<pre><code>{{1}, {2}}, {{1}, {3}}, {{2}, {3}}&#xA;</code></pre>&#xA;&...
habedi/stack-exchange-dataset
85,829
find the missing number in a block of 3 numbers
<p>Given a contiguous sequence of numbers in which each number repeats thrice, there is exactly one missing number. Find the missing number.</p>&#xA;&#xA;<pre><code>eg: 11122333 : Missing number 2&#xA;11122233344455666 Missing number 5&#xA;</code></pre>&#xA;&#xA;<p>I think we can't do better than just going from beginn...
algorithms
1
find the missing number in a block of 3 numbers -- (algorithms) <p>Given a contiguous sequence of numbers in which each number repeats thrice, there is exactly one missing number. Find the missing number.</p>&#xA;&#xA;<pre><code>eg: 11122333 : Missing number 2&#xA;11122233344455666 Missing number 5&#xA;</code></pre>&#x...
habedi/stack-exchange-dataset
85,834
Is the empty string a terminal symbol?
<p>I ask this question with regards to a grammar in Chosmky Normal Form. The definition states that the rules must be of the following forms:</p>&#xA;&#xA;<ol>&#xA;<li>A $\rightarrow$ BC</li>&#xA;<li>A $\rightarrow$ a</li>&#xA;<li>S $\rightarrow$ $\epsilon$</li>&#xA;</ol>&#xA;&#xA;<p>And A,B and C are non-terminal symb...
normal forms chomsky hierarchy
1
Is the empty string a terminal symbol? -- (normal forms chomsky hierarchy) <p>I ask this question with regards to a grammar in Chosmky Normal Form. The definition states that the rules must be of the following forms:</p>&#xA;&#xA;<ol>&#xA;<li>A $\rightarrow$ BC</li>&#xA;<li>A $\rightarrow$ a</li>&#xA;<li>S $\rightarrow...
habedi/stack-exchange-dataset
85,839
Count numbers less than $K$ in array
<p>Let's say we have given array $A$ consisting of $n$ integers, and integer $K$. Now we want to count number of indexes $i$ such that $A_i&lt;K$. What is the easiest way to pre-process the array and answer queries for different $K$ fast. Note that the elements of the array will be small up to $10^5$, so it will be pos...
data structures counting
1
Count numbers less than $K$ in array -- (data structures counting) <p>Let's say we have given array $A$ consisting of $n$ integers, and integer $K$. Now we want to count number of indexes $i$ such that $A_i&lt;K$. What is the easiest way to pre-process the array and answer queries for different $K$ fast. Note that the ...
habedi/stack-exchange-dataset
85,845
Quantum computing - Difference between a binary bit and a Q-bit
<p>I have recently watched this introductory <a href="https://www.youtube.com/watch?v=S52rxZG-zi0" rel="nofollow noreferrer">video</a> on quantum computing where the speaker talks about $n$ Q-bits and the representation of $2^n$ states.</p>&#xA;&#xA;<p>What I didn't get is the word state.How is it different from a clas...
complexity theory computer architecture quantum computing
1
Quantum computing - Difference between a binary bit and a Q-bit -- (complexity theory computer architecture quantum computing) <p>I have recently watched this introductory <a href="https://www.youtube.com/watch?v=S52rxZG-zi0" rel="nofollow noreferrer">video</a> on quantum computing where the speaker talks about $n$ Q-b...
habedi/stack-exchange-dataset
85,850
Minimum number of states in dfa accepting binary number with decimal equivalent divisible by $n$
<p>I was aware of the fact that, if DFA needs to accept binary string with its decimal equivalent divisible by $n$, then it can have minimum $n$ states.</p>&#xA;&#xA;<p>However recently came across following text:</p>&#xA;&#xA;<blockquote>&#xA; <ul>&#xA; <li><strong>If $n$ is power of $2$</strong><br>&#xA; Let $n=2^...
regular languages automata finite automata regular expressions
1
Minimum number of states in dfa accepting binary number with decimal equivalent divisible by $n$ -- (regular languages automata finite automata regular expressions) <p>I was aware of the fact that, if DFA needs to accept binary string with its decimal equivalent divisible by $n$, then it can have minimum $n$ states.</p...
habedi/stack-exchange-dataset
85,851
Time complexity of dequeue function (queues)
<p>Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.  &#xA; </p>&#xA;&#xA;<pre><code>MultiDequeue(Q){&#xA; m = k &#xA; while ((Q is not empty) and (m &gt; 0)) &#xA; { Dequeue(Q) &#xA; m = m – 1 &#xA; }&#xA;}&#xA;</code></pre>&#xA...
algorithms time complexity
1
Time complexity of dequeue function (queues) -- (algorithms time complexity) <p>Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter.  &#xA; </p>&#xA;&#xA;<pre><code>MultiDequeue(Q){&#xA; m = k &#xA; while ((Q is not empty) and (m &gt; 0)) &#xA; ...
habedi/stack-exchange-dataset
85,853
Number of nodes of a parse tree when the Grammar is in CNF?
<p>There happened to be a following question -</p>&#xA;&#xA;<blockquote>&#xA; <p>In any Chomsky Normal Form grammar $G$, how many nodes will all parse trees for terminal strings of length $n&gt;0$ generated by G have?</p>&#xA;</blockquote>&#xA;&#xA;<p>I tried for some examples &amp; arrived at the answer $2^{n}+1$ but...
formal grammars parsers
1
Number of nodes of a parse tree when the Grammar is in CNF? -- (formal grammars parsers) <p>There happened to be a following question -</p>&#xA;&#xA;<blockquote>&#xA; <p>In any Chomsky Normal Form grammar $G$, how many nodes will all parse trees for terminal strings of length $n&gt;0$ generated by G have?</p>&#xA;</bl...
habedi/stack-exchange-dataset
85,861
Systematic approach or algorithm for designing a pushdown automata that accepts a langauge
<p>I understand that designing automatons is mostly a creative process but, a month ago I was having a discussion with a classmate about designing a NPDA or a DPDA that accepts a non-trivial language (trivial meaning, it is straightforward to design a PDA that accepts it) and he gave me a solution while mentioning an a...
algorithms formal languages pushdown automata
1
Systematic approach or algorithm for designing a pushdown automata that accepts a langauge -- (algorithms formal languages pushdown automata) <p>I understand that designing automatons is mostly a creative process but, a month ago I was having a discussion with a classmate about designing a NPDA or a DPDA that accepts a...
habedi/stack-exchange-dataset
85,869
Reduction function from A to its complement
<p>I wanted to ask a simple question.</p>&#xA;&#xA;<p>Lets say we have A, language of all the words with more then 3 letters. so it belongs to R.</p>&#xA;&#xA;<p>and its complement , is the language of all words with less then 3 letters.</p>&#xA;&#xA;<p>is it possible to say that I can define a turing reduction between...
complexity theory formal languages turing machines reductions
1
Reduction function from A to its complement -- (complexity theory formal languages turing machines reductions) <p>I wanted to ask a simple question.</p>&#xA;&#xA;<p>Lets say we have A, language of all the words with more then 3 letters. so it belongs to R.</p>&#xA;&#xA;<p>and its complement , is the language of all wor...
habedi/stack-exchange-dataset
85,870
Time complexity of Prim's algorithm
<p>There is this Prim's algorithm I am studying, the time complexity of which is $O(n^2)$ (in the adjacency matrix).</p>&#xA;&#xA;<p>As far as I have understood,that is because we have to ckeck all the nodes per every node, that is, when checking the first node's best edge, we have to check edges from the current node ...
algorithm analysis runtime analysis adjacency matrix prims algorithm
1
Time complexity of Prim's algorithm -- (algorithm analysis runtime analysis adjacency matrix prims algorithm) <p>There is this Prim's algorithm I am studying, the time complexity of which is $O(n^2)$ (in the adjacency matrix).</p>&#xA;&#xA;<p>As far as I have understood,that is because we have to ckeck all the nodes pe...
habedi/stack-exchange-dataset
85,872
Is a Turing machine without the ability to write on blank cells less powerful than standard Turing?
<blockquote>&#xA; <p>Is a Turing machine without the ability to write on blank cells less powerful than standard Turing?</p>&#xA;</blockquote>&#xA;&#xA;<p>I think the answer is yes but i'm unable to find a computation that standard Turing machine can do but this machine can't.</p>&#xA;&#xA;<p>Any ideas?</p>&#xA;
formal languages turing machines computability automata
1
Is a Turing machine without the ability to write on blank cells less powerful than standard Turing? -- (formal languages turing machines computability automata) <blockquote>&#xA; <p>Is a Turing machine without the ability to write on blank cells less powerful than standard Turing?</p>&#xA;</blockquote>&#xA;&#xA;<p>I t...
habedi/stack-exchange-dataset
85,879
Genetic Algorithm Getting Stuck on Certain Values
<p>I'm attempting to teach myself something about genetic algorithms. I found a simple tutorial on it <a href="http://www.ai-junkie.com/ga/intro/gat1.html" rel="nofollow noreferrer">here</a>, and it made enough sense that I was able implement the suggested example of generating a string of single digit numbers and simp...
simulation floating point genetic algorithms
1
Genetic Algorithm Getting Stuck on Certain Values -- (simulation floating point genetic algorithms) <p>I'm attempting to teach myself something about genetic algorithms. I found a simple tutorial on it <a href="http://www.ai-junkie.com/ga/intro/gat1.html" rel="nofollow noreferrer">here</a>, and it made enough sense tha...
habedi/stack-exchange-dataset
85,881
simple but (seemingly?) tricky recurrence
<p>I'm <a href="https://math.stackexchange.com/questions/2517611/simple-but-seemingly-tricky-recurrence">cross-posting</a> from math stack exchange after receiving no answers there.</p>&#xA;&#xA;<p>I came across the following very simple recurrence-style expression but am having trouble solving it:&#xA;$$T(2n) \in \the...
asymptotics recurrence relation
1
simple but (seemingly?) tricky recurrence -- (asymptotics recurrence relation) <p>I'm <a href="https://math.stackexchange.com/questions/2517611/simple-but-seemingly-tricky-recurrence">cross-posting</a> from math stack exchange after receiving no answers there.</p>&#xA;&#xA;<p>I came across the following very simple rec...
habedi/stack-exchange-dataset
85,896
Should check all $2^n$ possibilities in array?
<p>Suppose I have an array of numbers, and a function <code>boolean isPrime(int n)</code> that I'm allowed to use.</p>&#xA;&#xA;<p><code>Boolean isPrime(int n)</code> receives a number <code>n</code> and return <code>true</code> if the received number is a prime and <code>false</code> otherwise.</p>&#xA;&#xA;<p>I need ...
algorithms arrays
1
Should check all $2^n$ possibilities in array? -- (algorithms arrays) <p>Suppose I have an array of numbers, and a function <code>boolean isPrime(int n)</code> that I'm allowed to use.</p>&#xA;&#xA;<p><code>Boolean isPrime(int n)</code> receives a number <code>n</code> and return <code>true</code> if the received numbe...
habedi/stack-exchange-dataset
85,898
Finding running time
<p>Apologies for this simple question. I found it in the book Algorithms by Sedgewick and Wayne.</p>&#xA;&#xA;<p>Give a formula to predict the running time of a program for a problem of size N when doubling experiments have shown that the doubling factor is $2^b$ and the running time for problems of size N0 is T.</p>&#...
runtime analysis
1
Finding running time -- (runtime analysis) <p>Apologies for this simple question. I found it in the book Algorithms by Sedgewick and Wayne.</p>&#xA;&#xA;<p>Give a formula to predict the running time of a program for a problem of size N when doubling experiments have shown that the doubling factor is $2^b$ and the runni...
habedi/stack-exchange-dataset
85,902
Why is $MOD_{p^k}P=MOD_pP$ at every prime $p$?
<p><a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:M#modkp" rel="nofollow noreferrer">Complexity zoo</a> states that $MOD_{2^k}P=MOD_2P$.</p>&#xA;&#xA;<p>It is clear that if $MOD_2P$ accepts (number of accepting paths is off) then $MOD_{2^k}P$ accepts.</p>&#xA;&#xA;<p>Why is it clear that if $MOD_2P$ rejects...
complexity theory complexity classes
1
Why is $MOD_{p^k}P=MOD_pP$ at every prime $p$? -- (complexity theory complexity classes) <p><a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:M#modkp" rel="nofollow noreferrer">Complexity zoo</a> states that $MOD_{2^k}P=MOD_2P$.</p>&#xA;&#xA;<p>It is clear that if $MOD_2P$ accepts (number of accepting paths is...
habedi/stack-exchange-dataset
85,910
Extremal related question regarding Intersection of neighbourhood of vertices
<p>What is the maximum number of edges that a simple directed graph on $n$ vertices can have, if the graph has the following restriction.</p>&#xA;&#xA;<p>Size of Intersection of Neighbourhood of any pair of vertices is at most $k$?</p>&#xA;&#xA;<p>Neighbourhood is defined as follows.&#xA;If a vertex $v$ has directed ed...
graphs
1
Extremal related question regarding Intersection of neighbourhood of vertices -- (graphs) <p>What is the maximum number of edges that a simple directed graph on $n$ vertices can have, if the graph has the following restriction.</p>&#xA;&#xA;<p>Size of Intersection of Neighbourhood of any pair of vertices is at most $k$...
habedi/stack-exchange-dataset
85,917
Applying a 1x1 convolution on an existing layer
<p>I am looking at the following <a href="https://github.com/mithi/semantic-segmentation" rel="nofollow noreferrer">github</a>. In this, <code>layer3</code> has a shape of <code>(1, 20, 72, 256)</code> and I interpret this is as a single layer having 20 input nodes and mapping to 72 output nodes and there are $256$ fil...
neural networks
1
Applying a 1x1 convolution on an existing layer -- (neural networks) <p>I am looking at the following <a href="https://github.com/mithi/semantic-segmentation" rel="nofollow noreferrer">github</a>. In this, <code>layer3</code> has a shape of <code>(1, 20, 72, 256)</code> and I interpret this is as a single layer having ...
habedi/stack-exchange-dataset
85,921
black-box function optimization with binary vector input: terminology and NP-hardness proof
<p>I have a black-box function optimization problem: &#xA;$$\arg\max_{\vec{x}} \; f(\vec{x}, \vec{y}) \\\text{subject to } \vec{x} \in \mathbb{Z}_2^N, \|\vec{x}\|_1=K, K&lt;N, \vec{y} \in \mathbb{Z}_2^M$$</p>&#xA;&#xA;<p>The function $f(\cdot)$ is a black-box function whose output I can only simulate: I cannot access i...
complexity theory optimization np complete np hard
1
black-box function optimization with binary vector input: terminology and NP-hardness proof -- (complexity theory optimization np complete np hard) <p>I have a black-box function optimization problem: &#xA;$$\arg\max_{\vec{x}} \; f(\vec{x}, \vec{y}) \\\text{subject to } \vec{x} \in \mathbb{Z}_2^N, \|\vec{x}\|_1=K, K&lt...
habedi/stack-exchange-dataset
85,926
Manipulating Intersection of oracles
<p>Suppose for different classes $A,B,C$ we have that $A\subseteq P^B$ and $A\subseteq P^C$.</p>&#xA;&#xA;<ol>&#xA;<li><p>We have $A\subseteq P^{B}\cap P^{C}$. Does it also mean $A\subseteq P^{B\cap C}$?</p></li>&#xA;<li><p>Supposing $A\subseteq P^{B\cap C}$ also holds does it also give $A\subseteq {B\cap C}$?</p></li>...
oracle machines oracles
1
Manipulating Intersection of oracles -- (oracle machines oracles) <p>Suppose for different classes $A,B,C$ we have that $A\subseteq P^B$ and $A\subseteq P^C$.</p>&#xA;&#xA;<ol>&#xA;<li><p>We have $A\subseteq P^{B}\cap P^{C}$. Does it also mean $A\subseteq P^{B\cap C}$?</p></li>&#xA;<li><p>Supposing $A\subseteq P^{B\cap...
habedi/stack-exchange-dataset
85,929
Efficient point grouping algorithm
<p>I'm trying to find a good solution to the following problem:&#xA;Given a set of 3d real number coordinates inside a cube, I want to group them into containers. The containers should contain all elements that are in predefined distance to at least one of the other elements. Should two elements be closer than a predef...
algorithms efficiency
1
Efficient point grouping algorithm -- (algorithms efficiency) <p>I'm trying to find a good solution to the following problem:&#xA;Given a set of 3d real number coordinates inside a cube, I want to group them into containers. The containers should contain all elements that are in predefined distance to at least one of t...
habedi/stack-exchange-dataset
85,932
Maximum number of different substrings in big string
<p>I'm trying to find the maximum number of different substrings of string consisting only of lowercase letters 'a' - 'z', if the length of string can be up to $5000$</p>&#xA;&#xA;<p>Firstly, I was thinking that the number of substrings is $\frac{n\cdot(n-1)}{2}$ but then I noticed that a lot of the substrings will be ...
strings substrings
1
Maximum number of different substrings in big string -- (strings substrings) <p>I'm trying to find the maximum number of different substrings of string consisting only of lowercase letters 'a' - 'z', if the length of string can be up to $5000$</p>&#xA;&#xA;<p>Firstly, I was thinking that the number of substrings is $\f...
habedi/stack-exchange-dataset
85,938
Difference between Tail-Recursion and structural recursion
<p>Is there any difference between structural-recursion and Tail-recursion or they both are same? I see that in both of these recursions , the recursive function is called on the subset of the orignal items.</p>&#xA;
recursion
1
Difference between Tail-Recursion and structural recursion -- (recursion) <p>Is there any difference between structural-recursion and Tail-recursion or they both are same? I see that in both of these recursions , the recursive function is called on the subset of the orignal items.</p>&#xA;
habedi/stack-exchange-dataset
85,944
Intuition behind the Master Theorem
<p>The Master Theorem provides a method of solving recurrence relations for divide-and-conquer algorithms. It was first presented to me in my intro algorithms class as the following: </p>&#xA;&#xA;<blockquote>&#xA; <p>For a recurrence of the form $T(n) = aT(\frac{n}{b})+f(n)$&#xA; with constants $a \ge 1$ and $b&gt;1...
recurrence relation master theorem
1
Intuition behind the Master Theorem -- (recurrence relation master theorem) <p>The Master Theorem provides a method of solving recurrence relations for divide-and-conquer algorithms. It was first presented to me in my intro algorithms class as the following: </p>&#xA;&#xA;<blockquote>&#xA; <p>For a recurrence of the f...
habedi/stack-exchange-dataset
85,957
Figuring out whether LL(1) grammar has an $\varepsilon$-free variant
<p>This question arose out of a concrete problem I had, which was to find an $\varepsilon$-free variant of the following LL(1) grammar $G_0$ that I developed for a Lisp-like language $L$ (I found a monotone LR(0) variant):</p>&#xA;&#xA;<p>$$&#xA;\begin{array} \\&#xA;P &amp; \rightarrow &amp; (EP \\&#xA; &amp; | &amp; ...
formal grammars
1
Figuring out whether LL(1) grammar has an $\varepsilon$-free variant -- (formal grammars) <p>This question arose out of a concrete problem I had, which was to find an $\varepsilon$-free variant of the following LL(1) grammar $G_0$ that I developed for a Lisp-like language $L$ (I found a monotone LR(0) variant):</p>&#xA...
habedi/stack-exchange-dataset
85,963
What is static complexity?
<p><strong>Definition :</strong> Kolmogorov complexity is a static complexity measure that captures the difficulty of describing a string.</p>&#xA;<p>For example, the string consisting of three million zeroes can be described with fewer than three million symbols (as in this sentence)</p>&#xA;<p>From wikipedia</p>&#xA;...
complexity theory terminology kolmogorov complexity
1
What is static complexity? -- (complexity theory terminology kolmogorov complexity) <p><strong>Definition :</strong> Kolmogorov complexity is a static complexity measure that captures the difficulty of describing a string.</p>&#xA;<p>For example, the string consisting of three million zeroes can be described with fewer...
habedi/stack-exchange-dataset
85,968
How to find the minimal path cost from left edge of a grid to the right edge using dynamic programming?
<blockquote>&#xA; <p>I need to find the minimal path cost from left edge of a $n\times n$ grid to the right edge where each node has some non-negative weight $cost(i,j)$. $i$ represents horizontal coordinates while $j$ represents vertical coordinates. Only the following movements are allowed in the grid:&#xA; $$&#xA;...
algorithms graphs shortest path
1
How to find the minimal path cost from left edge of a grid to the right edge using dynamic programming? -- (algorithms graphs shortest path) <blockquote>&#xA; <p>I need to find the minimal path cost from left edge of a $n\times n$ grid to the right edge where each node has some non-negative weight $cost(i,j)$. $i$ rep...
habedi/stack-exchange-dataset
85,973
Compute growth of function
<p>Suppose that $p&gt;0$ and $n&gt;0$ is a natural number. How do I prove that</p>&#xA;&#xA;<p>$$ \sum_{k=1}^n k^p = 1^p + 2^p + \dots +n^p \sim \frac{1}{p+1}n^{p+1}=\Theta(n^{p+1})$$</p>&#xA;&#xA;<p>for $n \rightarrow \infty$?</p>&#xA;
mathematical foundations
1
Compute growth of function -- (mathematical foundations) <p>Suppose that $p&gt;0$ and $n&gt;0$ is a natural number. How do I prove that</p>&#xA;&#xA;<p>$$ \sum_{k=1}^n k^p = 1^p + 2^p + \dots +n^p \sim \frac{1}{p+1}n^{p+1}=\Theta(n^{p+1})$$</p>&#xA;&#xA;<p>for $n \rightarrow \infty$?</p>&#xA;
habedi/stack-exchange-dataset
85,979
Questions about Amdahl's law?
<p>Doing exam papers now and I came across two questions which I cannot get my head around sadly. Both are regarding Amdahl's law and Parallel Computing but they seem rather simple and frustratingly enough I cannot really find a definitive answer to any of those questions.</p>&#xA;<p>The questions are:</p>&#xA;<blockqu...
parallel computing linear programming process scheduling
1
Questions about Amdahl's law? -- (parallel computing linear programming process scheduling) <p>Doing exam papers now and I came across two questions which I cannot get my head around sadly. Both are regarding Amdahl's law and Parallel Computing but they seem rather simple and frustratingly enough I cannot really find a...
habedi/stack-exchange-dataset
85,981
How to get Loop invariants to prove program is correct in Hoare logic
<p>start off stating the definition of a loop invariant. It is a condition that must be true at the start of the loop and must be true after each iteration of the loop. I understand what it is but i have trouble trying to come up with one.</p>&#xA;&#xA;<p>Here below is a program which i know is correct and I have state...
loops loop invariants hoare logic
1
How to get Loop invariants to prove program is correct in Hoare logic -- (loops loop invariants hoare logic) <p>start off stating the definition of a loop invariant. It is a condition that must be true at the start of the loop and must be true after each iteration of the loop. I understand what it is but i have trouble...
habedi/stack-exchange-dataset
85,985
Is this graph algorithm more efficient?
<p>Suppose we are given a digraph A. We need to calculate its connectivity digraph B.</p>&#xA;&#xA;<p>I conceived two algorithms:</p>&#xA;&#xA;<p>1.</p>&#xA;&#xA;<ul>&#xA;<li><p>Set X = A.</p></li>&#xA;<li><p>Loop</p></li>&#xA;<li><p>Set Y = X*A united with identity</p></li>&#xA;<li><p>Stop the loop if Y = X</p></li>&#...
algorithms graphs efficiency
1
Is this graph algorithm more efficient? -- (algorithms graphs efficiency) <p>Suppose we are given a digraph A. We need to calculate its connectivity digraph B.</p>&#xA;&#xA;<p>I conceived two algorithms:</p>&#xA;&#xA;<p>1.</p>&#xA;&#xA;<ul>&#xA;<li><p>Set X = A.</p></li>&#xA;<li><p>Loop</p></li>&#xA;<li><p>Set Y = X*A ...
habedi/stack-exchange-dataset
86,000
How would i go about calculating the Big Theta of the following nested loop?
<pre><code>for i = 0 ... log(n) - 1&#xA; for j = 2^i + 1 ... 2^(i + 1)&#xA; [code with Big-Theta(1) running time]&#xA;</code></pre>&#xA;&#xA;<p>Given this piece of code the outer loop runs log(n) times. But I'm confused as to how to try to calculate the running time of the second loop so as to multiply them....
asymptotics
1
How would i go about calculating the Big Theta of the following nested loop? -- (asymptotics) <pre><code>for i = 0 ... log(n) - 1&#xA; for j = 2^i + 1 ... 2^(i + 1)&#xA; [code with Big-Theta(1) running time]&#xA;</code></pre>&#xA;&#xA;<p>Given this piece of code the outer loop runs log(n) times. But I'm conf...
habedi/stack-exchange-dataset
86,005
Is graph search of shortest (optimal) path an instance of optimisation?
<ul>&#xA;<li>I am familiar with mathematical (gradient-based) optimisation methods, some heuristic methods like GAs or linear programming methods like simplex algorithm.</li>&#xA;<li>I am not too familiar with graphs / trees and their search.</li>&#xA;<li>But it does seem like all possible solutions can be represented ...
optimization trees search
1
Is graph search of shortest (optimal) path an instance of optimisation? -- (optimization trees search) <ul>&#xA;<li>I am familiar with mathematical (gradient-based) optimisation methods, some heuristic methods like GAs or linear programming methods like simplex algorithm.</li>&#xA;<li>I am not too familiar with graphs ...
habedi/stack-exchange-dataset
86,011
Is it possible to prove Turing irreducibility
<p>Given two languages $L_1$ and $L_2$, is there a known way to show that $L_1\not\leq_T L_2$?</p>&#xA;&#xA;<p>In other words, is it possible proving that there is no Turing reduction from $L_1$ to $L_2$?</p>&#xA;
complexity theory turing machines computability reductions
1
Is it possible to prove Turing irreducibility -- (complexity theory turing machines computability reductions) <p>Given two languages $L_1$ and $L_2$, is there a known way to show that $L_1\not\leq_T L_2$?</p>&#xA;&#xA;<p>In other words, is it possible proving that there is no Turing reduction from $L_1$ to $L_2$?</p>&#...
habedi/stack-exchange-dataset
86,015
How to prove that a custom iterative algorithm will determine all shortest paths to a graph node?
<p>I'm not sure what the following algorithm does but it seems that it calculates the shortest paths from a node $t$. </p>&#xA;&#xA;<p>Initially we're given a graph $G=(V,E)$ with non-negative weights $c(e) \ge0$ for each edge $e\in E$ and we're given a node $t\in V$.</p>&#xA;&#xA;<p>The algorithm is as follows:</p>&#x...
algorithms graphs shortest path
1
How to prove that a custom iterative algorithm will determine all shortest paths to a graph node? -- (algorithms graphs shortest path) <p>I'm not sure what the following algorithm does but it seems that it calculates the shortest paths from a node $t$. </p>&#xA;&#xA;<p>Initially we're given a graph $G=(V,E)$ with non-n...
habedi/stack-exchange-dataset
86,016
Is there any language for which $\overline{L^*}=\big(\overline L\big)^*$?
<p>This question was asked in peter linz exercise. I have tried languages such as $\phi,\epsilon,\Sigma^*$. </p>&#xA;
formal languages
1
Is there any language for which $\overline{L^*}=\big(\overline L\big)^*$? -- (formal languages) <p>This question was asked in peter linz exercise. I have tried languages such as $\phi,\epsilon,\Sigma^*$. </p>&#xA;
habedi/stack-exchange-dataset
86,019
How to proof UNIQUE-SAT is in $\Delta^p_2$
<p>How to proof UNIQUE-SAT is in $\Delta^p_2$ or in $P^{sat}$</p>&#xA;&#xA;<p>1) when given a bool formula can I ask oracle whether the given formula has at least one satisfying truth assignment and whether it has at least two?</p>&#xA;&#xA;<p>2) Is UNIQUE-SAT in NP?</p>&#xA;
complexity theory satisfiability
1
How to proof UNIQUE-SAT is in $\Delta^p_2$ -- (complexity theory satisfiability) <p>How to proof UNIQUE-SAT is in $\Delta^p_2$ or in $P^{sat}$</p>&#xA;&#xA;<p>1) when given a bool formula can I ask oracle whether the given formula has at least one satisfying truth assignment and whether it has at least two?</p>&#xA;&#x...
habedi/stack-exchange-dataset
86,024
What is the difference between language hierarchy and Grammar hierarchy for LL and LR?
<p>Till now I have believed that a LL language is a language generated by a LL grammar. Same goes for LR.</p>&#xA;&#xA;<p>Now I know some of the hierarchies such as $LL(1)\subset LR(1)$. I used to think that the hierarchy is valid for language as well as grammar i,e if a grammar is LL1 then it must be LR(1); If a langu...
formal languages formal grammars
1
What is the difference between language hierarchy and Grammar hierarchy for LL and LR? -- (formal languages formal grammars) <p>Till now I have believed that a LL language is a language generated by a LL grammar. Same goes for LR.</p>&#xA;&#xA;<p>Now I know some of the hierarchies such as $LL(1)\subset LR(1)$. I used t...
habedi/stack-exchange-dataset
86,025
Are all relational schemas with partial dependencies not in 3NF?
<p>From Database Management Systems, by Raghu Ramakrishnan, ‎Johannes Gehrk</p>&#xA;&#xA;<blockquote>&#xA; <p>Let <code>R</code> be a relation schema, <code>F</code> be the set of functional&#xA; dependencies (FDs) given to hold over <code>R</code> , <code>X</code> be a subset of the&#xA; attributes of <cod...
database theory databases
1
Are all relational schemas with partial dependencies not in 3NF? -- (database theory databases) <p>From Database Management Systems, by Raghu Ramakrishnan, ‎Johannes Gehrk</p>&#xA;&#xA;<blockquote>&#xA; <p>Let <code>R</code> be a relation schema, <code>F</code> be the set of functional&#xA; dependencies (FDs) giv...
habedi/stack-exchange-dataset
86,029
Can LP for matroid polytopes be solved using the greedy algorithm?
<p>For general linear programming (LP), i.e. optimization of a linear objective over a general polyhedron, to the best of my knowledge/recollection one can use the simplex algorithm (or hypothetically, although it's not done often in practice, the ellipsoid algorithm).</p>&#xA;<p>Matroids are well known for the propert...
linear programming greedy algorithms matroids
1
Can LP for matroid polytopes be solved using the greedy algorithm? -- (linear programming greedy algorithms matroids) <p>For general linear programming (LP), i.e. optimization of a linear objective over a general polyhedron, to the best of my knowledge/recollection one can use the simplex algorithm (or hypothetically, ...
habedi/stack-exchange-dataset
86,043
Why the Goemans-Williamson's MAX-CUT algorithm relax the variables to vectors of $n-$dimension on unit sphere?
<p>Why not to some constant like 3 or 4 dimension? I suspect that it is because Cholesky Decompostion will work only for $n \times n$ matrix $B$ where $B^TB = P$ where $P$ is a semidefinite matrix. Is it true? Or there is something else?</p>&#xA;
algorithms approximation max cut
1
Why the Goemans-Williamson's MAX-CUT algorithm relax the variables to vectors of $n-$dimension on unit sphere? -- (algorithms approximation max cut) <p>Why not to some constant like 3 or 4 dimension? I suspect that it is because Cholesky Decompostion will work only for $n \times n$ matrix $B$ where $B^TB = P$ where $P$...
habedi/stack-exchange-dataset