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 |
|---|---|---|---|---|---|---|
4,874 | Why are decision problems commonly used in complexity theory? | <p>From <a href="http://en.wikipedia.org/wiki/Computational_complexity_theory#Complexity_classes">Wikipedia</a>:</p>

<blockquote>
 <p>The type of computational problem: <strong>The most commonly used problems are
 decision problems</strong>. However, complexity classes can be defined based on
 f... | complexity theory terminology | 1 | Why are decision problems commonly used in complexity theory? -- (complexity theory terminology)
<p>From <a href="http://en.wikipedia.org/wiki/Computational_complexity_theory#Complexity_classes">Wikipedia</a>:</p>

<blockquote>
 <p>The type of computational problem: <strong>The most commonly used problems ... | habedi/stack-exchange-dataset |
4,880 | Relation between problems and algorithms | <p>From <a href="http://en.wikipedia.org/wiki/Computational_complexity_theory" rel="nofollow">Wikipedia</a></p>

<blockquote>
 <p><strong>a computational problem</strong> is understood to be a task that is in principle amenable to being solved by a computer (i.e. the problem can
 be stated by a set of... | algorithms complexity theory terminology | 1 | Relation between problems and algorithms -- (algorithms complexity theory terminology)
<p>From <a href="http://en.wikipedia.org/wiki/Computational_complexity_theory" rel="nofollow">Wikipedia</a></p>

<blockquote>
 <p><strong>a computational problem</strong> is understood to be a task that is in principle a... | habedi/stack-exchange-dataset |
4,884 | Meaning of complexity of a computational problem | <p>If I understand correctly, the complexity of solving a computational problem is defined in terms of which instance $I$ of the problem, what size $n$ of the problem instance, and what algorithm $A$ for solving the problem instance.</p>

<p>Is the complexity of the problem at a given size $n$ of the problem in... | complexity theory terminology | 1 | Meaning of complexity of a computational problem -- (complexity theory terminology)
<p>If I understand correctly, the complexity of solving a computational problem is defined in terms of which instance $I$ of the problem, what size $n$ of the problem instance, and what algorithm $A$ for solving the problem instance.</p... | habedi/stack-exchange-dataset |
4,887 | Dijkstra to favor solution with smallest number of edges if several paths have same weight | <p>You can modify any graph $G$ so that Dijkstra's finds the solution with the minimal number of edges thusly:</p>

<p>Multiply every edge weight with a number $a$, then add $1$ to the weight to penalize each additional edge in the solution, i.e. </p>

<p>$w'(u,v)=a*w(u,v)+1$</p>

<p>This does n... | algorithms graphs shortest path | 1 | Dijkstra to favor solution with smallest number of edges if several paths have same weight -- (algorithms graphs shortest path)
<p>You can modify any graph $G$ so that Dijkstra's finds the solution with the minimal number of edges thusly:</p>

<p>Multiply every edge weight with a number $a$, then add $1$ to the... | habedi/stack-exchange-dataset |
4,888 | Is there any way to distinguish between LL(k) and LR(k) grammar? | <p>I am recently studying about Compilers designing. I came to know about two types of grammar one is LL grammar and other is LR grammar.</p>

<p>We also know the facts that every LL grammar is LR that is LL grammar is a proper subset of LR grammar. First one is used in top-down parsing and the second one is us... | formal grammars compilers parsers lr k ll k | 1 | Is there any way to distinguish between LL(k) and LR(k) grammar? -- (formal grammars compilers parsers lr k ll k)
<p>I am recently studying about Compilers designing. I came to know about two types of grammar one is LL grammar and other is LR grammar.</p>

<p>We also know the facts that every LL grammar is LR t... | habedi/stack-exchange-dataset |
4,898 | Separate all leaves of a weighted tree with minimum weight cuts | <p>This is part of a larger problem, which I believe I have reduced to this. Given a tree $T$ having positive edge weights, and $k$ leaves (nodes which have exactly one connected node), I need to delete some edges in the tree so that no two leaves in the original tree are connected (by a path) in the newly formed fores... | algorithms graphs trees | 1 | Separate all leaves of a weighted tree with minimum weight cuts -- (algorithms graphs trees)
<p>This is part of a larger problem, which I believe I have reduced to this. Given a tree $T$ having positive edge weights, and $k$ leaves (nodes which have exactly one connected node), I need to delete some edges in the tree s... | habedi/stack-exchange-dataset |
4,899 | Expected gain of a game of chance with differently-priced tokens | <p>Foo and Bar are playing a game of strategy. At the start of the game, there are $N$ apples, placed in a row (in straight line). The apples are numbered from $1$ to $N$. Each apple has a particular price value.</p>

<p>The price of $i$th apple is $p_i$.</p>

<p>In this game, the players Foo and bar ma... | algorithms game theory | 1 | Expected gain of a game of chance with differently-priced tokens -- (algorithms game theory)
<p>Foo and Bar are playing a game of strategy. At the start of the game, there are $N$ apples, placed in a row (in straight line). The apples are numbered from $1$ to $N$. Each apple has a particular price value.</p>

<... | habedi/stack-exchange-dataset |
4,905 | How do I write a proof using induction on the length of the input string? | <p>In my Computing Theory course, a lot of our problems involve using induction on the length of the input string to prove statements about finite automata. I understand mathematical induction, however when strings come into play I get real tripped up. I'd really appreciate it if someone would go through the process ... | automata finite automata proof techniques reference question induction | 1 | How do I write a proof using induction on the length of the input string? -- (automata finite automata proof techniques reference question induction)
<p>In my Computing Theory course, a lot of our problems involve using induction on the length of the input string to prove statements about finite automata. I understand... | habedi/stack-exchange-dataset |
4,913 | Nested Big O-notation | <p>Let's say I have a graph $|G|$ with $|E|=O(V^2)$ edges. I want to run BFS on $G$ which has a running time of $O(V+E)$.</p>

<p>It feels natural to write that the running time on this graph would be $O(O(V^2)+V)$ and then simplify to $O(V^2)$.</p>

<p>Are there any pitfalls to using such a "remove-the... | terminology asymptotics landau notation | 1 | Nested Big O-notation -- (terminology asymptotics landau notation)
<p>Let's say I have a graph $|G|$ with $|E|=O(V^2)$ edges. I want to run BFS on $G$ which has a running time of $O(V+E)$.</p>

<p>It feels natural to write that the running time on this graph would be $O(O(V^2)+V)$ and then simplify to $O(V^2)$.... | habedi/stack-exchange-dataset |
4,914 | Why can't DFS be used to find shortest paths in unweighted graphs? | <p>I understand that using DFS "as is" will not find a shortest path in an unweighted graph. </p>

<p>But why is tweaking DFS to allow it to find shortest paths in unweighted graphs such a hopeless prospect? All texts on the subject simply state that it cannot be done. I'm unconvinced (without having tried it m... | algorithms graphs shortest path | 1 | Why can't DFS be used to find shortest paths in unweighted graphs? -- (algorithms graphs shortest path)
<p>I understand that using DFS "as is" will not find a shortest path in an unweighted graph. </p>

<p>But why is tweaking DFS to allow it to find shortest paths in unweighted graphs such a hopeless prospect? ... | habedi/stack-exchange-dataset |
4,918 | How to make a parse tree for the following propositional logic formula? | <p>I have a formula $ \neg((q \implies \neg q) \vee p \vee (\neg q \implies (r \wedge p))) $.</p>

<p>As it contains 3 subformulas between the $\vee$'s, how can i put it into a parse tree, as a parse tree contains 2 branches from each node.</p>
 | formal languages logic binary trees parsing | 1 | How to make a parse tree for the following propositional logic formula? -- (formal languages logic binary trees parsing)
<p>I have a formula $ \neg((q \implies \neg q) \vee p \vee (\neg q \implies (r \wedge p))) $.</p>

<p>As it contains 3 subformulas between the $\vee$'s, how can i put it into a parse tree, as... | habedi/stack-exchange-dataset |
4,924 | Closure of Deterministic context-free languages under prefix | <p>For a formal language $L \subseteq \Sigma^{*}$ I define the set Pref(L) to be:</p>

<p>$\text{pref}(L) = \{\alpha \in \Sigma^{*} : \exists \beta \in \Sigma^{*} \text{ such that } \alpha \beta \in L\}$</p>

<p>ie. the set of all (not necessarily proper) prefixes of words in $L$. I know that if $L$ is ... | formal languages context free closure properties | 1 | Closure of Deterministic context-free languages under prefix -- (formal languages context free closure properties)
<p>For a formal language $L \subseteq \Sigma^{*}$ I define the set Pref(L) to be:</p>

<p>$\text{pref}(L) = \{\alpha \in \Sigma^{*} : \exists \beta \in \Sigma^{*} \text{ such that } \alpha \beta \i... | habedi/stack-exchange-dataset |
4,941 | Dynamic programming with large number of subproblems | <p>Dynamic programming with large number of subproblems. So I'm trying to solve this problem from Interview Street:</p>

<blockquote>
 <p><strong>Grid Walking</strong> (Score 50 points)<br>
 You are situated in an $N$-dimensional grid at position $(x_1,x_2,\dots,x_N)$. The dimensions of the grid are $... | algorithms efficiency dynamic programming | 1 | Dynamic programming with large number of subproblems -- (algorithms efficiency dynamic programming)
<p>Dynamic programming with large number of subproblems. So I'm trying to solve this problem from Interview Street:</p>

<blockquote>
 <p><strong>Grid Walking</strong> (Score 50 points)<br>
 You are sit... | habedi/stack-exchange-dataset |
4,942 | Finding paths with smallest maximum edge weight | <p>I need to find the easiest cost path between two vertices of a graph. Easiest here means the path with the smallest maximum-weigth edge. </p>

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

<p>In the above graph, the easiest path from 1 to 2 is: </p>
&#... | algorithms graphs shortest path | 1 | Finding paths with smallest maximum edge weight -- (algorithms graphs shortest path)
<p>I need to find the easiest cost path between two vertices of a graph. Easiest here means the path with the smallest maximum-weigth edge. </p>

<p><img src="https://i.stack.imgur.com/WWszV.png" alt="enter image description he... | habedi/stack-exchange-dataset |
4,960 | Clarifications on polynomial reducibility for problems in P and NP-complete | <p><strong>Can I always increase the complexity of a problem via polynomial reduction?</strong> (in which case '<em>reduction</em>' is really a misnomer) For example, if I have a classic P problem (say, finding the smallest element in an array, by iterating through and making comparisons with the smallest value found t... | complexity theory time complexity | 1 | Clarifications on polynomial reducibility for problems in P and NP-complete -- (complexity theory time complexity)
<p><strong>Can I always increase the complexity of a problem via polynomial reduction?</strong> (in which case '<em>reduction</em>' is really a misnomer) For example, if I have a classic P problem (say, fi... | habedi/stack-exchange-dataset |
4,968 | Are $\log_{10}(x)$ and $\log_2(x)$ in the same big-O class of functions? | <p>Are $\log_{10}(x)$ and $\log_{2}(x)$ in the same big-O class of functions? In other words, can one say that $\log_{10}(x)=O(\log x)$ and $\log_{2}(x)=O(\log x)$?</p>
 | landau notation | 1 | Are $\log_{10}(x)$ and $\log_2(x)$ in the same big-O class of functions? -- (landau notation)
<p>Are $\log_{10}(x)$ and $\log_{2}(x)$ in the same big-O class of functions? In other words, can one say that $\log_{10}(x)=O(\log x)$ and $\log_{2}(x)=O(\log x)$?</p>
 | habedi/stack-exchange-dataset |
4,972 | What's the difference between a rule based system and an artificial neural network? | <p>I'm currently doing some reading into AI and up to this point couldn't find a satisfying answer to this question: what's the difference between a rule based system and an artificial neural network?</p>

<p>From my understanding both are trying to do inference based on a variety of different inputs.</p>
 | artificial intelligence neural networks | 1 | What's the difference between a rule based system and an artificial neural network? -- (artificial intelligence neural networks)
<p>I'm currently doing some reading into AI and up to this point couldn't find a satisfying answer to this question: what's the difference between a rule based system and an artificial neural... | habedi/stack-exchange-dataset |
4,984 | Prove that the language of non-prime numbers written in unary is not regular | <p>Im trying to prove that the following language is not regular.
$$\text{Notprime} = \{a^n \text{where \(n\) isn't prime}\}
 = \{\epsilon, a, aaaa, aaaaaa, aaaaaaaa, \ldots\}$$</p>

<p>Heres what I have:</p>

<p>"If Notprime were regular, then its complement would be regular also. However, the... | regular languages finite automata | 1 | Prove that the language of non-prime numbers written in unary is not regular -- (regular languages finite automata)
<p>Im trying to prove that the following language is not regular.
$$\text{Notprime} = \{a^n \text{where \(n\) isn't prime}\}
 = \{\epsilon, a, aaaa, aaaaaa, aaaaaaaa, \ldots\}$$</p>

<p>H... | habedi/stack-exchange-dataset |
4,989 | Why does it take $O(f(n)^2)$ to simulate a 3-tape $O(f(n))$-time TM on a 1-tape TM? | <p>This looks like a fundamental result but I can't find a resource online that gives an intuitive interpretation of this complexity. Any basic explanation is appreciated.</p>
 | turing machines tape complexity | 1 | Why does it take $O(f(n)^2)$ to simulate a 3-tape $O(f(n))$-time TM on a 1-tape TM? -- (turing machines tape complexity)
<p>This looks like a fundamental result but I can't find a resource online that gives an intuitive interpretation of this complexity. Any basic explanation is appreciated.</p>
 | habedi/stack-exchange-dataset |
4,992 | Which properties of context sensitive languages are decidable? | <p>There are two context-sensitive languages, $L_1$ and $L_2$. Which of the following statements about them are decidable respectively undecidable?</p>

<ol>
<li>$L_1 = \emptyset$</li>
<li>$L_1 = \Sigma^*$</li>
<li>$L_1 \cap L_2 = \emptyset$</li>
<li>$\overline{L_1}$ is also a context-sensitive ... | formal languages undecidability context sensitive | 1 | Which properties of context sensitive languages are decidable? -- (formal languages undecidability context sensitive)
<p>There are two context-sensitive languages, $L_1$ and $L_2$. Which of the following statements about them are decidable respectively undecidable?</p>

<ol>
<li>$L_1 = \emptyset$</li>
<... | habedi/stack-exchange-dataset |
4,994 | Dynamic programming table for finding similar substrings is too large | <blockquote>
 <p><strong>Substring Diff</strong><br>
 Given two strings of length $n$, $P = p_1\dots p_n$ and $Q = q_1 \dots q_n$, we define $M(i, j, L)$ as the number of
 mismatches between $p_i \dots p_{i+L-1}$ and $q_j \dots q_{j+L-1}$. In set
 notation, $M(i, j, L)$ refers to the size of the set... | strings dynamic programming substrings | 1 | Dynamic programming table for finding similar substrings is too large -- (strings dynamic programming substrings)
<blockquote>
 <p><strong>Substring Diff</strong><br>
 Given two strings of length $n$, $P = p_1\dots p_n$ and $Q = q_1 \dots q_n$, we define $M(i, j, L)$ as the number of
 mismatches between ... | habedi/stack-exchange-dataset |
4,998 | Is there a O(log n) algorithm for matrix exponentiation? | <p>Is there an algorithm to raise a matrix to the <span class="math-container">$n$</span>th power in <span class="math-container">$O(\log n)$</span> time? </p>

<p>I have been searching online, but have been unsuccessful thus far.</p>
 | algorithms time complexity matrices | 1 | Is there a O(log n) algorithm for matrix exponentiation? -- (algorithms time complexity matrices)
<p>Is there an algorithm to raise a matrix to the <span class="math-container">$n$</span>th power in <span class="math-container">$O(\log n)$</span> time? </p>

<p>I have been searching online, but have been unsucc... | habedi/stack-exchange-dataset |
5,006 | What's an intuitive distinction between semi-computable problems and noncomputable problems/functions? | <p>The definitions I've found were highly technical and using terms I've never seen before. </p>

<p>Say, I have a certain irrational number <em>e</em> that I get get closer and closer to with a computer and I want to determine if there is a particular digit <em>d</em> appearing after a certain position. Or wha... | computability terminology | 1 | What's an intuitive distinction between semi-computable problems and noncomputable problems/functions? -- (computability terminology)
<p>The definitions I've found were highly technical and using terms I've never seen before. </p>

<p>Say, I have a certain irrational number <em>e</em> that I get get closer and ... | habedi/stack-exchange-dataset |
5,009 | What is the relationship between NP/NP-Complete/NP-Hard to time complexity? | <p>I'm familiar with a few problems of each class and even though the definitions are based on sets and polynomial reducibility, I see a pattern with time complexity. NP problems appear to be $O(2^n)$ (minus the P problems of course), and NP-hard problems seem to be worse: $n^n$ or $n!$ (Chess, TSP). Is this a misleadi... | complexity theory terminology time complexity np hard | 1 | What is the relationship between NP/NP-Complete/NP-Hard to time complexity? -- (complexity theory terminology time complexity np hard)
<p>I'm familiar with a few problems of each class and even though the definitions are based on sets and polynomial reducibility, I see a pattern with time complexity. NP problems appear... | habedi/stack-exchange-dataset |
5,010 | Finding an isomorphism between finite automata | <p>Im having trouble figuring out how to determine if two finite automata are the same apart from renumbered states. </p>

<p>More specifically, heres an example:
<img src="https://i.stack.imgur.com/EPdpg.jpg" alt="example"> </p>

<p>It's easy to generate a regular expression by hand and see that b... | automata finite automata graph isomorphism | 1 | Finding an isomorphism between finite automata -- (automata finite automata graph isomorphism)
<p>Im having trouble figuring out how to determine if two finite automata are the same apart from renumbered states. </p>

<p>More specifically, heres an example:
<img src="https://i.stack.imgur.com/EPdpg.jpg" al... | habedi/stack-exchange-dataset |
5,036 | Alternative to Hamming distance for permutations | <p>I have two strings, where one is a permutation of the other. I was wondering if there is an alternative to <a href="http://en.wikipedia.org/wiki/Hamming_distance">Hamming distance</a> where instead of finding the minimum number of substitutions required, it would find the minimum number of translocations required to... | terminology string metrics permutations edit distance | 1 | Alternative to Hamming distance for permutations -- (terminology string metrics permutations edit distance)
<p>I have two strings, where one is a permutation of the other. I was wondering if there is an alternative to <a href="http://en.wikipedia.org/wiki/Hamming_distance">Hamming distance</a> where instead of finding ... | habedi/stack-exchange-dataset |
5,040 | What is the difference between bounding and pruning in branch-and-bound algorithms? | <p>Could anybody please explain what the difference between "bounding" and "pruning" in branch and bound algorithms is?</p>

<p>I'd also appreciate references (preferably books), where this distinction is made clear.</p>
 | algorithms terminology branch and bound | 1 | What is the difference between bounding and pruning in branch-and-bound algorithms? -- (algorithms terminology branch and bound)
<p>Could anybody please explain what the difference between "bounding" and "pruning" in branch and bound algorithms is?</p>

<p>I'd also appreciate references (preferably books), wher... | habedi/stack-exchange-dataset |
5,042 | Indirection in IAS computer | <p>From <a href="http://rads.stackoverflow.com/amzn/click/013293633X">Computer Organisation and Architecture</a>: </p>

<blockquote>
 <p>The IAS operates by repetitively performing an instruction cycle. Each
 instruction cycle consists of two sub cycles. During a fetch cycle,
 the opcode of the n... | computer architecture | 1 | Indirection in IAS computer -- (computer architecture)
<p>From <a href="http://rads.stackoverflow.com/amzn/click/013293633X">Computer Organisation and Architecture</a>: </p>

<blockquote>
 <p>The IAS operates by repetitively performing an instruction cycle. Each
 instruction cycle consists of two sub ... | habedi/stack-exchange-dataset |
6,046 | What is a good resource to learn about oriented matroids in the context of digraphs and optimization? | <p>I am interested in <a href="http://en.wikipedia.org/wiki/Oriented_matroid" rel="nofollow">oriented matroids</a> in the context of directed graphs and optimization. Unfortunately, I know very little of the topic. Is there a book, article or a resource that serves as a good introduction to oriented matroids, especiall... | optimization reference request discrete mathematics matroids | 1 | What is a good resource to learn about oriented matroids in the context of digraphs and optimization? -- (optimization reference request discrete mathematics matroids)
<p>I am interested in <a href="http://en.wikipedia.org/wiki/Oriented_matroid" rel="nofollow">oriented matroids</a> in the context of directed graphs and... | habedi/stack-exchange-dataset |
6,055 | Compute relational composition in $O(|E||V|)$ | <p>Definitions: Let $G=(V,E)$ be a DAG without self-loops, and $X \subseteq G$ and $Y \subseteq G$ be graphs.</p>

<p>Input: $X,Y$. Output: The relational composition <a href="http://en.wikipedia.org/wiki/Relation_composition">relational composition</a> $X \circ Y$ in $\mathcal{O}(|E||V|)$.</p>

<ul>&#x... | algorithms graphs algorithm analysis check my algorithm | 1 | Compute relational composition in $O(|E||V|)$ -- (algorithms graphs algorithm analysis check my algorithm)
<p>Definitions: Let $G=(V,E)$ be a DAG without self-loops, and $X \subseteq G$ and $Y \subseteq G$ be graphs.</p>

<p>Input: $X,Y$. Output: The relational composition <a href="http://en.wikipedia.org/wiki/... | habedi/stack-exchange-dataset |
6,058 | How can lazy learning systems simultaneously solve multiple problems? | <p>On the english Wikipedia <a href="http://en.wikipedia.org/wiki/Lazy_learning" rel="nofollow">it says about lazy learning systems</a>:</p>

<blockquote>
 <p>Because the target function is approximated locally for each query to the system, lazy learning systems can simultaneously solve multiple problems [... | terminology machine learning | 1 | How can lazy learning systems simultaneously solve multiple problems? -- (terminology machine learning)
<p>On the english Wikipedia <a href="http://en.wikipedia.org/wiki/Lazy_learning" rel="nofollow">it says about lazy learning systems</a>:</p>

<blockquote>
 <p>Because the target function is approximated ... | habedi/stack-exchange-dataset |
6,063 | How to prove that DFAs from NFAs can have exponential number of states? | <p>All non-deterministic finite automata can be turned into equivalent deterministic finite automata. However, a deterministic finite automata only allows a single arrow per symbol pointing from a state. Therefore, its states should be members of the power set of states of the NFA. This seems to indicate that the numbe... | automata finite automata nondeterminism | 1 | How to prove that DFAs from NFAs can have exponential number of states? -- (automata finite automata nondeterminism)
<p>All non-deterministic finite automata can be turned into equivalent deterministic finite automata. However, a deterministic finite automata only allows a single arrow per symbol pointing from a state.... | habedi/stack-exchange-dataset |
6,067 | What is the difference between operator and function? | <p>We have operator and operands, function and formal arguments. Is the difference purely lexical (we use alphanumerics for funciton identifiers but identify operators with special characters, e.g. "+" and ">=") or it is syntactical, like <a href="http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.vhdl/2012-10/msg0... | terminology programming languages | 1 | What is the difference between operator and function? -- (terminology programming languages)
<p>We have operator and operands, function and formal arguments. Is the difference purely lexical (we use alphanumerics for funciton identifiers but identify operators with special characters, e.g. "+" and ">=") or it is syntac... | habedi/stack-exchange-dataset |
6,072 | Why is Uniform cost search called "uniform" cost search? | <p>By <a href="https://math.stackexchange.com/questions/112734/in-what-sense-is-uniform-cost-search-uniform">this</a> possibly good attempt to explain this, the "uniformity" in the Uniform cost search <em>is actually the uniformity of the heuristic function</em>.</p>

<p>Is this explanation correct ? If yes, th... | terminology artificial intelligence search algorithms heuristics | 1 | Why is Uniform cost search called "uniform" cost search? -- (terminology artificial intelligence search algorithms heuristics)
<p>By <a href="https://math.stackexchange.com/questions/112734/in-what-sense-is-uniform-cost-search-uniform">this</a> possibly good attempt to explain this, the "uniformity" in the Uniform cost... | habedi/stack-exchange-dataset |
6,075 | How to prove $(n+1)! = O(2^{(2^n)})$ | <p>I am trying to prove $(n+1)! = O(2^{(2^n)})$. I am trying to use L'Hospital rule but I am stuck with infinite derivatives.</p>

<p>Can anyone tell me how i can prove this?</p>
 | asymptotics mathematical analysis landau notation | 1 | How to prove $(n+1)! = O(2^{(2^n)})$ -- (asymptotics mathematical analysis landau notation)
<p>I am trying to prove $(n+1)! = O(2^{(2^n)})$. I am trying to use L'Hospital rule but I am stuck with infinite derivatives.</p>

<p>Can anyone tell me how i can prove this?</p>
 | habedi/stack-exchange-dataset |
6,078 | A d-ary heap problem from CLRS | <p>I got confused while solving the following problem (questions 1–3).</p>

<h3>Question</h3>

<blockquote>
 <p>A <em>d</em>-ary heap is like a binary heap, but(with one possible exception) non-leaf nodes have <em>d</em> children instead of 2 children.</p>
 
 <ol>
 <li><p>How would y... | data structures time complexity runtime analysis | 1 | A d-ary heap problem from CLRS -- (data structures time complexity runtime analysis)
<p>I got confused while solving the following problem (questions 1–3).</p>

<h3>Question</h3>

<blockquote>
 <p>A <em>d</em>-ary heap is like a binary heap, but(with one possible exception) non-leaf nodes have <em>... | habedi/stack-exchange-dataset |
6,085 | Average number of comparisons to locate item in BST | <p>This is a GRE practice question. </p>

<p><img src="https://i.stack.imgur.com/dUavw.png" alt="BST n=8"></p>

<p>If a node in the binary search tree above is to be located by binary tree search, what is the expected number of comparisons required to locate one of the items (nodes) in the tree chosen a... | algorithm analysis data structures binary trees search trees average case | 1 | Average number of comparisons to locate item in BST -- (algorithm analysis data structures binary trees search trees average case)
<p>This is a GRE practice question. </p>

<p><img src="https://i.stack.imgur.com/dUavw.png" alt="BST n=8"></p>

<p>If a node in the binary search tree above is to be located... | habedi/stack-exchange-dataset |
6,086 | Which of the following regular expressions generate(s) no string with two consecutive 1’s? | <p>This is a GRE practice question. </p>

<p>Which of the following regular expressions generate(s) no string with two consecutive 1’s? (Note that ε denotes the empty string.)</p>

<p>I. (1 + ε)(01 + 0)* </p>

<p>II. (01+10)*</p>

<p>III. (0+1)*(0+ε)</p>

<p>(A) I only</p>
&#... | regular expressions | 1 | Which of the following regular expressions generate(s) no string with two consecutive 1’s? -- (regular expressions)
<p>This is a GRE practice question. </p>

<p>Which of the following regular expressions generate(s) no string with two consecutive 1’s? (Note that ε denotes the empty string.)</p>

<p>I. (... | habedi/stack-exchange-dataset |
6,088 | Decidability of a problem concerning polynomials | <p>I have come across the following interesting problem: let $p,q$ be polynomials over the field of real numbers, and let us suppose that their coefficients are all integer (that is, there is a finite exact representation of these polynomials). If needed, we may suppose that the degree of both polynomials is equal. Let... | computability undecidability computer algebra | 1 | Decidability of a problem concerning polynomials -- (computability undecidability computer algebra)
<p>I have come across the following interesting problem: let $p,q$ be polynomials over the field of real numbers, and let us suppose that their coefficients are all integer (that is, there is a finite exact representatio... | habedi/stack-exchange-dataset |
6,108 | Are all context-sensitive languages decidable? | <p>I was going through the <a href="http://en.wikipedia.org/wiki/Context-sensitive_language">Wikipedia definition of <em>context-sensitive language</em></a> and I found this:</p>

<blockquote>
 <p>Each category of languages is a proper subset of the category directly above it. Any automaton and any grammar... | formal grammars turing machines undecidability context sensitive | 1 | Are all context-sensitive languages decidable? -- (formal grammars turing machines undecidability context sensitive)
<p>I was going through the <a href="http://en.wikipedia.org/wiki/Context-sensitive_language">Wikipedia definition of <em>context-sensitive language</em></a> and I found this:</p>

<blockquote>&#x... | habedi/stack-exchange-dataset |
6,111 | How can I reduce Subset Sum to Partition? | <p>Maybe this is quite simple but I have some trouble to get this reduction. I want to reduce <a href="http://en.wikipedia.org/wiki/Subset_sum_problem">Subset Sum</a> to <a href="http://en.wikipedia.org/wiki/Partition_problem">Partition</a> but at this time I don't see the relation!</p>

<p>Is it possible to r... | complexity theory np complete reductions | 1 | How can I reduce Subset Sum to Partition? -- (complexity theory np complete reductions)
<p>Maybe this is quite simple but I have some trouble to get this reduction. I want to reduce <a href="http://en.wikipedia.org/wiki/Subset_sum_problem">Subset Sum</a> to <a href="http://en.wikipedia.org/wiki/Partition_problem">Part... | habedi/stack-exchange-dataset |
6,114 | Represent string as concatenations | <p>If $S_1,S_2$ are set of strings, then $S_1S_2 = \{s_1s_2|s_1\in S_1, s_2\in S_2\}$. $S^0=\{\epsilon\}$, $\epsilon$ is the empty string. $S^n = S^{n-1}S$. </p>

<p>Two related problems about represent string as concatenation of other strings. </p>

<ol>
<li><p>Given a finite set $S$ of strings, ho... | algorithms formal languages strings | 1 | Represent string as concatenations -- (algorithms formal languages strings)
<p>If $S_1,S_2$ are set of strings, then $S_1S_2 = \{s_1s_2|s_1\in S_1, s_2\in S_2\}$. $S^0=\{\epsilon\}$, $\epsilon$ is the empty string. $S^n = S^{n-1}S$. </p>

<p>Two related problems about represent string as concatenation of other ... | habedi/stack-exchange-dataset |
6,115 | What's a fast algorithm to decide whether there is an $A_G$ corresponding to a given $\chi_G(\lambda)$? | <p>Given an adjacency matrix <span class="math-container">$A_G$</span> of an undirected graph <span class="math-container">$G$</span>, it is easy and straightforward to compute the characteristic polynomial <span class="math-container">$\chi_G(\lambda)$</span>. What about the other way around? The problem can be formul... | algorithms graphs discrete mathematics matrices | 1 | What's a fast algorithm to decide whether there is an $A_G$ corresponding to a given $\chi_G(\lambda)$? -- (algorithms graphs discrete mathematics matrices)
<p>Given an adjacency matrix <span class="math-container">$A_G$</span> of an undirected graph <span class="math-container">$G$</span>, it is easy and straightforwa... | habedi/stack-exchange-dataset |
6,122 | How to show that f(x) is primitive recursive? | <blockquote>
 <p>Let </p>
 
 <p>$$f(x)=\begin{cases} x \quad \text{if Goldbach's conjecture is true
 }\\ 0 \quad \text{otherwise}\end{cases}$$</p>
 
 <p>Show that f(x) is primitive recursive.</p>
</blockquote>

<p>I know a primitive recursive function is obtained by composition ... | computability recursion | 1 | How to show that f(x) is primitive recursive? -- (computability recursion)
<blockquote>
 <p>Let </p>
 
 <p>$$f(x)=\begin{cases} x \quad \text{if Goldbach's conjecture is true
 }\\ 0 \quad \text{otherwise}\end{cases}$$</p>
 
 <p>Show that f(x) is primitive recursive.</p>
</blockquote>&#x... | habedi/stack-exchange-dataset |
6,125 | When would best first search be worse than breadth first search? | <p>I am studying <a href="http://en.wikipedia.org/wiki/Best-first_search" rel="noreferrer">best first search</a> as it compares to BFS (breadth-first search) and DFS (depth-first search), but I don't know when BFS is better than best-first search. So, my question is </p>

<blockquote>
 <p>When would best-f... | graphs artificial intelligence search algorithms | 1 | When would best first search be worse than breadth first search? -- (graphs artificial intelligence search algorithms)
<p>I am studying <a href="http://en.wikipedia.org/wiki/Best-first_search" rel="noreferrer">best first search</a> as it compares to BFS (breadth-first search) and DFS (depth-first search), but I don't k... | habedi/stack-exchange-dataset |
6,128 | Complement of HAMPATH | <p>Is the complement of the <a href="http://en.wikipedia.org/wiki/Hamiltonian_path" rel="nofollow">Hamiltonian Path problem</a> known to be in $\mathsf{NP}$? I could not find explanations saying that it is, but then neither were there any claims saying that it is <strong>not</strong> in $\mathsf{NP}$.</p>
 | complexity theory decision problem | 1 | Complement of HAMPATH -- (complexity theory decision problem)
<p>Is the complement of the <a href="http://en.wikipedia.org/wiki/Hamiltonian_path" rel="nofollow">Hamiltonian Path problem</a> known to be in $\mathsf{NP}$? I could not find explanations saying that it is, but then neither were there any claims saying that ... | habedi/stack-exchange-dataset |
6,138 | Problem with implementing Brzozowski's algorithm | <p>I've been trying to implement Brzozowski's algorithm but I've just discovered that it creates suboptimal automata for a certain class of inputs, having one more state than what is really needed in the result. I can show it on a trivial automaton:</p>

<pre><code> a b a b a b ... | algorithms automata finite automata | 1 | Problem with implementing Brzozowski's algorithm -- (algorithms automata finite automata)
<p>I've been trying to implement Brzozowski's algorithm but I've just discovered that it creates suboptimal automata for a certain class of inputs, having one more state than what is really needed in the result. I can show it on a... | habedi/stack-exchange-dataset |
6,139 | Universality of NOT and CNOT | <p>I'm trying to figure out why NOT and CNOT gates are not sufficient to create all bijective functions in classical circuits. I have been struggling on this for hours, and just can't make sense of it.</p>

<p>I feel it has something to do with the Toffoli gate, as it contains an (implicit) AND operation, and I... | logic circuits | 1 | Universality of NOT and CNOT -- (logic circuits)
<p>I'm trying to figure out why NOT and CNOT gates are not sufficient to create all bijective functions in classical circuits. I have been struggling on this for hours, and just can't make sense of it.</p>

<p>I feel it has something to do with the Toffoli gate, ... | habedi/stack-exchange-dataset |
6,144 | Rigorous proof against pseudo random function | <p>I have the following problem:</p>

<p>Define the keyed function F as follows: On input k ∈ {0, 1}$^n$
and x ∈ {0, 1}$^n$ , Fk(x) = k ⊕ x.Rigorously prove that F is not a pseudorandom function.</p>

<p>How do I approach a proof against pseudorandomness for a keyed function? I don't know where to st... | proof techniques cryptography | 1 | Rigorous proof against pseudo random function -- (proof techniques cryptography)
<p>I have the following problem:</p>

<p>Define the keyed function F as follows: On input k ∈ {0, 1}$^n$
and x ∈ {0, 1}$^n$ , Fk(x) = k ⊕ x.Rigorously prove that F is not a pseudorandom function.</p>

<p>How do I approac... | habedi/stack-exchange-dataset |
6,146 | Lower bounds: queues that return their min elements in $O(1)$ time | <p>First, consider this simple problem --- design a data structure of <em>comparable</em> elements that behaves just like a stack (in particular, push(), pop() and top() take constant time), but can also return its min value in $O(1)$ time, without removing it from the stack. This is easy by maintaining a second stack ... | data structures priority queues lower bounds | 1 | Lower bounds: queues that return their min elements in $O(1)$ time -- (data structures priority queues lower bounds)
<p>First, consider this simple problem --- design a data structure of <em>comparable</em> elements that behaves just like a stack (in particular, push(), pop() and top() take constant time), but can also... | habedi/stack-exchange-dataset |
6,150 | Designing context free grammar for a language with range restriction on repetition of alphabets | <p>I am having issue with designing contex free grammar for the following language:</p>

<p>$L = \{0^n 1^m \, | \, 2n \leq m \leq 3n \}$ </p>

<p>I can design for the individual cases i.e. for $m \geq 2n$ and $m \leq 3n$ but don't know how should i combine both. Or is it a different approach altogether?... | context free | 1 | Designing context free grammar for a language with range restriction on repetition of alphabets -- (context free)
<p>I am having issue with designing contex free grammar for the following language:</p>

<p>$L = \{0^n 1^m \, | \, 2n \leq m \leq 3n \}$ </p>

<p>I can design for the individual cases i.e. f... | habedi/stack-exchange-dataset |
6,154 | Given the phrase "Where NONE of the following are TRUE" and two statements how should a boolean logic be composed? | <p>Let's have two statements</p>

<ol>
<li><strong>(value > 10)</strong></li>
<li><strong>(value < 25)</strong></li>
</ol>

<p>And a list of items with the following values</p>

<ul>
<li>10</li>
<li>20</li>
<li>30</li>
</ul>

<p>This is what a truth table w... | logic | 1 | Given the phrase "Where NONE of the following are TRUE" and two statements how should a boolean logic be composed? -- (logic)
<p>Let's have two statements</p>

<ol>
<li><strong>(value > 10)</strong></li>
<li><strong>(value < 25)</strong></li>
</ol>

<p>And a list of items with the followi... | habedi/stack-exchange-dataset |
6,161 | What is the depth of a complete binary tree with $N$ nodes? | <p>This question uses the following definition of a complete binary tree<sup>†</sup>:</p>

<blockquote>
 <p>A binary tree $T$ with $N$ levels is complete if all levels except possibly the last are completely full, and the last level has all its nodes to the left side.</p>
</blockquote>

<p>The ... | data structures binary trees | 1 | What is the depth of a complete binary tree with $N$ nodes? -- (data structures binary trees)
<p>This question uses the following definition of a complete binary tree<sup>†</sup>:</p>

<blockquote>
 <p>A binary tree $T$ with $N$ levels is complete if all levels except possibly the last are completely full,... | habedi/stack-exchange-dataset |
6,163 | A context-free grammar for all strings that end in b and have an even number of bs | <p>I'm trying to find CFG's that generate a regular language over the alphabet {a b}</p>

<p>I believe I got this one right: All strings that end in b and have an <strong>even</strong> number of b's in total:</p>

<p>$\qquad S \to SS \\
\qquad S \to YbYb \mid \varepsilon \\
\qquad Y \to aY \mid ... | regular languages formal grammars context free | 1 | A context-free grammar for all strings that end in b and have an even number of bs -- (regular languages formal grammars context free)
<p>I'm trying to find CFG's that generate a regular language over the alphabet {a b}</p>

<p>I believe I got this one right: All strings that end in b and have an <strong>even</... | habedi/stack-exchange-dataset |
6,167 | If a Language is Non-Recognizable then what about its complement? | <p>Is the complement of a Non-Recognizable language</p>

<ol>
<li>Recognizable</li>
<li>Non-Recognizable</li>
<li>May be Recognizable, May be Non-recognizable. I.e cant comment.</li>
</ol>

<p>A mathematical proof would be of great help since im unable to think of any way to prove this.<... | computability turing machines | 1 | If a Language is Non-Recognizable then what about its complement? -- (computability turing machines)
<p>Is the complement of a Non-Recognizable language</p>

<ol>
<li>Recognizable</li>
<li>Non-Recognizable</li>
<li>May be Recognizable, May be Non-recognizable. I.e cant comment.</li>
</ol>
&#... | habedi/stack-exchange-dataset |
6,176 | Finding big O notation of function with two parameters | <p>I'm looking to work out the big-O notation for the following:</p>

<p>$$\frac{n^{s + 1} - 1}{n - 1} - 1$$</p>

<p>I have a feeling the result is $O\left( n^s \right)$ but I'm not sure how to prove it.</p>

<p>Any help greatly appreciated! :)</p>
 | time complexity | 1 | Finding big O notation of function with two parameters -- (time complexity)
<p>I'm looking to work out the big-O notation for the following:</p>

<p>$$\frac{n^{s + 1} - 1}{n - 1} - 1$$</p>

<p>I have a feeling the result is $O\left( n^s \right)$ but I'm not sure how to prove it.</p>

<p>Any help... | habedi/stack-exchange-dataset |
6,187 | Program compilation and execution flow | <p>I was studying operating system concepts from <a href="http://rads.stackoverflow.com/amzn/click/0471417432" rel="nofollow noreferrer">Silberschatz, Galvin and Gagne's book</a> (sixth edition) and I have some questions about the flow of execution of a program. A figure explains the processing of the user program:</p>... | compilers operating systems memory management virtual memory | 1 | Program compilation and execution flow -- (compilers operating systems memory management virtual memory)
<p>I was studying operating system concepts from <a href="http://rads.stackoverflow.com/amzn/click/0471417432" rel="nofollow noreferrer">Silberschatz, Galvin and Gagne's book</a> (sixth edition) and I have some ques... | habedi/stack-exchange-dataset |
6,192 | Explanation of recursive structure of Van Emde Boas Tree | <p>From <a href="http://fileadmin.cs.lth.se/cs/Personal/Rolf_Karlsson/lect12.pdf" rel="nofollow">Van Emde Boas trees lecture</a>:</p>

<blockquote>
 <p>We will use the idea of superimposing a tree of degree ${u^{1/2}}$ on top of
 a bit vector, but <strong>shrink the universe size recursively</strong> ... | algorithms data structures algorithm analysis search trees trees | 1 | Explanation of recursive structure of Van Emde Boas Tree -- (algorithms data structures algorithm analysis search trees trees)
<p>From <a href="http://fileadmin.cs.lth.se/cs/Personal/Rolf_Karlsson/lect12.pdf" rel="nofollow">Van Emde Boas trees lecture</a>:</p>

<blockquote>
 <p>We will use the idea of supe... | habedi/stack-exchange-dataset |
6,193 | Size of the universe for van Emde Boas Trees | <p>In order to achieve the time complexity of $O(\log \log u)$ for van Emde Boas trees I read in <a href="http://fileadmin.cs.lth.se/cs/Personal/Rolf_Karlsson/lect12.pdf" rel="nofollow">this lecture</a> that the the universe size $u$ is chosen as $u = 2^{2^k}$ for some integer $k$ for van Emde Boas trees. Why choose ... | algorithms data structures algorithm analysis binary trees trees | 1 | Size of the universe for van Emde Boas Trees -- (algorithms data structures algorithm analysis binary trees trees)
<p>In order to achieve the time complexity of $O(\log \log u)$ for van Emde Boas trees I read in <a href="http://fileadmin.cs.lth.se/cs/Personal/Rolf_Karlsson/lect12.pdf" rel="nofollow">this lecture</a> th... | habedi/stack-exchange-dataset |
6,200 | Using Amdahl's law how do you determine execution time after an improvement? | <p>Speeding up a new floating-point unit by 2 slows down data cache accesses by a factor of 2/3 (or a 1.5 slowdown for data caches). If old FP unit took 20% of program's execution time and data cache accesses took 10% of program's execution time, what is the overall speed up? </p>

<p>I solved this problem usi... | computer architecture program optimization | 1 | Using Amdahl's law how do you determine execution time after an improvement? -- (computer architecture program optimization)
<p>Speeding up a new floating-point unit by 2 slows down data cache accesses by a factor of 2/3 (or a 1.5 slowdown for data caches). If old FP unit took 20% of program's execution time and data ... | habedi/stack-exchange-dataset |
6,206 | What does 'computable in the limit from above' mean? | <p>$H(x)$ is the program size complexity of $x$ for some universal Turing machine $U$. $H$ is not computable, however $H$ is "<em>computable in the limit from above</em>".</p>

<p>From my notes:</p>

<blockquote>
 <p>i.e the set $\{(x,n) \mid x \in B^*,n \geq 0, H(x) \leq n\}$ is computably enumera... | computability terminology | 1 | What does 'computable in the limit from above' mean? -- (computability terminology)
<p>$H(x)$ is the program size complexity of $x$ for some universal Turing machine $U$. $H$ is not computable, however $H$ is "<em>computable in the limit from above</em>".</p>

<p>From my notes:</p>

<blockquote>
 <... | habedi/stack-exchange-dataset |
6,210 | Assignment problem for multiple days | <p>I have a problem that can be reduced to an assignment problem.
(In a previous <a href="https://cstheory.stackexchange.com/questions/12850/matching-on-bipartite-graph-multiple-edges">question</a> i found out how to do that.)</p>

<p>Which means we have a set $A$ of agents and a set $T$ of tasks as well as... | algorithms graphs assignment problem | 1 | Assignment problem for multiple days -- (algorithms graphs assignment problem)
<p>I have a problem that can be reduced to an assignment problem.
(In a previous <a href="https://cstheory.stackexchange.com/questions/12850/matching-on-bipartite-graph-multiple-edges">question</a> i found out how to do that.)</p>
&#... | habedi/stack-exchange-dataset |
6,211 | How can I improve my Algorithm? | <blockquote>
 <p>This is a problem from Interview Street in Dynamic Programming section.
 <a href="https://www.interviewstreet.com/challenges/dashboard/#problem/4f2c2e3780aeb" rel="nofollow">https://www.interviewstreet.com/challenges/dashboard/#problem/4f2c2e3780aeb</a></p>
 
 <p>Billboards(20 point... | algorithms data structures dynamic programming | 1 | How can I improve my Algorithm? -- (algorithms data structures dynamic programming)
<blockquote>
 <p>This is a problem from Interview Street in Dynamic Programming section.
 <a href="https://www.interviewstreet.com/challenges/dashboard/#problem/4f2c2e3780aeb" rel="nofollow">https://www.interviewstreet.com/cha... | habedi/stack-exchange-dataset |
6,221 | Classfication of randomized algorithms | <p>From <a href="http://en.wikipedia.org/wiki/Randomized_algorithm">Wikipedia</a> about randomized algorithms</p>

<blockquote>
 <p>One has to distinguish between <strong>algorithms</strong> that use the random
 input to reduce the expected running time or memory usage, but always
 terminate with... | algorithms terminology randomized algorithms nondeterminism machine models | 1 | Classfication of randomized algorithms -- (algorithms terminology randomized algorithms nondeterminism machine models)
<p>From <a href="http://en.wikipedia.org/wiki/Randomized_algorithm">Wikipedia</a> about randomized algorithms</p>

<blockquote>
 <p>One has to distinguish between <strong>algorithms</stron... | habedi/stack-exchange-dataset |
6,230 | What is tail recursion? | <p>I know the general concept of recursion. I came across the concept of <strong>tail recursion</strong> while studying the quicksort algorithm. In this <a href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/video-lectures/lecture-4-quickso... | algorithms reference request recursion | 1 | What is tail recursion? -- (algorithms reference request recursion)
<p>I know the general concept of recursion. I came across the concept of <strong>tail recursion</strong> while studying the quicksort algorithm. In this <a href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introducti... | habedi/stack-exchange-dataset |
6,236 | Minimum space needed to sort a stream of integers | <p>This question has gotten a lot of attention on SO:<br>
<a href="https://stackoverflow.com/questions/12748246/sorting-1-million-8-digit-numbers-in-1mb-of-ram">Sorting 1 million 8-digit numbers in 1MB of RAM</a></p>

<p>The problem is to sort a stream of 1 million 8-digit numbers (integers in the range $[0... | algorithms sorting space complexity data compression streaming algorithm | 1 | Minimum space needed to sort a stream of integers -- (algorithms sorting space complexity data compression streaming algorithm)
<p>This question has gotten a lot of attention on SO:<br>
<a href="https://stackoverflow.com/questions/12748246/sorting-1-million-8-digit-numbers-in-1mb-of-ram">Sorting 1 million 8-digit n... | habedi/stack-exchange-dataset |
6,237 | What units should Shannon entropy be measured in? | <p>The only examples I've seen use bits as a measurement of entropy, but all these examples happen to use binary code alphabets. If we wanted to see how well a coding with a code alphabet of length n works, would we measure entropy in units of n?</p>

<p>Or would it make sense to stay using bits if we're compar... | information theory entropy | 1 | What units should Shannon entropy be measured in? -- (information theory entropy)
<p>The only examples I've seen use bits as a measurement of entropy, but all these examples happen to use binary code alphabets. If we wanted to see how well a coding with a code alphabet of length n works, would we measure entropy in uni... | habedi/stack-exchange-dataset |
6,239 | Constructing deterministic PDA for not regular language | <p>Let the input alphabet be $\Sigma = \{a,b,c\}$ and <em>L</em> be the language of all words in which all of the <em>a</em>’s come before all of the <em>b</em>’s and there are the same number of <em>a</em>’s as <em>b</em>'s and arbitrarily many <em>c</em>’s that can be in front, behind or among the <em>a</em>’s and <e... | automata pushdown automata | 1 | Constructing deterministic PDA for not regular language -- (automata pushdown automata)
<p>Let the input alphabet be $\Sigma = \{a,b,c\}$ and <em>L</em> be the language of all words in which all of the <em>a</em>’s come before all of the <em>b</em>’s and there are the same number of <em>a</em>’s as <em>b</em>'s and arb... | habedi/stack-exchange-dataset |
6,241 | In the Miller-Rabin primality test, for a composite number, why are at least $\frac{3}{4}$ of the bases witnesses of compositeness? | <p>The following is an excerpt from the <a href="http://en.wikipedia.org/wiki/Miller-Rabin_primality_test#Accuracy_of_the_test" rel="nofollow">Wikipedia article on the Miller-Rabin primality test</a>:</p>

<blockquote>
 <p>It can be shown that for any odd composite $n$, at least $\frac{3}{4}$ of the bases ... | cryptography number theory | 1 | In the Miller-Rabin primality test, for a composite number, why are at least $\frac{3}{4}$ of the bases witnesses of compositeness? -- (cryptography number theory)
<p>The following is an excerpt from the <a href="http://en.wikipedia.org/wiki/Miller-Rabin_primality_test#Accuracy_of_the_test" rel="nofollow">Wikipedia art... | habedi/stack-exchange-dataset |
6,244 | Rényi entropy at infinity or min-entropy | <p>I'm reading a paper that refers to the limit as n goes to infinity of Rényi entropy. It defines it as ${{H}_{n}}\left( X \right)=\dfrac{1}{1-n} \log_2 \left( \sum\limits_{i=1}^{N}{p_{i}^{n}} \right)$. It then says that the limit as $n\to \infty $ is $-\log_2 \left( p_1 \right)$. I saw another article that uses the m... | information theory entropy | 1 | Rényi entropy at infinity or min-entropy -- (information theory entropy)
<p>I'm reading a paper that refers to the limit as n goes to infinity of Rényi entropy. It defines it as ${{H}_{n}}\left( X \right)=\dfrac{1}{1-n} \log_2 \left( \sum\limits_{i=1}^{N}{p_{i}^{n}} \right)$. It then says that the limit as $n\to \infty... | habedi/stack-exchange-dataset |
6,245 | Is there a data-structure for semilattices similar to a tree data-structure? | <p>If we regard a tree as a partial ordered set, it becomes a special case of a join-semilattice. For a join-semilattice, we want to be able to compute the (unique) least upper bound of two elements (more or less) efficiently. In the case of a tree, a data structure which would enable this would be to store for each el... | data structures lattices | 1 | Is there a data-structure for semilattices similar to a tree data-structure? -- (data structures lattices)
<p>If we regard a tree as a partial ordered set, it becomes a special case of a join-semilattice. For a join-semilattice, we want to be able to compute the (unique) least upper bound of two elements (more or less)... | habedi/stack-exchange-dataset |
6,247 | Do "inductively" and "recursively" have very similar meanings? | <p>Do "inductively" and "recursively" mean very similar?</p>

<p>For example, if there is an algorithm that determines a n-dim vector by determine its first k+1 components based on its first k components having been determined, and is initialized with the first component, would you call it works recursively or ... | algorithms terminology recursion induction | 1 | Do "inductively" and "recursively" have very similar meanings? -- (algorithms terminology recursion induction)
<p>Do "inductively" and "recursively" mean very similar?</p>

<p>For example, if there is an algorithm that determines a n-dim vector by determine its first k+1 components based on its first k componen... | habedi/stack-exchange-dataset |
6,249 | Constructing a tree from disjoint graphs | <p>I will preface my question with the definition of a simple tree that applies to my question:</p>

<blockquote>
 <p>A simple tree is an undirected and connected graph with no cycles.</p>
</blockquote>

<p>I am having difficulty coming up with a compelling argument that a tree of the above def... | graphs trees | 1 | Constructing a tree from disjoint graphs -- (graphs trees)
<p>I will preface my question with the definition of a simple tree that applies to my question:</p>

<blockquote>
 <p>A simple tree is an undirected and connected graph with no cycles.</p>
</blockquote>

<p>I am having difficulty coming... | habedi/stack-exchange-dataset |
6,253 | Visualizing a Non Deterministic Decider | <p>I know that we can visualize a Non deterministic TM as a TM which splits into multiple copies of itself whenever it sees a non deterministic path (Yes, I also know that this is just a visualization and is usually used by beginners like me for understanding non determistisism). </p>

<p>Further, I also know t... | turing machines undecidability nondeterminism | 1 | Visualizing a Non Deterministic Decider -- (turing machines undecidability nondeterminism)
<p>I know that we can visualize a Non deterministic TM as a TM which splits into multiple copies of itself whenever it sees a non deterministic path (Yes, I also know that this is just a visualization and is usually used by begin... | habedi/stack-exchange-dataset |
6,259 | Assumption on weights in threshold circuits | <p>A threshold gate implementing a linear threshold function on $n$ boolean inputs $x_1, x_2 \ldots, x_n$ is given by the equation:
$w_1 x_1 + w_2 x_2 + \ldots, w_n x_n \ge t$
where $w_1, \ldots, w_n, t \in \mathbb{R}$. The $w_i$'s are called the weights of the threshold function and $t$ is called the threshold... | complexity theory circuits | 1 | Assumption on weights in threshold circuits -- (complexity theory circuits)
<p>A threshold gate implementing a linear threshold function on $n$ boolean inputs $x_1, x_2 \ldots, x_n$ is given by the equation:
$w_1 x_1 + w_2 x_2 + \ldots, w_n x_n \ge t$
where $w_1, \ldots, w_n, t \in \mathbb{R}$. The $w_i$'s are ... | habedi/stack-exchange-dataset |
6,262 | If a predicate is not computable, what can be said about its negation? | <p>Doing the following exercise:</p>
<blockquote>
<p>Let <span class="math-container">$\overline{HALT(x,y)}$</span> be defined as</p>
<p><span class="math-container">$\overline {HALT(x,y)} \iff \text{program number y never halts on input x}$</span></p>
<p>Show that it is not computable.</p>
</blockq... | computability proof techniques | 1 | If a predicate is not computable, what can be said about its negation? -- (computability proof techniques)
<p>Doing the following exercise:</p>
<blockquote>
<p>Let <span class="math-container">$\overline{HALT(x,y)}$</span> be defined as</p>
<p><span class="math-container">$\overline {HALT(x,y)} \iff \text{p... | habedi/stack-exchange-dataset |
6,263 | How to prove or disprove that f is computable? | <p>If $f(x_1,\dots, x_n)$ is a total function that for some constant $K$, $f(x_1,\dots, x_n) \leq K$ for all $x_1,\dots, x_n$ then $f$ is computable. </p>

<p>I want some hints on how to prove/disprove the above claim. This an exercise from the book <a href="http://rads.stackoverflow.com/amzn/click/0122063821" ... | computability proof techniques | 1 | How to prove or disprove that f is computable? -- (computability proof techniques)
<p>If $f(x_1,\dots, x_n)$ is a total function that for some constant $K$, $f(x_1,\dots, x_n) \leq K$ for all $x_1,\dots, x_n$ then $f$ is computable. </p>

<p>I want some hints on how to prove/disprove the above claim. This an ex... | habedi/stack-exchange-dataset |
6,274 | Recurrence relation for time complexity $T(n) = T(n-1) + n^2$ | <p>I'm looking for a $\Theta$ approximation of
$$T(n) = T(n-1) + cn^{2}$$</p>

<p>This is what I have so far:</p>

<p>$$
\begin{align*}
T(n-1)& = T(n-2) + c(n-1)^2\\
T(n) &= T(n-2) + c(n-1) + cn^2\\[1ex]
T(n-2) &= T(n-3) + c(n-2)^2\\
T(n) & = T(n-3) + c(n-2)^2 + c... | time complexity algorithm analysis proof techniques recurrence relation | 1 | Recurrence relation for time complexity $T(n) = T(n-1) + n^2$ -- (time complexity algorithm analysis proof techniques recurrence relation)
<p>I'm looking for a $\Theta$ approximation of
$$T(n) = T(n-1) + cn^{2}$$</p>

<p>This is what I have so far:</p>

<p>$$
\begin{align*}
T(n-1)& = T(n... | habedi/stack-exchange-dataset |
6,276 | Regarding the height of a recursion tree on dynamic programming | <p>I am trying to understand dynamic programming and I am watching this mit video. If you guys could take some time out , can you refer to the slide on 41:36 . Why is the height m+n. I just don't get it why is the heigh of this recurrence tree m+n.</p>

<p><a href="http://videolectures.net/mit6046jf05_leiserson... | recurrence relation dynamic programming | 1 | Regarding the height of a recursion tree on dynamic programming -- (recurrence relation dynamic programming)
<p>I am trying to understand dynamic programming and I am watching this mit video. If you guys could take some time out , can you refer to the slide on 41:36 . Why is the height m+n. I just don't get it why is t... | habedi/stack-exchange-dataset |
6,277 | Why is the minimum height of a binary tree $\log_2(n+1) - 1$? | <p>In my Java class, we are learning about complexity of different types of collections.</p>

<p>Soon we will be discussing binary trees, which I have been reading up on. The book states that the minimum height of a binary tree is $\log_2(n+1) - 1$, but doesn't offer further explanation.</p>

<p>Can som... | data structures binary trees discrete mathematics trees | 1 | Why is the minimum height of a binary tree $\log_2(n+1) - 1$? -- (data structures binary trees discrete mathematics trees)
<p>In my Java class, we are learning about complexity of different types of collections.</p>

<p>Soon we will be discussing binary trees, which I have been reading up on. The book states th... | habedi/stack-exchange-dataset |
6,279 | If $L$ is a regular language, how to prove $L_1 = \{ uv \mid u \in L, |v| =2 \}$ is also regular? | <blockquote>
 <p>If $L$ is a regular language, prove that the language
 $L_1 = \{ uv \mid u \in L, |v| =2 \}$
 is also regular.</p>
</blockquote>

<p>My idea: $L$ can be represented as a DFA and then you could add 2 consecutive transitions from every final state for the letters of $v$, creati... | regular languages automata finite automata closure properties check my answer | 1 | If $L$ is a regular language, how to prove $L_1 = \{ uv \mid u \in L, |v| =2 \}$ is also regular? -- (regular languages automata finite automata closure properties check my answer)
<blockquote>
 <p>If $L$ is a regular language, prove that the language
 $L_1 = \{ uv \mid u \in L, |v| =2 \}$
 is also regul... | habedi/stack-exchange-dataset |
6,284 | Instruction Translation | <p>Imagine two machines of different architecture which produce output of a standard format.</p>

<p>If you have a program for one machine and can observe it's operation and output, what techniques exist to automatically produce an equivalent program for the alternate architecture?</p>

<p>By equivalent... | programming languages compilers | 1 | Instruction Translation -- (programming languages compilers)
<p>Imagine two machines of different architecture which produce output of a standard format.</p>

<p>If you have a program for one machine and can observe it's operation and output, what techniques exist to automatically produce an equivalent program ... | habedi/stack-exchange-dataset |
6,288 | Are randomized algorithms constructive? | <p>From , the proofs by the probabilistic method are often said to be non-constructive.</p>

<p>However, a proof by probabilistic method indeed designs a randomized algorithm and uses it for proving existence. Quoted from p103 of <a href="http://books.google.com/books?id=QKVY4mDivBEC&pg=PR5&lpg=PP1&... | algorithms terminology randomized algorithms | 1 | Are randomized algorithms constructive? -- (algorithms terminology randomized algorithms)
<p>From , the proofs by the probabilistic method are often said to be non-constructive.</p>

<p>However, a proof by probabilistic method indeed designs a randomized algorithm and uses it for proving existence. Quoted from... | habedi/stack-exchange-dataset |
6,290 | Help need to learn Quantum Computation and Information | <p>I want to learn quantum computation and information. I am studying from Nielsen & Chuang book for this.
Is there any online vedio (lecture series) starts from
basics of quantum computation and information up to factorization, discrete log, search etc? </p>
 | reference request education quantum computing | 1 | Help need to learn Quantum Computation and Information -- (reference request education quantum computing)
<p>I want to learn quantum computation and information. I am studying from Nielsen & Chuang book for this.
Is there any online vedio (lecture series) starts from
basics of quantum computation and inform... | habedi/stack-exchange-dataset |
6,291 | Polynomial time reducibility | <blockquote>
 <p>$L_1$ and $L_2$ are two languages defined on the alphabet $\sum$.
 $L_1$ is reducible to $L_2$ in polynomial time. Which of the following
 cannot be true?</p>
 
 <ul>
 <li>$L_1 \in P$ and $L_2$ is finite</li>
 <li>$L_1 \in NP$ and $L_2 \in P$</li>
 <li>$L_1$ is u... | complexity theory reductions complexity classes | 1 | Polynomial time reducibility -- (complexity theory reductions complexity classes)
<blockquote>
 <p>$L_1$ and $L_2$ are two languages defined on the alphabet $\sum$.
 $L_1$ is reducible to $L_2$ in polynomial time. Which of the following
 cannot be true?</p>
 
 <ul>
 <li>$L_1 \in P$ and $L_... | habedi/stack-exchange-dataset |
6,301 | Adjacent house , dynamic programming problem | <p>I have to be honest this is a homework problem, but I just need to discuss this with some one. The problem is there is a row of n houses, with different profit e.g profit1 for house 1, it can be either positive or negative value. But the aim is to maximize the profit by buying a subset of these houses. So infact, yo... | dynamic programming knapsack problems | 1 | Adjacent house , dynamic programming problem -- (dynamic programming knapsack problems)
<p>I have to be honest this is a homework problem, but I just need to discuss this with some one. The problem is there is a row of n houses, with different profit e.g profit1 for house 1, it can be either positive or negative value.... | habedi/stack-exchange-dataset |
6,308 | Practical applications of disjoint set datastructure | <p>I know that the disjoint set datastructure is used to keep track of the connected components of an undirected graph when the edges are added to the graph dynamically . I also know that is is used in <a href="http://en.wikipedia.org/wiki/Kruskal%27s_algorithm">Kruskal's algorithm for minimum spanning trees</a> . W... | algorithms graphs data structures | 1 | Practical applications of disjoint set datastructure -- (algorithms graphs data structures)
<p>I know that the disjoint set datastructure is used to keep track of the connected components of an undirected graph when the edges are added to the graph dynamically . I also know that is is used in <a href="http://en.wikip... | habedi/stack-exchange-dataset |
6,309 | Determining the classification of languages | <blockquote>
 <p>$L_0 = \{ \langle M, w, 0 \rangle \mid \text{$M$ halts on $w$}\}$ <br>
 $L_1 = \{ \langle M, w, 1 \rangle \mid \text{$M$ does not halt on $w$}\}$</p>
 
 <p>$L = L_0 \cup L_1$</p>
</blockquote>

<p>I need to determine where in the hierarchy of languages (recursive, recur... | formal languages turing machines undecidability halting problem | 1 | Determining the classification of languages -- (formal languages turing machines undecidability halting problem)
<blockquote>
 <p>$L_0 = \{ \langle M, w, 0 \rangle \mid \text{$M$ halts on $w$}\}$ <br>
 $L_1 = \{ \langle M, w, 1 \rangle \mid \text{$M$ does not halt on $w$}\}$</p>
 
 <p>$L = L_0 \cup... | habedi/stack-exchange-dataset |
6,312 | Language member explanation | <p>Given the following formal language $L$:</p>

<p>$$ L=\{ww \mid w\in\{a,b\}^*\}$$</p>

<p>Why is $a$ not a member of this language?</p>

<p>So what is $\{a,b\}^*$ exactly? I thought it means $(a+b)^*$?</p>
 | formal languages terminology regular expressions | 1 | Language member explanation -- (formal languages terminology regular expressions)
<p>Given the following formal language $L$:</p>

<p>$$ L=\{ww \mid w\in\{a,b\}^*\}$$</p>

<p>Why is $a$ not a member of this language?</p>

<p>So what is $\{a,b\}^*$ exactly? I thought it means $(a+b)^*$?</p>&#x... | habedi/stack-exchange-dataset |
6,319 | Shifting subset sum solution by constant positive integer | <p>While reading the <a href="http://en.wikipedia.org/wiki/Subset_sum_problem" rel="nofollow">Wikipedia article about the subset sum problem</a> I came across this example: "is there a non-empty subset whose sum is zero? For example, given the set $\{ −7, −3, −2, 5, 8 \}$, the answer is yes because the subset $\{ −3, −... | integers decision problem | 1 | Shifting subset sum solution by constant positive integer -- (integers decision problem)
<p>While reading the <a href="http://en.wikipedia.org/wiki/Subset_sum_problem" rel="nofollow">Wikipedia article about the subset sum problem</a> I came across this example: "is there a non-empty subset whose sum is zero? For exampl... | habedi/stack-exchange-dataset |
6,323 | Algorithmic consequences of algebraic formula for partition function? | <p><a href="http://www.aimath.org/news/partition/brunier-ono">Bruinier and Ono</a> have found an algebraic formula for the <a href="http://en.wikipedia.org/wiki/Partition_function_%28number_theory%29#Partition_function">partition function</a>, which was widely reported to be a breakthrough. I am unable to understand th... | algorithms complexity theory number theory | 1 | Algorithmic consequences of algebraic formula for partition function? -- (algorithms complexity theory number theory)
<p><a href="http://www.aimath.org/news/partition/brunier-ono">Bruinier and Ono</a> have found an algebraic formula for the <a href="http://en.wikipedia.org/wiki/Partition_function_%28number_theory%29#Pa... | habedi/stack-exchange-dataset |
6,325 | Computing the rank of a multiset after inserting another element | <p>What is the procedure for computing the rank of a <a href="http://mathworld.wolfram.com/Multiset.html" rel="nofollow">multiset</a> after inserting an element?</p>

<p>For instance, lets say we have a set $S = (0,1)$ containing $n = 2$ distinct elements.</p>

<p>The multiset $M = (1,1)$ has rank $5$ b... | algorithms combinatorics sets binary arithmetic | 1 | Computing the rank of a multiset after inserting another element -- (algorithms combinatorics sets binary arithmetic)
<p>What is the procedure for computing the rank of a <a href="http://mathworld.wolfram.com/Multiset.html" rel="nofollow">multiset</a> after inserting an element?</p>

<p>For instance, lets say w... | habedi/stack-exchange-dataset |
6,326 | What are some applications of binary finite fields in CS? | <p>I was looking at details on <a href="http://en.wikipedia.org/wiki/Finite_field" rel="nofollow">finite fields</a>. Finite binary fields, e.g. $\mathbb{F_2}$, are used in CS in some places such as circuit theory [1]. </p>

<blockquote>
 <p>What are some key applications of finite fields in CS?</p>
</b... | algorithms reference request discrete mathematics applied theory | 1 | What are some applications of binary finite fields in CS? -- (algorithms reference request discrete mathematics applied theory)
<p>I was looking at details on <a href="http://en.wikipedia.org/wiki/Finite_field" rel="nofollow">finite fields</a>. Finite binary fields, e.g. $\mathbb{F_2}$, are used in CS in some places su... | habedi/stack-exchange-dataset |
6,327 | Trigonometry in computer science | <p>What's the use of studying trigonometry in computer science? I mean, is it essential? Does it have a specific application in computer science? Because I can't seem to muster enough motivation for learning it.</p>
 | education mathematical analysis applied theory | 1 | Trigonometry in computer science -- (education mathematical analysis applied theory)
<p>What's the use of studying trigonometry in computer science? I mean, is it essential? Does it have a specific application in computer science? Because I can't seem to muster enough motivation for learning it.</p>
 | habedi/stack-exchange-dataset |
6,334 | Tensor Product in Quantum Computation | <p>I can not understand the following equality $$\langle ij|(|0\rangle \langle 0|\otimes I)kl \rangle= \langle i|0\rangle \langle 0|k \rangle \langle j|I|l \rangle?$$</p>

<p>Also to estimate phase $\phi$ in Nielsen & Chuang book, I can not understand why 
$(|0 \rangle + e^{2\pi i 2^{t-1}\phi} |1 \ran... | quantum computing | 1 | Tensor Product in Quantum Computation -- (quantum computing)
<p>I can not understand the following equality $$\langle ij|(|0\rangle \langle 0|\otimes I)kl \rangle= \langle i|0\rangle \langle 0|k \rangle \langle j|I|l \rangle?$$</p>

<p>Also to estimate phase $\phi$ in Nielsen & Chuang book, I can not unde... | habedi/stack-exchange-dataset |
6,342 | Proof that a randomly built binary search tree has logarithmic height | <p>How do you prove that the expected height of a randomly built <a href="http://en.wikipedia.org/wiki/Binary_search_tree">binary search tree</a> with $n$ nodes is $O(\log n)$? There is a proof in CLRS <em>Introduction to Algorithms</em> (chapter 12.4), but I don't understand it.</p>
 | data structures algorithm analysis binary trees search trees average case | 1 | Proof that a randomly built binary search tree has logarithmic height -- (data structures algorithm analysis binary trees search trees average case)
<p>How do you prove that the expected height of a randomly built <a href="http://en.wikipedia.org/wiki/Binary_search_tree">binary search tree</a> with $n$ nodes is $O(\log... | habedi/stack-exchange-dataset |
6,343 | Can you have three consecutive black nodes in red-black search tree? | <p>Suppose I am making a red-black search tree, and in my right subtree, I have a black node, then a red node, and it has two black children, the black children further black childrens. As such a lemma has been made that red-black trees with $n$ internal nodes have height at most $2\log(n+1)$, would this proof still ho... | data structures binary trees search trees | 1 | Can you have three consecutive black nodes in red-black search tree? -- (data structures binary trees search trees)
<p>Suppose I am making a red-black search tree, and in my right subtree, I have a black node, then a red node, and it has two black children, the black children further black childrens. As such a lemma ha... | habedi/stack-exchange-dataset |
6,347 | How do you go about designing a vector processor architecture for the sum of matrix products? | <p>The following equation is a matrix expression where $B_i$ and $C_i^T$ are $n\times n$ matrices and k is a positive integer:</p>

<p>$$P = \sum_{i=1}^k B_i C_i^T $$</p>

<p>So $P = B_1 C_1^T + B_2 C_2^T + \cdots +B_k C_k^T $</p>

<p>If $B_i $ and $C_i$ are $n\times n$ matrices themselves, ... | computer architecture parallel computing matrices | 1 | How do you go about designing a vector processor architecture for the sum of matrix products? -- (computer architecture parallel computing matrices)
<p>The following equation is a matrix expression where $B_i$ and $C_i^T$ are $n\times n$ matrices and k is a positive integer:</p>

<p>$$P = \sum_{i=1}^k B_i C_i... | habedi/stack-exchange-dataset |
6,348 | Why can't we use a hash tables for collision resolving in hash tables? | <p>To prevent collisions, hash tables with open addressing use a methodology to chain the contents. Why can't we use another hash table allocated to each slot of the primary hash table?</p>
 | data structures hash tables | 1 | Why can't we use a hash tables for collision resolving in hash tables? -- (data structures hash tables)
<p>To prevent collisions, hash tables with open addressing use a methodology to chain the contents. Why can't we use another hash table allocated to each slot of the primary hash table?</p>
 | habedi/stack-exchange-dataset |
6,357 | What precisely is infinite ambiguity in a grammar? | <p>From what I've read, an example of infinite ambiguity is usually given in a form of a loop:</p>

<p>$S \rightarrow aA \\
A \rightarrow B \\
B \rightarrow A \\
B \rightarrow b$</p>

<p>But a grammar is called <em>ambiguous</em> if there's more than 1 way to derive the input string ω.... | terminology formal grammars ambiguity | 1 | What precisely is infinite ambiguity in a grammar? -- (terminology formal grammars ambiguity)
<p>From what I've read, an example of infinite ambiguity is usually given in a form of a loop:</p>

<p>$S \rightarrow aA \\
A \rightarrow B \\
B \rightarrow A \\
B \rightarrow b$</p>

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