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
53,848
How convert instances of a language efficiently into 3SAT instances?
<p>The following question is from Sanjeev Arora and Boaz Barak ( not homework )</p>&#xA;&#xA;<blockquote>&#xA; <p>Show that for every time constructible&#xA; $T:N \to N$, if $L \in NTIME(T(n))$ then we can give a polynomial-time Karp reduction from $L$ to $3SAT$ that transforms instances of size $n$&#xA; into 3CNF f...
complexity theory nondeterminism
1
How convert instances of a language efficiently into 3SAT instances? -- (complexity theory nondeterminism) <p>The following question is from Sanjeev Arora and Boaz Barak ( not homework )</p>&#xA;&#xA;<blockquote>&#xA; <p>Show that for every time constructible&#xA; $T:N \to N$, if $L \in NTIME(T(n))$ then we can give ...
habedi/stack-exchange-dataset
53,853
Writing context free grammar
<p>I have the following language:</p>&#xA;&#xA;<p>{0<sup>m</sup>1<sup>n</sup>0<sup>n</sup>1<sup>m</sup> | m,n ≠ 0}</p>&#xA;&#xA;<p>I was wanting to write Context-free grammar for it. I'm a little confused&#xA;because the rule doesn't mention that m and n are not equal to each other, so could we treat them in a case as ...
formal languages context free formal grammars
1
Writing context free grammar -- (formal languages context free formal grammars) <p>I have the following language:</p>&#xA;&#xA;<p>{0<sup>m</sup>1<sup>n</sup>0<sup>n</sup>1<sup>m</sup> | m,n ≠ 0}</p>&#xA;&#xA;<p>I was wanting to write Context-free grammar for it. I'm a little confused&#xA;because the rule doesn't mentio...
habedi/stack-exchange-dataset
53,857
Deterministic vs. Non-Deterministic PDA?
<p>The following is an example of language $a^nb^n$ where $n \geq 1$</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/xRAmS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xRAmS.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>From what I have heard that in <em>finite state machines</em> if you ...
automata pushdown automata nondeterminism
1
Deterministic vs. Non-Deterministic PDA? -- (automata pushdown automata nondeterminism) <p>The following is an example of language $a^nb^n$ where $n \geq 1$</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/xRAmS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/xRAmS.png" alt="enter image description here"></...
habedi/stack-exchange-dataset
53,871
Check if a tree is formed by 3 subtrees with given number of nodes
<p>I have run into a contest problem (ACM like) that sounds like this:</p>&#xA;&#xA;<p><em>Input:</em> a tree of $N$ nodes; integers $X,Y,Z$ such that $X+Y+Z=N$<br>&#xA;<em>Question:</em> Can the tree be partitioned into three trees of $X,Y,Z$ nodes by removing only two edges?</p>&#xA;&#xA;<p>I am promised that $N \le...
algorithms trees dynamic programming
1
Check if a tree is formed by 3 subtrees with given number of nodes -- (algorithms trees dynamic programming) <p>I have run into a contest problem (ACM like) that sounds like this:</p>&#xA;&#xA;<p><em>Input:</em> a tree of $N$ nodes; integers $X,Y,Z$ such that $X+Y+Z=N$<br>&#xA;<em>Question:</em> Can the tree be partit...
habedi/stack-exchange-dataset
53,875
On graph isomorphism over exponential word sizes
<p>Is it known Graph isomorphism can be done in poly time if we allow exponential word sizes?</p>&#xA;&#xA;<p>(Shamir's poly time Integer Factoring algorithm is over exponential word sizes).</p>&#xA;
complexity theory time complexity space complexity polynomial time graph isomorphism
1
On graph isomorphism over exponential word sizes -- (complexity theory time complexity space complexity polynomial time graph isomorphism) <p>Is it known Graph isomorphism can be done in poly time if we allow exponential word sizes?</p>&#xA;&#xA;<p>(Shamir's poly time Integer Factoring algorithm is over exponential wor...
habedi/stack-exchange-dataset
53,878
Is there a complexity metric for finite state machines?
<p>I'm working on evolving Turing machines (with binary symbols / infinite tape) for simple operations (e.g. sorting) using genetic algorithms. I'm interested in using the complexity of the FSM for each Turing machine as one of the criteria to guide the evolution process.</p>&#xA;&#xA;<p>However, I couldn't find any re...
turing machines finite automata
1
Is there a complexity metric for finite state machines? -- (turing machines finite automata) <p>I'm working on evolving Turing machines (with binary symbols / infinite tape) for simple operations (e.g. sorting) using genetic algorithms. I'm interested in using the complexity of the FSM for each Turing machine as one of...
habedi/stack-exchange-dataset
53,879
Does hashing under the Simple Uniform Hashing Assumption battle worst-case adversaries the same way quick sort does?
<p>One common way for algorithms to battle adversarial inputs is by acting randomly. One popular example is quicksort and choosing pivots randomly (this sort of notions is explained well in section 5.3 in CLRS 3rd edition page 122 where by acting randomly we manage to impose a distribution on our inputs).</p>&#xA;&#xA;...
data structures randomized algorithms hash hash tables
1
Does hashing under the Simple Uniform Hashing Assumption battle worst-case adversaries the same way quick sort does? -- (data structures randomized algorithms hash hash tables) <p>One common way for algorithms to battle adversarial inputs is by acting randomly. One popular example is quicksort and choosing pivots rando...
habedi/stack-exchange-dataset
53,882
Can you form a group with assembly instructions under the MIPS-32 architecture?
<p>Would it be possible to form such a group using the <code>ADD</code> instruction and the <code>NOT</code> instruction?</p>&#xA;
group theory
1
Can you form a group with assembly instructions under the MIPS-32 architecture? -- (group theory) <p>Would it be possible to form such a group using the <code>ADD</code> instruction and the <code>NOT</code> instruction?</p>&#xA;
habedi/stack-exchange-dataset
53,898
Lower Bounds for Size of Independent Set in a Graph?
<p>I recently learnt that for any instance of a k-SAT problem with $m$ clauses and $n$ literals , we have an assignment of literals such that at least $m(1 - 2^{-k})$ clauses are satisfied.</p>&#xA;&#xA;<p>I was wondering if we can we show a (non trivial) lower bound of the kind that any graph $G = (V,E)$ has an indepe...
graphs satisfiability lower bounds
1
Lower Bounds for Size of Independent Set in a Graph? -- (graphs satisfiability lower bounds) <p>I recently learnt that for any instance of a k-SAT problem with $m$ clauses and $n$ literals , we have an assignment of literals such that at least $m(1 - 2^{-k})$ clauses are satisfied.</p>&#xA;&#xA;<p>I was wondering if we...
habedi/stack-exchange-dataset
53,901
How can I check constraints on my state machine behaviour?
<p>My background is fairly practical rather than theoretical, so this question may be a bit basic.</p>&#xA;&#xA;<p>I have a state machine with events, and events may optionally trigger action functions to be called as part of the state transition. In practice, actions functions do things like lighting LEDs. The state...
programming languages proof techniques automated theorem proving
1
How can I check constraints on my state machine behaviour? -- (programming languages proof techniques automated theorem proving) <p>My background is fairly practical rather than theoretical, so this question may be a bit basic.</p>&#xA;&#xA;<p>I have a state machine with events, and events may optionally trigger action...
habedi/stack-exchange-dataset
53,902
Rate Monotonic First Fit vs. Rate Monotonic Next Fit vs. Proportionate Fair
<p>What would an example of a set of tasks be, where RMFF, RMNF and P-Fair all result in a different number of processors required?</p>&#xA;
runtime analysis parallel computing scheduling real time multi tasking
1
Rate Monotonic First Fit vs. Rate Monotonic Next Fit vs. Proportionate Fair -- (runtime analysis parallel computing scheduling real time multi tasking) <p>What would an example of a set of tasks be, where RMFF, RMNF and P-Fair all result in a different number of processors required?</p>&#xA;
habedi/stack-exchange-dataset
53,908
Without primes in $P$ does integer factorization lie in $coNP$?
<p>In integer factorization we ask 'Given $N$ is there a $a\in[2,\sqrt{N}+1]$ such that $a|N$?'.</p>&#xA;&#xA;<p>Is the above problem in coNP because we know primes is in $P$? </p>&#xA;&#xA;<p>That is there is no such factor $a$ of $N$ iff $N$ is prime and we have AKS certificate.</p>&#xA;&#xA;<p>So was it not known pr...
factoring co np
1
Without primes in $P$ does integer factorization lie in $coNP$? -- (factoring co np) <p>In integer factorization we ask 'Given $N$ is there a $a\in[2,\sqrt{N}+1]$ such that $a|N$?'.</p>&#xA;&#xA;<p>Is the above problem in coNP because we know primes is in $P$? </p>&#xA;&#xA;<p>That is there is no such factor $a$ of $N$...
habedi/stack-exchange-dataset
53,912
Question simplifying boolean expression
<p>This is what I have so far, so I just want to know if I am doing everything right or wrong. I am novice in the topic.</p>&#xA;&#xA;<p>I have been given:</p>&#xA;&#xA;<p>$(A \oplus B) \land \neg A \lor A$</p>&#xA;&#xA;<ul>&#xA;<li>XOR = $\oplus$</li>&#xA;</ul>&#xA;&#xA;<p>By order of operations regroup:</p>&#xA;&#xA;...
boolean algebra
1
Question simplifying boolean expression -- (boolean algebra) <p>This is what I have so far, so I just want to know if I am doing everything right or wrong. I am novice in the topic.</p>&#xA;&#xA;<p>I have been given:</p>&#xA;&#xA;<p>$(A \oplus B) \land \neg A \lor A$</p>&#xA;&#xA;<ul>&#xA;<li>XOR = $\oplus$</li>&#xA;</...
habedi/stack-exchange-dataset
53,914
3-partition problem: why $b/4 < x_i < b/2$?
<p>Why does the definition of the 3-partition problem contain the condition&#xA;$$\frac{B}{4}&lt;x_i&lt;\frac{B}{2}?$$ </p>&#xA;&#xA;<p>I don't understand why leaving out this condition changes the 3-partition problem.</p>&#xA;
complexity theory partition problem
1
3-partition problem: why $b/4 < x_i < b/2$? -- (complexity theory partition problem) <p>Why does the definition of the 3-partition problem contain the condition&#xA;$$\frac{B}{4}&lt;x_i&lt;\frac{B}{2}?$$ </p>&#xA;&#xA;<p>I don't understand why leaving out this condition changes the 3-partition problem.</p>&#xA;
habedi/stack-exchange-dataset
53,917
Proof that MAX CLIQUE is NP-Hard
<p>My question is simple: does any body know where can I find the proof that MAX CLIQUE is NP-HARD?</p>&#xA;&#xA;<p><strong>Remarks:</strong></p>&#xA;&#xA;<p>MAX CLIQUE is the decision problem defined as follows:Given a graph $G$ and $k&gt;0$. Does the graph $G$ contain a maximum clique of size $k$?</p>&#xA;&#xA;<p>I h...
complexity theory np hard decision problem np
1
Proof that MAX CLIQUE is NP-Hard -- (complexity theory np hard decision problem np) <p>My question is simple: does any body know where can I find the proof that MAX CLIQUE is NP-HARD?</p>&#xA;&#xA;<p><strong>Remarks:</strong></p>&#xA;&#xA;<p>MAX CLIQUE is the decision problem defined as follows:Given a graph $G$ and $k...
habedi/stack-exchange-dataset
53,931
Why are Complexity Notations Called Asymptotic?
<p>Why do we use the term "asymptotic" in complexity. Although I know what an asymptote is, but what is an asymptote doing here?</p>&#xA;
complexity theory algorithm analysis terminology landau notation notation
1
Why are Complexity Notations Called Asymptotic? -- (complexity theory algorithm analysis terminology landau notation notation) <p>Why do we use the term "asymptotic" in complexity. Although I know what an asymptote is, but what is an asymptote doing here?</p>&#xA;
habedi/stack-exchange-dataset
53,936
Why is word-addressable the exception, not the rule?
<p>As stated on <a href="https://en.wikipedia.org/wiki/Memory_address" rel="noreferrer">Wikipedia</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Most modern computers are byte-addressable </p>&#xA;</blockquote>&#xA;&#xA;<p>instead of word-addressable. Why is this case? Since the CPU processes words (of predominantly 64 bits o...
computer architecture operating systems memory management memory hardware
1
Why is word-addressable the exception, not the rule? -- (computer architecture operating systems memory management memory hardware) <p>As stated on <a href="https://en.wikipedia.org/wiki/Memory_address" rel="noreferrer">Wikipedia</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Most modern computers are byte-addressable </p>&#x...
habedi/stack-exchange-dataset
53,943
Is the "Bidirectional Dijkstra" algorithm optimal?
<p>In some sites they say the bidirectional Dijkstra's algorithm is optimal, e.g.,&#xA;<a href="https://math.stackexchange.com/questions/1192678/proof-of-correctness-of-bidirectional-dijkstras-algorithm">this</a>, and <a href="http://intelligence.worldofcomputing.net/ai-search/bidirectional-search.html#.VtdKhVT5i7Q" re...
algorithms graphs shortest path
1
Is the "Bidirectional Dijkstra" algorithm optimal? -- (algorithms graphs shortest path) <p>In some sites they say the bidirectional Dijkstra's algorithm is optimal, e.g.,&#xA;<a href="https://math.stackexchange.com/questions/1192678/proof-of-correctness-of-bidirectional-dijkstras-algorithm">this</a>, and <a href="http:...
habedi/stack-exchange-dataset
53,949
How does a register remember value?
<p>So I am studying <a href="http://rads.stackoverflow.com/amzn/click/0262640686" rel="nofollow">this</a> great book, and Chapter $3.1$ is about <strong>registers</strong>.</p>&#xA;&#xA;<p>Quoting from this book / chapter: </p>&#xA;&#xA;<blockquote>&#xA; <p>A register is a storage device that can "store" or "remember"...
computer architecture memory hardware digital circuits
1
How does a register remember value? -- (computer architecture memory hardware digital circuits) <p>So I am studying <a href="http://rads.stackoverflow.com/amzn/click/0262640686" rel="nofollow">this</a> great book, and Chapter $3.1$ is about <strong>registers</strong>.</p>&#xA;&#xA;<p>Quoting from this book / chapter: <...
habedi/stack-exchange-dataset
53,953
Would creating a complete computer simulation of the human brain prove the Church-Turing thesis?
<p>According to <a href="https://en.wikipedia.org/wiki/Church%E2%80%93Turing_thesis" rel="nofollow">Wikipedia</a>, the Church-Turing thesis "states that a function on the natural numbers is computable by a human being ignoring resource limitations if and only if it is computable by a Turing machine."</p>&#xA;&#xA;<p>If...
computability simulation church turing thesis
1
Would creating a complete computer simulation of the human brain prove the Church-Turing thesis? -- (computability simulation church turing thesis) <p>According to <a href="https://en.wikipedia.org/wiki/Church%E2%80%93Turing_thesis" rel="nofollow">Wikipedia</a>, the Church-Turing thesis "states that a function on the n...
habedi/stack-exchange-dataset
53,967
Mapping several memories to one address space
<p>I am trying to understand deeply how memories work in computers, and I faced the next difficulty.</p>&#xA;&#xA;<p>Let's say we have a device with two memory chips but only one address space (for example, 0x00000000 to 0x10000000 will be memory1 and 0x10000000 to 0x20000000 will be memory2). In case an assembly code ...
memory management memory hardware memory access
1
Mapping several memories to one address space -- (memory management memory hardware memory access) <p>I am trying to understand deeply how memories work in computers, and I faced the next difficulty.</p>&#xA;&#xA;<p>Let's say we have a device with two memory chips but only one address space (for example, 0x00000000 to ...
habedi/stack-exchange-dataset
53,977
Minimize a sum with a weight constraint
<p>We are given <code>N</code> sets, each of which has a finite number of pairs $(x_i,y_i)$.</p>&#xA;&#xA;<p>$M_1=\{(0,0), (x_{1,1},y_{1,1}), ...\}$</p>&#xA;&#xA;<p>...</p>&#xA;&#xA;<p>$M_N=\{(0,0), (x_{1,N},y_{1,N}), ...\}$</p>&#xA;&#xA;<p>The problem is to select one and only one item from each set such that</p>&#xA;...
algorithms optimization dynamic programming knapsack problems
1
Minimize a sum with a weight constraint -- (algorithms optimization dynamic programming knapsack problems) <p>We are given <code>N</code> sets, each of which has a finite number of pairs $(x_i,y_i)$.</p>&#xA;&#xA;<p>$M_1=\{(0,0), (x_{1,1},y_{1,1}), ...\}$</p>&#xA;&#xA;<p>...</p>&#xA;&#xA;<p>$M_N=\{(0,0), (x_{1,N},y_{1,...
habedi/stack-exchange-dataset
53,978
Is the number of operators always one less than the number of values in an arithmetic Reverse Polish Notation expression with only binary operators?
<p>Is the number of operators always one less than the number of values in an arithmetic Reverse Polish Notation expression with only <strong>binary operators</strong>?</p>&#xA;&#xA;<p>This question seems very trivial, but I don't know if the statement is necessarily true for all N > 1 where N is the number of values. ...
parsers arithmetic
1
Is the number of operators always one less than the number of values in an arithmetic Reverse Polish Notation expression with only binary operators? -- (parsers arithmetic) <p>Is the number of operators always one less than the number of values in an arithmetic Reverse Polish Notation expression with only <strong>binar...
habedi/stack-exchange-dataset
53,979
What is the average degree of a complete graph and why?
<p>Is it correct that the average degree of a complete graph $K_n$, is $(n-1)/n$? or is it only $(n-1)$?</p>&#xA;&#xA;<p>I have the answer of my professor which is $(n-1)$, but I didn't understand why.</p>&#xA;
graphs
1
What is the average degree of a complete graph and why? -- (graphs) <p>Is it correct that the average degree of a complete graph $K_n$, is $(n-1)/n$? or is it only $(n-1)$?</p>&#xA;&#xA;<p>I have the answer of my professor which is $(n-1)$, but I didn't understand why.</p>&#xA;
habedi/stack-exchange-dataset
53,981
Can all NP-hard problems be reduced to one another?
<p>I know that all NP-complete problems can be reduced to each other, but how about NP-hard problems? Can all NP-hard problems be reduced to one another?</p>&#xA;
complexity theory np hard
1
Can all NP-hard problems be reduced to one another? -- (complexity theory np hard) <p>I know that all NP-complete problems can be reduced to each other, but how about NP-hard problems? Can all NP-hard problems be reduced to one another?</p>&#xA;
habedi/stack-exchange-dataset
54,000
Is Applicative-order and Normal-order evaluation model's definition contradictory as per sicp text book?
<p>As per this <a href="https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.5" rel="noreferrer">explaination</a>, it defines applicative and normal order evaluation in one form saying:</p>&#xA;&#xA;<blockquote>&#xA; <p>This alternative "fully expand and then reduce" evaluation method is known as no...
lambda calculus functional programming evaluation strategies
1
Is Applicative-order and Normal-order evaluation model's definition contradictory as per sicp text book? -- (lambda calculus functional programming evaluation strategies) <p>As per this <a href="https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-10.html#%_sec_1.1.5" rel="noreferrer">explaination</a>, it defines appl...
habedi/stack-exchange-dataset
54,008
Reference needed: lower bound on sample size for determining which side of coin is biased with high probability
<p>I am looking for a reference to see if the following problem has been addressed before. Suppose we know that a coin is biased with probability $p&gt;\frac{1}{2}$, but we are unsure if the coin is biased for heads or tails. I want to know a lower bound on a sample size $n$ needed to determine with high probability ...
complexity theory algorithm analysis
1
Reference needed: lower bound on sample size for determining which side of coin is biased with high probability -- (complexity theory algorithm analysis) <p>I am looking for a reference to see if the following problem has been addressed before. Suppose we know that a coin is biased with probability $p&gt;\frac{1}{2}$,...
habedi/stack-exchange-dataset
54,010
CNF-SAT reduction problem variant
<p>I'm aware of the Cook-Levin theorem. I've also seen how to reduce SAT to 3-CNF SAT to show that the latter is also NP-Complete. The following problem is a variant, though, and I'm not sure how to proceed:</p>&#xA;&#xA;<p>Define 1/3-CNFSAT as follows: given a set of boolean variables and clauses in Conjunctive Normal...
np complete reductions satisfiability constraint satisfaction
1
CNF-SAT reduction problem variant -- (np complete reductions satisfiability constraint satisfaction) <p>I'm aware of the Cook-Levin theorem. I've also seen how to reduce SAT to 3-CNF SAT to show that the latter is also NP-Complete. The following problem is a variant, though, and I'm not sure how to proceed:</p>&#xA;&#x...
habedi/stack-exchange-dataset
54,011
NP-completeness proof via reduction
<p>I'm aware that 0-1 integer programming problem is NP-complete, where the problem is stated as: Given some integer matrix A and some integer vector b, determine whether there exists a vector x consisting of 0's and 1's such that Ax >= b. I've seen that 3-CNF SAT is reducible to this problem.</p>&#xA;&#xA;<p>However, ...
complexity theory np complete reductions matrices
1
NP-completeness proof via reduction -- (complexity theory np complete reductions matrices) <p>I'm aware that 0-1 integer programming problem is NP-complete, where the problem is stated as: Given some integer matrix A and some integer vector b, determine whether there exists a vector x consisting of 0's and 1's such tha...
habedi/stack-exchange-dataset
54,013
Is there anything that MUST be done on a multi-core CPU?
<p>When considering how multi-thread-friendly our program must be, my team puzzled about whether there's anything that <em>absolutely cannot be done</em> on a single-core CPU. I posited that graphics processing requires massively parallel processing, but they argue that things like DOOM were done on single-core CPUs wi...
computation models cpu multi tasking
1
Is there anything that MUST be done on a multi-core CPU? -- (computation models cpu multi tasking) <p>When considering how multi-thread-friendly our program must be, my team puzzled about whether there's anything that <em>absolutely cannot be done</em> on a single-core CPU. I posited that graphics processing requires m...
habedi/stack-exchange-dataset
54,028
A greedy approximation algorithm for max k-cut
<p>The max k-cut problem is: Given an undirected graph G= (V;E) with nonnegative edge costs, and an integer k, find a partition of V into sets $S_1,\cdots,S_k$&#xA;so that the total cost of edges running between these sets&#xA;is maximized. The aim is to find a greedy algorithm for this problem that achieves a factor o...
algorithms approximation greedy algorithms
1
A greedy approximation algorithm for max k-cut -- (algorithms approximation greedy algorithms) <p>The max k-cut problem is: Given an undirected graph G= (V;E) with nonnegative edge costs, and an integer k, find a partition of V into sets $S_1,\cdots,S_k$&#xA;so that the total cost of edges running between these sets&#x...
habedi/stack-exchange-dataset
54,030
NP-complete reduction proof -- graph problem
<p>While studying proofs of NP-completeness via reduction, I saw a seemingly challenging problem:</p>&#xA;&#xA;<p>You are given some undirected graph $G = (V, E)$, along with a set $S$ which consists of 0 or more pairs of $G$'s edges.</p>&#xA;&#xA;<p>As an example, a complete graph on 3 vertices would be described as f...
complexity theory graphs np complete reductions
1
NP-complete reduction proof -- graph problem -- (complexity theory graphs np complete reductions) <p>While studying proofs of NP-completeness via reduction, I saw a seemingly challenging problem:</p>&#xA;&#xA;<p>You are given some undirected graph $G = (V, E)$, along with a set $S$ which consists of 0 or more pairs of ...
habedi/stack-exchange-dataset
54,037
Under what condition is P/poly equal to the class of languages having Turing machines running in polynomial length with polynomial advice?
<p>Sanjeev Arora and Boaz Barak show the following :</p>&#xA;&#xA;<blockquote>&#xA; <p>$P/poly = \cup_{c,d} DTIME (n^c)/n^d$</p>&#xA;</blockquote>&#xA;&#xA;<p>where $DTIME(n^c)/n^d$ is a Turing machine which is given an advice of length $O(n^d)$ and runs in $O(n^c)$ time. I do follow the proof. But I feel the proof ...
complexity theory circuits
1
Under what condition is P/poly equal to the class of languages having Turing machines running in polynomial length with polynomial advice? -- (complexity theory circuits) <p>Sanjeev Arora and Boaz Barak show the following :</p>&#xA;&#xA;<blockquote>&#xA; <p>$P/poly = \cup_{c,d} DTIME (n^c)/n^d$</p>&#xA;</blockquote>&#...
habedi/stack-exchange-dataset
54,038
When is bidirectional search unusable?
<p>Is there any situation that bidirectional search on a graph is not applicable? for example is there any classes of graph that we can only use ordinary Dijkstra's algorithm, and can not use its bidirectional variant.</p>&#xA;&#xA;<p>The graph may be a dynamic graph.</p>&#xA;
algorithms graphs shortest path
1
When is bidirectional search unusable? -- (algorithms graphs shortest path) <p>Is there any situation that bidirectional search on a graph is not applicable? for example is there any classes of graph that we can only use ordinary Dijkstra's algorithm, and can not use its bidirectional variant.</p>&#xA;&#xA;<p>The graph...
habedi/stack-exchange-dataset
54,047
How different is the working of SNN (Spiking Neural Network) as compared to a real Neuron System in biological systems?
<p>Assuming its one step closer to realism as compared to ANN, DNNs and other Neural Network models, what are the primary differences between a real neuron system and SNN?</p>&#xA;
machine learning artificial intelligence neural networks bioinformatics
1
How different is the working of SNN (Spiking Neural Network) as compared to a real Neuron System in biological systems? -- (machine learning artificial intelligence neural networks bioinformatics) <p>Assuming its one step closer to realism as compared to ANN, DNNs and other Neural Network models, what are the primary d...
habedi/stack-exchange-dataset
54,059
Would a polynomial-time algorithm for an NP-hard problem implies that P=NP?
<p>An NP-hard problem is not in NP. (If it was in NP, it would be an NP-complete problem not NP-hard.)</p>&#xA;&#xA;<p>So my question is: if someone can find a polynomial-time algorithm for an NP-hard problem, would that means that P=NP?</p>&#xA;&#xA;<p>I think yes (I am almost sure) but I can't find the reason why?</p...
np complete np hard np
1
Would a polynomial-time algorithm for an NP-hard problem implies that P=NP? -- (np complete np hard np) <p>An NP-hard problem is not in NP. (If it was in NP, it would be an NP-complete problem not NP-hard.)</p>&#xA;&#xA;<p>So my question is: if someone can find a polynomial-time algorithm for an NP-hard problem, would ...
habedi/stack-exchange-dataset
54,069
How is $a^nb^nc^{2n}$ not a context free language, where as $a^nb^mc^{n+m}$ is?
<p>$L_1 = \{a^mb^nc^{m+n}: n,m&gt;1\}$</p>&#xA;&#xA;<p>I know $L_1$ is CFL and works with a pushdown automata. </p>&#xA;&#xA;<p>$L_2 = \{a^nb^nc^{2n}: n&gt;1\}$</p>&#xA;&#xA;<p>The language $L_2$ should also be a CFL because it looks similar, but in my book $L_2$ is not a context-free language. I just can't figure out ...
formal languages context free
1
How is $a^nb^nc^{2n}$ not a context free language, where as $a^nb^mc^{n+m}$ is? -- (formal languages context free) <p>$L_1 = \{a^mb^nc^{m+n}: n,m&gt;1\}$</p>&#xA;&#xA;<p>I know $L_1$ is CFL and works with a pushdown automata. </p>&#xA;&#xA;<p>$L_2 = \{a^nb^nc^{2n}: n&gt;1\}$</p>&#xA;&#xA;<p>The language $L_2$ should al...
habedi/stack-exchange-dataset
54,071
Prove that the depth function of a Binary Search Tree is $O(\log n)$ on average
<p>I am struggling with this question because I am not sure how to see that a depth function is $\mathcal{O}(\log n)$ on average when it clearly traverses through the whole tree which should make it $\mathcal{O}(n)$:</p>&#xA;&#xA;<pre><code>depth(tree):&#xA; if tree is a leaf:&#xA; return 0&#xA; else:&#xA;...
time complexity binary trees binary search
1
Prove that the depth function of a Binary Search Tree is $O(\log n)$ on average -- (time complexity binary trees binary search) <p>I am struggling with this question because I am not sure how to see that a depth function is $\mathcal{O}(\log n)$ on average when it clearly traverses through the whole tree which should m...
habedi/stack-exchange-dataset
54,076
Is there constraint on reducibility while defining $\Sigma_i^p$?
<p>Sanjeev Arora and Boaz Barak define $\Sigma_i^p$ to be the set of languages such that if $L\in \Sigma_i^p$ then for every $x \in L \Longleftrightarrow \exists u_1 \forall u_2\ldots Qu_i M(x,u_1,u_2,\ldots,u_i) = 1 $ where $Q_i$ is $\exists$ or $\forall$ depending on whether $i$ is odd or even and $M$ is a Turing ma...
complexity theory
1
Is there constraint on reducibility while defining $\Sigma_i^p$? -- (complexity theory) <p>Sanjeev Arora and Boaz Barak define $\Sigma_i^p$ to be the set of languages such that if $L\in \Sigma_i^p$ then for every $x \in L \Longleftrightarrow \exists u_1 \forall u_2\ldots Qu_i M(x,u_1,u_2,\ldots,u_i) = 1 $ where $Q_i$ ...
habedi/stack-exchange-dataset
54,085
About a universal (functionally complete) function producing a constant
<p>I read in a note the following:</p>&#xA;&#xA;<p>Suppose we have a boolean function $f(x,y,z,w)$, if $f(a,a,a,a)=1$ then $f$ can't be functionally complete. </p>&#xA;&#xA;<p>Why is that? how does it imply that $f$ can't produce nand or nor?</p>&#xA;
logic boolean algebra
1
About a universal (functionally complete) function producing a constant -- (logic boolean algebra) <p>I read in a note the following:</p>&#xA;&#xA;<p>Suppose we have a boolean function $f(x,y,z,w)$, if $f(a,a,a,a)=1$ then $f$ can't be functionally complete. </p>&#xA;&#xA;<p>Why is that? how does it imply that $f$ can't...
habedi/stack-exchange-dataset
54,088
What is the significance of a Θ-bound on the running time of Mergesort?
<p>While <a href="http://www.cs.princeton.edu/~wayne/kleinberg-tardos/pdf/02AlgorithmAnalysis.pdf" rel="nofollow">studying</a> algorithm analysis I found that there is something called tight bound and there is some mathematical formula to support it.&#xA;Given:</p>&#xA;&#xA;<blockquote>&#xA; <p>Mergesort takes $\Theta...
algorithm analysis runtime analysis sorting landau notation
1
What is the significance of a Θ-bound on the running time of Mergesort? -- (algorithm analysis runtime analysis sorting landau notation) <p>While <a href="http://www.cs.princeton.edu/~wayne/kleinberg-tardos/pdf/02AlgorithmAnalysis.pdf" rel="nofollow">studying</a> algorithm analysis I found that there is something calle...
habedi/stack-exchange-dataset
54,097
Boolean algebra truths with more than one digit
<p>I understand that when you 0 AND 0 it will result in 0 and that 1 AND 1 will result in 1 etc but what I don't understand is if the question was 01 AND 11. How would I work this out?</p>&#xA;
boolean algebra
1
Boolean algebra truths with more than one digit -- (boolean algebra) <p>I understand that when you 0 AND 0 it will result in 0 and that 1 AND 1 will result in 1 etc but what I don't understand is if the question was 01 AND 11. How would I work this out?</p>&#xA;
habedi/stack-exchange-dataset
54,104
Dividing bins into segments
<p>This may be a question with a well known answer, but I've been thinking on it for two days, and can't quite come up with a satisfactory answer.</p>&#xA;&#xA;<p>Consider the problem of dividing $p n$ bins numbered $1$ through $pn$ into $p m + 1$ segments by placing $pm$ balls. If we let $k = pn - pm \bmod pm+1$, th...
discrete mathematics packing
1
Dividing bins into segments -- (discrete mathematics packing) <p>This may be a question with a well known answer, but I've been thinking on it for two days, and can't quite come up with a satisfactory answer.</p>&#xA;&#xA;<p>Consider the problem of dividing $p n$ bins numbered $1$ through $pn$ into $p m + 1$ segments b...
habedi/stack-exchange-dataset
54,111
Show that the Halting problem is reducible to its complement
<blockquote>&#xA; <p>HALT$_{TM}$ is the set of all machine-input pairs $&lt;M,w&gt; $ where $M$&#xA; halts on input $w$</p>&#xA; &#xA; <p>The complement of HALT$_{TM}$ is the set of all machine-input pairs&#xA; $&lt;M,w&gt; $ where $M$ doesn't halt on input $w$</p>&#xA; &#xA; <p>Show that HALT$_{TM}$ is turing r...
turing machines reductions halting problem
1
Show that the Halting problem is reducible to its complement -- (turing machines reductions halting problem) <blockquote>&#xA; <p>HALT$_{TM}$ is the set of all machine-input pairs $&lt;M,w&gt; $ where $M$&#xA; halts on input $w$</p>&#xA; &#xA; <p>The complement of HALT$_{TM}$ is the set of all machine-input pairs&#...
habedi/stack-exchange-dataset
54,112
Smallest number close to 0 in IEEE754 (64bits)?
<p>I thought the smallest number close to 0 would be : 0 00000000001 (exponent) 0000000000000000000000000000000000000000000000000000 (significand)</p>&#xA;&#xA;<p>But this site (<a href="http://binaryconvert.com/result_double.html?hexadecimal=0000000000000001" rel="nofollow">http://binaryconvert.com/result_double.html?...
floating point number formats
1
Smallest number close to 0 in IEEE754 (64bits)? -- (floating point number formats) <p>I thought the smallest number close to 0 would be : 0 00000000001 (exponent) 0000000000000000000000000000000000000000000000000000 (significand)</p>&#xA;&#xA;<p>But this site (<a href="http://binaryconvert.com/result_double.html?hexade...
habedi/stack-exchange-dataset
54,121
What is the approximation ratio of this randomized algorithm for finding matchings?
<p>I would like to analyze the following algorithm in terms of its approximation ratio.</p>&#xA;&#xA;<p>Here is the algorithm:</p>&#xA;&#xA;<pre><code>Input: A positive number T and two disjoint sets of nodes V={v1,...,vn} and W={w1,...,wn}.&#xA;Output: A matching S.&#xA;1: O = [] # An empty array.&#xA;2: for t = 1 to ...
algorithms algorithm analysis approximation randomized algorithms
1
What is the approximation ratio of this randomized algorithm for finding matchings? -- (algorithms algorithm analysis approximation randomized algorithms) <p>I would like to analyze the following algorithm in terms of its approximation ratio.</p>&#xA;&#xA;<p>Here is the algorithm:</p>&#xA;&#xA;<pre><code>Input: A posit...
habedi/stack-exchange-dataset
54,131
Solution to a Np-hard problem and its relevance to a dual LP
<p>From <a href="http://www.designofapproxalgs.com/" rel="nofollow">The design of APX algorithms</a> book by <em>David P. Williamson</em> and <em>David B. Shmoys</em>, at the bottom of page 21 I saw the following statement (it is about the set cover LP and its dual):</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $y^*$ be an o...
algorithms approximation linear programming set cover
1
Solution to a Np-hard problem and its relevance to a dual LP -- (algorithms approximation linear programming set cover) <p>From <a href="http://www.designofapproxalgs.com/" rel="nofollow">The design of APX algorithms</a> book by <em>David P. Williamson</em> and <em>David B. Shmoys</em>, at the bottom of page 21 I saw t...
habedi/stack-exchange-dataset
54,133
primitive recursive functional equivalence
<p>Given two primitive recursive functions is it decidable whether or not they are&#xA;the same function? For example lets take sorting algorithms A, and B which are&#xA;primitive recursive. While there are many algorithms for sorting they all&#xA;describe the same relation. Given two primitive recursive implementation...
computability decision problem primitive recursion
1
primitive recursive functional equivalence -- (computability decision problem primitive recursion) <p>Given two primitive recursive functions is it decidable whether or not they are&#xA;the same function? For example lets take sorting algorithms A, and B which are&#xA;primitive recursive. While there are many algorithm...
habedi/stack-exchange-dataset
54,143
on "On the cruelty of really teaching computing science"
<p>Dijkstra, in his essay <em><a href="https://www.cs.utexas.edu/%7EEWD/transcriptions/EWD10xx/EWD1036.html" rel="nofollow noreferrer">On the cruelty of really teaching computing science</a></em>, makes the following proposal for an introductory programming course:</p>&#xA;<blockquote>&#xA;<p>On the one hand, we teach ...
reference request programming languages education didactics
1
on "On the cruelty of really teaching computing science" -- (reference request programming languages education didactics) <p>Dijkstra, in his essay <em><a href="https://www.cs.utexas.edu/%7EEWD/transcriptions/EWD10xx/EWD1036.html" rel="nofollow noreferrer">On the cruelty of really teaching computing science</a></em>, m...
habedi/stack-exchange-dataset
54,145
Non-regularity of the set of primes in unary encoding using Myhill-Nerode
<p>I have found many proofs for this using pumping lemma, I'm curious of how to proof it via Myhill-Nerode theorem.</p>&#xA;&#xA;<p>Suppose $L= \{a^p \mid p \text{ is prime}\}$ is regular. Then we have congruence such $u ∼ v ⇒ uw ∼ vw$ of finite index $k$, so it has $k$ equivalence classes. $L$ is union of some of its ...
formal languages regular languages
1
Non-regularity of the set of primes in unary encoding using Myhill-Nerode -- (formal languages regular languages) <p>I have found many proofs for this using pumping lemma, I'm curious of how to proof it via Myhill-Nerode theorem.</p>&#xA;&#xA;<p>Suppose $L= \{a^p \mid p \text{ is prime}\}$ is regular. Then we have cong...
habedi/stack-exchange-dataset
54,155
A certain submatrix of the correlation polytope
<p>I am kind of confused by the argument at the top of page 5 here, <a href="http://homes.cs.washington.edu/~jrl/notes/bonn-lecture-notes.pdf" rel="nofollow">http://homes.cs.washington.edu/~jrl/notes/bonn-lecture-notes.pdf</a> </p>&#xA;&#xA;<ul>&#xA;<li><p>Firstly given that the author wanted to look at quadratic multi...
complexity theory np complete optimization np hard np
1
A certain submatrix of the correlation polytope -- (complexity theory np complete optimization np hard np) <p>I am kind of confused by the argument at the top of page 5 here, <a href="http://homes.cs.washington.edu/~jrl/notes/bonn-lecture-notes.pdf" rel="nofollow">http://homes.cs.washington.edu/~jrl/notes/bonn-lecture-...
habedi/stack-exchange-dataset
54,157
Can I simplify log(n+1) before showing that it is in O(log n)?
<p>Had a question about the following:</p>&#xA;&#xA;<p>$$\log (n+1) \in O(\log n)$$</p>&#xA;&#xA;<p>Can the left side be simplified any further or do I need to just go ahead and find a <strong><em>c</em></strong> and <strong><em>n</em></strong> that hold?</p>&#xA;
asymptotics proof techniques landau notation
1
Can I simplify log(n+1) before showing that it is in O(log n)? -- (asymptotics proof techniques landau notation) <p>Had a question about the following:</p>&#xA;&#xA;<p>$$\log (n+1) \in O(\log n)$$</p>&#xA;&#xA;<p>Can the left side be simplified any further or do I need to just go ahead and find a <strong><em>c</em></st...
habedi/stack-exchange-dataset
54,171
Is a balanced binary tree a complete binary tree?
<p>Considering that the opposite is true it's not mentioned anything about this. I am assuming its not, but I need a very good distinction between these two types of binary trees. </p>&#xA;&#xA;<p>All I know is this:</p>&#xA;&#xA;<ul>&#xA;<li>A binary tree is balanced (or height balanced), if the height of any node’s r...
data structures trees binary trees
1
Is a balanced binary tree a complete binary tree? -- (data structures trees binary trees) <p>Considering that the opposite is true it's not mentioned anything about this. I am assuming its not, but I need a very good distinction between these two types of binary trees. </p>&#xA;&#xA;<p>All I know is this:</p>&#xA;&#xA;...
habedi/stack-exchange-dataset
54,177
How can I prove that a Regular Language is closed under Union given two languages with different alphabets?
<p>I need some help to prove that a Regular Language is closed under the union, using a DFA with two differents alphabets.</p>&#xA;
formal languages finite automata
1
How can I prove that a Regular Language is closed under Union given two languages with different alphabets? -- (formal languages finite automata) <p>I need some help to prove that a Regular Language is closed under the union, using a DFA with two differents alphabets.</p>&#xA;
habedi/stack-exchange-dataset
54,181
Proving a CFG is ambiguous?
<p>I have a CFG:</p>&#xA;&#xA;<pre><code>S --&gt; 0S1S | 1S0S | ε&#xA;</code></pre>&#xA;&#xA;<p>I'm trying to prove that it is ambiguous, but the steps to proving so are confusing me.</p>&#xA;&#xA;<p>So if I pick a string, let's say 010110, I just have to show that there are two different parse trees for the string?</p...
formal languages regular languages context free
1
Proving a CFG is ambiguous? -- (formal languages regular languages context free) <p>I have a CFG:</p>&#xA;&#xA;<pre><code>S --&gt; 0S1S | 1S0S | ε&#xA;</code></pre>&#xA;&#xA;<p>I'm trying to prove that it is ambiguous, but the steps to proving so are confusing me.</p>&#xA;&#xA;<p>So if I pick a string, let's say 010110...
habedi/stack-exchange-dataset
54,187
Maximal class for which function equivalence is decidable
<p>I previously asked if it's decidable whether two primitive recursive functions are equivalent: "<a href="https://cs.stackexchange.com/questions/54133/primitive-recursive-functional-equivalence">primitive recursive functional equivalence</a>". The answer was no.</p>&#xA;&#xA;<p>Here is my followup. What is the most p...
computability complexity classes decision problem computation models
1
Maximal class for which function equivalence is decidable -- (computability complexity classes decision problem computation models) <p>I previously asked if it's decidable whether two primitive recursive functions are equivalent: "<a href="https://cs.stackexchange.com/questions/54133/primitive-recursive-functional-equi...
habedi/stack-exchange-dataset
54,190
Misconception in taking Pumping Length of language {a} to be $2$
<p>I would like to know why the pumping length of language {a} is $2$ as said in this <a href="http://chat.stackexchange.com/transcript/message/28097181#28097181">chat discussion</a>.</p>&#xA;&#xA;<p>Eventhough this discussion proves <em>trivially</em> that the pumping length of language {a} is $2$ I couldn't get by ...
formal languages pumping lemma
1
Misconception in taking Pumping Length of language {a} to be $2$ -- (formal languages pumping lemma) <p>I would like to know why the pumping length of language {a} is $2$ as said in this <a href="http://chat.stackexchange.com/transcript/message/28097181#28097181">chat discussion</a>.</p>&#xA;&#xA;<p>Eventhough this dis...
habedi/stack-exchange-dataset
54,200
Traveling Salesman Problem with Neural Network
<p>I was curious if there were any new developments in solving the traveling salesman problem using something like a Hopfield recurrent neural network. I feel like I saw something about recent research getting a breakthrough in this, but I can't find the academic papers anywhere. Is anyone aware of any new, novel dev...
np hard neural networks traveling salesman
1
Traveling Salesman Problem with Neural Network -- (np hard neural networks traveling salesman) <p>I was curious if there were any new developments in solving the traveling salesman problem using something like a Hopfield recurrent neural network. I feel like I saw something about recent research getting a breakthrough...
habedi/stack-exchange-dataset
54,203
Role of computational power in recent AI developments
<p>Today Google's AI <a href="http://www.wired.com/2016/03/googles-ai-taking-one-worlds-top-go-players/" rel="nofollow">won its first game</a> of Go against Lee Sedol, one of the best Go players on the planet. Image interpretation and self-driving cars are other recent success stories in machine learning. I was under t...
machine learning artificial intelligence neural networks
1
Role of computational power in recent AI developments -- (machine learning artificial intelligence neural networks) <p>Today Google's AI <a href="http://www.wired.com/2016/03/googles-ai-taking-one-worlds-top-go-players/" rel="nofollow">won its first game</a> of Go against Lee Sedol, one of the best Go players on the pl...
habedi/stack-exchange-dataset
54,204
Showing that 3-colorable is NP-complete
<p>Just as a background, <em>3-colorable</em> problem is as follows: Given a graph $G = (V, E)$, is it possible to color the vertices using just 3 colors such that no neighboring vertices have the same color?</p>&#xA;&#xA;<p>I'm aware we can show that <em>3-colorable</em> is an NP-complete problem by reducing <em>3-SAT...
graphs np complete reductions colorings clique
1
Showing that 3-colorable is NP-complete -- (graphs np complete reductions colorings clique) <p>Just as a background, <em>3-colorable</em> problem is as follows: Given a graph $G = (V, E)$, is it possible to color the vertices using just 3 colors such that no neighboring vertices have the same color?</p>&#xA;&#xA;<p>I'm...
habedi/stack-exchange-dataset
54,210
sorting a sorted array that has been inc/dec by random numbers
<p>If given a sorted array of n distinct positive integers. And each element is incremented or decremented by a number between 0 and X. For positive integer X that is a function of n.</p>&#xA;&#xA;<p>Formulate an algorithm that takes the inc/dec array and sort it. Make the run time O(n) when X is constant.</p>&#xA;&#xA...
algorithms runtime analysis sorting
1
sorting a sorted array that has been inc/dec by random numbers -- (algorithms runtime analysis sorting) <p>If given a sorted array of n distinct positive integers. And each element is incremented or decremented by a number between 0 and X. For positive integer X that is a function of n.</p>&#xA;&#xA;<p>Formulate an alg...
habedi/stack-exchange-dataset
54,212
Reduction between two decision problems
<p>We are given two decision problems: $Q_1\colon I_1\to\{0,1\}$ and $Q_2\colon I_2\to\{0,1\}$.</p>&#xA;&#xA;<p>By definition, if there exists a function $f\colon I_1\to I_2$ such that for each $x\in I_1$ we have $Q_1(x)=Q_2(f(x))$ then $Q_1$ can be reduced to $Q_2$ by $f$.</p>&#xA;&#xA;<p>Now suppose that $Q_1$ can be...
complexity theory reductions
1
Reduction between two decision problems -- (complexity theory reductions) <p>We are given two decision problems: $Q_1\colon I_1\to\{0,1\}$ and $Q_2\colon I_2\to\{0,1\}$.</p>&#xA;&#xA;<p>By definition, if there exists a function $f\colon I_1\to I_2$ such that for each $x\in I_1$ we have $Q_1(x)=Q_2(f(x))$ then $Q_1$ can...
habedi/stack-exchange-dataset
54,214
Question about idempotent and Dominance Laws in Boolean Algebra
<p>If I have the following statements:</p>&#xA;&#xA;<p>For Idempotent:</p>&#xA;&#xA;<p>Since <strong>X * X = X</strong>, would that imply that <strong>~X * ~X = ~X</strong></p>&#xA;&#xA;<p>For Dominance:</p>&#xA;&#xA;<p>Since <strong>X + 1 = 1</strong> would that imply that <strong>~X + 1 = 1</strong></p>&#xA;
boolean algebra
1
Question about idempotent and Dominance Laws in Boolean Algebra -- (boolean algebra) <p>If I have the following statements:</p>&#xA;&#xA;<p>For Idempotent:</p>&#xA;&#xA;<p>Since <strong>X * X = X</strong>, would that imply that <strong>~X * ~X = ~X</strong></p>&#xA;&#xA;<p>For Dominance:</p>&#xA;&#xA;<p>Since <strong>X...
habedi/stack-exchange-dataset
54,220
Euler graph k-coloring (np-completeness proof)
<p>I've been studying np-completeness proofs by reduction, and was wondering whether my approach to the following problem is viable.</p>&#xA;&#xA;<p>Define an Euler graph as a graph that 1) is connected, and 2) has every vertex with even degree.</p>&#xA;&#xA;<p>Input: An Euler graph and an integer $k$.&#xA;Problem: is ...
graphs np complete reductions colorings
1
Euler graph k-coloring (np-completeness proof) -- (graphs np complete reductions colorings) <p>I've been studying np-completeness proofs by reduction, and was wondering whether my approach to the following problem is viable.</p>&#xA;&#xA;<p>Define an Euler graph as a graph that 1) is connected, and 2) has every vertex ...
habedi/stack-exchange-dataset
54,221
Solving using the master theorem
<p>I am wondering why this </p>&#xA;&#xA;<p>$T(n)=3T(n/4)+n⋅lg(n)$</p>&#xA;&#xA;<p>recurrence can be solve by Master Theorem case 3 but this<br>&#xA;$T(n)=2T(n/2)+n⋅lg(n)$<br>&#xA;recurrence can not be solve by Master Theorem what is the difference between this two recurrences.<br>&#xA;When I searched on google I foun...
algorithms algorithm analysis master theorem
1
Solving using the master theorem -- (algorithms algorithm analysis master theorem) <p>I am wondering why this </p>&#xA;&#xA;<p>$T(n)=3T(n/4)+n⋅lg(n)$</p>&#xA;&#xA;<p>recurrence can be solve by Master Theorem case 3 but this<br>&#xA;$T(n)=2T(n/2)+n⋅lg(n)$<br>&#xA;recurrence can not be solve by Master Theorem what is th...
habedi/stack-exchange-dataset
54,227
Invertible function that randomizes order
<p>I am looking for an invertible discrete function $f:\{0,1,2,\dots,n-1\} \to \{0,1,2,\dots,n-1\}$ for some given integer $n$. I want $f(0),f(1),\dots,f(n-1)$ to return all the integers in range $[0..n)$ exactly once, but in a "messy", random-seeming arrangement. I anticipate that $n$ will be not bigger than $2^{30}...
algorithms discrete mathematics cryptography permutations randomness
1
Invertible function that randomizes order -- (algorithms discrete mathematics cryptography permutations randomness) <p>I am looking for an invertible discrete function $f:\{0,1,2,\dots,n-1\} \to \{0,1,2,\dots,n-1\}$ for some given integer $n$. I want $f(0),f(1),\dots,f(n-1)$ to return all the integers in range $[0..n)...
habedi/stack-exchange-dataset
54,229
What is the fastest way to input all of 30 million human "go" move into the computer that haven't digitized?
<p>What is the fastest way right now to input all of 30 million "go" move from the beginning into the computer that haven't digitized?</p>&#xA;&#xA;<p>The idea is came from Google's AlphaGo</p>&#xA;
algorithms
1
What is the fastest way to input all of 30 million human "go" move into the computer that haven't digitized? -- (algorithms) <p>What is the fastest way right now to input all of 30 million "go" move from the beginning into the computer that haven't digitized?</p>&#xA;&#xA;<p>The idea is came from Google's AlphaGo</p>&#...
habedi/stack-exchange-dataset
54,230
In this proof that sokoban+ is pspace complete, how does the gadgets register the fact that a cell of the turing machine has changed?
<p>I´ve been reading the paper "SOKOBAN and other motion planning problems" by Dorit Dor and Uri Zwick. </p>&#xA;&#xA;<p>This is a link to the paper: <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.41.7823&amp;rep=rep1&amp;type=pdf" rel="nofollow">Sokoban+ is pspace complete</a></p>&#xA;&#xA;<p>In the...
complexity theory turing machines
1
In this proof that sokoban+ is pspace complete, how does the gadgets register the fact that a cell of the turing machine has changed? -- (complexity theory turing machines) <p>I´ve been reading the paper "SOKOBAN and other motion planning problems" by Dorit Dor and Uri Zwick. </p>&#xA;&#xA;<p>This is a link to the pape...
habedi/stack-exchange-dataset
54,236
How to correctly define the ratio of an approximation algorithm?
<p>For a maximization problem $P$, I know that an $\gamma$-approximation algorithm for $P$ produces a solution $S$ that is $|OPT|\ge |S| \ge \gamma\cdot|OPT|$ for $\gamma &lt;1$ and $OPT$ the optimal solution for $P$. </p>&#xA;&#xA;<p>Is there an alternative definition? </p>&#xA;&#xA;<p>For example, can we say that an ...
algorithms terminology approximation
1
How to correctly define the ratio of an approximation algorithm? -- (algorithms terminology approximation) <p>For a maximization problem $P$, I know that an $\gamma$-approximation algorithm for $P$ produces a solution $S$ that is $|OPT|\ge |S| \ge \gamma\cdot|OPT|$ for $\gamma &lt;1$ and $OPT$ the optimal solution for ...
habedi/stack-exchange-dataset
54,238
Need to give a CFG for this language?
<p>I have the language:</p>&#xA;&#xA;<p>$$ L = \{0^m1^n \mid 0 ≤ m ≤ n\text{ or }0 ≤ n ≤ 2m\}. $$ </p>&#xA;&#xA;<p>My goal is to give an equivalent context-free grammar for this language, but I am unsure if I am going about it the right way. So far this is what I've come up with:</p>&#xA;&#xA;<p>$$&#xA;\begin{align*}&#...
formal languages context free
1
Need to give a CFG for this language? -- (formal languages context free) <p>I have the language:</p>&#xA;&#xA;<p>$$ L = \{0^m1^n \mid 0 ≤ m ≤ n\text{ or }0 ≤ n ≤ 2m\}. $$ </p>&#xA;&#xA;<p>My goal is to give an equivalent context-free grammar for this language, but I am unsure if I am going about it the right way. So fa...
habedi/stack-exchange-dataset
54,239
Complexity for merging 3 sorted arrays using this specific algorithtm
<p>During an interview I was asked to calculate the big theta complexity for the following algorithm that receives 3 sorted arrays of variable size and returns a new array which has the elements of the original 3 arrays.</p>&#xA;&#xA;<p>The algorithm is pretty basic: we set indexes at the beginning of each array and us...
complexity theory runtime analysis
1
Complexity for merging 3 sorted arrays using this specific algorithtm -- (complexity theory runtime analysis) <p>During an interview I was asked to calculate the big theta complexity for the following algorithm that receives 3 sorted arrays of variable size and returns a new array which has the elements of the original...
habedi/stack-exchange-dataset
54,247
How to prove: If $\textsf{EXP} \subseteq \textsf{P/poly} $ then $\textsf{EXP} = \Sigma^p_2$
<p>Following is a theorem from Sanjeev Arora and Boaz Barak I am unable to prove :</p>&#xA;&#xA;<blockquote>&#xA; <p>If $\textsf{EXP} \subseteq \textsf{P/poly}$ then $\textsf{EXP} = \Sigma^p_2$.</p>&#xA;</blockquote>&#xA;&#xA;<p>The previous similar theorem was </p>&#xA;&#xA;<blockquote>&#xA; <p>If $\textsf{NP} \subs...
complexity theory nondeterminism
1
How to prove: If $\textsf{EXP} \subseteq \textsf{P/poly} $ then $\textsf{EXP} = \Sigma^p_2$ -- (complexity theory nondeterminism) <p>Following is a theorem from Sanjeev Arora and Boaz Barak I am unable to prove :</p>&#xA;&#xA;<blockquote>&#xA; <p>If $\textsf{EXP} \subseteq \textsf{P/poly}$ then $\textsf{EXP} = \Sigma^...
habedi/stack-exchange-dataset
54,248
perspective transformation of a grid
<p>A <strong>perspective transformation</strong> of a point is defined as follows:</p>&#xA;&#xA;<p>$ x' = \frac{M_{11}x + M_{12}y +M_{13}}{M_{31}x + M_{32}y +M_{33}} $</p>&#xA;&#xA;<p>$ y' = \frac{M_{21}x + M_{22}y +M_{23}}{M_{31}x + M_{32}y +M_{33}} $</p>&#xA;&#xA;<p>Now, say I wish to transform a <strong>uniform</str...
computational geometry image processing
1
perspective transformation of a grid -- (computational geometry image processing) <p>A <strong>perspective transformation</strong> of a point is defined as follows:</p>&#xA;&#xA;<p>$ x' = \frac{M_{11}x + M_{12}y +M_{13}}{M_{31}x + M_{32}y +M_{33}} $</p>&#xA;&#xA;<p>$ y' = \frac{M_{21}x + M_{22}y +M_{23}}{M_{31}x + M_{3...
habedi/stack-exchange-dataset
54,253
Rank athletes by weighted criteria
<p>I have a structure. that consist of the following:</p>&#xA;&#xA;<pre><code>Athlete A Athlete B Athlete C&#xA;speed=10 speed=12 speed=6&#xA;endurance=60 endurance=59 endurance=64&#xA;</code></pre>&#xA;&#xA;<p>I would like to rank the strength of those three Athletes based on their s...
algorithms sorting
1
Rank athletes by weighted criteria -- (algorithms sorting) <p>I have a structure. that consist of the following:</p>&#xA;&#xA;<pre><code>Athlete A Athlete B Athlete C&#xA;speed=10 speed=12 speed=6&#xA;endurance=60 endurance=59 endurance=64&#xA;</code></pre>&#xA;&#xA;<p>I would like to...
habedi/stack-exchange-dataset
54,254
Proving a language is neither Recursively Enumerable nor co-Recursively Enumerable
<p>$$L = \{ \langle M \rangle \mid \text{\(M\) is a Turing Machine and \(|L(M)| = 1\)} \}$$</p>&#xA;&#xA;<p>I have to prove that this is not R.E. and not co-R.E.</p>&#xA;&#xA;<p>I know how to approach these kind of problems. For&#xA;$\check L = \{ \langle M \rangle \mid \text{\(M\) is a Turing Machine and \(|L(M)| \le ...
turing machines proof techniques undecidability
1
Proving a language is neither Recursively Enumerable nor co-Recursively Enumerable -- (turing machines proof techniques undecidability) <p>$$L = \{ \langle M \rangle \mid \text{\(M\) is a Turing Machine and \(|L(M)| = 1\)} \}$$</p>&#xA;&#xA;<p>I have to prove that this is not R.E. and not co-R.E.</p>&#xA;&#xA;<p>I know...
habedi/stack-exchange-dataset
54,261
Proving preservation under substitution System F Omega
<p>I am going over the proofs for the simply typed lambda calculus in the book "Types and Programming languages" by Benjamin Pierce. I am trying to find inspiration for the similar proofs for System F Omega. When I was going over the preservation under substitution proof for the simply typed lambda calculus I was a bi...
type theory type checking
1
Proving preservation under substitution System F Omega -- (type theory type checking) <p>I am going over the proofs for the simply typed lambda calculus in the book "Types and Programming languages" by Benjamin Pierce. I am trying to find inspiration for the similar proofs for System F Omega. When I was going over the ...
habedi/stack-exchange-dataset
54,266
How long does the Collatz recursion run?
<p>I have the following Python code.</p>&#xA;&#xA;<pre><code>def collatz(n):&#xA; if n &lt;= 1:&#xA; return True&#xA; elif (n%2==0):&#xA; return collatz(n/2)&#xA; else:&#xA; return collatz(3*n+1)&#xA;</code></pre>&#xA;&#xA;<p>What is the running-time of this algorithm?</p>&#xA;&#xA;<p>Try:...
algorithm analysis runtime analysis recurrence relation
1
How long does the Collatz recursion run? -- (algorithm analysis runtime analysis recurrence relation) <p>I have the following Python code.</p>&#xA;&#xA;<pre><code>def collatz(n):&#xA; if n &lt;= 1:&#xA; return True&#xA; elif (n%2==0):&#xA; return collatz(n/2)&#xA; else:&#xA; return collatz...
habedi/stack-exchange-dataset
54,279
Rigorous Books on Algorithms
<p>I thoroughly enjoyed my algorithms class but I felt that it lacked rigor. Most of the time I was able to intuitively understand why the algorithms presented worked and why they had the time complexity that was presented but I'd like to be able to prove such things. As such, I'd like a book that goes over lots of com...
algorithms education books
1
Rigorous Books on Algorithms -- (algorithms education books) <p>I thoroughly enjoyed my algorithms class but I felt that it lacked rigor. Most of the time I was able to intuitively understand why the algorithms presented worked and why they had the time complexity that was presented but I'd like to be able to prove suc...
habedi/stack-exchange-dataset
54,287
See that P$^{NP}_{||} = P^{NP}_{O(\log n)}$
<p>I'm trying to prove that P$^{NP}_{||} =$ P$^{NP}_{O(\log n)}$ where $n$ is the length of the input.</p>&#xA;&#xA;<p>So, to see that polynomially many non-adaptive queries to a problem in NP can do as much as logarithmically many adaptive ones.</p>&#xA;&#xA;<p>I know I need to see both inclusions, and have worked out...
complexity theory time complexity np
1
See that P$^{NP}_{||} = P^{NP}_{O(\log n)}$ -- (complexity theory time complexity np) <p>I'm trying to prove that P$^{NP}_{||} =$ P$^{NP}_{O(\log n)}$ where $n$ is the length of the input.</p>&#xA;&#xA;<p>So, to see that polynomially many non-adaptive queries to a problem in NP can do as much as logarithmically many ad...
habedi/stack-exchange-dataset
54,288
8-bit floating-point representation
<p>I'm studying about representing fractional numbers as floating-point values. It is going to be an 8-bit representation. Somewhere in the text, it is said that:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/AB8Wc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AB8Wc.png" alt="8-bit floating-po...
floating point numeral representations
1
8-bit floating-point representation -- (floating point numeral representations) <p>I'm studying about representing fractional numbers as floating-point values. It is going to be an 8-bit representation. Somewhere in the text, it is said that:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/AB8Wc.png" rel="nofollow n...
habedi/stack-exchange-dataset
54,291
is little-o notation correct after being powered by a number?
<p>I just wanted an example in which the equation given below is <strong>not</strong> correct.</p>&#xA;&#xA;<p>$f(n) = o(g(n)) \Leftrightarrow 2^{f(n)} = o(2^{g(n)})$</p>&#xA;
complexity theory
1
is little-o notation correct after being powered by a number? -- (complexity theory) <p>I just wanted an example in which the equation given below is <strong>not</strong> correct.</p>&#xA;&#xA;<p>$f(n) = o(g(n)) \Leftrightarrow 2^{f(n)} = o(2^{g(n)})$</p>&#xA;
habedi/stack-exchange-dataset
54,302
$O(n \log n)$ algorithm for disjoint segment visibility problem
<p>Consider we have $n$ disjoint segments and a point $P$ which is not on any segment. I want to find an $O(n \log n)$ algorithm to check which segments are visible from $P$. A segment is visible from $P$ if it has a point which is visible from $P$.</p>&#xA;&#xA;<p>My idea is to use a sweep half-line with one end-point...
algorithms computational geometry
1
$O(n \log n)$ algorithm for disjoint segment visibility problem -- (algorithms computational geometry) <p>Consider we have $n$ disjoint segments and a point $P$ which is not on any segment. I want to find an $O(n \log n)$ algorithm to check which segments are visible from $P$. A segment is visible from $P$ if it has a ...
habedi/stack-exchange-dataset
54,311
What are the differences between propositional logic and temporal logic?
<p>I am currently studying temporal logic and find it much similar to propositional logic. However, temporal logic seems to be slightly more specific because it encapsulates more precise meaning symbols, like <code>until, eventually, next</code> etc.. My question is are there other major differences with temporal logic...
propositional logic temporal logic
1
What are the differences between propositional logic and temporal logic? -- (propositional logic temporal logic) <p>I am currently studying temporal logic and find it much similar to propositional logic. However, temporal logic seems to be slightly more specific because it encapsulates more precise meaning symbols, lik...
habedi/stack-exchange-dataset
54,313
Does the memory get unallocated when program exits?
<p>I have been trying to manipulate pointers just for the sake of studying. I have had some problems with some programs I wrote where I had memory leak. <br><h3>Does this memory stay allocated even when the program returns?</h3> <br><ul><li>If yes how to deallocate it?</li><li>If no why, isn't all saved in heap so only...
memory management
1
Does the memory get unallocated when program exits? -- (memory management) <p>I have been trying to manipulate pointers just for the sake of studying. I have had some problems with some programs I wrote where I had memory leak. <br><h3>Does this memory stay allocated even when the program returns?</h3> <br><ul><li>If y...
habedi/stack-exchange-dataset
54,317
Indexing into a pattern database - Korf's Optimal Rubik's Cube solution
<p>As a fun project, I've been working on a C# implementation of Richard Korf's - Finding Optimal Solutions to Rubik's Cube Using Pattern Databases.</p>&#xA;&#xA;<p><a href="https://www.cs.princeton.edu/courses/archive/fall06/cos402/papers/korfrubik.pdf">https://www.cs.princeton.edu/courses/archive/fall06/cos402/papers...
algorithms permutations
1
Indexing into a pattern database - Korf's Optimal Rubik's Cube solution -- (algorithms permutations) <p>As a fun project, I've been working on a C# implementation of Richard Korf's - Finding Optimal Solutions to Rubik's Cube Using Pattern Databases.</p>&#xA;&#xA;<p><a href="https://www.cs.princeton.edu/courses/archive/...
habedi/stack-exchange-dataset
54,327
Approximating all independent sets of size k in a graph
<p>Given an undirected graph, I need an algorithm that outputs all the independent sets of size >= k (constant) in the graph. I know the problem is NPC, and I do not want to use the exponential brute-force solution. What I am looking for is to hear about the best solutions currently known to this problem. If someone ca...
complexity theory graphs
1
Approximating all independent sets of size k in a graph -- (complexity theory graphs) <p>Given an undirected graph, I need an algorithm that outputs all the independent sets of size >= k (constant) in the graph. I know the problem is NPC, and I do not want to use the exponential brute-force solution. What I am looking ...
habedi/stack-exchange-dataset
54,330
Need to remove indirect left recursion from CFG
<p>I need to remove indirect left recursion from the following CFG:&#xA;remove indirect left recursion from the following CFG.&#xA;$$A → Ba| b$$&#xA;$$B → Cd | e$$&#xA;$$C → Df | g$$&#xA;$$D → Df | Aa | Cg$$</p>&#xA;&#xA;<p>In the following solution, I have expanded all the non-terminals to get them converted to direct...
formal languages formal grammars parsers left recursion
1
Need to remove indirect left recursion from CFG -- (formal languages formal grammars parsers left recursion) <p>I need to remove indirect left recursion from the following CFG:&#xA;remove indirect left recursion from the following CFG.&#xA;$$A → Ba| b$$&#xA;$$B → Cd | e$$&#xA;$$C → Df | g$$&#xA;$$D → Df | Aa | Cg$$</p>...
habedi/stack-exchange-dataset
54,331
Why Does the Deterministic Selection Algorithm Run in $O(n)$ and not $O(n\log n)$?
<p>Here is pseudocode for the algorithm:</p>&#xA;&#xA;<pre><code>select(L,k)&#xA;{&#xA;if (L has 10 or fewer elements)&#xA;{&#xA; sort L&#xA; return the element in the kth position&#xA;}&#xA;&#xA;partition L into subsets S[i] of five elements each&#xA; (there will be n/5 subsets total).&#xA;&#xA;for (i = 1 to ...
algorithm analysis runtime analysis recursion selection problem
1
Why Does the Deterministic Selection Algorithm Run in $O(n)$ and not $O(n\log n)$? -- (algorithm analysis runtime analysis recursion selection problem) <p>Here is pseudocode for the algorithm:</p>&#xA;&#xA;<pre><code>select(L,k)&#xA;{&#xA;if (L has 10 or fewer elements)&#xA;{&#xA; sort L&#xA; return the element i...
habedi/stack-exchange-dataset
54,355
Brzozowski algebraic method for NFA
<p>Currently I have a graph (basically, a state graph) in Scala which is similar to an NFA </p>&#xA;&#xA;<ul>&#xA;<li><p>some nodes have multiple in/outgoing edges</p></li>&#xA;<li><p>single start state</p></li>&#xA;<li><p>there might be multiple final states</p></li>&#xA;<li>a state can contain self loops where a symb...
algorithms finite automata regular expressions nondeterminism simulation
1
Brzozowski algebraic method for NFA -- (algorithms finite automata regular expressions nondeterminism simulation) <p>Currently I have a graph (basically, a state graph) in Scala which is similar to an NFA </p>&#xA;&#xA;<ul>&#xA;<li><p>some nodes have multiple in/outgoing edges</p></li>&#xA;<li><p>single start state</p>...
habedi/stack-exchange-dataset
54,379
Find which bundles can be demanded together
<p>This question comes from economics. There is a market $M$ that contains $m$ items. There is a <em>value function</em> $v:2^M\to \mathbb{R}$, that assigns a monetary value to each "bundle" (- subset of $M$). The function is given by $2^m$ values - a value per bundle.</p>&#xA;&#xA;<p>A <em>price-vector</em> $p$ is a v...
algorithms combinatorics
1
Find which bundles can be demanded together -- (algorithms combinatorics) <p>This question comes from economics. There is a market $M$ that contains $m$ items. There is a <em>value function</em> $v:2^M\to \mathbb{R}$, that assigns a monetary value to each "bundle" (- subset of $M$). The function is given by $2^m$ value...
habedi/stack-exchange-dataset
54,410
Metaheuristic for NP-complete problem without exact algorithms other than brute-force
<p>Computing <a href="https://en.wikipedia.org/wiki/Strategy_(game_theory)#Pure_and_mixed_strategies" rel="nofollow">Pure Nash Equilibria</a> (PNE) is a <a href="https://en.wikipedia.org/wiki/Game_theory" rel="nofollow">Game Theory</a> related problem.&#xA;Deciding if there exists PNE in a given game has been shown to ...
np complete decision problem heuristics game theory
1
Metaheuristic for NP-complete problem without exact algorithms other than brute-force -- (np complete decision problem heuristics game theory) <p>Computing <a href="https://en.wikipedia.org/wiki/Strategy_(game_theory)#Pure_and_mixed_strategies" rel="nofollow">Pure Nash Equilibria</a> (PNE) is a <a href="https://en.wiki...
habedi/stack-exchange-dataset
54,414
Feedback polynomial of 7-bit Linear Feedback Shift Register
<p>My friend gave me a question to solve. The question he asked me was: the following sequence has been generated by a 7-bit linear feedback shift register. He asked me to find the feedback polynomial. I went through some lectures on LFSR on youtube. But still I am unable to solve this. Can anyone point out how to appr...
algorithms pseudo random generators
1
Feedback polynomial of 7-bit Linear Feedback Shift Register -- (algorithms pseudo random generators) <p>My friend gave me a question to solve. The question he asked me was: the following sequence has been generated by a 7-bit linear feedback shift register. He asked me to find the feedback polynomial. I went through so...
habedi/stack-exchange-dataset
54,415
Properties of self-dual code
<p>Let $C $ be a self-dual binary $[n,k,d]$ code.</p>&#xA;&#xA;<p>I want to show that if $ c=(c_1, \dots, c_n) \in C $ then $ \sum_{i=1}^n c_i=0$ and that all the words of the code have an even weight. </p>&#xA;&#xA;<p>We know that $ x \in C^{\perp} \Leftrightarrow Gx=0$ where $ G $ is the generator matrix.</p>&#xA;&#x...
coding theory
1
Properties of self-dual code -- (coding theory) <p>Let $C $ be a self-dual binary $[n,k,d]$ code.</p>&#xA;&#xA;<p>I want to show that if $ c=(c_1, \dots, c_n) \in C $ then $ \sum_{i=1}^n c_i=0$ and that all the words of the code have an even weight. </p>&#xA;&#xA;<p>We know that $ x \in C^{\perp} \Leftrightarrow Gx=0$ ...
habedi/stack-exchange-dataset
54,417
Proof of correctness of A star search algorithm
<p>I've been looking for the proof of correctness for the A star (A*) algorithm but none of the texts and websites offer it. Mostly they are talking about the proof of optimality of the A* algorithm. I'm looking for a proof that if the heuristic is admissible, A* will always give an optimal path.</p>&#xA;&#xA;<p>Please...
algorithms graphs search algorithms correctness proof
1
Proof of correctness of A star search algorithm -- (algorithms graphs search algorithms correctness proof) <p>I've been looking for the proof of correctness for the A star (A*) algorithm but none of the texts and websites offer it. Mostly they are talking about the proof of optimality of the A* algorithm. I'm looking f...
habedi/stack-exchange-dataset
54,423
Wang tile turing machine tile placement
<p>I've read numerous links on the fact that wang tiles are turing complete, and details about them (links at end).</p>&#xA;&#xA;<p>However there is little talk of how to actually place the tiles. One place i read mentioned (paraphrasing) "by placing tiles only where they are uniquely able to fit, you'll evaluate the ...
computability turing machines tiling
1
Wang tile turing machine tile placement -- (computability turing machines tiling) <p>I've read numerous links on the fact that wang tiles are turing complete, and details about them (links at end).</p>&#xA;&#xA;<p>However there is little talk of how to actually place the tiles. One place i read mentioned (paraphrasing...
habedi/stack-exchange-dataset
54,424
About the notation of XOR-SAT
<p>I am a bit confused by the notation here, <a href="http://www.boazbarak.org/sos/files/lec3.pdf" rel="nofollow">http://www.boazbarak.org/sos/files/lec3.pdf</a> </p>&#xA;&#xA;<ul>&#xA;<li><p>Given 3 Boolean variables $x_i, x_j, x_k$ what is supposed to be the meaning of $x_i \oplus x_j \oplus x_k$? </p>&#xA;&#xA;<p>Is...
np complete optimization np hard np
1
About the notation of XOR-SAT -- (np complete optimization np hard np) <p>I am a bit confused by the notation here, <a href="http://www.boazbarak.org/sos/files/lec3.pdf" rel="nofollow">http://www.boazbarak.org/sos/files/lec3.pdf</a> </p>&#xA;&#xA;<ul>&#xA;<li><p>Given 3 Boolean variables $x_i, x_j, x_k$ what is suppose...
habedi/stack-exchange-dataset
54,427
Running Build-Heap Algorithm on given numbers
<p>I don't fully understand this build-heap function. Lets assume we have array 3, 4, 5, 13, 16, 32. </p>&#xA;&#xA;<p>It seems like we swap the parent when it is less than the current A[j] but which number does the loop start with? Maybe somebody can go through 2-3 loops and show how the array changes after 1st loop, 2...
algorithms arrays heaps
1
Running Build-Heap Algorithm on given numbers -- (algorithms arrays heaps) <p>I don't fully understand this build-heap function. Lets assume we have array 3, 4, 5, 13, 16, 32. </p>&#xA;&#xA;<p>It seems like we swap the parent when it is less than the current A[j] but which number does the loop start with? Maybe somebod...
habedi/stack-exchange-dataset
54,428
Array covering problem
<p>Suppose that we have $N$ integer points on coordinate line: $X = \{x_1, ..., x_N\}$ and we have to add $M$ more points (their coordinates can be rational). </p>&#xA;&#xA;<p>Suppose that we chose some $Y = \{ y_1, ..., y_M \}$. Let's define distance between sets $X$ and $Y$ to be&#xA;$$d(X,Y) = \max_{i=1,...,N} ~~ \m...
optimization
1
Array covering problem -- (optimization) <p>Suppose that we have $N$ integer points on coordinate line: $X = \{x_1, ..., x_N\}$ and we have to add $M$ more points (their coordinates can be rational). </p>&#xA;&#xA;<p>Suppose that we chose some $Y = \{ y_1, ..., y_M \}$. Let's define distance between sets $X$ and $Y$ to...
habedi/stack-exchange-dataset
54,431
Why to implement Open list in Heuristic search with priority queue
<p>I don't understand why do we need to implement Open list using priority queue? There could be other data structure. </p>&#xA;&#xA;<p>I understand the usage of priority queues from <a href="https://stackoverflow.com/questions/18049847/when-would-i-use-a-priority-queue">this</a> example clearly. The newly discovered n...
algorithms search algorithms heuristics
1
Why to implement Open list in Heuristic search with priority queue -- (algorithms search algorithms heuristics) <p>I don't understand why do we need to implement Open list using priority queue? There could be other data structure. </p>&#xA;&#xA;<p>I understand the usage of priority queues from <a href="https://stackove...
habedi/stack-exchange-dataset
54,443
Randomized Meldable Heap - Expected Height
<p><a href="https://en.wikipedia.org/wiki/Randomized_meldable_heap">Randomized Meldable Heaps</a> have an operation "meld", which we then use to define all other operations, including insert.</p>&#xA;&#xA;<p>The question is, what is an expected height of that tree with $n$ nodes?</p>&#xA;&#xA;<p>Theorem 1 of Gambin and...
algorithm analysis data structures randomized algorithms heaps
1
Randomized Meldable Heap - Expected Height -- (algorithm analysis data structures randomized algorithms heaps) <p><a href="https://en.wikipedia.org/wiki/Randomized_meldable_heap">Randomized Meldable Heaps</a> have an operation "meld", which we then use to define all other operations, including insert.</p>&#xA;&#xA;<p>T...
habedi/stack-exchange-dataset