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
2,770
Kolmogorov complexity of a decision problem
<p>What's the definition of Kolmogorov complexity for a decision problem? For example, how to define the length of the shortest program that solves the 3SAT problem? Is it the "smallest" Turing machine that recognizes the 3SAT langauge?</p>&#xA;
computability terminology decision problem kolmogorov complexity 3 sat
1
Kolmogorov complexity of a decision problem -- (computability terminology decision problem kolmogorov complexity 3 sat) <p>What's the definition of Kolmogorov complexity for a decision problem? For example, how to define the length of the shortest program that solves the 3SAT problem? Is it the "smallest" Turing machin...
habedi/stack-exchange-dataset
2,771
Assign m agents to N points by minimizing the total distance
<p>Suppose we have $N$ fixed points (set $S$ with $|S|=N$) on the plane and $m$ agents with fixed, known initial positions ($m&lt;N$) outside $S$. We should transfer the agents so that in our final configuration they are all positioned to different points of $S$. How could we achieve it by minimizing the total distance...
algorithms graphs optimization
1
Assign m agents to N points by minimizing the total distance -- (algorithms graphs optimization) <p>Suppose we have $N$ fixed points (set $S$ with $|S|=N$) on the plane and $m$ agents with fixed, known initial positions ($m&lt;N$) outside $S$. We should transfer the agents so that in our final configuration they are al...
habedi/stack-exchange-dataset
2,774
How to convert a non-embedding context free grammar to regular grammar?
<p>Please note that I am aware the undecidability of the conversion of context-free grammar to regular grammar. But given the non-embedding property of the input context-free grammar, is there any algorithm to convert it to regular grammar, or DFA directly?</p>&#xA;
formal languages formal grammars context free
1
How to convert a non-embedding context free grammar to regular grammar? -- (formal languages formal grammars context free) <p>Please note that I am aware the undecidability of the conversion of context-free grammar to regular grammar. But given the non-embedding property of the input context-free grammar, is there any ...
habedi/stack-exchange-dataset
2,777
Determining how similar a given string is to a collection of strings
<p>I'm not sure if this question belongs here and I apologize if not. What I am looking to do is to develop a programmatic way in which I can probabilistically determine whether a given string "belongs" in a bag of strings. For example, if I have bag of 10,000 US city names, and then I have the string "Philadelphia",...
algorithms reference request string metrics
1
Determining how similar a given string is to a collection of strings -- (algorithms reference request string metrics) <p>I'm not sure if this question belongs here and I apologize if not. What I am looking to do is to develop a programmatic way in which I can probabilistically determine whether a given string "belongs...
habedi/stack-exchange-dataset
2,783
A polynomial reduction from any NP-complete problem to bounded PCP
<p>Text books everywhere assume that the <a href="https://en.wikipedia.org/wiki/Post_correspondence_problem"><em>Bounded</em> Post Correspondence Problem</a> is NP-complete (no more than $N$ indexes allowed with repetitions). However, nowhere is one shown a simple (as in, something that an undergrad can understand) pol...
complexity theory np complete reductions
1
A polynomial reduction from any NP-complete problem to bounded PCP -- (complexity theory np complete reductions) <p>Text books everywhere assume that the <a href="https://en.wikipedia.org/wiki/Post_correspondence_problem"><em>Bounded</em> Post Correspondence Problem</a> is NP-complete (no more than $N$ indexes allowed ...
habedi/stack-exchange-dataset
2,784
Message receipt verification in a cluster
<p>At my current project I had a network problem come up for which I could not find a solution. In a peer-to-peer network I needed to send an action to all peers, and each peer was to act on it only if it could verify that all other peers would also act on it.</p>&#xA;&#xA;<p>That is, given a network of peers $P = { P_...
algorithms distributed systems computer networks fault tolerance
1
Message receipt verification in a cluster -- (algorithms distributed systems computer networks fault tolerance) <p>At my current project I had a network problem come up for which I could not find a solution. In a peer-to-peer network I needed to send an action to all peers, and each peer was to act on it only if it cou...
habedi/stack-exchange-dataset
2,785
Where can I find the data of the computer experiments in the book "Neural Networks and Learning Machines"?
<p>The book <a href="http://rads.stackoverflow.com/amzn/click/0131471392" rel="nofollow">"Neural Networks and Learning Machines"</a> by Simon Haykin has many computer experiments to which many exercises are related. But there seems to be no data for these experiments available online. Where can I find them?</p>&#xA;
reference request data sets
1
Where can I find the data of the computer experiments in the book "Neural Networks and Learning Machines"? -- (reference request data sets) <p>The book <a href="http://rads.stackoverflow.com/amzn/click/0131471392" rel="nofollow">"Neural Networks and Learning Machines"</a> by Simon Haykin has many computer experiments t...
habedi/stack-exchange-dataset
2,791
When did $LR(k)$ acquire the meaning "left-to-right scan, rightmost derivation?"
<p>According to <a href="http://en.wikipedia.org/wiki/LR_parser#LR_and_Other_Kinds_of_Parsers">the Wikipedia article</a>, the L in $LR(k)$ means "left-to-right scan", and the "R" means "rightmost derivation." However, in <a href="http://classes.engr.oregonstate.edu/eecs/winter2012/cs480/assignments/Knuth-1965-Translat...
formal languages reference request terminology formal grammars parsers
1
When did $LR(k)$ acquire the meaning "left-to-right scan, rightmost derivation?" -- (formal languages reference request terminology formal grammars parsers) <p>According to <a href="http://en.wikipedia.org/wiki/LR_parser#LR_and_Other_Kinds_of_Parsers">the Wikipedia article</a>, the L in $LR(k)$ means "left-to-right sca...
habedi/stack-exchange-dataset
2,792
Removing Left Recursion from Context-Free Grammars - Ordering of nonterminals
<p>I have recently implemented the Paull's algorithm for removing left-recursion from context-free grammars:</p>&#xA;<blockquote>&#xA;<p>Assign an ordering <span class="math-container">$A_1, \dots, A_n$</span> to the nonterminals of the grammar.</p>&#xA;<p>for <span class="math-container">$i := 1$</span> to <span class...
algorithms context free formal grammars efficiency left recursion
1
Removing Left Recursion from Context-Free Grammars - Ordering of nonterminals -- (algorithms context free formal grammars efficiency left recursion) <p>I have recently implemented the Paull's algorithm for removing left-recursion from context-free grammars:</p>&#xA;<blockquote>&#xA;<p>Assign an ordering <span class="ma...
habedi/stack-exchange-dataset
2,811
Perplexed by Rice's theorem
<p><strong>Summary:</strong> According to Rice's theorem, everything is impossible. And yet, I <em>do</em> this supposedly impossible stuff <em>all the time!</em></p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Of course, Rice's theorem doesn't simply say "everything is impossible". It says something rather more specific: "Every propert...
terminology computability undecidability rice theorem
1
Perplexed by Rice's theorem -- (terminology computability undecidability rice theorem) <p><strong>Summary:</strong> According to Rice's theorem, everything is impossible. And yet, I <em>do</em> this supposedly impossible stuff <em>all the time!</em></p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Of course, Rice's theorem doesn't simply...
habedi/stack-exchange-dataset
2,814
Sums of Landau terms revisited
<p>I asked a (seed) question about sums of Landau terms <a href="https://cs.stackexchange.com/questions/366/what-goes-wrong-with-sums-of-landau-terms">before</a>, trying to gauge the dangers of abusing asymptotics notation in arithmetics, with mixed success.</p>&#xA;&#xA;<p>Now, <a href="https://cs.stackexchange.com/a/...
terminology asymptotics landau notation
1
Sums of Landau terms revisited -- (terminology asymptotics landau notation) <p>I asked a (seed) question about sums of Landau terms <a href="https://cs.stackexchange.com/questions/366/what-goes-wrong-with-sums-of-landau-terms">before</a>, trying to gauge the dangers of abusing asymptotics notation in arithmetics, with ...
habedi/stack-exchange-dataset
2,816
Tighter analysis of modified Borůvka's algorithm
<p><a href="http://en.wikipedia.org/wiki/Bor%C5%AFvka%27s_algorithm">Borůvka's algorithm</a> is one of the standard algorithms for calculating the minimum spanning tree for a graph $G = (V,E)$, with $|V| = n, |E| = m$.</p>&#xA;&#xA;<p>The pseudo-code is:</p>&#xA;&#xA;<pre><code>MST T = empty tree&#xA;Begin with each ve...
algorithms algorithm analysis spanning trees
1
Tighter analysis of modified Borůvka's algorithm -- (algorithms algorithm analysis spanning trees) <p><a href="http://en.wikipedia.org/wiki/Bor%C5%AFvka%27s_algorithm">Borůvka's algorithm</a> is one of the standard algorithms for calculating the minimum spanning tree for a graph $G = (V,E)$, with $|V| = n, |E| = m$.</p...
habedi/stack-exchange-dataset
2,832
Is a push-down automaton with two stacks equivalent to a turing machine?
<p>In <a href="https://stackoverflow.com/a/559969/113124">this answer</a> it is mentioned</p>&#xA;&#xA;<blockquote>&#xA; <p>A regular language can be recognized by a finite automaton. A context-free language requires a stack, and <strong>a context sensitive language requires two stacks (which is equivalent to saying i...
computability turing machines automata pushdown automata
1
Is a push-down automaton with two stacks equivalent to a turing machine? -- (computability turing machines automata pushdown automata) <p>In <a href="https://stackoverflow.com/a/559969/113124">this answer</a> it is mentioned</p>&#xA;&#xA;<blockquote>&#xA; <p>A regular language can be recognized by a finite automaton. ...
habedi/stack-exchange-dataset
2,834
How can I verify a solution to Travelling Salesman Problem in polynomial time?
<p>So, <a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem#Computational_complexity">TSP (Travelling salesman problem) decision problem is <strong>NP complete</strong></a>.</p>&#xA;&#xA;<p>But I do not understand how I can verify that a given solution to TSP is in fact optimal in polynomial time, given th...
complexity theory np complete traveling salesman
1
How can I verify a solution to Travelling Salesman Problem in polynomial time? -- (complexity theory np complete traveling salesman) <p>So, <a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem#Computational_complexity">TSP (Travelling salesman problem) decision problem is <strong>NP complete</strong></a>.<...
habedi/stack-exchange-dataset
2,837
Is it intuitive to see that finding a Hamiltonian path is not in P while finding Euler path is?
<p>I am not sure I see it. From what I understand, edges and vertices are complements for each other and it is quite surprising that this difference exists.</p>&#xA;&#xA;<p>Is there a good / quick / easy way to see that in fact finding a Hamiltonian path should be much harder than finding a Euler path?</p>&#xA;
complexity theory graphs np complete intuition
1
Is it intuitive to see that finding a Hamiltonian path is not in P while finding Euler path is? -- (complexity theory graphs np complete intuition) <p>I am not sure I see it. From what I understand, edges and vertices are complements for each other and it is quite surprising that this difference exists.</p>&#xA;&#xA;<p...
habedi/stack-exchange-dataset
2,840
Greedy choice and matroids (greedoids)
<p>As I was going through the material about the greedy approach, I came to know that a knowledge on matroids (greedoids) will help me approaching the problem properly. After reading about matroids I have roughly understood what matroids are. But how do you use the concept of a matroid for solving a given optimisation ...
algorithms graphs greedy algorithms matroids
1
Greedy choice and matroids (greedoids) -- (algorithms graphs greedy algorithms matroids) <p>As I was going through the material about the greedy approach, I came to know that a knowledge on matroids (greedoids) will help me approaching the problem properly. After reading about matroids I have roughly understood what ma...
habedi/stack-exchange-dataset
2,845
Standard or Top Text on Applied Graph Theory
<p>I am looking for a reference text on applied graph theory and graph algorithms. Is there a standard text used in most computer science programs? If not, what are the most respected texts in the field? I have Cormen et al.</p>&#xA;
algorithms graphs reference request education books
1
Standard or Top Text on Applied Graph Theory -- (algorithms graphs reference request education books) <p>I am looking for a reference text on applied graph theory and graph algorithms. Is there a standard text used in most computer science programs? If not, what are the most respected texts in the field? I have Corme...
habedi/stack-exchange-dataset
2,847
What is a good binary encoding for $\phi$-based balanced ternary arithmetic algorithms?
<p>I've been looking for a way to represent the <a href="http://en.wikipedia.org/wiki/Golden_ratio_base" rel="nofollow">golden ratio ($\phi$) base</a> more efficiently in binary. The standard binary golden ratio notation works but is horribly space inefficient. The Balanced Ternary Tau System (BTTS) is the best I've...
algorithms data structures efficiency coding theory
1
What is a good binary encoding for $\phi$-based balanced ternary arithmetic algorithms? -- (algorithms data structures efficiency coding theory) <p>I've been looking for a way to represent the <a href="http://en.wikipedia.org/wiki/Golden_ratio_base" rel="nofollow">golden ratio ($\phi$) base</a> more efficiently in bina...
habedi/stack-exchange-dataset
2,855
Choosing an element from a set satisfying a predicate uniformly at random in $O(1)$ space
<p>We are given a set of objects, say integers, $S$. In addition, we are given a predicate $P$, for example $P(i): \Leftrightarrow i \geq 0$. We don't know in advance how many elements of $S$ satisfy the predicate $P$, but we would like to sample or choose an element uniformly at random from $S' = \{ i \mid i \in S \we...
algorithms randomized algorithms streaming algorithm in place
1
Choosing an element from a set satisfying a predicate uniformly at random in $O(1)$ space -- (algorithms randomized algorithms streaming algorithm in place) <p>We are given a set of objects, say integers, $S$. In addition, we are given a predicate $P$, for example $P(i): \Leftrightarrow i \geq 0$. We don't know in adva...
habedi/stack-exchange-dataset
2,861
Are regular languages closed under sort (Parikh image)?
<p>Assume $L$ is a regular language over an ordered alphabet. Is the language built by taking every word in $L$ and sorting it always a regular language?</p>&#xA;
formal languages regular languages
1
Are regular languages closed under sort (Parikh image)? -- (formal languages regular languages) <p>Assume $L$ is a regular language over an ordered alphabet. Is the language built by taking every word in $L$ and sorting it always a regular language?</p>&#xA;
habedi/stack-exchange-dataset
2,863
Determining the particular number in $O(n)$ time and space (worst case)
<p>$\newcommand\ldotd{\mathinner{..}}$Given that $A[1\ldotd n]$ are integers such that $0\le A[k]\le m$ for all $1\le k\le n$, and the occurrence of each number except a particular number in $A[1\ldotd n]$ is an odd number. Try to find the number whose occurrence is an even number.</p>&#xA;&#xA;<p>There is an $\Theta(n...
algorithms search algorithms
1
Determining the particular number in $O(n)$ time and space (worst case) -- (algorithms search algorithms) <p>$\newcommand\ldotd{\mathinner{..}}$Given that $A[1\ldotd n]$ are integers such that $0\le A[k]\le m$ for all $1\le k\le n$, and the occurrence of each number except a particular number in $A[1\ldotd n]$ is an od...
habedi/stack-exchange-dataset
2,868
How to call something that can be either a terminal or a nonterminal?
<p>I had written a <a href="https://github.com/shabbyX/shCompiler" rel="nofollow">compiler compiler</a> a few years ago and I'm now cleaning it up, improving it, and turning it into C.</p>&#xA;&#xA;<p>I came across a terminology problem however that I remember in the past I couldn't solve it either.</p>&#xA;&#xA;<p>Ima...
terminology formal grammars compilers
1
How to call something that can be either a terminal or a nonterminal? -- (terminology formal grammars compilers) <p>I had written a <a href="https://github.com/shabbyX/shCompiler" rel="nofollow">compiler compiler</a> a few years ago and I'm now cleaning it up, improving it, and turning it into C.</p>&#xA;&#xA;<p>I came...
habedi/stack-exchange-dataset
2,869
What are staged functions (conceptually)?
<p>In a recent CACM article [1], the authors present an implementation for <em>staged functions</em>. They use the term as if it was well-known, and none of the references looks like an obvious introduction.</p>&#xA;&#xA;<p>They give a short explanation (emphasis mine and reference number changed; it's 22 in the origin...
terminology programming languages meta programming
1
What are staged functions (conceptually)? -- (terminology programming languages meta programming) <p>In a recent CACM article [1], the authors present an implementation for <em>staged functions</em>. They use the term as if it was well-known, and none of the references looks like an obvious introduction.</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
2,872
Origins of the term "distributed hash table"
<p>I am currently researching for my diploma thesis in computer science with a topic in the area of distributed hash tables. Naturally, I came to the question were the term <em>distributed hash table</em> came from. (I know it is not rocket science to just derive it from <em>distributing a hash table</em>, but somebody...
data structures terminology distributed systems hash tables history
1
Origins of the term "distributed hash table" -- (data structures terminology distributed systems hash tables history) <p>I am currently researching for my diploma thesis in computer science with a topic in the area of distributed hash tables. Naturally, I came to the question were the term <em>distributed hash table</e...
habedi/stack-exchange-dataset
2,878
Universal simulation of Turing machines
<p>Let <span class="math-container">$f$</span> be a fixed time-constructable function.</p>&#xA;<p>The classical universal simulation result for TMs (Hennie and Stearns, 1966) states that there is a two-tape TM <span class="math-container">$U$</span> such that given</p>&#xA;<ul>&#xA;<li>the description of a TM <span cla...
complexity theory reference request turing machines machine models simulation
1
Universal simulation of Turing machines -- (complexity theory reference request turing machines machine models simulation) <p>Let <span class="math-container">$f$</span> be a fixed time-constructable function.</p>&#xA;<p>The classical universal simulation result for TMs (Hennie and Stearns, 1966) states that there is a...
habedi/stack-exchange-dataset
2,886
Notation for operational semantics that can be used in code comments
<p>I'm defining an intermediate language for a multi-backend code generator that I'm writing. I want to document the operational semantics for this intermediate language in a way that is readable both from within the source code and generated documentation (ocamldoc). The notation introduced used in "Types and Progra...
programming languages semantics operational semantics
1
Notation for operational semantics that can be used in code comments -- (programming languages semantics operational semantics) <p>I'm defining an intermediate language for a multi-backend code generator that I'm writing. I want to document the operational semantics for this intermediate language in a way that is read...
habedi/stack-exchange-dataset
2,887
Why does NTIME consider the length of the longest computation?
<p>In Sipser's textbook "Introduction to the Theory of Computation, Second Edition," he defines nondeterministic time complexity as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $N$ be a nondeterministic Turing machine that is a decider. The <strong>running time</strong> of $N$ is the function $f : \mathbb{N} \right...
complexity theory time complexity terminology turing machines nondeterminism
1
Why does NTIME consider the length of the longest computation? -- (complexity theory time complexity terminology turing machines nondeterminism) <p>In Sipser's textbook "Introduction to the Theory of Computation, Second Edition," he defines nondeterministic time complexity as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p...
habedi/stack-exchange-dataset
2,889
Determining whether a CFG is $LL(k)$ for any $k$?
<p>In <a href="http://classes.engr.oregonstate.edu/eecs/winter2012/cs480/assignments/Knuth-1965-TranslationofLanguages.pdf" rel="nofollow">Knuth's original paper on $LR(k)$ grammars</a>, he proved that the decision problem "Given a CFG $G$, is there a $k$ such that $G$ is an $LR(k)$ grammar?" is undecidable.</p>&#xA;&#...
formal languages computability formal grammars context free parsing
1
Determining whether a CFG is $LL(k)$ for any $k$? -- (formal languages computability formal grammars context free parsing) <p>In <a href="http://classes.engr.oregonstate.edu/eecs/winter2012/cs480/assignments/Knuth-1965-TranslationofLanguages.pdf" rel="nofollow">Knuth's original paper on $LR(k)$ grammars</a>, he proved ...
habedi/stack-exchange-dataset
2,893
Bound on space for selection algorithm?
<p>There is a well known worst case $O(n)$ <a href="http://en.wikipedia.org/wiki/Selection_algorithm">selection algorithm</a> to find the $k$'th largest element in an array of integers. It uses a <a href="http://en.wikipedia.org/wiki/Selection_algorithm#Properties_of_pivot">median-of-medians</a> approach to find a goo...
algorithms algorithm analysis space complexity lower bounds
1
Bound on space for selection algorithm? -- (algorithms algorithm analysis space complexity lower bounds) <p>There is a well known worst case $O(n)$ <a href="http://en.wikipedia.org/wiki/Selection_algorithm">selection algorithm</a> to find the $k$'th largest element in an array of integers. It uses a <a href="http://en...
habedi/stack-exchange-dataset
2,907
What exactly is the difference between supervised and unsupervised learning?
<p>I am trying to understand clustering methods.</p>&#xA;&#xA;<p>What I I think I understood:</p>&#xA;&#xA;<ol>&#xA;<li><p>In supervised learning, the categories/labels data is assigned to are known before computation. So, the labels, classes or categories are being used in order to "learn" the parameters that are real...
machine learning data mining clustering
1
What exactly is the difference between supervised and unsupervised learning? -- (machine learning data mining clustering) <p>I am trying to understand clustering methods.</p>&#xA;&#xA;<p>What I I think I understood:</p>&#xA;&#xA;<ol>&#xA;<li><p>In supervised learning, the categories/labels data is assigned to are known...
habedi/stack-exchange-dataset
2,919
Inferring refinement types
<p>At work I’ve been tasked with inferring some type information about a dynamic language. I rewrite sequences of statements into nested <code>let</code> expressions, like so:</p>&#xA;&#xA;<pre><code>return x; Z =&gt; x&#xA;var x; Z =&gt; let x = undefined in Z&#xA;x = y; Z =&gt...
programming languages logic type theory type inference
1
Inferring refinement types -- (programming languages logic type theory type inference) <p>At work I’ve been tasked with inferring some type information about a dynamic language. I rewrite sequences of statements into nested <code>let</code> expressions, like so:</p>&#xA;&#xA;<pre><code>return x; Z =&gt; x&#...
habedi/stack-exchange-dataset
2,923
Looking for a book that derives and constructs a model checking application
<p>I am teaching myself program verification and am currently learning <a href="http://en.wikipedia.org/wiki/Proof_assistant" rel="nofollow">proof assistants</a>. I have the book <a href="http://www.cambridge.org/gb/knowledge/isbn/item2327697/?site_locale=en_GB" rel="nofollow">Handbook of Practical Logic and Automated ...
reference request formal methods proof assistants model checking
1
Looking for a book that derives and constructs a model checking application -- (reference request formal methods proof assistants model checking) <p>I am teaching myself program verification and am currently learning <a href="http://en.wikipedia.org/wiki/Proof_assistant" rel="nofollow">proof assistants</a>. I have the ...
habedi/stack-exchange-dataset
2,938
Can bottom-up architectures be effectively programmed in top-down paradigms?
<p>The <a href="http://en.wikipedia.org/wiki/Subsumption_architecture" rel="nofollow">subsumption architecture</a>, proposed by Rodney Brooks in 1986, is a "bottom-up" approach, in which robots are designed using simple hierarchical models. These models build upon and subsume the lower modules to form a final product....
programming languages artificial intelligence algorithm design object oriented
1
Can bottom-up architectures be effectively programmed in top-down paradigms? -- (programming languages artificial intelligence algorithm design object oriented) <p>The <a href="http://en.wikipedia.org/wiki/Subsumption_architecture" rel="nofollow">subsumption architecture</a>, proposed by Rodney Brooks in 1986, is a "bo...
habedi/stack-exchange-dataset
2,939
Do non-computable functions grow asymptotically larger?
<p>I read about busy beaver numbers and how they grow asymptotically larger than any computable function. Why is this so? Is it because of the busy beaver function's non-computability? If so, then do all non-computable functions grow asymptotically larger than computable ones?</p>&#xA;&#xA;<p><strong>Edit:</strong></p>...
computability asymptotics
1
Do non-computable functions grow asymptotically larger? -- (computability asymptotics) <p>I read about busy beaver numbers and how they grow asymptotically larger than any computable function. Why is this so? Is it because of the busy beaver function's non-computability? If so, then do all non-computable functions grow...
habedi/stack-exchange-dataset
2,948
Counting with constant space bounded TMs
<p>The problem, coming from an interview question, is:</p>&#xA;&#xA;<blockquote>&#xA; <p>You have a stream of incoming numbers in range 0 to 60000 and you have&#xA; a function which will take a number from that range and return the&#xA; count of occurrence of that number till that moment. Give a suitable&#xA; Data ...
regular languages turing machines finite automata space complexity streaming algorithm
1
Counting with constant space bounded TMs -- (regular languages turing machines finite automata space complexity streaming algorithm) <p>The problem, coming from an interview question, is:</p>&#xA;&#xA;<blockquote>&#xA; <p>You have a stream of incoming numbers in range 0 to 60000 and you have&#xA; a function which wil...
habedi/stack-exchange-dataset
2,952
Generating inputs for random-testing graph algorithms?
<p>When testing algorithms, a common approach is random testing: generate a significant number of inputs according to some distribution (usually uniform), run the algorithm on them and verify correctness. Modern testing frameworks can generate inputs automatically given the algorithms signature, with some restrictions....
algorithms graphs randomness software testing
1
Generating inputs for random-testing graph algorithms? -- (algorithms graphs randomness software testing) <p>When testing algorithms, a common approach is random testing: generate a significant number of inputs according to some distribution (usually uniform), run the algorithm on them and verify correctness. Modern te...
habedi/stack-exchange-dataset
2,961
Example using Penetrance & Branching Factor in State-space Heuristic Search
<p>I need an example for how to calculate penetrance and branching factor of the search tree in in state-space heuristic search. The definitions are as following. <em>Penetrance</em> $P$ is defined by</p>&#xA;&#xA;<p>$\qquad \displaystyle P = \frac{L}{T}$</p>&#xA;&#xA;<p>and <em>branching factor</em> $B$ is defined by<...
artificial intelligence search algorithms
1
Example using Penetrance & Branching Factor in State-space Heuristic Search -- (artificial intelligence search algorithms) <p>I need an example for how to calculate penetrance and branching factor of the search tree in in state-space heuristic search. The definitions are as following. <em>Penetrance</em> $P$ is defined...
habedi/stack-exchange-dataset
2,962
Period in postulate; what does it mean?
<p>While I am learning a lot from others here at the Computer Science site, I must admit that I don't get as much out of some questions and answers since I typically don't understand the theorems to the level necessary. I am currently reading <a href="http://rads.stackoverflow.com/amzn/click/0910319375" rel="nofollow n...
terminology logic
1
Period in postulate; what does it mean? -- (terminology logic) <p>While I am learning a lot from others here at the Computer Science site, I must admit that I don't get as much out of some questions and answers since I typically don't understand the theorems to the level necessary. I am currently reading <a href="http:...
habedi/stack-exchange-dataset
2,965
Looking for books on creating and understanding theorems targeted at Computer Science
<p>In studying logic to understand verifying programs I have found that there are books on logic targeted at Computer Science e.g.</p>&#xA;&#xA;<ul>&#xA;<li><a href="http://rads.stackoverflow.com/amzn/click/052154310X" rel="nofollow">Logic in Computer Science: Modelling and Reasoning about Systems </a></li>&#xA;<li><a ...
logic proof techniques books
1
Looking for books on creating and understanding theorems targeted at Computer Science -- (logic proof techniques books) <p>In studying logic to understand verifying programs I have found that there are books on logic targeted at Computer Science e.g.</p>&#xA;&#xA;<ul>&#xA;<li><a href="http://rads.stackoverflow.com/amzn...
habedi/stack-exchange-dataset
2,971
Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$
<p>Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$.<br>&#xA;The book from which this example is, falsely claims that $T(n) = O(n)$ by guessing $T(n) \leq cn$ and then arguing </p>&#xA;&#xA;<p>$\qquad \begin{align*} T(n) &amp; \leq 2(c \lfloor n/2 \rfloor ) + n \\ &amp;\leq cn +n \\ &amp;=O(n) \qua...
proof techniques asymptotics recurrence relation landau notation induction
1
Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$ -- (proof techniques asymptotics recurrence relation landau notation induction) <p>Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$.<br>&#xA;The book from which this example is, falsely claims that $T(n) = O(n)$ by guessing $T(n) \...
habedi/stack-exchange-dataset
2,973
Generalised 3SUM (k-SUM) problem?
<p>The <a href="http://en.wikipedia.org/wiki/3SUM">3SUM</a> problem tries to identify 3 integers $a,b,c$ from a set $S$ of size $n$ such that $a + b + c = 0$.</p>&#xA;&#xA;<p>It is conjectured that there is not better solution than quadratic, i.e. $\mathcal{o}(n^2)$. Or to put it differently: $\mathcal{o}(n \log(n) + n...
complexity theory combinatorics complexity classes
1
Generalised 3SUM (k-SUM) problem? -- (complexity theory combinatorics complexity classes) <p>The <a href="http://en.wikipedia.org/wiki/3SUM">3SUM</a> problem tries to identify 3 integers $a,b,c$ from a set $S$ of size $n$ such that $a + b + c = 0$.</p>&#xA;&#xA;<p>It is conjectured that there is not better solution tha...
habedi/stack-exchange-dataset
2,981
Showing that the set of TMs which visit the starting state twice on the empty input is undecidable
<p>I'm trying to prove that </p>&#xA;&#xA;<p>$L_1=\{\langle M\rangle \mid M \text{ is a Turing machine and visits } q_0 \text{ at least twice on } \varepsilon\} \notin R$.</p>&#xA;&#xA;<p>I'm not sure whether to reduce the halting problem to it or not. I tried to construct a new machine $M'$ for $(\langle M \rangle,w)$...
turing machines reductions undecidability halting problem
1
Showing that the set of TMs which visit the starting state twice on the empty input is undecidable -- (turing machines reductions undecidability halting problem) <p>I'm trying to prove that </p>&#xA;&#xA;<p>$L_1=\{\langle M\rangle \mid M \text{ is a Turing machine and visits } q_0 \text{ at least twice on } \varepsilon...
habedi/stack-exchange-dataset
2,982
Examples of undecidable problems whose intersection is decidable
<p>I know that given two problems are undecidable it does not follow that their intersection must be undecidable. For example, take a property of languages $P$ such that it is undecidable whether the language accepted by a given pushdown automaton $M$ has that property. Clearly $P$ and $\lnot P$ are undecidable (for a ...
reference request undecidability decision problem
1
Examples of undecidable problems whose intersection is decidable -- (reference request undecidability decision problem) <p>I know that given two problems are undecidable it does not follow that their intersection must be undecidable. For example, take a property of languages $P$ such that it is undecidable whether the ...
habedi/stack-exchange-dataset
2,985
Micro-optimisation for edit distance computation: is it valid?
<p>On <a href="https://en.wikipedia.org/wiki/Levenshtein_distance#Computing_Levenshtein_distance">Wikipedia</a>, an implementation for the bottom-up dynamic programming scheme for the edit distance is given. It does not follow the definition completely; inner cells are computed thus:</p>&#xA;&#xA;<pre><code>if s[i] = t...
algorithms dynamic programming string metrics correctness proof program optimization
1
Micro-optimisation for edit distance computation: is it valid? -- (algorithms dynamic programming string metrics correctness proof program optimization) <p>On <a href="https://en.wikipedia.org/wiki/Levenshtein_distance#Computing_Levenshtein_distance">Wikipedia</a>, an implementation for the bottom-up dynamic programmin...
habedi/stack-exchange-dataset
2,987
Automated geometric theorem-proving using synthetic methods
<p>This question is about geometric theorem proving and is inspired by this <a href="https://math.stackexchange.com/questions/31192/is-it-possible-to-solve-any-euclidean-geometry-problem-using-a-computer"> Math.SE </a> post. Currently, Euclidean-geometric theorem provers, as referred to in the post, use coordinate geo...
artificial intelligence automated theorem proving
1
Automated geometric theorem-proving using synthetic methods -- (artificial intelligence automated theorem proving) <p>This question is about geometric theorem proving and is inspired by this <a href="https://math.stackexchange.com/questions/31192/is-it-possible-to-solve-any-euclidean-geometry-problem-using-a-computer">...
habedi/stack-exchange-dataset
2,988
How fast can we find all Four-Square combinations that sum to N?
<p>A question was asked at Stack Overflow (<a href="https://stackoverflow.com/questions/11732555/how-to-find-all-possible-values-of-four-variables-when-squared-sum-to-n#comment15599644_11732555">here</a>):</p>&#xA;&#xA;<blockquote>&#xA; <p>Given an integer $N$, print out all possible&#xA; combinations of integer valu...
complexity theory time complexity number theory enumeration
1
How fast can we find all Four-Square combinations that sum to N? -- (complexity theory time complexity number theory enumeration) <p>A question was asked at Stack Overflow (<a href="https://stackoverflow.com/questions/11732555/how-to-find-all-possible-values-of-four-variables-when-squared-sum-to-n#comment15599644_11732...
habedi/stack-exchange-dataset
2,994
Time complexity formula of nested loops
<p>I've just begun this stage 2 Compsci paper on algorithms, and stuff like this is not my strong point. I've come across this in my lecture slides.</p>&#xA;&#xA;<pre><code>int length = input.length();&#xA;for (int i = 0; i &lt; length - 1; i++) {&#xA; for (int j = i + 1; j &lt; length; j++) {&#xA; System.out...
algorithms algorithm analysis runtime analysis loops
1
Time complexity formula of nested loops -- (algorithms algorithm analysis runtime analysis loops) <p>I've just begun this stage 2 Compsci paper on algorithms, and stuff like this is not my strong point. I've come across this in my lecture slides.</p>&#xA;&#xA;<pre><code>int length = input.length();&#xA;for (int i = 0; ...
habedi/stack-exchange-dataset
2,999
Problem with the definition of P
<p>In <em>"Introduction to Algorithms: 3rd Edition"</em> there is Theorem 34.2, which states</p>&#xA;&#xA;<blockquote>&#xA; <p>$P = \{ L \mid L \text{ is accepted by a polynomial-time algorithm} \}$</p>&#xA;</blockquote>&#xA;&#xA;<p><em>"Accepted in polynomial-time"</em> is defined by:</p>&#xA;&#xA;<blockquote>&#xA; ...
complexity theory terminology time complexity polynomial time
1
Problem with the definition of P -- (complexity theory terminology time complexity polynomial time) <p>In <em>"Introduction to Algorithms: 3rd Edition"</em> there is Theorem 34.2, which states</p>&#xA;&#xA;<blockquote>&#xA; <p>$P = \{ L \mid L \text{ is accepted by a polynomial-time algorithm} \}$</p>&#xA;</blockquote...
habedi/stack-exchange-dataset
3,001
Why can L3 caches hold only shared blocks?
<p>In a recent CACM article [1], the authors present a way to improve scalability of shared and coherent caches. The core ingredient is assuming the caches are <em>inclusive</em>, that is higher-level caches (e.g. L3, one global cache) contain all blocks which are stored in their descendant lower-level caches (e.g. L1...
terminology computer architecture cpu cache shared memory
1
Why can L3 caches hold only shared blocks? -- (terminology computer architecture cpu cache shared memory) <p>In a recent CACM article [1], the authors present a way to improve scalability of shared and coherent caches. The core ingredient is assuming the caches are <em>inclusive</em>, that is higher-level caches (e.g....
habedi/stack-exchange-dataset
3,012
What if the electricity goes off while a file is being renamed?
<p>Suppose I'm renaming a file and the electricity goes off right in the middle. Naively, it looks like the file could be in some “half-renamed” state. Maybe the name would have half the old name and half the new name. Or maybe the file could disappear altogether because it no longer exists under the old name but it do...
operating systems filesystems fault tolerance
1
What if the electricity goes off while a file is being renamed? -- (operating systems filesystems fault tolerance) <p>Suppose I'm renaming a file and the electricity goes off right in the middle. Naively, it looks like the file could be in some “half-renamed” state. Maybe the name would have half the old name and half ...
habedi/stack-exchange-dataset
3,014
Running time of CDCL compared to DPLL
<p>What's the complexity of Conflict-Driven Clause Learning SAT solvers, compared to DPLL solvers? Was it proven that CDCL is faster in general? Are there instances of SAT that are hard for CDCL but easy for DPLL?</p>&#xA;
complexity theory time complexity efficiency satisfiability sat solvers
1
Running time of CDCL compared to DPLL -- (complexity theory time complexity efficiency satisfiability sat solvers) <p>What's the complexity of Conflict-Driven Clause Learning SAT solvers, compared to DPLL solvers? Was it proven that CDCL is faster in general? Are there instances of SAT that are hard for CDCL but easy f...
habedi/stack-exchange-dataset
3,019
What is the novelty in MapReduce?
<p>A few years ago, <a href="https://en.wikipedia.org/wiki/Mapreduce">MapReduce</a> was hailed as revolution of distributed programming. There have also been <a href="http://craig-henderson.blogspot.de/2009/11/dewitt-and-stonebrakers-mapreduce-major.html">critics</a> but by and large there was an enthusiastic hype. It ...
algorithms distributed systems parallel computing algorithm design
1
What is the novelty in MapReduce? -- (algorithms distributed systems parallel computing algorithm design) <p>A few years ago, <a href="https://en.wikipedia.org/wiki/Mapreduce">MapReduce</a> was hailed as revolution of distributed programming. There have also been <a href="http://craig-henderson.blogspot.de/2009/11/dewi...
habedi/stack-exchange-dataset
3,022
Maximum Independent Subset of 2D Grid Subgraph
<p>In the general case finding a Maximum Independent Subset of a Graph is NP-Hard.</p>&#xA;&#xA;<p>However consider the following subset of graphs:</p>&#xA;&#xA;<ul>&#xA;<li>Create an $N \times N$ grid of unit square cells.</li>&#xA;<li>Build a graph $G$ by creating a vertex corresponding to every cell. Notice that th...
algorithms graphs
1
Maximum Independent Subset of 2D Grid Subgraph -- (algorithms graphs) <p>In the general case finding a Maximum Independent Subset of a Graph is NP-Hard.</p>&#xA;&#xA;<p>However consider the following subset of graphs:</p>&#xA;&#xA;<ul>&#xA;<li>Create an $N \times N$ grid of unit square cells.</li>&#xA;<li>Build a graph...
habedi/stack-exchange-dataset
3,027
Maximum Independent Set of a Bipartite Graph
<p>I'm trying to find the Maximum Independent Set of a Biparite Graph.</p>&#xA;&#xA;<p>I found the following in some notes <strong>"May 13, 1998 - University of Washington - CSE 521 - Applications of network flow"</strong>:</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>Problem:</strong></p>&#xA; &#xA; <p>Given a biparti...
algorithms graphs network flow
1
Maximum Independent Set of a Bipartite Graph -- (algorithms graphs network flow) <p>I'm trying to find the Maximum Independent Set of a Biparite Graph.</p>&#xA;&#xA;<p>I found the following in some notes <strong>"May 13, 1998 - University of Washington - CSE 521 - Applications of network flow"</strong>:</p>&#xA;&#xA;<b...
habedi/stack-exchange-dataset
3,031
What is known about coRL and RL?
<p>Wondering about any known relations between <a href="http://qwiki.stanford.edu/index.php/Complexity_Zoo%3aR#rl" rel="nofollow">$\mathsf{RL}$</a> complexity class (one sided error with logarithmic space) and its complementary class, $\mathsf{coRL}$.</p>&#xA;&#xA;<p>Are they the same class?</p>&#xA;&#xA;<p>What are $\...
complexity theory complexity classes probabilistic algorithms
1
What is known about coRL and RL? -- (complexity theory complexity classes probabilistic algorithms) <p>Wondering about any known relations between <a href="http://qwiki.stanford.edu/index.php/Complexity_Zoo%3aR#rl" rel="nofollow">$\mathsf{RL}$</a> complexity class (one sided error with logarithmic space) and its comple...
habedi/stack-exchange-dataset
3,039
Run time of product of polynomially bounded numbers
<p>Let $M$ denote a set of $n$ positive integers, each less than $n^c$.</p>&#xA;&#xA;<p>What is the runtime of computing $\prod_{m \in M} m$ with a deterministic Turing machine?</p>&#xA;
algorithms time complexity integers
1
Run time of product of polynomially bounded numbers -- (algorithms time complexity integers) <p>Let $M$ denote a set of $n$ positive integers, each less than $n^c$.</p>&#xA;&#xA;<p>What is the runtime of computing $\prod_{m \in M} m$ with a deterministic Turing machine?</p>&#xA;
habedi/stack-exchange-dataset
3,044
Is the set of minimal DFA decidable?
<p>Let $\mathrm{MIN}_{\mathrm{DFA}}$ collection of all the codings of DFAs such that they are minimal regarding their states number. I mean if $\langle A \rangle \in \mathrm{MIN}_{\mathrm{DFA}}$ then for every other DFA $B$ with less states than $A$, $L(A)\ne L(B)$ holds. I'm trying to figure out how come that $\mathrm...
formal languages computability automata finite automata
1
Is the set of minimal DFA decidable? -- (formal languages computability automata finite automata) <p>Let $\mathrm{MIN}_{\mathrm{DFA}}$ collection of all the codings of DFAs such that they are minimal regarding their states number. I mean if $\langle A \rangle \in \mathrm{MIN}_{\mathrm{DFA}}$ then for every other DFA $B...
habedi/stack-exchange-dataset
3,061
A hash function with predicted collisions
<p>As far as I know, the more collision-resistant a hash function is, the better. But is there any way to define a hash function with <em>predicted</em> collisions? In other words, a hash function that collides for some known set of possible inputs and avoids collisions for other input values. To state the problem simp...
cryptography hash
1
A hash function with predicted collisions -- (cryptography hash) <p>As far as I know, the more collision-resistant a hash function is, the better. But is there any way to define a hash function with <em>predicted</em> collisions? In other words, a hash function that collides for some known set of possible inputs and av...
habedi/stack-exchange-dataset
3,067
Why classes implicitly derive from only the Object Class?
<p>I do not have any argument opposing why we need only a single universal class. However why not we have two universal classes, say an Object and an AntiObject Class. In nature and in science we find the concept of duality - like Energy &amp; Dark Energy; Male &amp; Female; Plus &amp; Minus; Multiply &amp; Divide; Ele...
programming languages type theory object oriented
1
Why classes implicitly derive from only the Object Class? -- (programming languages type theory object oriented) <p>I do not have any argument opposing why we need only a single universal class. However why not we have two universal classes, say an Object and an AntiObject Class. In nature and in science we find the co...
habedi/stack-exchange-dataset
3,071
Cost in time of constructing and running an NFA vs DFA for a given regex
<p>Repost from Stack Overflow:</p>&#xA;&#xA;<p>I'm going through past exams and keep coming across questions that I can't find an answer for in textbooks or on google, so any help would be much appreciated.</p>&#xA;&#xA;<p>The question I'm having problems with at the moment is as follows: </p>&#xA;&#xA;<blockquote>&#x...
regular languages automata finite automata compilers
1
Cost in time of constructing and running an NFA vs DFA for a given regex -- (regular languages automata finite automata compilers) <p>Repost from Stack Overflow:</p>&#xA;&#xA;<p>I'm going through past exams and keep coming across questions that I can't find an answer for in textbooks or on google, so any help would be ...
habedi/stack-exchange-dataset
3,078
Algorithm that finds the number of simple paths from $s$ to $t$ in $G$
<p>Can anyone suggest me a linear time algorithm that takes as input a directed acyclic graph $G=(V,E)$ and two vertices $s$ and $t$ and returns the number of simple paths from $s$ to $t$ in $G$.<br>&#xA;I have an algorithm in which I will run a DFS(Depth First Search) but if DFS finds $t$ then it will not change the c...
algorithms graphs
1
Algorithm that finds the number of simple paths from $s$ to $t$ in $G$ -- (algorithms graphs) <p>Can anyone suggest me a linear time algorithm that takes as input a directed acyclic graph $G=(V,E)$ and two vertices $s$ and $t$ and returns the number of simple paths from $s$ to $t$ in $G$.<br>&#xA;I have an algorithm in...
habedi/stack-exchange-dataset
3,086
Is there a repository for the hierarchy of proofs?
<p>I am self-learning <a href="http://en.wikipedia.org/wiki/Proof_assistant">proof assistants</a> and decided to start on some basic proofs and work my way up. Since proofs are based on other proofs and so form a hierarchy, is there a repository of the hierarchy of proofs?</p>&#xA;&#xA;<p>I know I can pick a particular...
reference request logic proof assistants
1
Is there a repository for the hierarchy of proofs? -- (reference request logic proof assistants) <p>I am self-learning <a href="http://en.wikipedia.org/wiki/Proof_assistant">proof assistants</a> and decided to start on some basic proofs and work my way up. Since proofs are based on other proofs and so form a hierarchy,...
habedi/stack-exchange-dataset
3,090
For a Turing Machine $M_1$, how is the set of machines $M_2$ which are "shorter" than $M_1$ and which accept the same language decidable?
<p>I wonder how come that the following language is in $\mathrm R$.</p>&#xA;&#xA;<p>$L_{M_1}=\Bigl\{\langle M_2\rangle \;\Big|\;\; M_2 \text{ is a TM, and } L(M_1)=L(M_2), \text{ and } |\langle M_1\rangle| &gt; | \langle M_2 \rangle| \Bigr\} $</p>&#xA;&#xA;<p>(I know that it's in $\mathrm R$ since there's an answer for...
computability undecidability
1
For a Turing Machine $M_1$, how is the set of machines $M_2$ which are "shorter" than $M_1$ and which accept the same language decidable? -- (computability undecidability) <p>I wonder how come that the following language is in $\mathrm R$.</p>&#xA;&#xA;<p>$L_{M_1}=\Bigl\{\langle M_2\rangle \;\Big|\;\; M_2 \text{ is a T...
habedi/stack-exchange-dataset
3,095
Dataflow framework for global analysis: Why meet, then apply?
<p>In Chapter 9 of the Dragon Book, the authors describe the dataflow framework for global analysis (described also in <a href="http://dragonbook.stanford.edu/lecture-notes/Stanford-CS243/l3-handout.pdf">these slides</a>). In this framework, an analysis is defined by a set of transfer functions, along with a <a href="...
compilers program optimization
1
Dataflow framework for global analysis: Why meet, then apply? -- (compilers program optimization) <p>In Chapter 9 of the Dragon Book, the authors describe the dataflow framework for global analysis (described also in <a href="http://dragonbook.stanford.edu/lecture-notes/Stanford-CS243/l3-handout.pdf">these slides</a>)....
habedi/stack-exchange-dataset
3,101
Is the set of Turing machines which stops in at most 50 steps on all inputs, decidable?
<p>Let $F = \{⟨M⟩:\text{M is a TM which stops for every input in at most 50 steps}\}$. I need to decide whether <em>F</em> is decidable or recursively enumerable. I think it's decidable, but I don't know how to prove it.</p>&#xA;&#xA;<p><strong>My thoughts</strong></p>&#xA;&#xA;<p>This "50 steps" part immediate turns t...
computability undecidability
1
Is the set of Turing machines which stops in at most 50 steps on all inputs, decidable? -- (computability undecidability) <p>Let $F = \{⟨M⟩:\text{M is a TM which stops for every input in at most 50 steps}\}$. I need to decide whether <em>F</em> is decidable or recursively enumerable. I think it's decidable, but I don't...
habedi/stack-exchange-dataset
3,109
How to compute linear recurrence using matrix with fraction coefficients?
<p>What I'm trying to do is generate <a href="http://en.wikipedia.org/wiki/Motzkin_number" rel="nofollow">Motzkin numbers</a> mod a large number $10^{14} + 7$ (not prime), and it needs to compute the $n$th Motzkin number as fast as possible. From Wikipedia, the formula for the $n$th Motzkin number is defined as followi...
algorithms recurrence relation efficiency integers
1
How to compute linear recurrence using matrix with fraction coefficients? -- (algorithms recurrence relation efficiency integers) <p>What I'm trying to do is generate <a href="http://en.wikipedia.org/wiki/Motzkin_number" rel="nofollow">Motzkin numbers</a> mod a large number $10^{14} + 7$ (not prime), and it needs to co...
habedi/stack-exchange-dataset
3,110
Introduction into first order logic verification
<p>I am trying to teach myself different approaches to software verification. I have read some articles. As far as I learned, propositional logic with temporal generally uses model checking with SAT solvers (in ongoing - reactive systems), but what about first order Logic with temporal? Does it use theorem provers? Or ...
reference request logic formal methods sat solvers software verification
1
Introduction into first order logic verification -- (reference request logic formal methods sat solvers software verification) <p>I am trying to teach myself different approaches to software verification. I have read some articles. As far as I learned, propositional logic with temporal generally uses model checking wit...
habedi/stack-exchange-dataset
3,115
What different lines of reasoning and traditions lead to the conclusion that Software Engineering is or isn't part of Computer Science?
<p><strong>Background:</strong> Some people consider Software Engineering as a branch of Computer Science, while others consider that they are, or should be, separate. The former stance seems to be well presented in written works. On Wikipedia, Software Engineering <a href="http://en.wikipedia.org/wiki/Computer_science...
software engineering
1
What different lines of reasoning and traditions lead to the conclusion that Software Engineering is or isn't part of Computer Science? -- (software engineering) <p><strong>Background:</strong> Some people consider Software Engineering as a branch of Computer Science, while others consider that they are, or should be, ...
habedi/stack-exchange-dataset
3,119
Is it decidable whether a TM reaches some position on the tape?
<p>I have these questions from an old exam I'm trying to solve. For each problem, the input is an encoding of some Turing machine $M$.</p>&#xA;&#xA;<blockquote>&#xA; <p>For an integer $c&gt;1$, and the following three problems:</p>&#xA; &#xA; <ol>&#xA; <li><p>Is it true that for every input $x$, M does not pass the...
computability turing machines undecidability
1
Is it decidable whether a TM reaches some position on the tape? -- (computability turing machines undecidability) <p>I have these questions from an old exam I'm trying to solve. For each problem, the input is an encoding of some Turing machine $M$.</p>&#xA;&#xA;<blockquote>&#xA; <p>For an integer $c&gt;1$, and the fol...
habedi/stack-exchange-dataset
3,134
Is #P closed under exponentiation? modulo?
<p>The complexity class $\newcommand{\sharpp}{\mathsf{\#P}}\sharpp$ is defined as </p>&#xA;&#xA;<p>$\qquad \displaystyle \sharpp = \{f \mid \exists \text{ polynomial-time NTM } M\ \forall x.\, f(x) = \#\operatorname{accept}_{M}(x)\}$. </p>&#xA;&#xA;<p>It is known that $\sharpp$ is closed under addition, multiplication ...
complexity theory turing machines closure properties
1
Is #P closed under exponentiation? modulo? -- (complexity theory turing machines closure properties) <p>The complexity class $\newcommand{\sharpp}{\mathsf{\#P}}\sharpp$ is defined as </p>&#xA;&#xA;<p>$\qquad \displaystyle \sharpp = \{f \mid \exists \text{ polynomial-time NTM } M\ \forall x.\, f(x) = \#\operatorname{acc...
habedi/stack-exchange-dataset
3,138
How Does Populating Pastry's Routing Table Work?
<p>I'm trying to implement the Pastry Distributed Hash Table, but some things are escaping my understanding. I was hoping someone could clarify.</p>&#xA;&#xA;<p><strong>Disclaimer</strong>: I'm not a computer science student. I've taken precisely two computer science courses in my life, and neither dealt with anything ...
algorithms data structures distributed systems hash tables
1
How Does Populating Pastry's Routing Table Work? -- (algorithms data structures distributed systems hash tables) <p>I'm trying to implement the Pastry Distributed Hash Table, but some things are escaping my understanding. I was hoping someone could clarify.</p>&#xA;&#xA;<p><strong>Disclaimer</strong>: I'm not a compute...
habedi/stack-exchange-dataset
3,139
How to find contour lines for Appel's Hidden Line Removal Algorithm
<p>For fun I am trying to make a wire-frame viewer for the <a href="http://0x10c.com/doc/dcpu-16.txt" rel="nofollow noreferrer">DCPU-16</a>. I understand how do do everything except how to hide the lines that are hidden in the wire frame. All of the questions here on SO all assume you have access to OpenGL, unfortunate...
algorithms computational geometry graphics
1
How to find contour lines for Appel's Hidden Line Removal Algorithm -- (algorithms computational geometry graphics) <p>For fun I am trying to make a wire-frame viewer for the <a href="http://0x10c.com/doc/dcpu-16.txt" rel="nofollow noreferrer">DCPU-16</a>. I understand how do do everything except how to hide the lines ...
habedi/stack-exchange-dataset
3,141
Pizza commercial claim of 34 million combinations
<p>A pizza commercial claims that you can combine their ingredients to 34 million different combinations. I didn't believe it, so I dusted off my rusty combinatorics skills and tried to figure it out. Here's what I have so far:&#xA;From the online ordering site I got the choices</p>&#xA;&#xA;<ol>&#xA;<li>crust (4 type...
combinatorics discrete mathematics
1
Pizza commercial claim of 34 million combinations -- (combinatorics discrete mathematics) <p>A pizza commercial claims that you can combine their ingredients to 34 million different combinations. I didn't believe it, so I dusted off my rusty combinatorics skills and tried to figure it out. Here's what I have so far:&#...
habedi/stack-exchange-dataset
3,149
What is the meaning of $O(m+n)$?
<p>This is a basic question, but I'm thinking that $O(m+n)$ is the same as $O(\max(m,n))$, since the larger term should dominate as we go to infinity? Also, that would be different from $O(\min(m,n))$. Is that right? I keep seeing this notation, especially when discussing graph algorithms. For example, you routinely se...
terminology asymptotics mathematical analysis landau notation
1
What is the meaning of $O(m+n)$? -- (terminology asymptotics mathematical analysis landau notation) <p>This is a basic question, but I'm thinking that $O(m+n)$ is the same as $O(\max(m,n))$, since the larger term should dominate as we go to infinity? Also, that would be different from $O(\min(m,n))$. Is that right? I k...
habedi/stack-exchange-dataset
3,154
How to show two models of computation are equivalent?
<p>I'm seeking explanation on how one could prove that two models of computation are equivalent. I have been reading books on the subject except that equivalence proofs are omitted. I have a basic idea about what it means for two models of computation to be equivalent (the automata view: if they accept the same languag...
proof techniques computation models simulation
1
How to show two models of computation are equivalent? -- (proof techniques computation models simulation) <p>I'm seeking explanation on how one could prove that two models of computation are equivalent. I have been reading books on the subject except that equivalence proofs are omitted. I have a basic idea about what i...
habedi/stack-exchange-dataset
3,156
Dynamic changes to classes or context activation -- how to treat existing objects in a consistent way?
<p>I am looking for references and papers on the following topic.</p>&#xA;<ol>&#xA;<li><p>In <em>general</em>, some programming languages allow dynamic changes to classes. As an example, a new instance variable ‘weight’ can be added to the class <code>Edge</code> (the class of unweighted edges of graphs). But what shou...
reference request programming languages semantics object oriented
1
Dynamic changes to classes or context activation -- how to treat existing objects in a consistent way? -- (reference request programming languages semantics object oriented) <p>I am looking for references and papers on the following topic.</p>&#xA;<ol>&#xA;<li><p>In <em>general</em>, some programming languages allow dy...
habedi/stack-exchange-dataset
3,161
Why larger input sizes imply harder instances?
<p><em>Below, assume we're working with an infinite-tape Turing machine.</em></p>&#xA;&#xA;<p>When explaining the notion of time complexity to someone, and why it is measured relative to the input size of an instance, I stumbled across the following claim:</p>&#xA;&#xA;<blockquote>&#xA; <p>[..] For example, it's natur...
complexity theory time complexity intuition
1
Why larger input sizes imply harder instances? -- (complexity theory time complexity intuition) <p><em>Below, assume we're working with an infinite-tape Turing machine.</em></p>&#xA;&#xA;<p>When explaining the notion of time complexity to someone, and why it is measured relative to the input size of an instance, I stum...
habedi/stack-exchange-dataset
3,176
Is Huffman Encoding always optimal?
<p>The requirement of the encoding to be <em>prefix free</em> results in large trees due to the tree having to be complete. Is there a threshold where fixed-length non-encoded storage of data would be more efficient than encoding the data?</p>&#xA;
information theory data compression
1
Is Huffman Encoding always optimal? -- (information theory data compression) <p>The requirement of the encoding to be <em>prefix free</em> results in large trees due to the tree having to be complete. Is there a threshold where fixed-length non-encoded storage of data would be more efficient than encoding the data?</p>...
habedi/stack-exchange-dataset
3,185
Floating point rounding
<p>Can an IEEE-754 floating point number &lt; 1 (i.e. generated with a random number generator which generates a number >= 0.0 and &lt; 1.0) ever be multiplied by some integer (in floating point form) to get a number equal to or larger than that integer due to rounding?</p>&#xA;&#xA;<p>i.e.</p>&#xA;&#xA;<pre><code>doub...
numerical analysis floating point rounding
1
Floating point rounding -- (numerical analysis floating point rounding) <p>Can an IEEE-754 floating point number &lt; 1 (i.e. generated with a random number generator which generates a number >= 0.0 and &lt; 1.0) ever be multiplied by some integer (in floating point form) to get a number equal to or larger than that in...
habedi/stack-exchange-dataset
3,201
Good text on algorithm complexity
<p>Where should I look for a good introductory text in algorithm complexity? So far, I have had an Algorithms class, and several language classes, but nothing with a theoretical backbone. I get the whole complexity, but sometimes it's hard for me to differentiate between O(1) and O(n) plus there's the whole theta notat...
complexity theory reference request algorithm analysis education books
1
Good text on algorithm complexity -- (complexity theory reference request algorithm analysis education books) <p>Where should I look for a good introductory text in algorithm complexity? So far, I have had an Algorithms class, and several language classes, but nothing with a theoretical backbone. I get the whole comple...
habedi/stack-exchange-dataset
3,202
Undergraduate studies: Math or CS?
<p>hope it's possible for this question to be answered in an objective manner.</p>&#xA;&#xA;<p>I'm not studying in a liberal arts college so basically I only get to study one subject. Which would be the better preparation for future research (probably grad school) into theoretical CS? The standard undergraduate math co...
education
1
Undergraduate studies: Math or CS? -- (education) <p>hope it's possible for this question to be answered in an objective manner.</p>&#xA;&#xA;<p>I'm not studying in a liberal arts college so basically I only get to study one subject. Which would be the better preparation for future research (probably grad school) into ...
habedi/stack-exchange-dataset
3,209
What is the difference between a scripting language and a normal programming language?
<p>What is the difference between programming language and a scripting language?&#xA;For example, consider C versus Perl.</p>&#xA;&#xA;<p>Is the only difference that scripting languages require only the interpreter and don't require compile and linking?</p>&#xA;
programming languages
1
What is the difference between a scripting language and a normal programming language? -- (programming languages) <p>What is the difference between programming language and a scripting language?&#xA;For example, consider C versus Perl.</p>&#xA;&#xA;<p>Is the only difference that scripting languages require only the int...
habedi/stack-exchange-dataset
3,214
Is every linear-time algorithm a streaming algorithm?
<p>Over at <a href="https://cs.stackexchange.com/questions/3200/counting-inversion-pairs">this question about inversion counting</a>, I <a href="https://cs.stackexchange.com/questions/3200/counting-inversion-pairs#comment8724_3200">found a paper</a> that proves a lower bound on space complexity for all (exact) <a href=...
algorithms streaming algorithm simulation lower bounds
1
Is every linear-time algorithm a streaming algorithm? -- (algorithms streaming algorithm simulation lower bounds) <p>Over at <a href="https://cs.stackexchange.com/questions/3200/counting-inversion-pairs">this question about inversion counting</a>, I <a href="https://cs.stackexchange.com/questions/3200/counting-inversio...
habedi/stack-exchange-dataset
3,226
How are all NP Complete problems similar?
<p>I'm reading few proofs which prove a given problem is NP complete. The proof technique has following steps.</p>&#xA;&#xA;<ol>&#xA;<li>Prove that current problem is NP, i.e., given a certificate, prove&#xA;that it can be verified in polynomial time.</li>&#xA;<li>Take any known NP-complete problem (call "Easy") and re...
complexity theory np complete reductions
1
How are all NP Complete problems similar? -- (complexity theory np complete reductions) <p>I'm reading few proofs which prove a given problem is NP complete. The proof technique has following steps.</p>&#xA;&#xA;<ol>&#xA;<li>Prove that current problem is NP, i.e., given a certificate, prove&#xA;that it can be verified ...
habedi/stack-exchange-dataset
3,227
Uniform sampling from a simplex
<p>I am looking for an algorithm to generate an array of N random numbers, such that the sum of the N numbers is 1, and all numbers lie within 0 and 1. For example, N=3, the random point (x, y, z) should lie within the triangle:</p>&#xA;&#xA;<pre><code>x + y + z = 1&#xA;0 &lt; x &lt; 1&#xA;0 &lt; y &lt; 1&#xA;0 &lt; z ...
algorithms randomness random number generator sampling
1
Uniform sampling from a simplex -- (algorithms randomness random number generator sampling) <p>I am looking for an algorithm to generate an array of N random numbers, such that the sum of the N numbers is 1, and all numbers lie within 0 and 1. For example, N=3, the random point (x, y, z) should lie within the triangle:...
habedi/stack-exchange-dataset
3,240
Is $O$ contained in $\Theta$?
<p>So I have this question to prove a statement:</p>&#xA;&#xA;<p>$O(n)\subset\Theta(n)$...</p>&#xA;&#xA;<p>I don't need to know how to prove it, just that in my mind this makes no sense and I think it should rather be that $\Theta(n)\subset O(n)$. </p>&#xA;&#xA;<p>My understanding is that $O(n)$ is the set of all funct...
asymptotics mathematical analysis landau notation
1
Is $O$ contained in $\Theta$? -- (asymptotics mathematical analysis landau notation) <p>So I have this question to prove a statement:</p>&#xA;&#xA;<p>$O(n)\subset\Theta(n)$...</p>&#xA;&#xA;<p>I don't need to know how to prove it, just that in my mind this makes no sense and I think it should rather be that $\Theta(n)\s...
habedi/stack-exchange-dataset
3,245
$L$ APX-hard thus PTAS for $L$ implies $\mathsf{P} = \mathsf{NP}$
<p>If $L$ is an APX-hard language, doesn't the existence of a PTAS for $L$ trivially imply $\mathsf{P} = \mathsf{NP}$?</p>&#xA;&#xA;<p>Since for example metric-TSP is in APX, but it is not approximable within 220/219 of OPT [1] unless $\mathsf{P} = \mathsf{NP}$. Thus if there was a PTAS for $L$ we could reduce metric-T...
complexity theory np complete approximation
1
$L$ APX-hard thus PTAS for $L$ implies $\mathsf{P} = \mathsf{NP}$ -- (complexity theory np complete approximation) <p>If $L$ is an APX-hard language, doesn't the existence of a PTAS for $L$ trivially imply $\mathsf{P} = \mathsf{NP}$?</p>&#xA;&#xA;<p>Since for example metric-TSP is in APX, but it is not approximable wit...
habedi/stack-exchange-dataset
3,250
Proof of equivalence of parse-trees and derivations
<p>Intuitively, every derivation in a context-free grammar corresponds to a parse-tree and vise versa. </p>&#xA;&#xA;<p>Is this intuition correct? If so how can I formalize and prove such a thing?</p>&#xA;
formal grammars context free
1
Proof of equivalence of parse-trees and derivations -- (formal grammars context free) <p>Intuitively, every derivation in a context-free grammar corresponds to a parse-tree and vise versa. </p>&#xA;&#xA;<p>Is this intuition correct? If so how can I formalize and prove such a thing?</p>&#xA;
habedi/stack-exchange-dataset
3,251
How to show that a "reversed" regular language is regular
<p>I'm stuck on the following question:</p>&#xA;&#xA;<p>"Regular languages are precisely those accepted by finite automata. Given this fact, show that if the language $L$ is accepted by some finite automaton, then $L^{R}$ is also accepted by some finite; $L^{R}$ consists of all words of $L$ reversed."</p>&#xA;
formal languages regular languages automata finite automata
1
How to show that a "reversed" regular language is regular -- (formal languages regular languages automata finite automata) <p>I'm stuck on the following question:</p>&#xA;&#xA;<p>"Regular languages are precisely those accepted by finite automata. Given this fact, show that if the language $L$ is accepted by some finite...
habedi/stack-exchange-dataset
3,266
Heuristics for an Artificial Intelligence problem
<blockquote>&#xA; <p><strong>Problem</strong> : Given a (one dimensional) row containing $2N$ tiles arranged in $2N + 1$ spaces. There are $N$ black tiles (B), $N$ white tiles (W), and a single empty space. The tiles are initially in an arbitrary ordering. Our goal is to arrange the tiles such that all white tiles are...
artificial intelligence heuristics
1
Heuristics for an Artificial Intelligence problem -- (artificial intelligence heuristics) <blockquote>&#xA; <p><strong>Problem</strong> : Given a (one dimensional) row containing $2N$ tiles arranged in $2N + 1$ spaces. There are $N$ black tiles (B), $N$ white tiles (W), and a single empty space. The tiles are initiall...
habedi/stack-exchange-dataset
3,274
Free variables of (λx.xy)x and bound variables of λxy.x
<p>I was solving exercises on Lambda calculus. However, my solutions are different from the answers and I cannot see what is wrong.</p>&#xA;&#xA;<ol>&#xA;<li><p>Find free variables of $(\lambda x.xy)x$.<br>&#xA;My workings: $FV((\lambda x.xy)x)=FV(\lambda x.xy) \cup FV(x)=\{y\} \cup \{x\}=\{x,y\}$.<br>&#xA;The model an...
logic lambda calculus
1
Free variables of (λx.xy)x and bound variables of λxy.x -- (logic lambda calculus) <p>I was solving exercises on Lambda calculus. However, my solutions are different from the answers and I cannot see what is wrong.</p>&#xA;&#xA;<ol>&#xA;<li><p>Find free variables of $(\lambda x.xy)x$.<br>&#xA;My workings: $FV((\lambda ...
habedi/stack-exchange-dataset
3,276
Given a set of sets, find the smallest set(s) containing at least one element from each set
<p>Given a set $\mathbf{S}$ of sets, I’d like to find a set $M$ such that every set $S$ in $\mathbf{S}$ contains at least one element of $M$. I’d also like $M$ to contain as few elements as possible while still meeting this criterion, although there may exist more than one smallest $M$ with this property (the solution ...
algorithms optimization sets
1
Given a set of sets, find the smallest set(s) containing at least one element from each set -- (algorithms optimization sets) <p>Given a set $\mathbf{S}$ of sets, I’d like to find a set $M$ such that every set $S$ in $\mathbf{S}$ contains at least one element of $M$. I’d also like $M$ to contain as few elements as poss...
habedi/stack-exchange-dataset
3,278
What is a malformed token?
<p>I am reading Programming Language Pragmatics by Michael Scott. He says that on a first pass, a compiler will break a program into a series of tokens. He says that it will check for malformed tokens, like 123abc or $@foo (in C). </p>&#xA;&#xA;<p>What is a malformed token? A variable that does not meet the rules of va...
programming languages compilers
1
What is a malformed token? -- (programming languages compilers) <p>I am reading Programming Language Pragmatics by Michael Scott. He says that on a first pass, a compiler will break a program into a series of tokens. He says that it will check for malformed tokens, like 123abc or $@foo (in C). </p>&#xA;&#xA;<p>What is ...
habedi/stack-exchange-dataset
3,286
Types of reductions and associated definitions of hardness
<p>Let A be reducible to B, i.e., $A \leq B$. Hence, the Turing machine accepting $A$ has access to an oracle for $B$. Let the Turing machine accepting $A$ be $M_{A}$ and the oracle for $B$ be $O_{B}$. The types of reductions:</p>&#xA;&#xA;<ul>&#xA;<li><p>Turing reduction: $M_{A}$ can make multiple queries to $O_{B}$.<...
complexity theory np complete reductions complexity classes
1
Types of reductions and associated definitions of hardness -- (complexity theory np complete reductions complexity classes) <p>Let A be reducible to B, i.e., $A \leq B$. Hence, the Turing machine accepting $A$ has access to an oracle for $B$. Let the Turing machine accepting $A$ be $M_{A}$ and the oracle for $B$ be $O_...
habedi/stack-exchange-dataset
3,293
Produce decision version of the problem
<p>An optimisation problem requires minimising some function $f(x)$, where $x$ is a&#xA;vector of integers. What is the corresponding decision version of the problem?</p>&#xA;
complexity theory optimization reductions
1
Produce decision version of the problem -- (complexity theory optimization reductions) <p>An optimisation problem requires minimising some function $f(x)$, where $x$ is a&#xA;vector of integers. What is the corresponding decision version of the problem?</p>&#xA;
habedi/stack-exchange-dataset
3,296
Why does the experience propagation rule for checkers work in Tom Mitchell's book?
<p>In Tom Mitchell's book <a href="http://rads.stackoverflow.com/amzn/click/0070428077">"Machine Learning"</a>, Chap.1, a checkers game is used to illustrate how machine learning can be applied solve problems.</p>&#xA;&#xA;<p>An experience propagation rule is described for iterative learning of a hypothesis. Suppose a ...
machine learning
1
Why does the experience propagation rule for checkers work in Tom Mitchell's book? -- (machine learning) <p>In Tom Mitchell's book <a href="http://rads.stackoverflow.com/amzn/click/0070428077">"Machine Learning"</a>, Chap.1, a checkers game is used to illustrate how machine learning can be applied solve problems.</p>&#...
habedi/stack-exchange-dataset
3,310
Which Is a Better Way of Obtaining Scales, Gaussian Blur or Down Sampling?
<p>In computer vision, scales are important when we carry out a scene analysis. Choosing different scales affect the result of the analysis. For example, if a face is relatively small in the scene, then the details including nose, eyes will be omitted. On the other hand, details on larger faces become relatively more s...
machine learning computer vision image processing
1
Which Is a Better Way of Obtaining Scales, Gaussian Blur or Down Sampling? -- (machine learning computer vision image processing) <p>In computer vision, scales are important when we carry out a scene analysis. Choosing different scales affect the result of the analysis. For example, if a face is relatively small in the...
habedi/stack-exchange-dataset
3,312
Is the validity of some instance of an equational problem decidable?
<p>Is the following FOL-problem (equality is a logical symbol) &#xA;effectively decidable?</p>&#xA;&#xA;<p><strong>Given.</strong> A finite equation system $E$ and an equation $s = t$.</p>&#xA;&#xA;<p><strong>Question.</strong> Is there a substitution $\sigma$, such that $\sigma(E)&#xA;\models \sigma(s = t)$?</p>&#xA...
computability logic decision problem equality
1
Is the validity of some instance of an equational problem decidable? -- (computability logic decision problem equality) <p>Is the following FOL-problem (equality is a logical symbol) &#xA;effectively decidable?</p>&#xA;&#xA;<p><strong>Given.</strong> A finite equation system $E$ and an equation $s = t$.</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
3,313
Formally describing a new domain specific programming language
<p>I am about to implement a domain specific language for representation of social learning conventions. Part of the implementation is a formal description of a language - its 'calculus', symbols and logical expressions.</p>&#xA;&#xA;<p>My approach would be to describe the language by describing its grammar but there a...
formal languages programming languages semantics
1
Formally describing a new domain specific programming language -- (formal languages programming languages semantics) <p>I am about to implement a domain specific language for representation of social learning conventions. Part of the implementation is a formal description of a language - its 'calculus', symbols and log...
habedi/stack-exchange-dataset
3,314
Given a mechanical assembly as a graph, how to find an upper bound on number of assembly paths
<p>The rules are that you can only build from an existing part, so in the example below, B is the only option for the first move = A.</p>&#xA;&#xA;<p>A mechanical assembly might be represented as follows:</p>&#xA;&#xA;<pre><code> E&#xA; |&#xA; C&#xA; |&#xA;A-B&#xA; |&#xA; D&#xA; |&#xA; F&#xA;</code></pre>&#xA;&...
algorithms graphs
1
Given a mechanical assembly as a graph, how to find an upper bound on number of assembly paths -- (algorithms graphs) <p>The rules are that you can only build from an existing part, so in the example below, B is the only option for the first move = A.</p>&#xA;&#xA;<p>A mechanical assembly might be represented as follow...
habedi/stack-exchange-dataset