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,240
Do Higher Order Functions provide more power to Functional Programming?
<p><em>I've asked a similar question <a href="https://cstheory.stackexchange.com/questions/11652/does-high-order-functions-provide-more-power-to-functional-programming">on cstheory.SE</a>.</em></p>&#xA;&#xA;<p>According to <a href="https://stackoverflow.com/a/1990580/209629">this answer on Stackoverflow</a> there is an...
complexity theory lambda calculus functional programming turing completeness
1
Do Higher Order Functions provide more power to Functional Programming? -- (complexity theory lambda calculus functional programming turing completeness) <p><em>I've asked a similar question <a href="https://cstheory.stackexchange.com/questions/11652/does-high-order-functions-provide-more-power-to-functional-programmin...
habedi/stack-exchange-dataset
2,249
voting scheme for peaceful coexistence
<p>Many areas in the world suffer from conflicts between two groups (usually ethnic or religious). For the purpose of this question, I assume that most people of both sides want to live in peace, but there are few extremists who incite hatred and violence. The goal of this question is to find an objective way to filter...
reference request game theory voting
1
voting scheme for peaceful coexistence -- (reference request game theory voting) <p>Many areas in the world suffer from conflicts between two groups (usually ethnic or religious). For the purpose of this question, I assume that most people of both sides want to live in peace, but there are few extremists who incite hat...
habedi/stack-exchange-dataset
2,251
Why is it seemingly easier to resume torrent downloads than browser downloads?
<p>I really wonder how torrent downloads can be resumed at later point of time.&#xA;If such a technology exists, then why is it not possible in browsers?</p>&#xA;&#xA;<p>It is often not possible to pause a browser download so that it can be resumed at a later point of time. Often, the download will start again from the...
computer networks communication protocols
1
Why is it seemingly easier to resume torrent downloads than browser downloads? -- (computer networks communication protocols) <p>I really wonder how torrent downloads can be resumed at later point of time.&#xA;If such a technology exists, then why is it not possible in browsers?</p>&#xA;&#xA;<p>It is often not possible...
habedi/stack-exchange-dataset
2,257
Generating number of possibilites of popping two stacks to two other stacks
<p>Context: I'm working on <a href="https://stackoverflow.com/questions/10875675/how-to-find-out-all-the-popping-out-possibilities-of-two-stacks">this problem</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>There are two stacks here:</p>&#xA;&#xA;<pre><code>A: 1,2,3,4 &lt;- Stack Top&#xA; B: 5,6,7,8&#xA;</code></pre>&#xA; &#...
algorithms combinatorics efficiency
1
Generating number of possibilites of popping two stacks to two other stacks -- (algorithms combinatorics efficiency) <p>Context: I'm working on <a href="https://stackoverflow.com/questions/10875675/how-to-find-out-all-the-popping-out-possibilities-of-two-stacks">this problem</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Ther...
habedi/stack-exchange-dataset
2,259
Finding interesting anagrams
<p>Say that $a_1a_2\ldots a_n$ and $b_1b_2\ldots b_n$ are two strings of the same length. An <strong>anagramming</strong> of two strings is a bijective mapping $p:[1\ldots n]\to[1\ldots n]$ such that $a_i = b_{p(i)}$ for each $i$.</p>&#xA;&#xA;<p>There might be more than one anagramming for the same pair of strings. ...
algorithms strings search algorithms natural language processing
1
Finding interesting anagrams -- (algorithms strings search algorithms natural language processing) <p>Say that $a_1a_2\ldots a_n$ and $b_1b_2\ldots b_n$ are two strings of the same length. An <strong>anagramming</strong> of two strings is a bijective mapping $p:[1\ldots n]\to[1\ldots n]$ such that $a_i = b_{p(i)}$ for...
habedi/stack-exchange-dataset
2,263
Probabilities of duplicate mail detection by comparing notes among servers
<p>I have the following problem:</p>&#xA;<blockquote>&#xA;<p>We want to implement a filtering strategy in e-mail servers to reduce the number of spam messages. Each server will have a buffer, and before sending an e-mail, it checks whether there is a duplicate of the same message in its own buffer and contacts k distin...
combinatorics probability theory
1
Probabilities of duplicate mail detection by comparing notes among servers -- (combinatorics probability theory) <p>I have the following problem:</p>&#xA;<blockquote>&#xA;<p>We want to implement a filtering strategy in e-mail servers to reduce the number of spam messages. Each server will have a buffer, and before send...
habedi/stack-exchange-dataset
2,272
Representing Negative and Complex Numbers Using Lambda Calculus
<p>Most tutorials on Lambda Calculus provide example where Positive Integers and Booleans can be represented by Functions. What about -1 and i?</p>&#xA;
data structures lambda calculus integers real numbers
1
Representing Negative and Complex Numbers Using Lambda Calculus -- (data structures lambda calculus integers real numbers) <p>Most tutorials on Lambda Calculus provide example where Positive Integers and Booleans can be represented by Functions. What about -1 and i?</p>&#xA;
habedi/stack-exchange-dataset
2,280
Does there exist any work on creating a Real Number/Probability Theory Framework in COQ?
<p><a href="http://en.wikipedia.org/wiki/Coq">COQ</a> is an interactive theorem prover that uses the calculus of inductive constructions, i.e. it relies heavily on inductive types. Using those, discrete structures like natural numbers, rational numbers, graphs, grammars, semantics etc. are very concisely represented.</...
probability theory coq real numbers uncountability
1
Does there exist any work on creating a Real Number/Probability Theory Framework in COQ? -- (probability theory coq real numbers uncountability) <p><a href="http://en.wikipedia.org/wiki/Coq">COQ</a> is an interactive theorem prover that uses the calculus of inductive constructions, i.e. it relies heavily on inductive t...
habedi/stack-exchange-dataset
2,292
Computing follow sets conservatively for a PEG grammar
<p>Given a <a href="https://en.wikipedia.org/wiki/Parsing_expression_grammar" rel="nofollow">parsing expression grammar</a> (PEG) grammar and the name of the start production, I would like to label each node with the set of characters that can follow it. I would be happy with a good approximation that is conservative ...
formal languages reference request formal grammars parsers
1
Computing follow sets conservatively for a PEG grammar -- (formal languages reference request formal grammars parsers) <p>Given a <a href="https://en.wikipedia.org/wiki/Parsing_expression_grammar" rel="nofollow">parsing expression grammar</a> (PEG) grammar and the name of the start production, I would like to label eac...
habedi/stack-exchange-dataset
2,293
Can the encodings set of a non-trivial class of languages which contains the empty set be recursively enumerable?
<p>Let $C$ be a non-trivial set of recursively enumerable languages ($\emptyset \subsetneq C \subsetneq \mathrm{RE}$) and let $L$ be the set of encodings of Turing machines that recognize some language in $C$: $$L=\{\langle M \rangle \mid L(M) \in C \}$$</p>&#xA;&#xA;<p>Suppose that $\langle M_{loopy}\rangle \in L$, wh...
computability turing machines
1
Can the encodings set of a non-trivial class of languages which contains the empty set be recursively enumerable? -- (computability turing machines) <p>Let $C$ be a non-trivial set of recursively enumerable languages ($\emptyset \subsetneq C \subsetneq \mathrm{RE}$) and let $L$ be the set of encodings of Turing machine...
habedi/stack-exchange-dataset
2,301
Categorisation of type systems (strong/weak, dynamic/static)
<p>In short: how are type systems categorised in academic contexts; particularly, where can I find reputable sources that make the distinctions between different sorts of type system clear?</p>&#xA;&#xA;<p>In a sense the difficulty with this question is not that I can't find an answer, but rather that I can find too ma...
reference request programming languages type theory
1
Categorisation of type systems (strong/weak, dynamic/static) -- (reference request programming languages type theory) <p>In short: how are type systems categorised in academic contexts; particularly, where can I find reputable sources that make the distinctions between different sorts of type system clear?</p>&#xA;&#xA...
habedi/stack-exchange-dataset
2,304
Recursive, Recursively Enumerable and None of the Above
<p>Let </p>&#xA;&#xA;<ul>&#xA;<li>$A = \mathrm{R}$ be the set of all languages that are recursive,</li>&#xA;<li>$B = \mathrm{RE} \setminus \mathrm{R}$ be the set of all languages that are recursively enumerable but not recursive and</li>&#xA;<li>$C = \overline{\mathrm{RE}}$ be the set of all languages that are not recu...
formal languages computability
1
Recursive, Recursively Enumerable and None of the Above -- (formal languages computability) <p>Let </p>&#xA;&#xA;<ul>&#xA;<li>$A = \mathrm{R}$ be the set of all languages that are recursive,</li>&#xA;<li>$B = \mathrm{RE} \setminus \mathrm{R}$ be the set of all languages that are recursively enumerable but not recursive...
habedi/stack-exchange-dataset
2,317
Complexity of space density and sequentiality
<p>I'm looking for some standard terminology, metrics and/or applications of the consideration of density and sequentiality of algorithms.</p>&#xA;&#xA;<p>When we measure algorithms we tend to give the big-Oh notation such as $O(n)$ and usually we are measuring time complexity. Somewhat less frequently, though still of...
complexity theory reference request terminology space complexity
1
Complexity of space density and sequentiality -- (complexity theory reference request terminology space complexity) <p>I'm looking for some standard terminology, metrics and/or applications of the consideration of density and sequentiality of algorithms.</p>&#xA;&#xA;<p>When we measure algorithms we tend to give the bi...
habedi/stack-exchange-dataset
2,326
Type inference with product types
<p>I’m working on a compiler for a concatenative language and would like to add type inference support. I understand Hindley–Milner, but I’ve been learning the type theory as I go, so I’m unsure of how to adapt it. Is the following system sound and decidably inferable?</p>&#xA;&#xA;<p>A term is a literal, a composition...
programming languages logic compilers type theory type checking
1
Type inference with product types -- (programming languages logic compilers type theory type checking) <p>I’m working on a compiler for a concatenative language and would like to add type inference support. I understand Hindley–Milner, but I’ve been learning the type theory as I go, so I’m unsure of how to adapt it. Is...
habedi/stack-exchange-dataset
2,336
Sorting algorithms which accept a random comparator
<p>Generic sorting algorithms generally take a set of data to sort and a comparator function which can compare two individual elements. If the comparator is an order relation¹, then the output of the algorithm is a sorted list/array.</p>&#xA;&#xA;<p>I am wondering though which sort algorithms would actually <em>work</e...
algorithms randomized algorithms sorting
1
Sorting algorithms which accept a random comparator -- (algorithms randomized algorithms sorting) <p>Generic sorting algorithms generally take a set of data to sort and a comparator function which can compare two individual elements. If the comparator is an order relation¹, then the output of the algorithm is a sorted ...
habedi/stack-exchange-dataset
2,338
How to prove that ε-loops are not necessary in PDAs?
<p>In the context of our investigation of <a href="https://cs.stackexchange.com/questions/110/determining-capabilities-of-a-min-heap-or-other-exotic-state-machines">heap automata</a>, I would like to prove that a particular variant can not accept non-context-sensitive languages. As we have no equivalent grammar model, ...
automata pushdown automata
1
How to prove that ε-loops are not necessary in PDAs? -- (automata pushdown automata) <p>In the context of our investigation of <a href="https://cs.stackexchange.com/questions/110/determining-capabilities-of-a-min-heap-or-other-exotic-state-machines">heap automata</a>, I would like to prove that a particular variant can...
habedi/stack-exchange-dataset
2,339
per-record timeline consistency vs. monotonic writes
<p>It seems to me that the <em>per-record timeline consistency</em> as defined by Cooper et al. in "PNUTS: Yahoo!’s Hosted Data Serving Platform" mimics the (older?) definition of <em>monotonic writes</em>. From the paper:</p>&#xA;&#xA;<blockquote>&#xA; <p>per-record timeline consistency: all replicas of a given recor...
terminology distributed systems
1
per-record timeline consistency vs. monotonic writes -- (terminology distributed systems) <p>It seems to me that the <em>per-record timeline consistency</em> as defined by Cooper et al. in "PNUTS: Yahoo!’s Hosted Data Serving Platform" mimics the (older?) definition of <em>monotonic writes</em>. From the paper:</p>&#xA...
habedi/stack-exchange-dataset
2,341
Can exactly one of NP and co-NP be equal to P?
<p>Maybe I am missing something obvious, but can it be that P = co-NP $\subsetneq$ NP or vice versa? My feeling is that there must be some theorem that rules out this possibility.</p>&#xA;
complexity theory p vs np
1
Can exactly one of NP and co-NP be equal to P? -- (complexity theory p vs np) <p>Maybe I am missing something obvious, but can it be that P = co-NP $\subsetneq$ NP or vice versa? My feeling is that there must be some theorem that rules out this possibility.</p>&#xA;
habedi/stack-exchange-dataset
2,374
How to describe algorithms, prove and analyse them?
<p>Before reading <em>The Art of Computer Programming (TAOCP)</em>, I have not considered these questions deeply. I would use pseudo code to describe algorithms, understand them and estimate the running time only about orders of growth. The <em>TAOCP</em> thoroughly changes my mind.</p>&#xA;&#xA;<p><em>TAOCP</em> uses ...
algorithms proof techniques runtime analysis
1
How to describe algorithms, prove and analyse them? -- (algorithms proof techniques runtime analysis) <p>Before reading <em>The Art of Computer Programming (TAOCP)</em>, I have not considered these questions deeply. I would use pseudo code to describe algorithms, understand them and estimate the running time only about...
habedi/stack-exchange-dataset
2,382
Methods to evaluate a system of written rules
<p>I was trying to come up with a system that would evaluate bylaws for an organization as to determine their underlying logic.</p>&#xA;&#xA;<p>I think a first-order predicate system would work for representing the rules, which could be translated from the text via part-of-speech tagging and other NLP techniques. </p>...
machine learning algorithms pattern recognition logic
1
Methods to evaluate a system of written rules -- (machine learning algorithms pattern recognition logic) <p>I was trying to come up with a system that would evaluate bylaws for an organization as to determine their underlying logic.</p>&#xA;&#xA;<p>I think a first-order predicate system would work for representing the ...
habedi/stack-exchange-dataset
2,385
Which is the minimal number of operations for intractability?
<p>If we have an algorithm that need to run $n=2$ operations and then halt, I think we could say the problem it solves, is tractable, but if $n=10^{120}$ althought It could be theoretically solvable it seems to be intractable, and what about a problem that needs $n=10^{1000}$, or $n=10^{10^{1000}}$ operations, that's s...
complexity theory church turing thesis
1
Which is the minimal number of operations for intractability? -- (complexity theory church turing thesis) <p>If we have an algorithm that need to run $n=2$ operations and then halt, I think we could say the problem it solves, is tractable, but if $n=10^{120}$ althought It could be theoretically solvable it seems to be ...
habedi/stack-exchange-dataset
2,393
How to feel intuitively that a language is regular
<p>Given a language $ L= \{a^n b^n c^n\}$, how can I say directly, without looking at production rules, that this language is not regular?</p>&#xA;&#xA;<p>I could use pumping lemma but some guys are saying just looking at the grammar that this is not regular one. How is it possible?</p>&#xA;
formal languages regular languages pumping lemma intuition
1
How to feel intuitively that a language is regular -- (formal languages regular languages pumping lemma intuition) <p>Given a language $ L= \{a^n b^n c^n\}$, how can I say directly, without looking at production rules, that this language is not regular?</p>&#xA;&#xA;<p>I could use pumping lemma but some guys are saying...
habedi/stack-exchange-dataset
2,394
Algorithm to check the 2∀-connectness property of a graph
<p>A graph is 2∀-connected if it remains connected even if any single edge is removed. Let G = (V, E) be a connected undirected graph. Develop an algorithm as fast as possible to check 2∀-connectness of G.</p>&#xA;&#xA;<p>I know the basic idea is to build a DFS searching tree and then check each edge is not on a circle...
algorithms graphs efficiency
1
Algorithm to check the 2∀-connectness property of a graph -- (algorithms graphs efficiency) <p>A graph is 2∀-connected if it remains connected even if any single edge is removed. Let G = (V, E) be a connected undirected graph. Develop an algorithm as fast as possible to check 2∀-connectness of G.</p>&#xA;&#xA;<p>I know...
habedi/stack-exchange-dataset
2,404
Online Learning Resources for Discrete Mathematics
<p>Are there any good Discrete mathematics learning web resources with problem sets?</p>&#xA;
reference request education discrete mathematics
1
Online Learning Resources for Discrete Mathematics -- (reference request education discrete mathematics) <p>Are there any good Discrete mathematics learning web resources with problem sets?</p>&#xA;
habedi/stack-exchange-dataset
2,406
Must Neural Networks always converge?
<h2>Introduction</h2>&#xA;&#xA;<p><strong>Step One</strong></p>&#xA;&#xA;<p>I wrote a standard backpropegating neural network, and to test it, I decided to have it map XOR.</p>&#xA;&#xA;<p>It is a 2-2-1 network (with tanh activation function)</p>&#xA;&#xA;<pre><code>X1 M1&#xA; O1&#xA;X2 M2&#xA;&#xA;B1 B2&#xA;...
machine learning neural networks
1
Must Neural Networks always converge? -- (machine learning neural networks) <h2>Introduction</h2>&#xA;&#xA;<p><strong>Step One</strong></p>&#xA;&#xA;<p>I wrote a standard backpropegating neural network, and to test it, I decided to have it map XOR.</p>&#xA;&#xA;<p>It is a 2-2-1 network (with tanh activation function)</...
habedi/stack-exchange-dataset
2,407
Time complexity of a triple nested loop with squared indices
<p>I have seen this function in past year exam paper.</p>&#xA;&#xA;<pre><code>public static void run(int n){&#xA; for(int i = 1 ; i * i &lt; n ; i++){&#xA; for(int j = i ; j * j &lt; n ; j++){&#xA; for(int k = j ; k * k &lt; n ; k++){&#xA;&#xA; }&#xA; }&#xA; }&#xA;}&#xA;</code>...
algorithm analysis runtime analysis loops
1
Time complexity of a triple nested loop with squared indices -- (algorithm analysis runtime analysis loops) <p>I have seen this function in past year exam paper.</p>&#xA;&#xA;<pre><code>public static void run(int n){&#xA; for(int i = 1 ; i * i &lt; n ; i++){&#xA; for(int j = i ; j * j &lt; n ; j++){&#xA; ...
habedi/stack-exchange-dataset
2,411
Attempt to write a function with cubed log runtime complexity $O(\log^3 n)$
<p>I'm learning Data Structures and Algorithms now, I have a practical question that asked to write a function with O(log<sup>3</sup>n), which means log(n)*log(n)*log(n).</p>&#xA;&#xA;<pre><code>public void run(int n) {&#xA; for (int i = 1; i &lt; n; i *= 2) {&#xA; for (int j = 1; j &lt; n; j *= 2) {&#xA; ...
time complexity
1
Attempt to write a function with cubed log runtime complexity $O(\log^3 n)$ -- (time complexity) <p>I'm learning Data Structures and Algorithms now, I have a practical question that asked to write a function with O(log<sup>3</sup>n), which means log(n)*log(n)*log(n).</p>&#xA;&#xA;<pre><code>public void run(int n) {&#xA...
habedi/stack-exchange-dataset
2,415
Shortest distance between a point in A and a point in B
<blockquote>&#xA; <p>Given two sets $A$ and $B$ each containing $n$ disjoint points&#xA; in the plane, compute the shortest distance between a point in $A$ and a point in $B$, i.e., $\min \space \{\mbox{ } \text{dist}(p, q) \mbox{ } | \mbox{ } p \in A \land q \in B \space \} $.</p>&#xA;</blockquote>&#xA;&#xA;<p>I am ...
algorithms computational geometry
1
Shortest distance between a point in A and a point in B -- (algorithms computational geometry) <blockquote>&#xA; <p>Given two sets $A$ and $B$ each containing $n$ disjoint points&#xA; in the plane, compute the shortest distance between a point in $A$ and a point in $B$, i.e., $\min \space \{\mbox{ } \text{dist}(p, q)...
habedi/stack-exchange-dataset
2,422
How to prove 2-EXP != EXP
<p>I am guessing that this is correct for <code>3-EXP</code>, <code>4-EXP</code> etc...</p>&#xA;&#xA;<p>Basically I should find a problem in <code>2-EXP</code> that is not in <code>EXP</code>.&#xA;Any examples ?</p>&#xA;
complexity theory
1
How to prove 2-EXP != EXP -- (complexity theory) <p>I am guessing that this is correct for <code>3-EXP</code>, <code>4-EXP</code> etc...</p>&#xA;&#xA;<p>Basically I should find a problem in <code>2-EXP</code> that is not in <code>EXP</code>.&#xA;Any examples ?</p>&#xA;
habedi/stack-exchange-dataset
2,425
Semi-decidable problems with linear bound
<p>Take a semi-decidable problem and an algorithm that finds the positive answer in finite time. The run-time of the algorithm, restricted to inputs with a positive answer, cannot be bounded by a computable function. (Otherwise we’d know how long to wait for a positive answer. If the algorithm runs longer than that we ...
computability time complexity undecidability
1
Semi-decidable problems with linear bound -- (computability time complexity undecidability) <p>Take a semi-decidable problem and an algorithm that finds the positive answer in finite time. The run-time of the algorithm, restricted to inputs with a positive answer, cannot be bounded by a computable function. (Otherwise ...
habedi/stack-exchange-dataset
2,433
A concrete example about string w and string x used in the proof of Rice's Theorem
<p>So, in lectures about Rice's Theorem, reduction is usually used to proved the theorem. Reduction usually consists a construction of $M'$, using a TM $M$ which is in the form $\langle M,w \rangle$ to be simulated first, an input $x$ to be simulated if $M$ accepts. $M'$ accepts if x is accepted. </p>&#xA;&#xA;<p>I re...
computability
1
A concrete example about string w and string x used in the proof of Rice's Theorem -- (computability) <p>So, in lectures about Rice's Theorem, reduction is usually used to proved the theorem. Reduction usually consists a construction of $M'$, using a TM $M$ which is in the form $\langle M,w \rangle$ to be simulated fi...
habedi/stack-exchange-dataset
2,437
What is the type theory judgement symbol?
<p>In type theory judgements are often presented with the following syntax:</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/7V5r2.png" alt="enter image description here"></p>&#xA;&#xA;<p>My question is what is that symbol in the middle called? All the papers I've found seem to use an image rather than a unicode cha...
logic terminology type theory
1
What is the type theory judgement symbol? -- (logic terminology type theory) <p>In type theory judgements are often presented with the following syntax:</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/7V5r2.png" alt="enter image description here"></p>&#xA;&#xA;<p>My question is what is that symbol in the middle cal...
habedi/stack-exchange-dataset
2,450
How do I construct a doubly connected edge list given a set of line segments?
<blockquote>&#xA; <p>For a given planar graph $G(V,E)$ embedded in the plane, defined by a set of line segments $E= \left \{ e_1,...,e_m \right \} $, each segment $e_i$ is represented by its endpoints $\left \{ L_i,R_i \right \}$. Construct a DCEL data structure for the planar subdivision, describe an algorithm, prove...
algorithms data structures computational geometry doubly connected edge list
1
How do I construct a doubly connected edge list given a set of line segments? -- (algorithms data structures computational geometry doubly connected edge list) <blockquote>&#xA; <p>For a given planar graph $G(V,E)$ embedded in the plane, defined by a set of line segments $E= \left \{ e_1,...,e_m \right \} $, each segm...
habedi/stack-exchange-dataset
2,453
If any 3 points are collinear
<blockquote>&#xA; <p>Given a set $S$ of points $p_1,..,p_2$ give the most efficient algorithm for determining if any 3 points of the set are collinear.</p>&#xA;</blockquote>&#xA;&#xA;<p>The problem is I started with general definition but I cannot continue to actually solving the problem.</p>&#xA;&#xA;<p>What can we s...
algorithms computational geometry
1
If any 3 points are collinear -- (algorithms computational geometry) <blockquote>&#xA; <p>Given a set $S$ of points $p_1,..,p_2$ give the most efficient algorithm for determining if any 3 points of the set are collinear.</p>&#xA;</blockquote>&#xA;&#xA;<p>The problem is I started with general definition but I cannot co...
habedi/stack-exchange-dataset
2,462
Why is Turing completeness right?
<p>I am using a digital computer to write this message. Such a machine has a property which, if you think about it, is actually quite remarkable: It is <em>one machine</em> which, if programmed appropriately, can perform <em>any possible computation</em>.</p>&#xA;&#xA;<p>Of course, calculating machines of one kind or a...
computability turing machines history
1
Why is Turing completeness right? -- (computability turing machines history) <p>I am using a digital computer to write this message. Such a machine has a property which, if you think about it, is actually quite remarkable: It is <em>one machine</em> which, if programmed appropriately, can perform <em>any possible compu...
habedi/stack-exchange-dataset
2,464
Time-space tradeoff for missing element problem
<p>Here is a well-known problem.</p>&#xA;&#xA;<p>Given an array $A[1\dots n]$ of positive integers, output the smallest positive integer not in the array.</p>&#xA;&#xA;<p>The problem can be solved in $O(n)$ space and time: read the array, keep track in $O(n)$ space whether $1,2,\dots,n+1$ occured, scan for smallest ele...
complexity theory time complexity space complexity
1
Time-space tradeoff for missing element problem -- (complexity theory time complexity space complexity) <p>Here is a well-known problem.</p>&#xA;&#xA;<p>Given an array $A[1\dots n]$ of positive integers, output the smallest positive integer not in the array.</p>&#xA;&#xA;<p>The problem can be solved in $O(n)$ space and...
habedi/stack-exchange-dataset
2,470
Efficient bandwidth algorithm
<p>Recently I sort of stumbled on a problem of finding an efficient topology given a weighted directed graph. Consider the following scenario:</p>&#xA;&#xA;<ol>&#xA;<li><p>Node 1 is connected to 2,3,4 at 50 Mbps. Node 1 has 100 Mbps network card.</p></li>&#xA;<li><p>Node 3 is connected to 5 at 50 Mbps. Node 3 has 100 M...
algorithms graphs optimization linear programming
1
Efficient bandwidth algorithm -- (algorithms graphs optimization linear programming) <p>Recently I sort of stumbled on a problem of finding an efficient topology given a weighted directed graph. Consider the following scenario:</p>&#xA;&#xA;<ol>&#xA;<li><p>Node 1 is connected to 2,3,4 at 50 Mbps. Node 1 has 100 Mbps ne...
habedi/stack-exchange-dataset
2,471
What is the bitwise xor of an interval?
<p>Let $\oplus$ be bitwise xor. Let $k,a,b$ be non-negative integers. $[a..b]=\{x\mid a\leq x, x\leq b\}$, it is called a integer interval.</p>&#xA;&#xA;<p>What is a fast algorithm to find &#xA;$\{ k\oplus x\mid x\in [a..b]\}$ as a union of set of integer intervals.</p>&#xA;&#xA;<p>One can prove that $[a+k..b-k]\subset...
algorithms integers
1
What is the bitwise xor of an interval? -- (algorithms integers) <p>Let $\oplus$ be bitwise xor. Let $k,a,b$ be non-negative integers. $[a..b]=\{x\mid a\leq x, x\leq b\}$, it is called a integer interval.</p>&#xA;&#xA;<p>What is a fast algorithm to find &#xA;$\{ k\oplus x\mid x\in [a..b]\}$ as a union of set of integer...
habedi/stack-exchange-dataset
2,487
What is the time complexity of this function?
<p>This is an example in my lecture notes.&#xA;Is this function with time complexity $O(n \log n)$?.&#xA;Because the worst case is the funtion goes into <code>else</code> branch, and 2 nested loops with time complexity of $\log n$ and $n$, so it is $O(n \log n)$. Am I right?</p>&#xA;&#xA;<pre><code>int j = 3;&#xA;int k...
complexity theory time complexity algorithm analysis runtime analysis
1
What is the time complexity of this function? -- (complexity theory time complexity algorithm analysis runtime analysis) <p>This is an example in my lecture notes.&#xA;Is this function with time complexity $O(n \log n)$?.&#xA;Because the worst case is the funtion goes into <code>else</code> branch, and 2 nested loops w...
habedi/stack-exchange-dataset
2,492
CLRS - Maxflow Augmented Flow Lemma 26.1 - don't understand use of def. in proof
<p>In Cormen et. al., <em>Introduction to Algorithms</em> (3rd ed.), I don't get a line in the proof of Lemma 26.1 which states that the augmented flow $f\uparrow f'$ is a flow in $G$ and is s.t. $|f\uparrow f'| =|f|+|f'|$ (this is pp. 717-718).</p>&#xA;&#xA;<p>My confusion: When arguing <em>flow-conservation</em> the...
algorithms network flow
1
CLRS - Maxflow Augmented Flow Lemma 26.1 - don't understand use of def. in proof -- (algorithms network flow) <p>In Cormen et. al., <em>Introduction to Algorithms</em> (3rd ed.), I don't get a line in the proof of Lemma 26.1 which states that the augmented flow $f\uparrow f'$ is a flow in $G$ and is s.t. $|f\uparrow f...
habedi/stack-exchange-dataset
2,495
Book for algorithms beyond Cormen
<p>I've finished most of the material in Cormen's Intro to Algorithms book and I am looking for an algorithms book that covers material beyond Corman's book. Are there any recommendations?</p>&#xA;&#xA;<p>NOTE: I asked this on stackoverflow but wasn't all too happy with the answer. </p>&#xA;&#xA;<p>NOTE: Looking at mos...
algorithms reference request books
1
Book for algorithms beyond Cormen -- (algorithms reference request books) <p>I've finished most of the material in Cormen's Intro to Algorithms book and I am looking for an algorithms book that covers material beyond Corman's book. Are there any recommendations?</p>&#xA;&#xA;<p>NOTE: I asked this on stackoverflow but w...
habedi/stack-exchange-dataset
2,501
Neighbourhood in local search metaheuristic
<p>I cannot seem to find an answer to this question with Google, so I am going to ask here: is it required for a good neighbourhood function that it in principle (i. e. by recursively considering all neighbours of a certain solution - which is not practical) can reach all possible solutions?</p>&#xA;&#xA;<p>My questio...
optimization heuristics
1
Neighbourhood in local search metaheuristic -- (optimization heuristics) <p>I cannot seem to find an answer to this question with Google, so I am going to ask here: is it required for a good neighbourhood function that it in principle (i. e. by recursively considering all neighbours of a certain solution - which is no...
habedi/stack-exchange-dataset
2,503
Eliminating useless productions resulting from PDA to CFG converison
<p>In my class we used a Pushdown Automata to Context Free Grammar conversion algorithm that produces a lot extraneous states.</p>&#xA;&#xA;<p>For example, for two transitions, I am getting the following productions</p>&#xA;&#xA;<blockquote>&#xA; <p>$$\begin{gather*}&#xA; \delta(q_0,1,Z) = (q_0,XZ) \\&#xA; {}[q_0,Z,...
automata formal grammars context free pushdown automata
1
Eliminating useless productions resulting from PDA to CFG converison -- (automata formal grammars context free pushdown automata) <p>In my class we used a Pushdown Automata to Context Free Grammar conversion algorithm that produces a lot extraneous states.</p>&#xA;&#xA;<p>For example, for two transitions, I am getting ...
habedi/stack-exchange-dataset
2,508
Could an artificial neural network algorithm be expressed in terms of map-reduce operations?
<p>Could an artificial neural network algorithm be expressed in terms of map-reduce operations? I am also interested more generally in methods of parallelization as applied to ANNs and their application to cloud computing. </p>&#xA;&#xA;<p>I would think one approach would involve running a full ANN on each node and som...
parallel computing artificial intelligence neural networks
1
Could an artificial neural network algorithm be expressed in terms of map-reduce operations? -- (parallel computing artificial intelligence neural networks) <p>Could an artificial neural network algorithm be expressed in terms of map-reduce operations? I am also interested more generally in methods of parallelization a...
habedi/stack-exchange-dataset
2,519
Efficiently calculating minimum edit distance of a smaller string at each position in a larger one
<p>Given two strings, $r$ and $s$, where $n = |r|$, $m = |s|$ and $m \ll n$, find the minimum edit distance between $s$ for each beginning position in $r$ efficiently.</p>&#xA;&#xA;<p>That is, for each suffix of $r$ beginning at position $k$, $r_k$, find the <a href="http://en.wikipedia.org/wiki/Levenshtein_distance" r...
algorithms runtime analysis strings dynamic programming string metrics
1
Efficiently calculating minimum edit distance of a smaller string at each position in a larger one -- (algorithms runtime analysis strings dynamic programming string metrics) <p>Given two strings, $r$ and $s$, where $n = |r|$, $m = |s|$ and $m \ll n$, find the minimum edit distance between $s$ for each beginning positi...
habedi/stack-exchange-dataset
2,521
Is the type inference here really complicated?
<p>There's a <a href="https://stackoverflow.com/questions/9058430/why-doesnt-immutablemap-builder-build-pick-the-correct-type-parameters">question on SO</a> asking why in Java the right type doesn't get picked in a concrete case. I know that Java can't do it in such "complicated" cases, but I'm asking myself <em>WHY</e...
programming languages typing java type inference
1
Is the type inference here really complicated? -- (programming languages typing java type inference) <p>There's a <a href="https://stackoverflow.com/questions/9058430/why-doesnt-immutablemap-builder-build-pick-the-correct-type-parameters">question on SO</a> asking why in Java the right type doesn't get picked in a conc...
habedi/stack-exchange-dataset
2,524
Getting parallel items in dependency resolution
<p>I have implemented a topological sort based on the <a href="http://en.wikipedia.org/wiki/Topological_sort">Wikipedia article</a> which I'm using for dependency resolution, but it returns a linear list. What kind of algorithm can I use to find the independent paths?</p>&#xA;
algorithms graphs parallel computing scheduling
1
Getting parallel items in dependency resolution -- (algorithms graphs parallel computing scheduling) <p>I have implemented a topological sort based on the <a href="http://en.wikipedia.org/wiki/Topological_sort">Wikipedia article</a> which I'm using for dependency resolution, but it returns a linear list. What kind of a...
habedi/stack-exchange-dataset
2,531
Time to construct a GNBA for LTL formula
<p>I have a problem with the proof for constructing a GNBA (<a href="https://en.wikipedia.org/wiki/Generalized_B%C3%BCchi_automaton" rel="nofollow">generalized nondeterministic Büchi automaton</a>) for a <a href="https://en.wikipedia.org/wiki/Linear_temporal_logic" rel="nofollow">LTL formula</a>:</p>&#xA;&#xA;<p><stron...
logic automata formal methods model checking linear temporal logic
1
Time to construct a GNBA for LTL formula -- (logic automata formal methods model checking linear temporal logic) <p>I have a problem with the proof for constructing a GNBA (<a href="https://en.wikipedia.org/wiki/Generalized_B%C3%BCchi_automaton" rel="nofollow">generalized nondeterministic Büchi automaton</a>) for a <a ...
habedi/stack-exchange-dataset
2,539
Minimizing the total variation of a sequence of discrete choices
<p>My setup is something like this: I have a sequence of sets of integers $C_i (1\leq i\leq n)$, with $|C_i|$ relatively small - on the order of four or five items for all $i$. I want to choose a sequence $x_i (1\leq i\leq n)$ with each $x_i\in C_i$ such that the total variation (either $\ell_1$ or $\ell_2$, i.e. $\su...
algorithms complexity theory optimization
1
Minimizing the total variation of a sequence of discrete choices -- (algorithms complexity theory optimization) <p>My setup is something like this: I have a sequence of sets of integers $C_i (1\leq i\leq n)$, with $|C_i|$ relatively small - on the order of four or five items for all $i$. I want to choose a sequence $x...
habedi/stack-exchange-dataset
2,546
Find string that minimizes the sum of the edit distances to all other strings in set
<p>I have a set of strings $S$ and I am using the edit-distance (<a href="http://en.wikipedia.org/wiki/Levenshtein_distance" rel="nofollow">Levenshtein</a>) to measure the distance between all pairs.</p>&#xA;&#xA;<p>Is there an algorithm for finding the string $x$ which minimizes the sum of the distances to all strings...
algorithms reference request strings string metrics
1
Find string that minimizes the sum of the edit distances to all other strings in set -- (algorithms reference request strings string metrics) <p>I have a set of strings $S$ and I am using the edit-distance (<a href="http://en.wikipedia.org/wiki/Levenshtein_distance" rel="nofollow">Levenshtein</a>) to measure the distan...
habedi/stack-exchange-dataset
2,553
Maximum number of points that two paths can reach
<p>Suppose we are given a list of $n$ points, whose $x$ and $y$ coordinates are all non-negative. Suppose also that there are no duplicate points. We can only go from point $(x_i, y_i)$ to point $(x_j, y_j)$ if $x_i \le x_j$ and $y_i \le y_j$. The question is: given these $n$ points, what is the maximum number of point...
computational geometry dynamic programming recurrence relation
1
Maximum number of points that two paths can reach -- (computational geometry dynamic programming recurrence relation) <p>Suppose we are given a list of $n$ points, whose $x$ and $y$ coordinates are all non-negative. Suppose also that there are no duplicate points. We can only go from point $(x_i, y_i)$ to point $(x_j, ...
habedi/stack-exchange-dataset
2,557
How to simulate backreferences, lookaheads, and lookbehinds in finite state automata?
<p>I created a simple regular expression lexer and parser to take a regular expression and generate its parse tree. Creating a non-deterministic finite state automaton from this parse tree is relatively simple for basic regular expressions. However I can't seem to wrap my head around how to simulate backreferences, loo...
automata finite automata regular expressions
1
How to simulate backreferences, lookaheads, and lookbehinds in finite state automata? -- (automata finite automata regular expressions) <p>I created a simple regular expression lexer and parser to take a regular expression and generate its parse tree. Creating a non-deterministic finite state automaton from this parse ...
habedi/stack-exchange-dataset
2,569
Worst case $O(n \ln n)$ in place stable sort?
<p>I am having trouble finding good resources that give a worst case $O(n \ln n)$ <a href="http://en.wikipedia.org/wiki/In-place_algorithm">in place</a> <a href="http://www.algorithmist.com/index.php/Stable_Sort">stable</a> sorting algorithm. Does anyone know of any good resources?</p>&#xA;&#xA;<p>Just a reminder, in ...
algorithms reference request sorting in place
1
Worst case $O(n \ln n)$ in place stable sort? -- (algorithms reference request sorting in place) <p>I am having trouble finding good resources that give a worst case $O(n \ln n)$ <a href="http://en.wikipedia.org/wiki/In-place_algorithm">in place</a> <a href="http://www.algorithmist.com/index.php/Stable_Sort">stable</a>...
habedi/stack-exchange-dataset
2,571
3-dimensional matching approximation algorithm (implementation details)
<p>I have a run-time implementation question regarding the 3-dimensional (unweighted 2-)approximation algorithm below:&#xA;How can I construct the maximum matching M_r in S_r in linear time in line 8?</p>&#xA;&#xA;<p>$X, Y, Z $ are disjoint sets; a matching $M$ is a subset of $S$ s.t. no two triples in $M$ have the sam...
algorithms graphs approximation matching
1
3-dimensional matching approximation algorithm (implementation details) -- (algorithms graphs approximation matching) <p>I have a run-time implementation question regarding the 3-dimensional (unweighted 2-)approximation algorithm below:&#xA;How can I construct the maximum matching M_r in S_r in linear time in line 8?</...
habedi/stack-exchange-dataset
2,575
Finding the $k$th largest element in an evolving query data structure
<p>Basically, the problem I am solving is this. Initially, the array $A$ is empty. Then I am given data to fill the array and at any time I have to make a query to print the $|A|/3$-th largest element inserted so far.</p>&#xA;&#xA;<p>I was solving the problem with segment trees, but I am not able to make a little modif...
algorithms data structures
1
Finding the $k$th largest element in an evolving query data structure -- (algorithms data structures) <p>Basically, the problem I am solving is this. Initially, the array $A$ is empty. Then I am given data to fill the array and at any time I have to make a query to print the $|A|/3$-th largest element inserted so far.<...
habedi/stack-exchange-dataset
2,576
Most efficient algorithm to print 1-100 using a given random number generator
<p>We are given a random number generator <code>RandNum50</code> which generates a random integer uniformly in the range 1–50.&#xA;We may use only this random number generator to generate and print all integers from 1 to 100 in a random order. Every number must come exactly once, and the probability of any number occur...
algorithms integers randomness random number generator
1
Most efficient algorithm to print 1-100 using a given random number generator -- (algorithms integers randomness random number generator) <p>We are given a random number generator <code>RandNum50</code> which generates a random integer uniformly in the range 1–50.&#xA;We may use only this random number generator to gen...
habedi/stack-exchange-dataset
2,582
How to detect stack order?
<p>We take the sequence of integers from $1$ to $n$, and we push them onto a stack one by one in order. Between each push, we can choose to pop any number of items from the stack (from 0 to the current stack size).</p>&#xA;&#xA;<p>Every time we pop a value from the stack, we will print it out.</p>&#xA;&#xA;<p>For examp...
algorithms stacks
1
How to detect stack order? -- (algorithms stacks) <p>We take the sequence of integers from $1$ to $n$, and we push them onto a stack one by one in order. Between each push, we can choose to pop any number of items from the stack (from 0 to the current stack size).</p>&#xA;&#xA;<p>Every time we pop a value from the stac...
habedi/stack-exchange-dataset
2,583
Finding the Largest "Ordered" Difference in Elements of an Array
<p>Suppose we are given an array of positive integers $P = [p_1, p_2, \dots, p_N]$ where each $p_i$ represents the price of a product on a different day $i = 1 \dots N$. </p>&#xA;&#xA;<p>I would like to design an algorithm to find the maximum profit that you can given this array of prices. Profit is made by buying at a...
algorithms arrays
1
Finding the Largest "Ordered" Difference in Elements of an Array -- (algorithms arrays) <p>Suppose we are given an array of positive integers $P = [p_1, p_2, \dots, p_N]$ where each $p_i$ represents the price of a product on a different day $i = 1 \dots N$. </p>&#xA;&#xA;<p>I would like to design an algorithm to find t...
habedi/stack-exchange-dataset
2,587
Time complexity version of the Church-Turing Thesis
<p>There's a <a href="http://plato.stanford.edu/entries/church-turing/#Bloopers" rel="nofollow">lot of debate</a> about what exactly the Church-Turing thesis is, but roughly it's the argument that "undecidable" should be considered equivalent to "undecidable by a universal turing machine."</p>&#xA;&#xA;<p>I'm wondering...
computability terminology turing machines church turing thesis
1
Time complexity version of the Church-Turing Thesis -- (computability terminology turing machines church turing thesis) <p>There's a <a href="http://plato.stanford.edu/entries/church-turing/#Bloopers" rel="nofollow">lot of debate</a> about what exactly the Church-Turing thesis is, but roughly it's the argument that "un...
habedi/stack-exchange-dataset
2,595
Operations on OBDD: negation through Shannon's expansion
<p>I have a problem with the application of the <a href="http://en.wikipedia.org/wiki/Shannon_expansion" rel="nofollow">Shannon expansion</a> for to obtain the negation of a formula boolean, than will need for implement the negation operator on OBDD (<a href="http://en.wikipedia.org/wiki/Binary_decision_diagram" rel="n...
logic information theory
1
Operations on OBDD: negation through Shannon's expansion -- (logic information theory) <p>I have a problem with the application of the <a href="http://en.wikipedia.org/wiki/Shannon_expansion" rel="nofollow">Shannon expansion</a> for to obtain the negation of a formula boolean, than will need for implement the negation ...
habedi/stack-exchange-dataset
2,598
Balanced weighting of edges in cactus graph
<p>Given a <a href="https://en.wikipedia.org/wiki/Cactus_graph" rel="nofollow">cactus</a>, we want to weight its edges in such a way that</p>&#xA;&#xA;<ol>&#xA;<li>For each vertex, the sum of the weights of edges incident to the vertex is no more than 1.</li>&#xA;<li>The sum of all edge weights is maximized.</li>&#xA;<...
algorithms graphs greedy algorithms
1
Balanced weighting of edges in cactus graph -- (algorithms graphs greedy algorithms) <p>Given a <a href="https://en.wikipedia.org/wiki/Cactus_graph" rel="nofollow">cactus</a>, we want to weight its edges in such a way that</p>&#xA;&#xA;<ol>&#xA;<li>For each vertex, the sum of the weights of edges incident to the vertex...
habedi/stack-exchange-dataset
2,605
Is rejection sampling the only way to get a truly uniform distribution of random numbers?
<p>Suppose that we have a random generator that outputs&#xA;numbers in the range $[0..R-1]$ with uniform distribution and we&#xA;need to generate random numbers in the range $[0..N-1]$&#xA;with uniform distribution.</p>&#xA;&#xA;<p>Suppose that $N &lt; R$ and $N$ does not evenly divide $R$;&#xA;in order to get a <stron...
probability theory randomness random number generator sampling
1
Is rejection sampling the only way to get a truly uniform distribution of random numbers? -- (probability theory randomness random number generator sampling) <p>Suppose that we have a random generator that outputs&#xA;numbers in the range $[0..R-1]$ with uniform distribution and we&#xA;need to generate random numbers i...
habedi/stack-exchange-dataset
2,608
How to random-generate a graph with Pareto-Lognormal degree nodes?
<p>I have read that the degree of nodes in a "knowledge" graph of people roughly follows a power law distribution, and more exactly can be approximated with a Pareto-Lognormal distribution.</p>&#xA;&#xA;<p>Where can I find a kind of algorithm that will produce a random graph with this distribution?</p>&#xA;&#xA;<p>See ...
algorithms graphs probability theory randomness
1
How to random-generate a graph with Pareto-Lognormal degree nodes? -- (algorithms graphs probability theory randomness) <p>I have read that the degree of nodes in a "knowledge" graph of people roughly follows a power law distribution, and more exactly can be approximated with a Pareto-Lognormal distribution.</p>&#xA;&#...
habedi/stack-exchange-dataset
2,614
When does the function mapping a string to its prefix-free Kolmogorov complexity halt?
<p>In <em>Algorithmic Randomness and Complexity</em> from Downey and Hirschfeldt, it is stated on page 129 that </p>&#xA;&#xA;<p>$\qquad \displaystyle \sum_{K(\sigma)\downarrow} 2^{-K(\sigma)} \leq 1$, </p>&#xA;&#xA;<p>where $K(\sigma)\downarrow$ means that $K$ halts on $\sigma$, $\sigma$ being a binary string. $K$ den...
computability terminology kolmogorov complexity descriptive complexity
1
When does the function mapping a string to its prefix-free Kolmogorov complexity halt? -- (computability terminology kolmogorov complexity descriptive complexity) <p>In <em>Algorithmic Randomness and Complexity</em> from Downey and Hirschfeldt, it is stated on page 129 that </p>&#xA;&#xA;<p>$\qquad \displaystyle \sum_{...
habedi/stack-exchange-dataset
2,615
Prove that every two longest paths have at least one vertex in common
<p>If a graph $G$ is connected and has no path with a length greater than $k$, prove that every two paths in $G$ of length $k$ have at least one vertex in common. </p>&#xA;&#xA;<p>I think that that common vertex should be in the middle of both the paths. Because if this is not the case then we can have a path of lengt...
graphs combinatorics
1
Prove that every two longest paths have at least one vertex in common -- (graphs combinatorics) <p>If a graph $G$ is connected and has no path with a length greater than $k$, prove that every two paths in $G$ of length $k$ have at least one vertex in common. </p>&#xA;&#xA;<p>I think that that common vertex should be i...
habedi/stack-exchange-dataset
2,623
Is this language Context-Free?
<p>Is the language</p>&#xA;&#xA;<p>$$L = \{a,b\}^* \setminus \{(a^nb^n)^n\mid n \geq1 \}$$</p>&#xA;&#xA;<p>context-free? I believe that the answer is that it is not a CFL, but I can't prove it by Ogden's lemma or Pumping lemma.</p>&#xA;
formal languages context free pumping lemma
1
Is this language Context-Free? -- (formal languages context free pumping lemma) <p>Is the language</p>&#xA;&#xA;<p>$$L = \{a,b\}^* \setminus \{(a^nb^n)^n\mid n \geq1 \}$$</p>&#xA;&#xA;<p>context-free? I believe that the answer is that it is not a CFL, but I can't prove it by Ogden's lemma or Pumping lemma.</p>&#xA;
habedi/stack-exchange-dataset
2,638
Does there exist a Turing complete typed lambda calculus?
<p>Do there exist any Turing complete typed lambda calculi? If so, what are a few examples?</p>&#xA;
computability lambda calculus type theory
1
Does there exist a Turing complete typed lambda calculus? -- (computability lambda calculus type theory) <p>Do there exist any Turing complete typed lambda calculi? If so, what are a few examples?</p>&#xA;
habedi/stack-exchange-dataset
2,641
Witness for the $EU(\phi_1,\phi_2)$ using BDDs
<p>I wanted ask if you know an algorithm to find the witness for $EU(\phi_1,\phi_2)$ (CTL formula "Exist Until") using BDDs (<a href="http://en.wikipedia.org/wiki/Binary_decision_diagram" rel="nofollow">Binary Decision Diagram</a>). In pratice you should use the fixed point for calculating $EU(\phi_1,\phi_2)$, that is...
formal methods model checking
1
Witness for the $EU(\phi_1,\phi_2)$ using BDDs -- (formal methods model checking) <p>I wanted ask if you know an algorithm to find the witness for $EU(\phi_1,\phi_2)$ (CTL formula "Exist Until") using BDDs (<a href="http://en.wikipedia.org/wiki/Binary_decision_diagram" rel="nofollow">Binary Decision Diagram</a>). In p...
habedi/stack-exchange-dataset
2,646
Is it possible to always construct a hamiltonian path on a tournament graph by sorting?
<p>Is it possible to always construct a hamiltonian path on a <a href="http://en.wikipedia.org/wiki/Tournament_%28graph_theory%29#Paths_and_cycles" rel="nofollow">tournament graph</a> $G=(V,E)$ by sorting (using any sorting algorithm) with the following total order:</p>&#xA;&#xA;<p>$\qquad \displaystyle a \leq b \iff (...
algorithms graphs sorting
1
Is it possible to always construct a hamiltonian path on a tournament graph by sorting? -- (algorithms graphs sorting) <p>Is it possible to always construct a hamiltonian path on a <a href="http://en.wikipedia.org/wiki/Tournament_%28graph_theory%29#Paths_and_cycles" rel="nofollow">tournament graph</a> $G=(V,E)$ by sort...
habedi/stack-exchange-dataset
2,648
Collectively pay the bill problem
<p>There are $n$ people at a table. The $i$th person has to pay $p_i$ dollars. </p>&#xA;&#xA;<p>Some people don't have the right bills to pay exactly $p_i$, so they come up with the following algorithm.</p>&#xA;&#xA;<blockquote>&#xA; <p>First, everyone puts some of their money on the table. Then each individual takes ...
algorithms optimization
1
Collectively pay the bill problem -- (algorithms optimization) <p>There are $n$ people at a table. The $i$th person has to pay $p_i$ dollars. </p>&#xA;&#xA;<p>Some people don't have the right bills to pay exactly $p_i$, so they come up with the following algorithm.</p>&#xA;&#xA;<blockquote>&#xA; <p>First, everyone put...
habedi/stack-exchange-dataset
2,649
A regular expression for a given formal language
<p>I wanted to ask if someone can help me to construct a regular expression over the alphabet $\{a,b,x\}$ for the language $L$ which is constituted by all strings containing an odd number of $a$'s, and in which between each pair of consecutive $a$'s there is an even number of $b$'s (and an arbirtary number of $x$'s).</...
formal languages regular languages regular expressions
1
A regular expression for a given formal language -- (formal languages regular languages regular expressions) <p>I wanted to ask if someone can help me to construct a regular expression over the alphabet $\{a,b,x\}$ for the language $L$ which is constituted by all strings containing an odd number of $a$'s, and in which ...
habedi/stack-exchange-dataset
2,653
NP-completeness and NP problems
<p>Suppose that someone found a polynomial algorithm for a NP-complete decision problem. Would this mean that we can modify the algorithm a bit and use it for solving the problems that are in NP, but not in NP-complete? Or would this just shows the availability of a polynomial algorithm for each NP problem indirectly?<...
complexity theory
1
NP-completeness and NP problems -- (complexity theory) <p>Suppose that someone found a polynomial algorithm for a NP-complete decision problem. Would this mean that we can modify the algorithm a bit and use it for solving the problems that are in NP, but not in NP-complete? Or would this just shows the availability of ...
habedi/stack-exchange-dataset
2,655
How do we distinguish NP-complete problems from other NP problems?
<p>I just learned that when we have a polynomial algorithm for NP-complete problems, it is possible to use that algorithm to solve all NP problems. </p>&#xA;&#xA;<p>So, the question is how we then distinguish non-NP-complete NP problems from NP-complete problems? It seems that all these problems will have a polynomial ...
complexity theory terminology np complete
1
How do we distinguish NP-complete problems from other NP problems? -- (complexity theory terminology np complete) <p>I just learned that when we have a polynomial algorithm for NP-complete problems, it is possible to use that algorithm to solve all NP problems. </p>&#xA;&#xA;<p>So, the question is how we then distingui...
habedi/stack-exchange-dataset
2,658
How hard is finding the discrete logarithm?
<p>The <a href="http://en.wikipedia.org/wiki/Discrete_logarithm">discrete logarithm</a> is the same as finding $b$ in $a^b=c \bmod N$, given $a$, $c$, and $N$.</p>&#xA;&#xA;<p>I wonder what complexity groups (e.g. for classical and quantum computers) this is in, and what approaches (i.e. algorithms) are the best for ac...
algorithms complexity theory time complexity discrete mathematics
1
How hard is finding the discrete logarithm? -- (algorithms complexity theory time complexity discrete mathematics) <p>The <a href="http://en.wikipedia.org/wiki/Discrete_logarithm">discrete logarithm</a> is the same as finding $b$ in $a^b=c \bmod N$, given $a$, $c$, and $N$.</p>&#xA;&#xA;<p>I wonder what complexity grou...
habedi/stack-exchange-dataset
2,660
Is finding the longest path of a graph NP-complete?
<p>The problem of finding the largest subgraph of a graph that has a Hamiltonian path can be restated as finding the longest path of a graph. Is this NP-complete? Also, is finding the $k$-length path of a graph NP-complete? Is it still NP-complete if we require the path to visit a given vertex?</p>&#xA;
complexity theory graphs np complete
1
Is finding the longest path of a graph NP-complete? -- (complexity theory graphs np complete) <p>The problem of finding the largest subgraph of a graph that has a Hamiltonian path can be restated as finding the longest path of a graph. Is this NP-complete? Also, is finding the $k$-length path of a graph NP-complete? Is...
habedi/stack-exchange-dataset
2,669
regular expression given the language
<p>The language is:&#xA;$$&#xA;L = \{ (a^n) (b^m) \mid n + m = 3k, k \ge 0 \}&#xA;$$</p>&#xA;&#xA;<p>My attempt at an answer:&#xA;$$&#xA;(a \cup b)^{3k}&#xA;$$</p>&#xA;&#xA;<p>This will work if the a OR b can change for each instance in the string that is (3k) long. If not, what can I do to fix this?</p>&#xA;
formal languages regular languages regular expressions
1
regular expression given the language -- (formal languages regular languages regular expressions) <p>The language is:&#xA;$$&#xA;L = \{ (a^n) (b^m) \mid n + m = 3k, k \ge 0 \}&#xA;$$</p>&#xA;&#xA;<p>My attempt at an answer:&#xA;$$&#xA;(a \cup b)^{3k}&#xA;$$</p>&#xA;&#xA;<p>This will work if the a OR b can change for ea...
habedi/stack-exchange-dataset
2,676
The $\text{k-key}$ problem
<p>Given an undirected graph, I define a structure called <em>k-key</em> as a path containing $k$ vertices which are connected to a simple cycle which contains $k$ vertices as well.</p>&#xA;&#xA;<p>Here's the <em>k-key problem</em>: given an undirected graph $G$ and a number $k$, decide whether $G$ contains k $k$-key.<...
complexity theory np complete reductions np hard
1
The $\text{k-key}$ problem -- (complexity theory np complete reductions np hard) <p>Given an undirected graph, I define a structure called <em>k-key</em> as a path containing $k$ vertices which are connected to a simple cycle which contains $k$ vertices as well.</p>&#xA;&#xA;<p>Here's the <em>k-key problem</em>: given ...
habedi/stack-exchange-dataset
2,677
Algorithm for type conversion / signature matching
<p>I'm working on an expression typing system and looking for insights on what algorithms may be available which solve my problem -- or a proof that its complexity is too high to be reasonable to implement. The problem is defined below.</p>&#xA;&#xA;<p>I have a set of types which form a directed graph $T = (V,E)$ (assu...
algorithms typing
1
Algorithm for type conversion / signature matching -- (algorithms typing) <p>I'm working on an expression typing system and looking for insights on what algorithms may be available which solve my problem -- or a proof that its complexity is too high to be reasonable to implement. The problem is defined below.</p>&#xA;&...
habedi/stack-exchange-dataset
2,688
Time series probability and mutual information
<p>There is a time series of say $100$ data points. I wish to assign symbols of $0, 1, 2$ for each unique data point. The issue is I have tried but got stuck since no matter I specify the symbols, the program just outputs probability of $1$'s and $0$'s. The following are the questions:</p>&#xA;&#xA;<ol>&#xA;<li>How to ...
probability theory information theory
1
Time series probability and mutual information -- (probability theory information theory) <p>There is a time series of say $100$ data points. I wish to assign symbols of $0, 1, 2$ for each unique data point. The issue is I have tried but got stuck since no matter I specify the symbols, the program just outputs probabil...
habedi/stack-exchange-dataset
2,689
Is Karp Reduction identical to Levin Reduction
<h3>Definition: Karp Reduction</h3>&#xA;<p>A language <span class="math-container">$A$</span> is Karp reducible to a language <span class="math-container">$B$</span> if there is a polynomial-time computable function <span class="math-container">$f:\{0,1\}^*\rightarrow\{0,1\}^*$</span> such that for every <span class="m...
complexity theory reductions check my proof
1
Is Karp Reduction identical to Levin Reduction -- (complexity theory reductions check my proof) <h3>Definition: Karp Reduction</h3>&#xA;<p>A language <span class="math-container">$A$</span> is Karp reducible to a language <span class="math-container">$B$</span> if there is a polynomial-time computable function <span cl...
habedi/stack-exchange-dataset
2,690
Vertex coloring with an upper bound on the degree of the nodes
<p>Consider the set of graphs in which the maximum degree of the vertices is a constant number $\Delta$ independent of the number of vertices. Is the vertex coloring problem (that is, color the vertices with minimum number of colors such that no pair of adjacent nodes have the same color) on this set still NP-hard? Why...
algorithms complexity theory graphs np complete
1
Vertex coloring with an upper bound on the degree of the nodes -- (algorithms complexity theory graphs np complete) <p>Consider the set of graphs in which the maximum degree of the vertices is a constant number $\Delta$ independent of the number of vertices. Is the vertex coloring problem (that is, color the vertices w...
habedi/stack-exchange-dataset
2,696
Left recursion and left factoring -- which one goes first?
<p>if I have a grammar having a production that contains both left recursion and left factoring like </p>&#xA;&#xA;<p>$\qquad \displaystyle F \to FBa \mid cDS \mid c$ </p>&#xA;&#xA;<p>which one has priority, left recursion or left factoring?</p>&#xA;
formal languages formal grammars parsers left recursion
1
Left recursion and left factoring -- which one goes first? -- (formal languages formal grammars parsers left recursion) <p>if I have a grammar having a production that contains both left recursion and left factoring like </p>&#xA;&#xA;<p>$\qquad \displaystyle F \to FBa \mid cDS \mid c$ </p>&#xA;&#xA;<p>which one has pr...
habedi/stack-exchange-dataset
2,697
Why is solving of diagonal quadratic equations over $\mathbb R$ and $\mathbb C$ in $P$?
<p>Let $\mathbb F\in\{\mathbb R, \mathbb C\}$ the field of real or complex numbers. Then [1, page 22 in the middle] claims that the following equation can easily be solved in deterministic polynomial time:&#xA;$$ \sum_{i=1}^n a_ix_i^2=b$$&#xA;with $a_i, b\in\mathbb F$. Some discussion suggests, that the algorithmical m...
algorithms real numbers
1
Why is solving of diagonal quadratic equations over $\mathbb R$ and $\mathbb C$ in $P$? -- (algorithms real numbers) <p>Let $\mathbb F\in\{\mathbb R, \mathbb C\}$ the field of real or complex numbers. Then [1, page 22 in the middle] claims that the following equation can easily be solved in deterministic polynomial tim...
habedi/stack-exchange-dataset
2,698
Concept of reduction and algorithm
<p>Suppose that someone found an algorithm A for a NP problem (that is not NP-complete) that uses an algorithm B for PSPACE-complete or #P-complete problem during execution. (Remaining part of the algorithm takes polynomial time.)</p>&#xA;&#xA;<p>Then suppose there is also an algorithm C for a NP problem that uses the ...
complexity theory
1
Concept of reduction and algorithm -- (complexity theory) <p>Suppose that someone found an algorithm A for a NP problem (that is not NP-complete) that uses an algorithm B for PSPACE-complete or #P-complete problem during execution. (Remaining part of the algorithm takes polynomial time.)</p>&#xA;&#xA;<p>Then suppose th...
habedi/stack-exchange-dataset
2,704
Is SAT in P if there are exponentially many clauses in the number of variables?
<p>I define a <em>long CNF</em> to contain at least $2^\frac{n}{2}$ clauses, where $n$ is the number of its variables. Let $\text{Long-SAT}=\{\phi: \phi$ is a satisfiable long CNF formula$\}$. </p>&#xA;&#xA;<p>I'd like to know why $\text{Long-SAT} \in P$. First I thought it is $\text{NPC}$ since I can do a polynomial-t...
complexity theory np complete reductions satisfiability polynomial time
1
Is SAT in P if there are exponentially many clauses in the number of variables? -- (complexity theory np complete reductions satisfiability polynomial time) <p>I define a <em>long CNF</em> to contain at least $2^\frac{n}{2}$ clauses, where $n$ is the number of its variables. Let $\text{Long-SAT}=\{\phi: \phi$ is a sati...
habedi/stack-exchange-dataset
2,710
Is finding dead-end nodes in NL?
<p>Given a directed graph $G$ and two nodes $s,t$, decide whether there is some node $s'$ such that $s'$ is reachable from $s$ while $t$ is <em>not</em> reachable from $s'$.</p>&#xA;&#xA;<p>I am wondering whether this problem is in <a href="https://en.wikipedia.org/wiki/NL_%28complexity%29" rel="nofollow">NL</a>.</p>&#...
complexity theory graphs
1
Is finding dead-end nodes in NL? -- (complexity theory graphs) <p>Given a directed graph $G$ and two nodes $s,t$, decide whether there is some node $s'$ such that $s'$ is reachable from $s$ while $t$ is <em>not</em> reachable from $s'$.</p>&#xA;&#xA;<p>I am wondering whether this problem is in <a href="https://en.wikip...
habedi/stack-exchange-dataset
2,713
Are regular expressions $LR(k)$?
<p>If I have a Type 3 Grammar, it can be represented on a pushdown automaton (without doing any operation on the stack) so I can represent regular expressions by using context free languages. But can I know if a type 3 grammar is $LR(1)$, $LL(1)$, $SLR(1)$, etc. without constructing any parse tables?</p>&#xA;
formal languages regular languages formal grammars parsers regular expressions
1
Are regular expressions $LR(k)$? -- (formal languages regular languages formal grammars parsers regular expressions) <p>If I have a Type 3 Grammar, it can be represented on a pushdown automaton (without doing any operation on the stack) so I can represent regular expressions by using context free languages. But can I k...
habedi/stack-exchange-dataset
2,717
Polygons generated by a set of segments
<p>Given a set of segments, I would like to compute the set of closed polygons inside the convex hull of the set of the end of those segments. The vertices of the polygons are the intersections of the segments. For example, if you draw the 6 lines restricted which equations are: $x=-1$, $x=0$, $x=1$, $y=-1$, $y=0$, $y=...
algorithms computational geometry
1
Polygons generated by a set of segments -- (algorithms computational geometry) <p>Given a set of segments, I would like to compute the set of closed polygons inside the convex hull of the set of the end of those segments. The vertices of the polygons are the intersections of the segments. For example, if you draw the 6...
habedi/stack-exchange-dataset
2,718
What is the difference between quantum TM and nondetermistic TM?
<p>I was going through the discussion on the question <a href="https://cs.stackexchange.com/questions/125/how-to-define-quantum-turing-machines/">How to define quantum Turing machines?</a> and I feel that quantum TM and <em>nondetermistic</em> TM are one and the same. The answers to the other question do not touch on t...
computability turing machines quantum computing nondeterminism
1
What is the difference between quantum TM and nondetermistic TM? -- (computability turing machines quantum computing nondeterminism) <p>I was going through the discussion on the question <a href="https://cs.stackexchange.com/questions/125/how-to-define-quantum-turing-machines/">How to define quantum Turing machines?</a...
habedi/stack-exchange-dataset
2,722
How would a neural network deal with an arbitrary length output?
<p>I've been looking into Recurrent Neural Networks, but I don't understand what the architecture of a neural network would look like when the output length is not necessarily fixed. </p>&#xA;&#xA;<p>It seems like most networks I've read descriptions of require the output length to be equal to the input length or at le...
neural networks
1
How would a neural network deal with an arbitrary length output? -- (neural networks) <p>I've been looking into Recurrent Neural Networks, but I don't understand what the architecture of a neural network would look like when the output length is not necessarily fixed. </p>&#xA;&#xA;<p>It seems like most networks I've r...
habedi/stack-exchange-dataset
2,728
Does a never-halting machine always loop?
<p>A Turing machine that returns to a previously encountered state with its read/write head on the same cell of the exact same tape will be caught in a loop. Such a machine doesn't halt.</p>&#xA;&#xA;<p>Can someone give an example of a never-halting machine that doesn't loop?</p>&#xA;
computability turing machines halting problem
1
Does a never-halting machine always loop? -- (computability turing machines halting problem) <p>A Turing machine that returns to a previously encountered state with its read/write head on the same cell of the exact same tape will be caught in a loop. Such a machine doesn't halt.</p>&#xA;&#xA;<p>Can someone give an exam...
habedi/stack-exchange-dataset
2,734
Algorithm to find optimal currency denominations
<p>Mark lives in a tiny country populated by people who tend to over-think things. One day, the king of the country decides to redesign the country's currency to make giving change more efficient. The king wants to minimize the expected number of coins it takes to exactly pay any amount up to (but not including) the am...
algorithms optimization combinatorics integers
1
Algorithm to find optimal currency denominations -- (algorithms optimization combinatorics integers) <p>Mark lives in a tiny country populated by people who tend to over-think things. One day, the king of the country decides to redesign the country's currency to make giving change more efficient. The king wants to mini...
habedi/stack-exchange-dataset
2,735
Context-free grammar to a pushdown automaton
<p>I'm trying to convert a context free grammar to a pushdown automaton (PDA); I'm not sure how I'm gonna get an answer or show you my progress as it's a diagram... Anyway this is the last problem I have on a homework that's due later today, so I'd appreciate some kind of help, even if it's just an explanation of the c...
formal grammars context free pushdown automata
1
Context-free grammar to a pushdown automaton -- (formal grammars context free pushdown automata) <p>I'm trying to convert a context free grammar to a pushdown automaton (PDA); I'm not sure how I'm gonna get an answer or show you my progress as it's a diagram... Anyway this is the last problem I have on a homework that'...
habedi/stack-exchange-dataset
2,739
Algorithm to translate a deterministic Büchi automaton to LTL (when possible)
<p><a href="http://en.wikipedia.org/wiki/Linear_temporal_logic">Linear temporal logic</a> and deterministic <a href="http://en.wikipedia.org/wiki/B%C3%BCchi_automaton">Büchi automata</a> are incomparable: DBA cannot express $FGa$, and LTL cannot express <em>"at least each odd letter is 'a'"</em>. But sometimes it is in...
logic automata linear temporal logic buchi automata
1
Algorithm to translate a deterministic Büchi automaton to LTL (when possible) -- (logic automata linear temporal logic buchi automata) <p><a href="http://en.wikipedia.org/wiki/Linear_temporal_logic">Linear temporal logic</a> and deterministic <a href="http://en.wikipedia.org/wiki/B%C3%BCchi_automaton">Büchi automata</a...
habedi/stack-exchange-dataset
2,741
Minimize the maximum component of a sum of vectors
<p>I'd like to learn something about this optimization problem: For given non-negative whole numbers $a_{i,j,k}$,&#xA;find a function $f$ minimizing the expression</p>&#xA;&#xA;<p>$$\max_k \sum_i a_{i,f(i),k}$$</p>&#xA;&#xA;<p>An example using a different formulation might make it clearer:&#xA;You're given a set of set...
algorithms optimization linear programming
1
Minimize the maximum component of a sum of vectors -- (algorithms optimization linear programming) <p>I'd like to learn something about this optimization problem: For given non-negative whole numbers $a_{i,j,k}$,&#xA;find a function $f$ minimizing the expression</p>&#xA;&#xA;<p>$$\max_k \sum_i a_{i,f(i),k}$$</p>&#xA;&#...
habedi/stack-exchange-dataset
2,745
Building a finite state transducer
<p>I know it's possible to build a Finite State Transducer for converting numbers from base 2 to base 4 or 8 or other powers of 2 (translating from base N to base N^M is easy). However I've never seen a FST that can convert numbers from base 1 to base 2 or viceversa. Can a FST even do this? If so, can you please give s...
automata finite automata
1
Building a finite state transducer -- (automata finite automata) <p>I know it's possible to build a Finite State Transducer for converting numbers from base 2 to base 4 or 8 or other powers of 2 (translating from base N to base N^M is easy). However I've never seen a FST that can convert numbers from base 1 to base 2 o...
habedi/stack-exchange-dataset
2,749
Finding Feature Representation Such That Two Samples Are Similar in Feature Space
<p>Consider one specific useful function of our human brain: abstraction of object. Take the example of two pictures: if we are told the pictures are similar, we actually make conclusion about the aspects in which they are close to each other.</p>&#xA;&#xA;<p>I'm considering whether machine can have the ability describ...
machine learning artificial intelligence neural networks
1
Finding Feature Representation Such That Two Samples Are Similar in Feature Space -- (machine learning artificial intelligence neural networks) <p>Consider one specific useful function of our human brain: abstraction of object. Take the example of two pictures: if we are told the pictures are similar, we actually make ...
habedi/stack-exchange-dataset
2,752
Weak hashing function for memorable IPv6 addresses
<p>IPv6 addresses in the form of <code>862A:7373:3386:BF1F:8D77:D3D2:220F:D7E0</code> are much harder to memorize or even transcribe than the 4 octets of IPv4. </p>&#xA;&#xA;<p>There <a href="http://blog.jgc.org/2011/07/pronounceable-ipv6-addresses-wpa2-psk.html?m=1" rel="nofollow">have</a> <a href="http://www.halfbak...
cryptography computer networks hash user interface
1
Weak hashing function for memorable IPv6 addresses -- (cryptography computer networks hash user interface) <p>IPv6 addresses in the form of <code>862A:7373:3386:BF1F:8D77:D3D2:220F:D7E0</code> are much harder to memorize or even transcribe than the 4 octets of IPv4. </p>&#xA;&#xA;<p>There <a href="http://blog.jgc.org/...
habedi/stack-exchange-dataset
2,762
What is the average height of a binary tree?
<p>Is there any formal definition about the average height of a binary tree?</p>&#xA;&#xA;<p>I have a tutorial question about finding the average height of a binary tree using the following two methods:</p>&#xA;&#xA;<ol>&#xA;<li><p>The natural solution might be to take the average length of all possible&#xA;paths from ...
graphs terminology combinatorics binary trees
1
What is the average height of a binary tree? -- (graphs terminology combinatorics binary trees) <p>Is there any formal definition about the average height of a binary tree?</p>&#xA;&#xA;<p>I have a tutorial question about finding the average height of a binary tree using the following two methods:</p>&#xA;&#xA;<ol>&#xA...
habedi/stack-exchange-dataset
2,764
Canonical reference on agent-based computing
<p>I am interested in exploring the world of <a href="http://en.wikipedia.org/wiki/BDI_software_agent" rel="nofollow">BDI agents</a> (software agents that possess "beliefs, desires, intentions", essentially the agent has knowledge of the world, a set of motivations, and carries out certain plans).</p>&#xA;&#xA;<p>I rec...
reference request human computing agent based computing
1
Canonical reference on agent-based computing -- (reference request human computing agent based computing) <p>I am interested in exploring the world of <a href="http://en.wikipedia.org/wiki/BDI_software_agent" rel="nofollow">BDI agents</a> (software agents that possess "beliefs, desires, intentions", essentially the age...
habedi/stack-exchange-dataset