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
22,949
Abstract Syntax Tree of Pure Lambda Calculus
<p>I was wondering if anyone had any good references or book recommendations that cover abstract syntax trees (ASTs). Specifically, I am interested in the abstract syntax trees of different evaluation strategies (call by value vs. call by name) of the pure lambda calculus. I would like to be able to draw the AST of som...
lambda calculus syntax trees
1
Abstract Syntax Tree of Pure Lambda Calculus -- (lambda calculus syntax trees) <p>I was wondering if anyone had any good references or book recommendations that cover abstract syntax trees (ASTs). Specifically, I am interested in the abstract syntax trees of different evaluation strategies (call by value vs. call by na...
habedi/stack-exchange-dataset
22,953
AI approach for exploring a static grid environment
<p>I have a grid environment which contains in each cell a static agent. When my agent enters a cell, the static agent in this cell might take points away from me, give me points, or do nothing. My agent can not observe adjacent cells until it moves into one them, it can only move up, down, left or right.</p>&#xA;&#xA;...
artificial intelligence
1
AI approach for exploring a static grid environment -- (artificial intelligence) <p>I have a grid environment which contains in each cell a static agent. When my agent enters a cell, the static agent in this cell might take points away from me, give me points, or do nothing. My agent can not observe adjacent cells unti...
habedi/stack-exchange-dataset
22,954
Lambda Calculus: How do evaluation contexts "work"
<p>In the pure lambda calculus, we have the inductively defined set of terms (the grammar):&#xA;$$e::= x \mid \lambda x . e \mid e_1 e_2$$</p>&#xA;&#xA;<p>Under the call-by-value evaluation strategy, we have the inference rules for beta-reduction and rules on how to evaluate applications (congruence rules). I am trying...
programming languages lambda calculus semantics
1
Lambda Calculus: How do evaluation contexts "work" -- (programming languages lambda calculus semantics) <p>In the pure lambda calculus, we have the inductively defined set of terms (the grammar):&#xA;$$e::= x \mid \lambda x . e \mid e_1 e_2$$</p>&#xA;&#xA;<p>Under the call-by-value evaluation strategy, we have the infe...
habedi/stack-exchange-dataset
22,955
Analyze Speed Up in A Dispatcher-Woker Model
<p>In a Dispatcher-Worker model of parallel computation, we have $N$ worker machines simultaneously working on the task (for example, computing the checksum of network packets). There is no synchronization between these workers. A dispatcher distributes total amount of work $S$ to these workers. </p>&#xA;&#xA;<p>Now co...
parallel computing
1
Analyze Speed Up in A Dispatcher-Woker Model -- (parallel computing) <p>In a Dispatcher-Worker model of parallel computation, we have $N$ worker machines simultaneously working on the task (for example, computing the checksum of network packets). There is no synchronization between these workers. A dispatcher distribut...
habedi/stack-exchange-dataset
22,960
Does exploiting a spatial Locality in Cache always leads to a lower miss rate?
<p>I've read that, incorporating many words(spatial locality) per cache blocks leads to lower miss rate. Is it the case always? &#xA;One possibility of such approach is to make a single cache block of size equal to the size of the cache, but that would be meaningless as far as benefits of memory hierarchy are concerned...
computer architecture memory management cpu cache
1
Does exploiting a spatial Locality in Cache always leads to a lower miss rate? -- (computer architecture memory management cpu cache) <p>I've read that, incorporating many words(spatial locality) per cache blocks leads to lower miss rate. Is it the case always? &#xA;One possibility of such approach is to make a single ...
habedi/stack-exchange-dataset
22,964
Role of Term Constants in Simply Typed Lambda Calculus
<p>In the <a href="http://en.wikipedia.org/wiki/Simply_typed_lambda_calculus" rel="nofollow noreferrer">Wikipedia article on Simply Typed Lambda Calculus</a> (among other places), there is a notion of a "term constant". This is particularly notable in the production grammar given:</p>&#xA;&#xA;<p><img src="https://i.s...
type theory lambda calculus
1
Role of Term Constants in Simply Typed Lambda Calculus -- (type theory lambda calculus) <p>In the <a href="http://en.wikipedia.org/wiki/Simply_typed_lambda_calculus" rel="nofollow noreferrer">Wikipedia article on Simply Typed Lambda Calculus</a> (among other places), there is a notion of a "term constant". This is par...
habedi/stack-exchange-dataset
22,972
Undirected graph with 12 edges and 6 vertices
<p>For school we have to make an assignment, and part of the assignment is this question:</p>&#xA;&#xA;<blockquote>&#xA; <p>Describe an unidrected graph that has 12 edges and at least 6&#xA; vertices. 6 of the vertices have to have degree exactly 3, all other&#xA; vertices have to have degree less than 2. Use as few...
graphs discrete mathematics
1
Undirected graph with 12 edges and 6 vertices -- (graphs discrete mathematics) <p>For school we have to make an assignment, and part of the assignment is this question:</p>&#xA;&#xA;<blockquote>&#xA; <p>Describe an unidrected graph that has 12 edges and at least 6&#xA; vertices. 6 of the vertices have to have degree ...
habedi/stack-exchange-dataset
22,992
How many states when converting CFG to PDA
<p>When converting a CFG to a PDA I know that you get three main states, Qstart, Qloop and Qaccept. But Qloops will need a various amount of states, and my question is how many? Is there a way to find out the "worst case scenario" of how many states there can potentially be? I don't mean for one particular CFG, but in ...
context free automata formal grammars pushdown automata simulation
1
How many states when converting CFG to PDA -- (context free automata formal grammars pushdown automata simulation) <p>When converting a CFG to a PDA I know that you get three main states, Qstart, Qloop and Qaccept. But Qloops will need a various amount of states, and my question is how many? Is there a way to find out ...
habedi/stack-exchange-dataset
23,008
Are all DFAs also NFAs?
<p>Are all Deterministic Finite Automatons also Non Deterministic Finite Automatons?</p>&#xA;
terminology automata finite automata
1
Are all DFAs also NFAs? -- (terminology automata finite automata) <p>Are all Deterministic Finite Automatons also Non Deterministic Finite Automatons?</p>&#xA;
habedi/stack-exchange-dataset
23,009
Can we break the Shannon capacity?
<p>I have a friend working in wireless communications research. He told me that we can transmit more than one symbol in a given slot using one frequency (of course we can decode them at the receiver).</p>&#xA;&#xA;<p>The technique as he said uses a new modulation scheme. Therefore if one transmitting node transmits to ...
reference request computer networks
1
Can we break the Shannon capacity? -- (reference request computer networks) <p>I have a friend working in wireless communications research. He told me that we can transmit more than one symbol in a given slot using one frequency (of course we can decode them at the receiver).</p>&#xA;&#xA;<p>The technique as he said us...
habedi/stack-exchange-dataset
23,010
Can PRNGs be used to magically compress stuff?
<p>This idea occurred to me as a kid learning to program and&#xA;on first encountering PRNG's. I still don't know how realistic&#xA;it is, but now there's stack exchange.</p>&#xA;&#xA;<p>Here's a 14 year-old's scheme for an amazing compression algorithm: </p>&#xA;&#xA;<p>Take a PRNG and seed it with seed <code>s</code>...
information theory randomness data compression pseudo random generators entropy
1
Can PRNGs be used to magically compress stuff? -- (information theory randomness data compression pseudo random generators entropy) <p>This idea occurred to me as a kid learning to program and&#xA;on first encountering PRNG's. I still don't know how realistic&#xA;it is, but now there's stack exchange.</p>&#xA;&#xA;<p>H...
habedi/stack-exchange-dataset
23,018
Assume that SAT ∈ PSIZE, does it imply that NP = coNP?
<p>Assume that $\mathrm{SAT} \in \mathrm{PSIZE}$, does it imply that $\mathrm{NP} = \mathrm{coNP}$ ?</p>&#xA;&#xA;<p>I think that I've managed to show that if $\mathrm{SAT} \in \mathrm{PSIZE}$, then both $\mathrm{NP}$ and $\mathrm{coNP}$ are contained in $\mathrm{PSIZE}$, but I can't see how does help me. Any ideas ?</...
complexity theory time complexity complexity classes circuits
1
Assume that SAT ∈ PSIZE, does it imply that NP = coNP? -- (complexity theory time complexity complexity classes circuits) <p>Assume that $\mathrm{SAT} \in \mathrm{PSIZE}$, does it imply that $\mathrm{NP} = \mathrm{coNP}$ ?</p>&#xA;&#xA;<p>I think that I've managed to show that if $\mathrm{SAT} \in \mathrm{PSIZE}$, then...
habedi/stack-exchange-dataset
23,037
Can somebody explain Horner's method of evaluating polynomials and how does it reduce the time complexity to 2n operations?
<p>I have been trying to understand the difference between normal polynomial evaluation and horner's method. usually it takes 3n-1 operations while horner's method reduces it to 2n operations. I tried a couple of explanations but they were too theoritical. I would be glad if somebody comes up with a decent and simple e...
algorithms time complexity
1
Can somebody explain Horner's method of evaluating polynomials and how does it reduce the time complexity to 2n operations? -- (algorithms time complexity) <p>I have been trying to understand the difference between normal polynomial evaluation and horner's method. usually it takes 3n-1 operations while horner's method ...
habedi/stack-exchange-dataset
23,038
Is this method really uniformly random?
<p>I have a list and want to select a random item from the list.</p>&#xA;<p>An algorithm which is said to be random:</p>&#xA;<blockquote>&#xA;<p>When you see the first item in the list, you set it as the selected item.</p>&#xA;<p>When you see the second item, you pick a random integer in the range [1,2]. If it's 1, the...
algorithms probability theory randomized algorithms sampling
1
Is this method really uniformly random? -- (algorithms probability theory randomized algorithms sampling) <p>I have a list and want to select a random item from the list.</p>&#xA;<p>An algorithm which is said to be random:</p>&#xA;<blockquote>&#xA;<p>When you see the first item in the list, you set it as the selected i...
habedi/stack-exchange-dataset
23,044
Complexity of calculating independence number of a hypergraph
<p>Let $G$ be a "hypergraph", a collection of vertices $V=\{v_1,v_2,\ldots,v_n\}$ and a collection of "hyperedges" $E=\{e_1,e_2,\ldots,e_m\}$, where $e_i\subseteq V$ and unlike normal edges, an edge may contain more than two vertices.</p>&#xA;&#xA;<p>An "independent set" (<a href="http://en.wikipedia.org/wiki/Independe...
complexity theory graphs
1
Complexity of calculating independence number of a hypergraph -- (complexity theory graphs) <p>Let $G$ be a "hypergraph", a collection of vertices $V=\{v_1,v_2,\ldots,v_n\}$ and a collection of "hyperedges" $E=\{e_1,e_2,\ldots,e_m\}$, where $e_i\subseteq V$ and unlike normal edges, an edge may contain more than two ver...
habedi/stack-exchange-dataset
23,047
Can you reduce a precedence graph or do *all* relevant nodes need to be connected
<p>Let's say we have the following simple transaction-schedule:</p>&#xA;&#xA;<pre><code> T1 | T2 | T3&#xA;-----+------+-----&#xA; w(x)| |&#xA; | w(x) |&#xA; | | w(x)&#xA;</code></pre>&#xA;&#xA;<p>T1 comes before T2, so in the precedence graph, we draw an arrow from T1 to T2. T2 comes before T3, so...
database theory precedence graph
1
Can you reduce a precedence graph or do *all* relevant nodes need to be connected -- (database theory precedence graph) <p>Let's say we have the following simple transaction-schedule:</p>&#xA;&#xA;<pre><code> T1 | T2 | T3&#xA;-----+------+-----&#xA; w(x)| |&#xA; | w(x) |&#xA; | | w(x)&#xA;</code><...
habedi/stack-exchange-dataset
23,056
Intersection of two NPDAs
<p>Is there a way to take the interection of two NPDAs?</p>&#xA;&#xA;<p>I can't seem to find anything that can make that happen, but it seems like the type of thing that is should be relatively trival.</p>&#xA;
formal languages automata closure properties pushdown automata
1
Intersection of two NPDAs -- (formal languages automata closure properties pushdown automata) <p>Is there a way to take the interection of two NPDAs?</p>&#xA;&#xA;<p>I can't seem to find anything that can make that happen, but it seems like the type of thing that is should be relatively trival.</p>&#xA;
habedi/stack-exchange-dataset
23,058
Correctness proof of greedy algorithm for 0-1 knapsack problem
<p>We have a 0-1 knapsack in which the increasing order of items by weight is the same as the decreasing order of items by value. Design a greedy algorithm and prove that the greedy choice guarantees an optimal solution.</p>&#xA;&#xA;<p>Given the two orders I imagined that we could just choose the first k elements from...
algorithms algorithm analysis correctness proof greedy algorithms knapsack problems
1
Correctness proof of greedy algorithm for 0-1 knapsack problem -- (algorithms algorithm analysis correctness proof greedy algorithms knapsack problems) <p>We have a 0-1 knapsack in which the increasing order of items by weight is the same as the decreasing order of items by value. Design a greedy algorithm and prove th...
habedi/stack-exchange-dataset
23,064
Show that the pumping lemmas for context-free and regular languages are equivalent for unary languages
<p>I want to show that for any language $L \subseteq \{ a \}^* $, $L$ satisfies the pumping lemma for context free languages if and only if it satisfies the pumping lemma for regular languages.</p>&#xA;&#xA;<p>I know that every regular language is also a context free language so I tried to show that direction of the pr...
formal languages regular languages context free pumping lemma
1
Show that the pumping lemmas for context-free and regular languages are equivalent for unary languages -- (formal languages regular languages context free pumping lemma) <p>I want to show that for any language $L \subseteq \{ a \}^* $, $L$ satisfies the pumping lemma for context free languages if and only if it satisfi...
habedi/stack-exchange-dataset
23,068
How do O and Ω relate to worst and best case?
<p>Today we discussed in a lecture a very simple algorithm for finding an element in a sorted array using <a href="http://en.wikipedia.org/wiki/Binary_search_algorithm" rel="noreferrer">binary search</a>. We were asked to determine its asymptotic complexity for an array of $n$ elements.</p>&#xA;&#xA;<p>My idea was, tha...
algorithm analysis asymptotics landau notation reference question
1
How do O and Ω relate to worst and best case? -- (algorithm analysis asymptotics landau notation reference question) <p>Today we discussed in a lecture a very simple algorithm for finding an element in a sorted array using <a href="http://en.wikipedia.org/wiki/Binary_search_algorithm" rel="noreferrer">binary search</a>...
habedi/stack-exchange-dataset
23,076
What are efficient ways to compute the derivatives of iterated functions?
<p>The derivatives of iterated functions at a fixed point $z_0$ are useful in constructing a Taylors series of iterated analytic functions - in other words, the Taylors series of a dynamical system $f^t(z_0)$. </p>&#xA;&#xA;<p>A simpler version of the problem casts light on possible approaches. Instead of iterated func...
algorithms combinatorics recursion
1
What are efficient ways to compute the derivatives of iterated functions? -- (algorithms combinatorics recursion) <p>The derivatives of iterated functions at a fixed point $z_0$ are useful in constructing a Taylors series of iterated analytic functions - in other words, the Taylors series of a dynamical system $f^t(z_0...
habedi/stack-exchange-dataset
23,081
Which NPC problems are NP Hard
<p>I have read that TSP and Subset Sum problems are NPC problems which are also NP Hard. There are also problems like Halting Problem which is NP Hard, but not NP Complete</p>&#xA;&#xA;<p>And Wikipedia defines this as</p>&#xA;&#xA;<blockquote>&#xA; <p>A problem $H$ is NP-hard if and only if there is an NP-complete pro...
complexity theory np complete np hard
1
Which NPC problems are NP Hard -- (complexity theory np complete np hard) <p>I have read that TSP and Subset Sum problems are NPC problems which are also NP Hard. There are also problems like Halting Problem which is NP Hard, but not NP Complete</p>&#xA;&#xA;<p>And Wikipedia defines this as</p>&#xA;&#xA;<blockquote>&#x...
habedi/stack-exchange-dataset
23,089
How are REGEXP implemented in programming languages?
<p>Is there a good general paper about the interpretation or compilation&#xA;of REGEXP in programming languages for pattern matching, with or&#xA;without variables? I am not looking for a quick explanation about the&#xA;construction of DFAs, but for a real paper on how it is actually done&#xA;in programming languages i...
programming languages compilers regular expressions matching interpreters
1
How are REGEXP implemented in programming languages? -- (programming languages compilers regular expressions matching interpreters) <p>Is there a good general paper about the interpretation or compilation&#xA;of REGEXP in programming languages for pattern matching, with or&#xA;without variables? I am not looking for a ...
habedi/stack-exchange-dataset
23,100
Looking for sources: Graph search in social media
<p>I am looking for more information/references on how graph search is utilized in social media. Papers, books , anything really. </p>&#xA;
graphs
1
Looking for sources: Graph search in social media -- (graphs) <p>I am looking for more information/references on how graph search is utilized in social media. Papers, books , anything really. </p>&#xA;
habedi/stack-exchange-dataset
23,104
Why can't we derandomize the PCP theorem by iterating over all possible $\log n$ random strings?
<p>Let's say I can solve problem $A$ in polynomial time using only $\log n$ bits of randomness, with a $\ge \frac{2}{3}$ chance of a correct answer. Then surely I can solve $A$ determistically by running my algorithm for $A$ over all random strings of length $\log n$ (of which there are a polynomial number) and take a...
randomized algorithms
1
Why can't we derandomize the PCP theorem by iterating over all possible $\log n$ random strings? -- (randomized algorithms) <p>Let's say I can solve problem $A$ in polynomial time using only $\log n$ bits of randomness, with a $\ge \frac{2}{3}$ chance of a correct answer. Then surely I can solve $A$ determistically by...
habedi/stack-exchange-dataset
23,111
Computing the intersection of two NPDA where it is possible
<p>Apropois to Raphael's suggestion on <a href="https://cs.stackexchange.com/questions/23056/intersection-of-two-npdas">Intersection of two NPDAs</a>:</p>&#xA;&#xA;<p>Let $A_1$ and $A_2$ NPDA for context-free languages $L_1$ and $L_2$, respectively. Assuming that we know that $L = L_1 \cap L_2$ is context-free, can we ...
computability automata pushdown automata
1
Computing the intersection of two NPDA where it is possible -- (computability automata pushdown automata) <p>Apropois to Raphael's suggestion on <a href="https://cs.stackexchange.com/questions/23056/intersection-of-two-npdas">Intersection of two NPDAs</a>:</p>&#xA;&#xA;<p>Let $A_1$ and $A_2$ NPDA for context-free langu...
habedi/stack-exchange-dataset
23,119
Why should leaf nodes in a red-black tree be black?
<p>From the property of Red-Black Trees we know that: </p>&#xA;&#xA;<ul>&#xA;<li>All leaves (NIL) are black. (All leaves are same color as the root.)(Comren et al "Introduction to Algorithms")</li>&#xA;</ul>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/hz7wf.png" alt="An example of a red–black tree. From Wikipedia">...
terminology data structures search trees dictionaries
1
Why should leaf nodes in a red-black tree be black? -- (terminology data structures search trees dictionaries) <p>From the property of Red-Black Trees we know that: </p>&#xA;&#xA;<ul>&#xA;<li>All leaves (NIL) are black. (All leaves are same color as the root.)(Comren et al "Introduction to Algorithms")</li>&#xA;</ul>&#...
habedi/stack-exchange-dataset
23,125
Can you use a Bayes classifier to determine if something is NOT in a defined class?
<p>I know I can use a Bayes classifier to determine if something is one of N classes, but can I also determine if something is NOT in any of the predefined classes? Or will a Bayes classifier only find the closest class?</p>&#xA;
machine learning bayesian statistics
1
Can you use a Bayes classifier to determine if something is NOT in a defined class? -- (machine learning bayesian statistics) <p>I know I can use a Bayes classifier to determine if something is one of N classes, but can I also determine if something is NOT in any of the predefined classes? Or will a Bayes classifier o...
habedi/stack-exchange-dataset
23,127
Do all states in a DFA must be connected?
<p>Could I construct (for some wired reason) a DFA that has a state that is not connected to anything, and it would still be legal?</p>&#xA;&#xA;<p>I'm studying for a test, and I found a question that asks if an infinite DFA could represent a regular language, and I want to use a regular DFA and add all the infinite st...
automata finite automata
1
Do all states in a DFA must be connected? -- (automata finite automata) <p>Could I construct (for some wired reason) a DFA that has a state that is not connected to anything, and it would still be legal?</p>&#xA;&#xA;<p>I'm studying for a test, and I found a question that asks if an infinite DFA could represent a regul...
habedi/stack-exchange-dataset
23,129
If a thread containing main terminates, can another thread do anything?
<p>I'm studying threads in C and I have this theoretical question in mind that is driving me crazy.&#xA;Assume the following code:</p>&#xA;&#xA;<pre><code>1) void main() {&#xA;2) createThread(...); // create a new thread that does "something"&#xA;3) }&#xA;</code></pre>&#xA;&#xA;<p>After line 2 is executed, two path...
parallel computing concurrency threads
1
If a thread containing main terminates, can another thread do anything? -- (parallel computing concurrency threads) <p>I'm studying threads in C and I have this theoretical question in mind that is driving me crazy.&#xA;Assume the following code:</p>&#xA;&#xA;<pre><code>1) void main() {&#xA;2) createThread(...); //...
habedi/stack-exchange-dataset
23,139
Error bound for minimum-degree spanning tree
<p>I am reading <em>The Design of Approximation Algorithms</em> (Williamson and Schmoys; page 50 of <a href="http://www.designofapproxalgs.com/book.pdf" rel="nofollow">this PDF</a>) about solving the minimum-degree spanning tree problem of maximum degree 2 in polynomial time. The text states that we are going to find a...
algorithms
1
Error bound for minimum-degree spanning tree -- (algorithms) <p>I am reading <em>The Design of Approximation Algorithms</em> (Williamson and Schmoys; page 50 of <a href="http://www.designofapproxalgs.com/book.pdf" rel="nofollow">this PDF</a>) about solving the minimum-degree spanning tree problem of maximum degree 2 in...
habedi/stack-exchange-dataset
23,155
Why does appending permutations of servers at the end of hash table avoid bottlenecks?
<p>I was reading the following FDS paper:</p>&#xA;&#xA;<p><a href="https://www.usenix.org/system/files/conference/osdi12/osdi12-final-75.pdf" rel="nofollow">https://www.usenix.org/system/files/conference/osdi12/osdi12-final-75.pdf</a></p>&#xA;&#xA;<p>The paper has a TLT (tract locator table) for identifying where to wr...
distributed systems hash hash tables
1
Why does appending permutations of servers at the end of hash table avoid bottlenecks? -- (distributed systems hash hash tables) <p>I was reading the following FDS paper:</p>&#xA;&#xA;<p><a href="https://www.usenix.org/system/files/conference/osdi12/osdi12-final-75.pdf" rel="nofollow">https://www.usenix.org/system/file...
habedi/stack-exchange-dataset
23,162
Quantum Computing and Turing Machines: Are Turing Machines still an Accurate Measure?
<p>In class last week, my professor commented and said that Turing machines are used as a standard measure/model of what is computable and are a helpful basis of discussion for that subject. She also said that all variants of Turing machines are proven to be computationally equivalent -- read, just as powerful -- as on...
turing machines quantum computing
1
Quantum Computing and Turing Machines: Are Turing Machines still an Accurate Measure? -- (turing machines quantum computing) <p>In class last week, my professor commented and said that Turing machines are used as a standard measure/model of what is computable and are a helpful basis of discussion for that subject. She ...
habedi/stack-exchange-dataset
23,179
If all edges are of equal weight, can one use BFS to obtain a minimal spanning tree?
<p>If given that all edges in a graph $G$ are of equal weight $c$, can one use breadth-first search (BFS) in order to produce a minimal spanning tree in <strong>linear time</strong>?</p>&#xA;&#xA;<p>Intuitively this sounds correct, as BFS does not visit a node twice, and it only traverses from vertex $v$ to vertex $u$ ...
algorithms graphs spanning trees
1
If all edges are of equal weight, can one use BFS to obtain a minimal spanning tree? -- (algorithms graphs spanning trees) <p>If given that all edges in a graph $G$ are of equal weight $c$, can one use breadth-first search (BFS) in order to produce a minimal spanning tree in <strong>linear time</strong>?</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
23,185
What does it mean that numbers are "totally ordered", in the Paxos Made Simple paper?
<p>I was studying Paxos from the paper by Lamport called <a href="http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf" rel="nofollow noreferrer">"Paxos Made Simple"</a>.</p>&#xA;&#xA;<p>Recall that Paxos is a distributed system algorithm with the goal that the processes participating in its prot...
algorithms algorithm analysis distributed systems
1
What does it mean that numbers are "totally ordered", in the Paxos Made Simple paper? -- (algorithms algorithm analysis distributed systems) <p>I was studying Paxos from the paper by Lamport called <a href="http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf" rel="nofollow noreferrer">"Paxos Mad...
habedi/stack-exchange-dataset
23,193
Show that this algorithm does not work for determining convex polygons
<p><strong>Context</strong></p>&#xA;&#xA;<p>Consider this algorithm. If the set $\{\angle p_ip_{i+1}p_{i+2} : i=0,...,n-1\}$ does not contain left and right turns, output "yes the polygon is convex"; otherwise, "no".</p>&#xA;&#xA;<p><strong>My answer</strong> </p>&#xA;&#xA;<p>Consider this nonsimple polygon having 4 ...
algorithms graphs computational geometry
1
Show that this algorithm does not work for determining convex polygons -- (algorithms graphs computational geometry) <p><strong>Context</strong></p>&#xA;&#xA;<p>Consider this algorithm. If the set $\{\angle p_ip_{i+1}p_{i+2} : i=0,...,n-1\}$ does not contain left and right turns, output "yes the polygon is convex"; ot...
habedi/stack-exchange-dataset
23,204
Polynomial Hierarchy --- polynomial time TM
<p>Consider, for example, the definition for $\Sigma_2^p$ complexity class.</p>&#xA;&#xA;<p>$$ x \in L \Leftrightarrow \exists u_1 \forall u_2 \;M(x, u_1, u_2) = 1, $$</p>&#xA;&#xA;<p>where $u_1, u_2 \in \{0,1\}^{p(|x|)}$, for some polynomial $p$. Here, $M$ must be polynomial time. But polynomial in the size of what ex...
complexity theory time complexity complexity classes polynomial time
1
Polynomial Hierarchy --- polynomial time TM -- (complexity theory time complexity complexity classes polynomial time) <p>Consider, for example, the definition for $\Sigma_2^p$ complexity class.</p>&#xA;&#xA;<p>$$ x \in L \Leftrightarrow \exists u_1 \forall u_2 \;M(x, u_1, u_2) = 1, $$</p>&#xA;&#xA;<p>where $u_1, u_2 \i...
habedi/stack-exchange-dataset
23,209
How can an artificial neural net change the sign of a weight?
<p>My neural net is having trouble switching the sign of a weight. The issue is that the deltas applied to the weight are proportional to that weight, so when it gets closer to zero, the deltas become smaller and are never sufficient to get it past that point. I tried adding a momentum term with 5% of the previous iter...
neural networks
1
How can an artificial neural net change the sign of a weight? -- (neural networks) <p>My neural net is having trouble switching the sign of a weight. The issue is that the deltas applied to the weight are proportional to that weight, so when it gets closer to zero, the deltas become smaller and are never sufficient to ...
habedi/stack-exchange-dataset
23,225
Proof that $A_{DFA}$ is decidable in Sipser
<p>It seems like the proof that <span class="math-container">$A_{DFA}$</span> is decidable in <a href="https://rads.stackoverflow.com/amzn/click/com/0534950973" rel="nofollow noreferrer" rel="nofollow noreferrer">Sipser (2nd ed.)</a> assumes the computation will halt... and hence only really proves that <span class="ma...
formal languages finite automata undecidability
1
Proof that $A_{DFA}$ is decidable in Sipser -- (formal languages finite automata undecidability) <p>It seems like the proof that <span class="math-container">$A_{DFA}$</span> is decidable in <a href="https://rads.stackoverflow.com/amzn/click/com/0534950973" rel="nofollow noreferrer" rel="nofollow noreferrer">Sipser (2n...
habedi/stack-exchange-dataset
23,227
Proving that the continuation of a non-regular language is not ω-regular
<p>I want to prove that a language is not $\omega$-regular. </p>&#xA;&#xA;<p>The language I'm working with can be defined as:</p>&#xA;&#xA;<p>$$L = \{ a_1 \dots a_n x^\omega ~ | ~ n &gt; 0, a_1 \dots a_n \in L^\prime \}$$</p>&#xA;&#xA;<p>where $L^\prime$ is a specific non regular language (I omit the definition $L^\pri...
formal languages regular languages proof techniques buchi automata
1
Proving that the continuation of a non-regular language is not ω-regular -- (formal languages regular languages proof techniques buchi automata) <p>I want to prove that a language is not $\omega$-regular. </p>&#xA;&#xA;<p>The language I'm working with can be defined as:</p>&#xA;&#xA;<p>$$L = \{ a_1 \dots a_n x^\omega ~...
habedi/stack-exchange-dataset
23,228
If a DFA can be simulated by a real program, can it be simulated by a TM
<p>In proofs of decidability, we often want to simulate another model of computation by a Turing machine. But if I can simulate a $\mathsf{DFA}$ by, say, a C program, then is there some result which says that the $\mathsf{DFA}$ can be simulated by some $\mathsf{TM}$? Could a program be used in place of a $\mathsf{TM}$ ...
computability simulation turing completeness
1
If a DFA can be simulated by a real program, can it be simulated by a TM -- (computability simulation turing completeness) <p>In proofs of decidability, we often want to simulate another model of computation by a Turing machine. But if I can simulate a $\mathsf{DFA}$ by, say, a C program, then is there some result whic...
habedi/stack-exchange-dataset
23,231
What is the time/space complexity of $n!$? Can $n!$ has polynomial space complexity?
<p>Given an integer $n$, calculate $n!=n\times(n-1)\times(n-2)\dotsc 3\times2\times1$. </p>&#xA;&#xA;<p>What is the best time and space complexity of calculating $n!$?</p>&#xA;&#xA;<p>P.S. I do not have any idea about this topic. I was using MATLAB and I needed to compute $200!$ but it said "Out of memory"!! That's why...
time complexity space complexity
1
What is the time/space complexity of $n!$? Can $n!$ has polynomial space complexity? -- (time complexity space complexity) <p>Given an integer $n$, calculate $n!=n\times(n-1)\times(n-2)\dotsc 3\times2\times1$. </p>&#xA;&#xA;<p>What is the best time and space complexity of calculating $n!$?</p>&#xA;&#xA;<p>P.S. I do not...
habedi/stack-exchange-dataset
23,232
Why is this algorithm $O(n^3)?$
<p>In a programming book that I'm currently reading it's stated that</p>&#xA;&#xA;<p>$$\sum\limits_{i=1}^{n}i^2$$ is $O(n^3)$. My understanding was that $i\times i$ is a primitive operation and the complexity would be $O(n)$. What am I missing?</p>&#xA;
time complexity
1
Why is this algorithm $O(n^3)?$ -- (time complexity) <p>In a programming book that I'm currently reading it's stated that</p>&#xA;&#xA;<p>$$\sum\limits_{i=1}^{n}i^2$$ is $O(n^3)$. My understanding was that $i\times i$ is a primitive operation and the complexity would be $O(n)$. What am I missing?</p>&#xA;
habedi/stack-exchange-dataset
23,236
Approximating NP-complete problems
<p>Say that for a particular problem, e.g., the independent set problem, it has been shown that no polynomial-time algorithm exists to solve it.</p>&#xA;&#xA;<p>Could we get around this by finding an algorithm which approximates the solution to a certain accuracy?</p>&#xA;&#xA;<p>That is, would the result above bar the...
algorithms graphs algorithm analysis time complexity
1
Approximating NP-complete problems -- (algorithms graphs algorithm analysis time complexity) <p>Say that for a particular problem, e.g., the independent set problem, it has been shown that no polynomial-time algorithm exists to solve it.</p>&#xA;&#xA;<p>Could we get around this by finding an algorithm which approximate...
habedi/stack-exchange-dataset
23,238
What determines the entropy of a program's source code?
<p>a few days ago I asked a question about the limits of compression:&#xA;<a href="https://cs.stackexchange.com/questions/23010/can-prngs-be-used-to-magically-compress-stuff">Can PRNGs be used to magically compress-stuff?</a></p>&#xA;&#xA;<p>The idea common to all the answers was that if you consider all programs&#xA;o...
data compression kolmogorov complexity
1
What determines the entropy of a program's source code? -- (data compression kolmogorov complexity) <p>a few days ago I asked a question about the limits of compression:&#xA;<a href="https://cs.stackexchange.com/questions/23010/can-prngs-be-used-to-magically-compress-stuff">Can PRNGs be used to magically compress-stuff...
habedi/stack-exchange-dataset
23,243
Polynomial hierarchy intersection
<p>While familiarizing myself with polynomial hierarchy, I have come across a problem&#xA;of showing $NP^{\Sigma_{k}^{p} \cap \Pi_{k}^{p}} \subseteq \Sigma_{k}^{p}$. By looking at the proof for $NP^{SAT} \subseteq \Sigma_{2}^{p}$, I got the concept&#xA;where we can guess the choices of the NTM and answers to SAT call a...
complexity theory time complexity polynomial time
1
Polynomial hierarchy intersection -- (complexity theory time complexity polynomial time) <p>While familiarizing myself with polynomial hierarchy, I have come across a problem&#xA;of showing $NP^{\Sigma_{k}^{p} \cap \Pi_{k}^{p}} \subseteq \Sigma_{k}^{p}$. By looking at the proof for $NP^{SAT} \subseteq \Sigma_{2}^{p}$, ...
habedi/stack-exchange-dataset
23,246
What is pass-by-value-result and its advantage and disadvantage?
<p>I have searched on Google, but I can't quite understand what is pass-by-value-result. What is the advantage and disadvantage of using pass-by-value-result?</p>&#xA;&#xA;<p>If I have a program code like this, what will be the result when parameters are passed by value-result?</p>&#xA;&#xA;<pre><code>#include &lt;stdi...
terminology programming languages semantics
1
What is pass-by-value-result and its advantage and disadvantage? -- (terminology programming languages semantics) <p>I have searched on Google, but I can't quite understand what is pass-by-value-result. What is the advantage and disadvantage of using pass-by-value-result?</p>&#xA;&#xA;<p>If I have a program code like t...
habedi/stack-exchange-dataset
23,251
Find the minimum amount of swaps in fixed indices to sort an array
<p>When given the length of a source array, I want to generate the array of swaps that need to be performed in order to sort the source array. I want to make this array <strong>as small as possible</strong>. Swaps will be performed only if necessary for sorting, as defined by the following function.</p>&#xA;&#xA;<pre><...
algorithms sorting
1
Find the minimum amount of swaps in fixed indices to sort an array -- (algorithms sorting) <p>When given the length of a source array, I want to generate the array of swaps that need to be performed in order to sort the source array. I want to make this array <strong>as small as possible</strong>. Swaps will be perform...
habedi/stack-exchange-dataset
23,252
Quick calculation for $(x^y) \bmod z$
<p>What are the possible ways to calculate $(x^y) \bmod z$ quickly for very large integers?&#xA;Integers $x,y \lt 10^{10000}$ and $z \lt 10^6$.</p>&#xA;
integers number theory arithmetic
1
Quick calculation for $(x^y) \bmod z$ -- (integers number theory arithmetic) <p>What are the possible ways to calculate $(x^y) \bmod z$ quickly for very large integers?&#xA;Integers $x,y \lt 10^{10000}$ and $z \lt 10^6$.</p>&#xA;
habedi/stack-exchange-dataset
23,265
Does there exist a proof of closure of regular languages under regular substitution by giving the corresponding DFA?
<p>Every proof I can find of this result is by way of regular expressions. Is there any "constructive" proof that defines the corresponding DFA (probably NFA)? For instance the proof of concatenation closure is most often presented by demonstrating the NFA. I'm just curious whether this is out there somewhere</p>&#xA;
formal languages reference request finite automata closure properties
1
Does there exist a proof of closure of regular languages under regular substitution by giving the corresponding DFA? -- (formal languages reference request finite automata closure properties) <p>Every proof I can find of this result is by way of regular expressions. Is there any "constructive" proof that defines the co...
habedi/stack-exchange-dataset
23,284
Difference between diameter of a graph vs longest path of the graph
<p>I am curious what is the difference between diameter of a graph vs longest path of a graph. I just read diameter of a graph can be solved using Floyd warshall in O(V^3) while longest path can be calculated in O(V + E) using topological sort. </p>&#xA;
graphs terminology
1
Difference between diameter of a graph vs longest path of the graph -- (graphs terminology) <p>I am curious what is the difference between diameter of a graph vs longest path of a graph. I just read diameter of a graph can be solved using Floyd warshall in O(V^3) while longest path can be calculated in O(V + E) using t...
habedi/stack-exchange-dataset
23,290
Is the language $\{ a^pb^q \mid p, q \text{ are prime} \}$ regular?
<p>I am interested to know whether that language $$&#xA;L = \{ a^pb^q \mid p, q \text{ are prime} \}&#xA;$$ is regular. How do you prove that it is not regular?</p>&#xA;
formal languages regular languages
1
Is the language $\{ a^pb^q \mid p, q \text{ are prime} \}$ regular? -- (formal languages regular languages) <p>I am interested to know whether that language $$&#xA;L = \{ a^pb^q \mid p, q \text{ are prime} \}&#xA;$$ is regular. How do you prove that it is not regular?</p>&#xA;
habedi/stack-exchange-dataset
23,295
Expected number of updates of minimum
<p>I came across the following problem in a exam. </p>&#xA;&#xA;<p>We choose a permutation of n elements $[1,n]$ uniformly at random. Now a variable MIN holds the minimum value seen so far at it is defined to $\infty$ initially. Now during our inspection if we see a smaller value than MIN, then MIN is updated to the ne...
algorithm analysis runtime analysis search algorithms
1
Expected number of updates of minimum -- (algorithm analysis runtime analysis search algorithms) <p>I came across the following problem in a exam. </p>&#xA;&#xA;<p>We choose a permutation of n elements $[1,n]$ uniformly at random. Now a variable MIN holds the minimum value seen so far at it is defined to $\infty$ initi...
habedi/stack-exchange-dataset
23,306
Variable programs and variable data
<p>I'm reading "Sets for Mathematics" by Lawvere, and he uses the following metaphor at the end of section 1.3: "we will see...how any abstract set F of the right size can act as mappings between given abstract sets. (For example, in computers variable programs are just a particular kind of variable data.)"</p>&#xA;&#x...
terminology programming languages
1
Variable programs and variable data -- (terminology programming languages) <p>I'm reading "Sets for Mathematics" by Lawvere, and he uses the following metaphor at the end of section 1.3: "we will see...how any abstract set F of the right size can act as mappings between given abstract sets. (For example, in computers v...
habedi/stack-exchange-dataset
23,315
What is average number of cycles in an undirected ordered graph of size n?
<p>What is average number of cycles in an undirected ordered graph of size $n$? &#xA;I've tried finding out sum of number of cycles in all sorts of a graph of size n but I couldn't find that out.</p>&#xA;
graphs combinatorics
1
What is average number of cycles in an undirected ordered graph of size n? -- (graphs combinatorics) <p>What is average number of cycles in an undirected ordered graph of size $n$? &#xA;I've tried finding out sum of number of cycles in all sorts of a graph of size n but I couldn't find that out.</p>&#xA;
habedi/stack-exchange-dataset
23,319
Min-entropy of a random pre-image of a random function
<p>I am facing hard time understanding min-entropy.</p>&#xA;&#xA;<p>Fix $v \in \{0,1\}^{n/2}$, let $F\colon \{0,1\}^n \to \{0,1\}^{n/2}$ be chosen randomly, and let $X_v$ be a string chosen uniformly at random among $F^{(-1)}(v)$ (or a special string $\epsilon$ if $F^{(-1)}(v) = \emptyset$). We want to compute the prob...
probability theory
1
Min-entropy of a random pre-image of a random function -- (probability theory) <p>I am facing hard time understanding min-entropy.</p>&#xA;&#xA;<p>Fix $v \in \{0,1\}^{n/2}$, let $F\colon \{0,1\}^n \to \{0,1\}^{n/2}$ be chosen randomly, and let $X_v$ be a string chosen uniformly at random among $F^{(-1)}(v)$ (or a speci...
habedi/stack-exchange-dataset
23,320
Can we test whether two vertices are connected in time linear in the number of nodes?
<p>Consider the problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given an undirected graph and two of its vertices, is there a path between them? </p>&#xA;</blockquote>&#xA;&#xA;<p>I often read that this problem can be solved in linear time in the number of vertices! I am not sure why this claim holds.</p>&#xA;&#xA;<p>Can t...
algorithms graphs
1
Can we test whether two vertices are connected in time linear in the number of nodes? -- (algorithms graphs) <p>Consider the problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given an undirected graph and two of its vertices, is there a path between them? </p>&#xA;</blockquote>&#xA;&#xA;<p>I often read that this problem can ...
habedi/stack-exchange-dataset
23,329
How to read edge labels like "01, 1" on a state diagram?
<p><img src="https://i.stack.imgur.com/lSvI9.png" alt="enter image description here"></p>&#xA;&#xA;<p>Is this state machine a moore machine or a mealy machine? I am confused because the states have outputs and the transitions have output based on the input. I tried making a state table but I think its wrong. Can anyone...
terminology automata finite automata
1
How to read edge labels like "01, 1" on a state diagram? -- (terminology automata finite automata) <p><img src="https://i.stack.imgur.com/lSvI9.png" alt="enter image description here"></p>&#xA;&#xA;<p>Is this state machine a moore machine or a mealy machine? I am confused because the states have outputs and the transit...
habedi/stack-exchange-dataset
23,338
How can I debug my pseudocode algorithm?
<p>The algorithms for the problem I am working on become more and more complex as I try to improve their performance. They already span several pages with cases and sub-cases, and will probably become even longer. I am worried that there might be mistakes that are difficult to notice.</p>&#xA;&#xA;<p>As a programmer, I...
algorithms software testing
1
How can I debug my pseudocode algorithm? -- (algorithms software testing) <p>The algorithms for the problem I am working on become more and more complex as I try to improve their performance. They already span several pages with cases and sub-cases, and will probably become even longer. I am worried that there might be...
habedi/stack-exchange-dataset
23,339
Why don't we calculate swaps and other steps except comparison for finding time complexity of a sorting algorithm?
<p>I was learning some basic sorting techniques with their complexity. However I cannot understand why only the number of comparisons are taken into account while calculating time complexity and operations such as swap are ignored. <a href="http://en.wikipedia.org/wiki/Selection_sort#Analysis" rel="nofollow">Link to se...
algorithm analysis runtime analysis sorting
1
Why don't we calculate swaps and other steps except comparison for finding time complexity of a sorting algorithm? -- (algorithm analysis runtime analysis sorting) <p>I was learning some basic sorting techniques with their complexity. However I cannot understand why only the number of comparisons are taken into account...
habedi/stack-exchange-dataset
23,347
How does an Operating System without kernel mode work?
<p>Andrew S. Tanenbaum, in his book <em>Modern Operating Systems (3rd Edition)</em>, states that the distinction between operating system software and normal (user mode) software can sometimes be blurred in embedded systems (which <strong>may not have a kernel mode</strong>).</p>&#xA;&#xA;<blockquote>&#xA; <p>Can some...
operating systems
1
How does an Operating System without kernel mode work? -- (operating systems) <p>Andrew S. Tanenbaum, in his book <em>Modern Operating Systems (3rd Edition)</em>, states that the distinction between operating system software and normal (user mode) software can sometimes be blurred in embedded systems (which <strong>may...
habedi/stack-exchange-dataset
23,349
executing threads with no synchronization
<p>suppose Threads 1 and 2 are executing concurrently with shared integer variables A, B, and C. Thread 1 executes:A=4, B=5, C=B-A; Thread 2 executes: A=3, B=6, C=A+B; </p>&#xA;&#xA;<p>I'm trying to find what can the possible values of C be after execution of this fragment when synchronization is not implemented.</p>&#...
threads
1
executing threads with no synchronization -- (threads) <p>suppose Threads 1 and 2 are executing concurrently with shared integer variables A, B, and C. Thread 1 executes:A=4, B=5, C=B-A; Thread 2 executes: A=3, B=6, C=A+B; </p>&#xA;&#xA;<p>I'm trying to find what can the possible values of C be after execution of this ...
habedi/stack-exchange-dataset
23,353
Why is SAT in NP?
<p>I know that CNF SAT is in NP (and also NP-complete), because SAT is in NP and NP-complete. But what I don't understand is why? Is there anyone that can explain this?</p>&#xA;
complexity theory satisfiability decision problem np
1
Why is SAT in NP? -- (complexity theory satisfiability decision problem np) <p>I know that CNF SAT is in NP (and also NP-complete), because SAT is in NP and NP-complete. But what I don't understand is why? Is there anyone that can explain this?</p>&#xA;
habedi/stack-exchange-dataset
23,363
Algorithm to decide if $n \le m!$
<p>This is an assignment of an introductory course of complexity theory and I need to <em>find</em> a way to do the following:</p>&#xA;&#xA;<p>Given $n,m \in \Bbb N$, is $n \le m!$ ?</p>&#xA;&#xA;<p>The idea is to provide a <strong>Post Machine</strong> that can decide this in an <em>efficient way</em>, using $n,m$ in ...
algorithms decision problem integers
1
Algorithm to decide if $n \le m!$ -- (algorithms decision problem integers) <p>This is an assignment of an introductory course of complexity theory and I need to <em>find</em> a way to do the following:</p>&#xA;&#xA;<p>Given $n,m \in \Bbb N$, is $n \le m!$ ?</p>&#xA;&#xA;<p>The idea is to provide a <strong>Post Machine...
habedi/stack-exchange-dataset
23,365
Implications of the $\Omega(\frac{2^n}{n})$ circuit lower bound being tight
<p>There is a basic result in circuit complexity that says:</p>&#xA;&#xA;<blockquote>&#xA; <p>There exists a language that cannot be solved with circuits of size $o(\frac{2^n}{n})$.</p>&#xA;</blockquote>&#xA;&#xA;<p>The argument is a simple counting argument on the number of boolean functions and the number of distinc...
complexity theory lower bounds circuits
1
Implications of the $\Omega(\frac{2^n}{n})$ circuit lower bound being tight -- (complexity theory lower bounds circuits) <p>There is a basic result in circuit complexity that says:</p>&#xA;&#xA;<blockquote>&#xA; <p>There exists a language that cannot be solved with circuits of size $o(\frac{2^n}{n})$.</p>&#xA;</blockq...
habedi/stack-exchange-dataset
23,367
How to find whether a grammar's language is finite or infinite?
<p>I have this context-free grammar and I want to find out whether its language is finite or infinite.</p>&#xA;&#xA;<pre><code>S -&gt; XY|bb Step 1&#xA;X -&gt; XY|SS Step 2&#xA;Y -&gt; XY|SS Step 3&#xA;</code></pre>&#xA;&#xA;<p>So I would do</p>&#xA;&#xA;<pre><code>S -&gt; XY From step 1&#xA;S -&gt; YYY ...
formal languages context free formal grammars proof techniques induction
1
How to find whether a grammar's language is finite or infinite? -- (formal languages context free formal grammars proof techniques induction) <p>I have this context-free grammar and I want to find out whether its language is finite or infinite.</p>&#xA;&#xA;<pre><code>S -&gt; XY|bb Step 1&#xA;X -&gt; XY|SS Step 2&#xA...
habedi/stack-exchange-dataset
23,370
Can we improve the precision of IEEE floats by dropping leading zeros in the mantissa?
<p>It seems like it would be possible to add more precision to the IEEE 32-bit mantissa system if the leading zeroes were also dropped, just like the leading 1 is dropped due to it being implicitly known.</p>&#xA;&#xA;<p>For example, the number 17 would be represented as 0|10000100|00010000000000000000000. The leading ...
floating point number formats
1
Can we improve the precision of IEEE floats by dropping leading zeros in the mantissa? -- (floating point number formats) <p>It seems like it would be possible to add more precision to the IEEE 32-bit mantissa system if the leading zeroes were also dropped, just like the leading 1 is dropped due to it being implicitly ...
habedi/stack-exchange-dataset
23,375
how to draw a complement of a Turing Machine?
<p>I am now pretty confident on how I would turn something into a Turing Machine. Now my question is how do you convert TM into a complement of a Turing Machine. From what I can remember in Finite Automata, complementing it you would just turn a start state into a ending state, also if you have an ending state you woul...
turing machines automata closure properties
1
how to draw a complement of a Turing Machine? -- (turing machines automata closure properties) <p>I am now pretty confident on how I would turn something into a Turing Machine. Now my question is how do you convert TM into a complement of a Turing Machine. From what I can remember in Finite Automata, complementing it y...
habedi/stack-exchange-dataset
23,382
Is there a basic proof that there exists some edit distance between two strings?
<p>Title says it all pretty much. I do realize that often edit distance is defined as the minimum number of operations needed to transform one string to another, but I want something to point to that's even more general than that. </p>&#xA;&#xA;<p>I recently saw a brain teaser that claimed that some string was connecte...
strings string metrics edit distance
1
Is there a basic proof that there exists some edit distance between two strings? -- (strings string metrics edit distance) <p>Title says it all pretty much. I do realize that often edit distance is defined as the minimum number of operations needed to transform one string to another, but I want something to point to th...
habedi/stack-exchange-dataset
23,387
Performance impact due to time required for shuffling in Quicksort
<p>As a programmer with non CS background, I am learning algorithms.</p>&#xA;&#xA;<p>When explaining the performance of quicksort in an <a href="http://www.amazon.de/Algorithms-Robert-Sedgewick/dp/032157351X/ref=sr_1_1?ie=UTF8&amp;qid=1394794069&amp;sr=8-1&amp;keywords=algorithm" rel="nofollow">Algorithm book</a> and a...
time complexity runtime analysis quicksort
1
Performance impact due to time required for shuffling in Quicksort -- (time complexity runtime analysis quicksort) <p>As a programmer with non CS background, I am learning algorithms.</p>&#xA;&#xA;<p>When explaining the performance of quicksort in an <a href="http://www.amazon.de/Algorithms-Robert-Sedgewick/dp/03215735...
habedi/stack-exchange-dataset
23,391
Permute the subintervals of an interval partition to most closely align with a model partition
<p>You are given two things: A fixed initial 'model' partition of an interval, e.g.</p>&#xA;&#xA;<pre><code>I------I---I-----I-------I----...&#xA;</code></pre>&#xA;&#xA;<p>where each <code>-</code> or <code>I</code> represents an element in a discrete time series and the <code>I</code>s are the partition boundaries. T...
algorithms permutations partitions
1
Permute the subintervals of an interval partition to most closely align with a model partition -- (algorithms permutations partitions) <p>You are given two things: A fixed initial 'model' partition of an interval, e.g.</p>&#xA;&#xA;<pre><code>I------I---I-----I-------I----...&#xA;</code></pre>&#xA;&#xA;<p>where each <c...
habedi/stack-exchange-dataset
23,406
How to prove the following properties of Small-step semantics?
<p>I have to prove the following 2 properties of the Small-step semantics of the WHILE programming language:</p>&#xA;&#xA;<ul>&#xA;<li>If $\langle C_1; C_2, s\rangle \rightarrow^k s'$ then there is a&#xA;state $s''$ and natural numbers $k_1$ and $k_2$ such that $\langle C_1;s&#xA; \rangle \rightarrow^{k_1} s''$ and $...
proof techniques operational semantics
1
How to prove the following properties of Small-step semantics? -- (proof techniques operational semantics) <p>I have to prove the following 2 properties of the Small-step semantics of the WHILE programming language:</p>&#xA;&#xA;<ul>&#xA;<li>If $\langle C_1; C_2, s\rangle \rightarrow^k s'$ then there is a&#xA;state $s'...
habedi/stack-exchange-dataset
23,407
NDFA associated with language L
<p>Let A = <span class="math-container">$(Q, \Sigma, \delta, S, F)$</span> be a deterministic finite automaton associated with the language&#xA;<span class="math-container">$L \subseteq \Sigma^*$</span></p>&#xA;<blockquote>&#xA;<p><span class="math-container">$L' = \{y \in \Sigma^*:\exists x\in L. |x| = |y|\}$</span></...
regular languages finite automata nondeterminism
1
NDFA associated with language L -- (regular languages finite automata nondeterminism) <p>Let A = <span class="math-container">$(Q, \Sigma, \delta, S, F)$</span> be a deterministic finite automaton associated with the language&#xA;<span class="math-container">$L \subseteq \Sigma^*$</span></p>&#xA;<blockquote>&#xA;<p><sp...
habedi/stack-exchange-dataset
23,409
Counting approximate solutions
<p>Many of us are familiar with the $P$ class. Counting solutions is believed to be a difficult task and that is why we usually end up approximating the number of solutions (we relax the accuracy of the counting). I want to ask, if relaxing the quality of the solutions counted has been addressed as a problem. Is there ...
complexity theory complexity classes
1
Counting approximate solutions -- (complexity theory complexity classes) <p>Many of us are familiar with the $P$ class. Counting solutions is believed to be a difficult task and that is why we usually end up approximating the number of solutions (we relax the accuracy of the counting). I want to ask, if relaxing the qu...
habedi/stack-exchange-dataset
23,417
Quantum algorithms and quantum computation
<p>Is my (very high-level) understanding correct here regarding quantum algorithms &mdash;</p>&#xA;&#xA;<p>Quantum computers can process a massive amount of operations in parallel to the nature of qubits and their ability to have states that are superpositions of $|0\rangle$ and $|1\rangle$.</p>&#xA;&#xA;<p>Yet when we...
quantum computing random walks
1
Quantum algorithms and quantum computation -- (quantum computing random walks) <p>Is my (very high-level) understanding correct here regarding quantum algorithms &mdash;</p>&#xA;&#xA;<p>Quantum computers can process a massive amount of operations in parallel to the nature of qubits and their ability to have states that...
habedi/stack-exchange-dataset
23,428
How to compute a curious inverse
<p>Let $M$ be a square matrix with entries that are $0$ or $1$ and let $v$ be a vector with values that are also $0$ or $1$. If we are given $M$ and $y = Mv$, we can computer $v$ if $M$ is non-singular. </p>&#xA;&#xA;<p>Now let us take the second bit (from the right) of the binary representation of each $y_i$ as anot...
algorithms np hard linear algebra
1
How to compute a curious inverse -- (algorithms np hard linear algebra) <p>Let $M$ be a square matrix with entries that are $0$ or $1$ and let $v$ be a vector with values that are also $0$ or $1$. If we are given $M$ and $y = Mv$, we can computer $v$ if $M$ is non-singular. </p>&#xA;&#xA;<p>Now let us take the second...
habedi/stack-exchange-dataset
23,431
What does Tarski's Fixed-Point theorem give us that that Y-Combinator does't
<p>I'm taking a graduate course on the theory of functional programming, based on Paul Taylor's "Practical Foundations of Mathematics." I understand the statement of Tarski's theorem about how for any $\omega$-compelte poset $X$, and any $\omega$-continuous function $T:X\rightarrow X$, that $T$ has a fixed point which...
lambda calculus recursion type theory partial order lattices
1
What does Tarski's Fixed-Point theorem give us that that Y-Combinator does't -- (lambda calculus recursion type theory partial order lattices) <p>I'm taking a graduate course on the theory of functional programming, based on Paul Taylor's "Practical Foundations of Mathematics." I understand the statement of Tarski's t...
habedi/stack-exchange-dataset
23,440
number of different undirected graphs?
<p>The question is:</p>&#xA;&#xA;<p>How many different undirected graphs are there with n nodes and no parallel edges but may include self-loops?</p>&#xA;&#xA;<p>I've been wracking my brain over this for hours now. Basically, I know that for 1 vertex, there are 2 graphs. For 2 vertices, there are 8 graphs. For 3 vertic...
graphs
1
number of different undirected graphs? -- (graphs) <p>The question is:</p>&#xA;&#xA;<p>How many different undirected graphs are there with n nodes and no parallel edges but may include self-loops?</p>&#xA;&#xA;<p>I've been wracking my brain over this for hours now. Basically, I know that for 1 vertex, there are 2 graph...
habedi/stack-exchange-dataset
23,441
Is it theoretically exist a computer that never affected by computer virus?
<p>Is it theoretically exist a computer that never affected by computer virus?</p>&#xA;&#xA;<p>just wonder if there could be a revolution on the computer?</p>&#xA;
terminology security
1
Is it theoretically exist a computer that never affected by computer virus? -- (terminology security) <p>Is it theoretically exist a computer that never affected by computer virus?</p>&#xA;&#xA;<p>just wonder if there could be a revolution on the computer?</p>&#xA;
habedi/stack-exchange-dataset
23,444
Reduction from Partition problem to 3-Partition problem
<p>I'm trying to show how to reduce the Partition problem to the 3-Partition problem.<br>&#xA;I'll first describe the problem using the definitions and notations I'm familiar with (I hope they're legit), and will then ask my question.<br>&#xA;So, the Partition problem is as follow:<br>&#xA;Given a multiset of integers ...
reductions
1
Reduction from Partition problem to 3-Partition problem -- (reductions) <p>I'm trying to show how to reduce the Partition problem to the 3-Partition problem.<br>&#xA;I'll first describe the problem using the definitions and notations I'm familiar with (I hope they're legit), and will then ask my question.<br>&#xA;So, t...
habedi/stack-exchange-dataset
23,451
Edges in and out of cycles and their relation to connectivity of the graph
<p>We know that if an edge is a part of a cycle in an undirected connected graph $G$, then if we remove that edge the graph is still connected.</p>&#xA;&#xA;<p>Is the opposite true? If an edge is <strong>not</strong> a part of a cycle in a connected graph $G$, and we remove that edge, then the graph we get is disconnec...
graphs
1
Edges in and out of cycles and their relation to connectivity of the graph -- (graphs) <p>We know that if an edge is a part of a cycle in an undirected connected graph $G$, then if we remove that edge the graph is still connected.</p>&#xA;&#xA;<p>Is the opposite true? If an edge is <strong>not</strong> a part of a cycl...
habedi/stack-exchange-dataset
23,452
Solving System of Equations
<p>(Re-posted from StackOverflow as suggested)</p>&#xA;&#xA;<p>I have the following problem.</p>&#xA;&#xA;<p>The functions $f(x),g(x)$ are defined as&#xA;$$&#xA;f(x) = \begin{cases} f_1(x) &amp; 0 \leq x \leq 10, \\ f_2(x) &amp; 10 &lt; x \leq 20, \\ 0 &amp; \text{otherwise}, \end{cases} \qquad&#xA;g(x) = \begin{cases}...
algorithms
1
Solving System of Equations -- (algorithms) <p>(Re-posted from StackOverflow as suggested)</p>&#xA;&#xA;<p>I have the following problem.</p>&#xA;&#xA;<p>The functions $f(x),g(x)$ are defined as&#xA;$$&#xA;f(x) = \begin{cases} f_1(x) &amp; 0 \leq x \leq 10, \\ f_2(x) &amp; 10 &lt; x \leq 20, \\ 0 &amp; \text{otherwise},...
habedi/stack-exchange-dataset
23,458
Automatic seat assignment algorithm
<p>I am looking for articles relating to algorithms that deal with automatic selection of seating assignment.&#xA;I need an algorithm (preferably more than one) that can automatically select a seating place while enforcing certain constraints that are predefined.&#xA;Originally I was planning on having the seats select...
algorithms optimization
1
Automatic seat assignment algorithm -- (algorithms optimization) <p>I am looking for articles relating to algorithms that deal with automatic selection of seating assignment.&#xA;I need an algorithm (preferably more than one) that can automatically select a seating place while enforcing certain constraints that are pre...
habedi/stack-exchange-dataset
23,460
I need clarification about DFA's and DFA acceptable languages
<p>In class yesterday we went over DFA's and DFA acceptable languages. An example of a language that is not DFA acceptable was given as $\{ ab, aabb, aaabbb, aaaabbbb, \ldots \}$. The reason given was that the machine would need an infinite amount of states. </p>&#xA;&#xA;<p>But wouldn't a simple DFA that has only o...
formal languages finite automata
1
I need clarification about DFA's and DFA acceptable languages -- (formal languages finite automata) <p>In class yesterday we went over DFA's and DFA acceptable languages. An example of a language that is not DFA acceptable was given as $\{ ab, aabb, aaabbb, aaaabbbb, \ldots \}$. The reason given was that the machine ...
habedi/stack-exchange-dataset
23,477
Best solutions to 6 degrees of separation
<p>From purely my knowledge of computer science a simple breadth first search from root A in search of node B, while keeping track of the depth of the tree, would be the most effective way to check whether A and B have 6 degrees of separation. If I simply wanted to check whether B is within 6 degrees I could also limit...
algorithms graphs search algorithms
1
Best solutions to 6 degrees of separation -- (algorithms graphs search algorithms) <p>From purely my knowledge of computer science a simple breadth first search from root A in search of node B, while keeping track of the depth of the tree, would be the most effective way to check whether A and B have 6 degrees of separ...
habedi/stack-exchange-dataset
23,484
a regular language so that $unary(L) \notin $Context Free Languages
<p>I need a regular language $ L\subseteq \{0,1\}^{*} $ so that $unary(L)$ is not context free.</p>&#xA;&#xA;<p>unary of $L$ is defined by:&#xA;$$unary(L) = \{0^{1x} : x \in L \}$$</p>&#xA;&#xA;<p>Example $L = \{0, 11\} $ $\rightarrow unary(L) = \{00, 0000000\}$ </p>&#xA;&#xA;<p>Any help would be great.</p>&#xA;
formal languages regular languages context free
1
a regular language so that $unary(L) \notin $Context Free Languages -- (formal languages regular languages context free) <p>I need a regular language $ L\subseteq \{0,1\}^{*} $ so that $unary(L)$ is not context free.</p>&#xA;&#xA;<p>unary of $L$ is defined by:&#xA;$$unary(L) = \{0^{1x} : x \in L \}$$</p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
23,485
find function which is in o(log^k(n)) for fixed value of k and in ω(1)
<p>I need to find a function $f$ which is in $o(\log^{k} n)$ for fixed value of $k$ with $f = \omega(1)$. I know that for little $o$ the function should be strictly less than $c\log^k n$ for all $c$ and large enough $n$; and for little $\omega$ it should be strictly greater than $c\cdot 1$ for all $c$ and large enough ...
asymptotics
1
find function which is in o(log^k(n)) for fixed value of k and in ω(1) -- (asymptotics) <p>I need to find a function $f$ which is in $o(\log^{k} n)$ for fixed value of $k$ with $f = \omega(1)$. I know that for little $o$ the function should be strictly less than $c\log^k n$ for all $c$ and large enough $n$; and for lit...
habedi/stack-exchange-dataset
23,493
Dynamic programming VS Greedy Algroithms
<p>I have two <code>True or False</code> questions in my practice test that are related but I am unsure about:</p>&#xA;&#xA;<pre><code>1. If an optimization problem can be solved using a greedy algorithm, &#xA;there must be a solution for this optimization problem using dynamic programming as well.&#xA;&#xA;2. If an op...
algorithms dynamic programming greedy algorithms
1
Dynamic programming VS Greedy Algroithms -- (algorithms dynamic programming greedy algorithms) <p>I have two <code>True or False</code> questions in my practice test that are related but I am unsure about:</p>&#xA;&#xA;<pre><code>1. If an optimization problem can be solved using a greedy algorithm, &#xA;there must be a...
habedi/stack-exchange-dataset
23,496
asymptotic growth of n^log log n
<p>I'm ordering functions by their asymptotic growth for an assignment and I have verified I have the correct order by using limits, but I'm trying to understand why $n^{log\ log\ n}$ is between $n^3$ and $2^n$. It seems like it should be closer to the order of $n^n$. Can anyone provide some insight on this.</p>&#xA;
asymptotics
1
asymptotic growth of n^log log n -- (asymptotics) <p>I'm ordering functions by their asymptotic growth for an assignment and I have verified I have the correct order by using limits, but I'm trying to understand why $n^{log\ log\ n}$ is between $n^3$ and $2^n$. It seems like it should be closer to the order of $n^n$. C...
habedi/stack-exchange-dataset
23,513
3SAT to CNF-SAT reduction
<p>I am trying to prove that 3SAT is polynome time reducable to CNF-SAT, but I don't know how to do this. A formula F is in 3SAT iff f(F) is in KNFSAT, but since 3SAT is a part of KNFSAT, every formula that is in 3SAT will automatically be in CNF-SAT. Is my conclusion correct? And how do I actually show this in a corre...
complexity theory reductions satisfiability 3 sat
1
3SAT to CNF-SAT reduction -- (complexity theory reductions satisfiability 3 sat) <p>I am trying to prove that 3SAT is polynome time reducable to CNF-SAT, but I don't know how to do this. A formula F is in 3SAT iff f(F) is in KNFSAT, but since 3SAT is a part of KNFSAT, every formula that is in 3SAT will automatically be...
habedi/stack-exchange-dataset
23,515
Unknown notation "$e^T$" in a machine learning paper
<p>I'm trying to understand the material in "A Dual Coordinate Descent Method for Large-scale Linear SVM" by Hsieh et. al. (<a href="http://ntu.csie.org/~cjlin/papers/cddual.pdf" rel="nofollow">link to paper</a>) There is an equation for the Dual form of an unconstrained optimisation problem,</p>&#xA;&#xA;<p>$$&#xA;f(\...
terminology machine learning optimization
1
Unknown notation "$e^T$" in a machine learning paper -- (terminology machine learning optimization) <p>I'm trying to understand the material in "A Dual Coordinate Descent Method for Large-scale Linear SVM" by Hsieh et. al. (<a href="http://ntu.csie.org/~cjlin/papers/cddual.pdf" rel="nofollow">link to paper</a>) There i...
habedi/stack-exchange-dataset
23,519
What is the common terminology to refer to the nth ancestor of a tree root?
<p>Reading the Wikipedia article for common terminology for tree <a href="http://en.wikipedia.org/wiki/Tree_%28data_structure%29" rel="nofollow noreferrer">(data structure)</a> there are several near references, but I don't read a formal declaration for how to refer to a specific generation of a tree's subtrees.</p>&#x...
graphs terminology trees
1
What is the common terminology to refer to the nth ancestor of a tree root? -- (graphs terminology trees) <p>Reading the Wikipedia article for common terminology for tree <a href="http://en.wikipedia.org/wiki/Tree_%28data_structure%29" rel="nofollow noreferrer">(data structure)</a> there are several near references, bu...
habedi/stack-exchange-dataset
23,521
Can Java be accurately described as statically and dynamically typed?
<p>Java seems to be categorized as a statically-typed language<a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29" rel="nofollow"> [1]</a>, but I'm wondering if it would be accurate to describe it as generally statically-typed but having some dynamic typing because of the run-time type checks performe...
terminology programming languages typing type checking
1
Can Java be accurately described as statically and dynamically typed? -- (terminology programming languages typing type checking) <p>Java seems to be categorized as a statically-typed language<a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29" rel="nofollow"> [1]</a>, but I'm wondering if it would be...
habedi/stack-exchange-dataset
23,528
How many size $s$ circuits from $\{0, 1\}^n \to \{0, 1\}$ are there?
<p>For simplicity, we can assume that only NAND gates are allowed. An asymptotically correct solution is all I really need.</p>&#xA;&#xA;<p>Thanks!</p>&#xA;
combinatorics circuits
1
How many size $s$ circuits from $\{0, 1\}^n \to \{0, 1\}$ are there? -- (combinatorics circuits) <p>For simplicity, we can assume that only NAND gates are allowed. An asymptotically correct solution is all I really need.</p>&#xA;&#xA;<p>Thanks!</p>&#xA;
habedi/stack-exchange-dataset
23,532
number of edges in a graph
<p>I got a problem related to graph theory - </p>&#xA;&#xA;<p>Consider an undirected graph ܩ where self-loops are not allowed. The vertex set of G is&#xA;{(i,j):1&lt;=i,j &lt;=12}. There is an edge between (a, b) and (c, d) if |a-c|&lt;=1 and |b-d|&lt;=1&#xA;The number of edges in this graph is </p>&#xA;&#xA;<p>Answer ...
graphs combinatorics counting
1
number of edges in a graph -- (graphs combinatorics counting) <p>I got a problem related to graph theory - </p>&#xA;&#xA;<p>Consider an undirected graph ܩ where self-loops are not allowed. The vertex set of G is&#xA;{(i,j):1&lt;=i,j &lt;=12}. There is an edge between (a, b) and (c, d) if |a-c|&lt;=1 and |b-d|&lt;=1&#xA...
habedi/stack-exchange-dataset
23,534
Compression of non-adjacent structure using grammar
<p>I'm working with compression algorithms that use context-free grammars (e.g. RE-PAIR and SEQUITUR). These grammars look for frequently occurring digrams (pairs of adjacent symbols) in an input string and use recursive substitution with non-terminal symbols to achieve compression. </p>&#xA;&#xA;<p>What I'm wondering ...
formal languages formal grammars data compression
1
Compression of non-adjacent structure using grammar -- (formal languages formal grammars data compression) <p>I'm working with compression algorithms that use context-free grammars (e.g. RE-PAIR and SEQUITUR). These grammars look for frequently occurring digrams (pairs of adjacent symbols) in an input string and use re...
habedi/stack-exchange-dataset
23,541
Canonical infinitely ambiguous languages
<p>In an article I am currently reading the grammar</p>&#xA;&#xA;<p><strong>S → SS | a | ε</strong></p>&#xA;&#xA;<p>is being described as canonical infinitely ambiguous. The infinitely ambiguous part I have no problem recognizing, but does "canonical" mean? Does it mean "typical", "standard example" etc.?</p>&#xA;
formal languages terminology
1
Canonical infinitely ambiguous languages -- (formal languages terminology) <p>In an article I am currently reading the grammar</p>&#xA;&#xA;<p><strong>S → SS | a | ε</strong></p>&#xA;&#xA;<p>is being described as canonical infinitely ambiguous. The infinitely ambiguous part I have no problem recognizing, but does "cano...
habedi/stack-exchange-dataset
23,549
Understanding Intel's algorithm for reducing a polynomial modulo an irreducible polynomial
<p>I'm reading <a href="http://download-software.intel.com/sites/default/files/article/165685/clmul-wp-rev-2.01-2012-09-21.pdf">this Intel white paper on carry-less multiplication</a>. It describes multiplication of polynomials in $\text{GF}(2^n)$. On a high level, this is performed in two steps: (1) multiplication of ...
algorithms integers polynomials multiplication
1
Understanding Intel's algorithm for reducing a polynomial modulo an irreducible polynomial -- (algorithms integers polynomials multiplication) <p>I'm reading <a href="http://download-software.intel.com/sites/default/files/article/165685/clmul-wp-rev-2.01-2012-09-21.pdf">this Intel white paper on carry-less multiplicati...
habedi/stack-exchange-dataset
23,554
If $\log xy=\log x+\log y$ then why multiplication is harder than addition?
<p>Someone told me that the $\log$ function was introduced to make the calculation easier. If we have to calculate $xy$, we can calculate instead $\log x+\log y$ since $\log xy=\log x+\log y$. How this can make the calculation easier? Maybe from a mathematician point of view but what about a computer scientist's point ...
algorithms complexity theory reference request education
1
If $\log xy=\log x+\log y$ then why multiplication is harder than addition? -- (algorithms complexity theory reference request education) <p>Someone told me that the $\log$ function was introduced to make the calculation easier. If we have to calculate $xy$, we can calculate instead $\log x+\log y$ since $\log xy=\log ...
habedi/stack-exchange-dataset
23,561
Boosting algorithms: Confusion between "weak classifiers" versus "number of boosting rounds"
<p>I've been reading up on boosting algorithms.</p>&#xA;&#xA;<p>I understand that the main crux of the algorithm is to build weak classifiers that are slightly better than random guessing, and then to add them up so that we end up with a strong classifier. This is done via "boosting rounds".</p>&#xA;&#xA;<p>With differ...
algorithms classification
1
Boosting algorithms: Confusion between "weak classifiers" versus "number of boosting rounds" -- (algorithms classification) <p>I've been reading up on boosting algorithms.</p>&#xA;&#xA;<p>I understand that the main crux of the algorithm is to build weak classifiers that are slightly better than random guessing, and the...
habedi/stack-exchange-dataset