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
11,927
Sequential hash tree traversal
<p>A lot of articles say that hash tree traversal cost to any <em>randomly</em> chosen leaf is $\mathcal{O}(\log_2 N)$ ($N$ is a number of leafs) and that is right. If we have a tree of 8 leafs it will take us at most 3 operations to get to any leaf, if we have a tree of 64 leafs it will take us at most 5 operations et...
data structures search trees graph traversal hash tables
1
Sequential hash tree traversal -- (data structures search trees graph traversal hash tables) <p>A lot of articles say that hash tree traversal cost to any <em>randomly</em> chosen leaf is $\mathcal{O}(\log_2 N)$ ($N$ is a number of leafs) and that is right. If we have a tree of 8 leafs it will take us at most 3 operati...
habedi/stack-exchange-dataset
11,935
Converting an NFA to regex using GNFA algorithm?
<p>So I've been trying to crack this for a long time and almost feel like I am going in loops about this question.</p>&#xA;&#xA;<p>Given the following NFA:</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/hL3Ps.png" alt="enter image description here"></p>&#xA;&#xA;<p>Using the GNFA algorithm get the regular expressi...
automata finite automata regular expressions nondeterminism
1
Converting an NFA to regex using GNFA algorithm? -- (automata finite automata regular expressions nondeterminism) <p>So I've been trying to crack this for a long time and almost feel like I am going in loops about this question.</p>&#xA;&#xA;<p>Given the following NFA:</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.co...
habedi/stack-exchange-dataset
11,936
Is there an always-halting, limited model of computation accepting $R$ but not $RE$?
<p>So, I know that the halting problem is undecidable for Turing machines. The trick is that TMs can decide recursive languages, and can accept Recursively Enumerable (RE) languages.</p>&#xA;&#xA;<p>I'm wondering, is there a more limited model of computation which accepts only recursive languages, and not RE? And if so...
computability turing machines lambda calculus computation models halting problem
1
Is there an always-halting, limited model of computation accepting $R$ but not $RE$? -- (computability turing machines lambda calculus computation models halting problem) <p>So, I know that the halting problem is undecidable for Turing machines. The trick is that TMs can decide recursive languages, and can accept Recur...
habedi/stack-exchange-dataset
11,937
What was going on before PAC learning
<p>I am investigating PAC learning (computational learning theory) as a beginner with no previous knowledge of machine learning / AI. I am investigating the model mainly from a historical point of view.</p>&#xA;&#xA;<p>For this, the most important things are of course the results based on the model. There are enough pa...
machine learning
1
What was going on before PAC learning -- (machine learning) <p>I am investigating PAC learning (computational learning theory) as a beginner with no previous knowledge of machine learning / AI. I am investigating the model mainly from a historical point of view.</p>&#xA;&#xA;<p>For this, the most important things are o...
habedi/stack-exchange-dataset
11,938
Problem regarding Turing Machine notation
<p>Here I have a Turing Machine (sorry for awful drawing):</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/82dec.png" alt="enter image description here"></p>&#xA;&#xA;<p>So, I have a question regarding the usage of <code>a</code> here. It is treated as a variable here. But since it doesn't alter input tape in any w...
turing machines
1
Problem regarding Turing Machine notation -- (turing machines) <p>Here I have a Turing Machine (sorry for awful drawing):</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/82dec.png" alt="enter image description here"></p>&#xA;&#xA;<p>So, I have a question regarding the usage of <code>a</code> here. It is treated as ...
habedi/stack-exchange-dataset
11,942
Wheel subgraph problem
<p>In the following two threads I specified the question in the wrong way (easier to solve that way). &#xA;<a href="https://cs.stackexchange.com/questions/11505/proving-that-finding-wheel-subgraphs-is-np-complete">Proving that finding wheel subgraphs is NP-complete</a></p>&#xA;&#xA;<p><a href="https://cs.stackexchange....
graphs np complete np
1
Wheel subgraph problem -- (graphs np complete np) <p>In the following two threads I specified the question in the wrong way (easier to solve that way). &#xA;<a href="https://cs.stackexchange.com/questions/11505/proving-that-finding-wheel-subgraphs-is-np-complete">Proving that finding wheel subgraphs is NP-complete</a><...
habedi/stack-exchange-dataset
11,946
Strategic vertex labeling
<p>We are given a graph $G=(V,E)$ with positive edge weights $w_{i}$ and numerical {0,1,-1} labels $l$ for all vertices . We know that $G$ has a subset $G'$ with all vertices labeled 0. The problem is to assign labels to the vertices in $G'$ in such way that this sum is maximized $\sum_{e_{u,v}\in E} w_{i}l_ul_v.$ The ...
graphs np complete np colorings
1
Strategic vertex labeling -- (graphs np complete np colorings) <p>We are given a graph $G=(V,E)$ with positive edge weights $w_{i}$ and numerical {0,1,-1} labels $l$ for all vertices . We know that $G$ has a subset $G'$ with all vertices labeled 0. The problem is to assign labels to the vertices in $G'$ in such way tha...
habedi/stack-exchange-dataset
11,954
Show that Vertex-Cover is NP-complete, using Stable-Set
<p>My task is to give proof, the Vertex-Cover problem is NP-complete, assuming it's already shown that the Stable-Set problem is NP-complete, too.</p>&#xA;&#xA;<p>My approach: i know, Stable-Set is NP-complete, and all Problems that are NP-complete can be reduced to each other. If i could solve one NP-complete problem,...
complexity theory graphs
1
Show that Vertex-Cover is NP-complete, using Stable-Set -- (complexity theory graphs) <p>My task is to give proof, the Vertex-Cover problem is NP-complete, assuming it's already shown that the Stable-Set problem is NP-complete, too.</p>&#xA;&#xA;<p>My approach: i know, Stable-Set is NP-complete, and all Problems that a...
habedi/stack-exchange-dataset
11,983
What makes Bayesian Networks decomposable into joint trees?
<p>Given a Bayesian Network $N$, one can build a junction/joint tree $JT$ over $N$ by applying series of steps (namely, moralisation,triangulation..etc). Then we can use $JT$ to answer queries over $N$.</p>&#xA;&#xA;<p>My question is: what makes BN decomposable into $JT$? The structure (along with the CPTs) must exhibi...
graphs probability theory trees
1
What makes Bayesian Networks decomposable into joint trees? -- (graphs probability theory trees) <p>Given a Bayesian Network $N$, one can build a junction/joint tree $JT$ over $N$ by applying series of steps (namely, moralisation,triangulation..etc). Then we can use $JT$ to answer queries over $N$.</p>&#xA;&#xA;<p>My q...
habedi/stack-exchange-dataset
11,990
How does a program execute with respect to the operating system?
<p>I am reading Operating Systems by William Stallings 6th edition and I came across this text,</p>&#xA;&#xA;<h2>Program execution:</h2>&#xA;&#xA;<pre><code>A number of steps need to be performed to execute a&#xA;program. Instructions and data must be loaded into main memory, I/O devices&#xA;and files must be initializ...
operating systems
1
How does a program execute with respect to the operating system? -- (operating systems) <p>I am reading Operating Systems by William Stallings 6th edition and I came across this text,</p>&#xA;&#xA;<h2>Program execution:</h2>&#xA;&#xA;<pre><code>A number of steps need to be performed to execute a&#xA;program. Instructio...
habedi/stack-exchange-dataset
12,007
Definition of “K-fairness” with respect to concurrency?
<p>There are definitions of Absolute, Strong and Weak Fairness available across the internet, but I cannot find a definition of "K-Fairness" property for critical section algorithms (also algorithms that satisfy a 1-fairness or 3-fairness property). Does this actually exist or is this something that was made up to desc...
concurrency
1
Definition of “K-fairness” with respect to concurrency? -- (concurrency) <p>There are definitions of Absolute, Strong and Weak Fairness available across the internet, but I cannot find a definition of "K-Fairness" property for critical section algorithms (also algorithms that satisfy a 1-fairness or 3-fairness property...
habedi/stack-exchange-dataset
12,009
Reducing from Hamiltonian Cycle problem to the Graph Wheel problem cannot be proved vice versa
<p>I saw a proof by Saeed Amiri,&#xA;We will add one extra vertex v to the graph G and we make new graph G′, such that v is connected to the all other vertices of G. G has a Hamiltonian cycle if and only if G′ has a Wn+1. It is easy to check that if G has a Hamiltonian cycle then G′ has a Wn+1 wheel (just set v as a ce...
algorithms graphs np complete polynomial time
1
Reducing from Hamiltonian Cycle problem to the Graph Wheel problem cannot be proved vice versa -- (algorithms graphs np complete polynomial time) <p>I saw a proof by Saeed Amiri,&#xA;We will add one extra vertex v to the graph G and we make new graph G′, such that v is connected to the all other vertices of G. G has a ...
habedi/stack-exchange-dataset
12,031
MAX 10-SAT Algorithm
<p>The MAX k-SAT problem is:</p>&#xA;&#xA;<blockquote>&#xA; <p>“Given a set of clauses C1,…,Ck, each of length k, over a set of&#xA; variables x1,…,xn, find a truth assignment that satisfies as many of&#xA; the clauses as possible.”</p>&#xA;</blockquote>&#xA;&#xA;<p>I'm trying for find a randomized 0.999-approximati...
algorithms proof techniques dynamic programming
1
MAX 10-SAT Algorithm -- (algorithms proof techniques dynamic programming) <p>The MAX k-SAT problem is:</p>&#xA;&#xA;<blockquote>&#xA; <p>“Given a set of clauses C1,…,Ck, each of length k, over a set of&#xA; variables x1,…,xn, find a truth assignment that satisfies as many of&#xA; the clauses as possible.”</p>&#xA;</...
habedi/stack-exchange-dataset
12,036
Is “Find the shortest tour from a to z passing each node once in a directed graph” NP-complete?
<p>Given a directed graph with the following attributes: - a chain from node $a$ to node $z$ passing nodes $b$ to $y$ exists and is unidirectional. - additionally a set of nodes having bidirectional vertices to at least two of the nodes $a \ldots z$ exists. These nodes are connected in a second unidirectional chain.</p...
algorithms graphs np complete
1
Is “Find the shortest tour from a to z passing each node once in a directed graph” NP-complete? -- (algorithms graphs np complete) <p>Given a directed graph with the following attributes: - a chain from node $a$ to node $z$ passing nodes $b$ to $y$ exists and is unidirectional. - additionally a set of nodes having bidi...
habedi/stack-exchange-dataset
12,037
Shortest sub-sequence of one string, that's not a sub-sequence of another string
<p>Given two strings $x$ and $y$ over the alphabet $\{A,C,G,T\}$, I'm trying to determine a shortest string $z$ such that $z$ is a subsequence of $x$ and not a subsequence of $y$.</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>Example:</strong> a shortest string that is a subsequence of AATGAAC but not a subsequence of ATC...
algorithms strings
1
Shortest sub-sequence of one string, that's not a sub-sequence of another string -- (algorithms strings) <p>Given two strings $x$ and $y$ over the alphabet $\{A,C,G,T\}$, I'm trying to determine a shortest string $z$ such that $z$ is a subsequence of $x$ and not a subsequence of $y$.</p>&#xA;&#xA;<blockquote>&#xA; <p>...
habedi/stack-exchange-dataset
12,041
Example of a non-context free language that nonetheless CAN be pumped?
<p>So basically L satisfies the conditions of the pumping lemma for CFL's but is not a CFL (that is possible according to the definition of the lemma).</p>&#xA;
formal languages context free pumping lemma
1
Example of a non-context free language that nonetheless CAN be pumped? -- (formal languages context free pumping lemma) <p>So basically L satisfies the conditions of the pumping lemma for CFL's but is not a CFL (that is possible according to the definition of the lemma).</p>&#xA;
habedi/stack-exchange-dataset
12,043
Is this simplified consensus problem easier than the original?
<p>There is a famous <a href="http://en.wikipedia.org/wiki/Consensus_%28computer_science%29" rel="nofollow">Consensus Problem</a> in Distributed Computing.</p>&#xA;&#xA;<p>Let's consider and try to find the best possible algorithm for a simplified version of the consensus problem. </p>&#xA;&#xA;<p><strong>Assumptions:<...
algorithms algorithm analysis distributed systems
1
Is this simplified consensus problem easier than the original? -- (algorithms algorithm analysis distributed systems) <p>There is a famous <a href="http://en.wikipedia.org/wiki/Consensus_%28computer_science%29" rel="nofollow">Consensus Problem</a> in Distributed Computing.</p>&#xA;&#xA;<p>Let's consider and try to find...
habedi/stack-exchange-dataset
12,045
Find longest common subsequence in limited space
<p>Given three strings $x$, $y$, and $z$ over an arbitrary finite alphabet, I need to determine their longest common subsequence (LCS).</p>&#xA;&#xA;<p><strong>Example</strong>: A longest common subsequence of <code>bandana</code>, <code>cabana</code>, and <code>magazine</code> is <code>aan</code>.</p>&#xA;&#xA;<p>I'm ...
algorithms algorithm analysis dynamic programming strings
1
Find longest common subsequence in limited space -- (algorithms algorithm analysis dynamic programming strings) <p>Given three strings $x$, $y$, and $z$ over an arbitrary finite alphabet, I need to determine their longest common subsequence (LCS).</p>&#xA;&#xA;<p><strong>Example</strong>: A longest common subsequence o...
habedi/stack-exchange-dataset
12,047
What is the difference between "definition" and "inductive" in Coq?
<p>In Coq, you can use two different kinds of keywords to do definitions--Inductive and Definition. I do not understand the difference between an inductive and a definition, or when it is appropriate to use one instead of the other.</p>&#xA;&#xA;<p>Could someone with experience in Coq please shed some light on this, o...
automated theorem proving coq
1
What is the difference between "definition" and "inductive" in Coq? -- (automated theorem proving coq) <p>In Coq, you can use two different kinds of keywords to do definitions--Inductive and Definition. I do not understand the difference between an inductive and a definition, or when it is appropriate to use one inste...
habedi/stack-exchange-dataset
12,048
Graph Has Two / Three Different Minimal Spanning Trees?
<p>I'm trying to find an efficient method of detecting whether a given graph G has two different minimal spanning trees. I'm also trying to find a method to check whether it has 3 different minimal spanning trees. The naive solution that I've though about is running Kruskal's algorithm once and finding the total weight...
algorithms graphs spanning trees
1
Graph Has Two / Three Different Minimal Spanning Trees? -- (algorithms graphs spanning trees) <p>I'm trying to find an efficient method of detecting whether a given graph G has two different minimal spanning trees. I'm also trying to find a method to check whether it has 3 different minimal spanning trees. The naive so...
habedi/stack-exchange-dataset
12,060
Are all databases reducible to this ultimate abstract database design?
<p>I've designed a few databases in my time, and on more than one occasion the drive to abstract common elements from specific tables has led me to create generic top-level tables which contain those common elements. For example:</p>&#xA;&#xA;<pre><code>Table Column Column&#xA;&#xA;Hamburgers Item ...
databases normal forms
1
Are all databases reducible to this ultimate abstract database design? -- (databases normal forms) <p>I've designed a few databases in my time, and on more than one occasion the drive to abstract common elements from specific tables has led me to create generic top-level tables which contain those common elements. For...
habedi/stack-exchange-dataset
12,067
Realtime hardware/software versus PC software/hardware, how are these distinct and alike?
<p>This question stems from a few answers and comments on a question I posted in signal processing <a href="https://dsp.stackexchange.com/questions/9132/implement-a-software-pid-for-the-first-time-in-real-time-software-i-can-find-p">found here</a>.</p>&#xA;&#xA;<p>I guess I am a little confused. Are there any concrete ...
terminology computer architecture real time
1
Realtime hardware/software versus PC software/hardware, how are these distinct and alike? -- (terminology computer architecture real time) <p>This question stems from a few answers and comments on a question I posted in signal processing <a href="https://dsp.stackexchange.com/questions/9132/implement-a-software-pid-for...
habedi/stack-exchange-dataset
12,068
Please explain "decidability" and "verifiability"
<p>I am trying to (intuitively) understand the two terms "decidability" and "verifiability".</p>&#xA;&#xA;<p>I have done a reasonable amount of searching and going through the various texts I can put my hands on. However, their intuitive understanding seems to escape me, specially for the second one.</p>&#xA;&#xA;<p>Ou...
complexity theory formal languages terminology computability
1
Please explain "decidability" and "verifiability" -- (complexity theory formal languages terminology computability) <p>I am trying to (intuitively) understand the two terms "decidability" and "verifiability".</p>&#xA;&#xA;<p>I have done a reasonable amount of searching and going through the various texts I can put my h...
habedi/stack-exchange-dataset
12,087
Converting (math) problems to SAT instances
<p>What I want to do is turn a math problem I have into a boolean satisfiability problem (SAT) and then solve it using a SAT Solver. I wonder if someone knows a manual, guide or anything that will help me convert my problem to a SAT instance.</p>&#xA;&#xA;<p>Also, I want to solve this in a better than exponential time...
algorithms reductions satisfiability
1
Converting (math) problems to SAT instances -- (algorithms reductions satisfiability) <p>What I want to do is turn a math problem I have into a boolean satisfiability problem (SAT) and then solve it using a SAT Solver. I wonder if someone knows a manual, guide or anything that will help me convert my problem to a SAT ...
habedi/stack-exchange-dataset
12,096
The sum of all integers less than n with a zero
<p>For example, if n=14, the output should be 10; n=22, the output should be 30=10+20; n=102, output=(10+...+100)+101+102=5703</p>&#xA;&#xA;<p>In this problem, n is smaller than $10^{18}$ , and the algorithm should finish within 1 second.</p>&#xA;
algorithms
1
The sum of all integers less than n with a zero -- (algorithms) <p>For example, if n=14, the output should be 10; n=22, the output should be 30=10+20; n=102, output=(10+...+100)+101+102=5703</p>&#xA;&#xA;<p>In this problem, n is smaller than $10^{18}$ , and the algorithm should finish within 1 second.</p>&#xA;
habedi/stack-exchange-dataset
12,100
Conditional Probabilities as Tensors?
<p>Is it proper to view conditional probabilities, such as the forms:</p>&#xA;&#xA;<p>P(a|c)</p>&#xA;&#xA;<p>P(a|c,d)</p>&#xA;&#xA;<p>P(a, b|c, d)</p>&#xA;&#xA;<p>...and so forth, as being tensors?</p>&#xA;&#xA;<p>If so, does anyone know of a decent introductory text (online tutorial, workshop paper, book, etc) which d...
machine learning probability theory statistics
1
Conditional Probabilities as Tensors? -- (machine learning probability theory statistics) <p>Is it proper to view conditional probabilities, such as the forms:</p>&#xA;&#xA;<p>P(a|c)</p>&#xA;&#xA;<p>P(a|c,d)</p>&#xA;&#xA;<p>P(a, b|c, d)</p>&#xA;&#xA;<p>...and so forth, as being tensors?</p>&#xA;&#xA;<p>If so, does anyo...
habedi/stack-exchange-dataset
12,109
Equivalence of logical Formula (Kripke structures)
<p>Can someone explain me how to find if these formulas are equivalent with Kripke structures?</p>&#xA;&#xA;<p>AG(Fp or Fq) , A(GFp or GFq)</p>&#xA;&#xA;<p>AGF(p and q) , A(GFp and GFq)</p>&#xA;&#xA;<p>AFG(p and q) , A(FGp and FGq)</p>&#xA;&#xA;<p>Thank you in advance for your help :)</p>&#xA;
logic linear temporal logic
1
Equivalence of logical Formula (Kripke structures) -- (logic linear temporal logic) <p>Can someone explain me how to find if these formulas are equivalent with Kripke structures?</p>&#xA;&#xA;<p>AG(Fp or Fq) , A(GFp or GFq)</p>&#xA;&#xA;<p>AGF(p and q) , A(GFp and GFq)</p>&#xA;&#xA;<p>AFG(p and q) , A(FGp and FGq)</p>&...
habedi/stack-exchange-dataset
12,111
Algorithm to find a line that divides the number of points equally
<p>I have recently been asked in an interview to devise an algorithm that divides a set of points in a coordinate system so that half of the points lie on one side of the line, and the rest on the other side.</p>&#xA;&#xA;<p>The points are unevenly placed and the line must not pass through any of the points.</p>&#xA;&#...
algorithms machine learning computational geometry classification
1
Algorithm to find a line that divides the number of points equally -- (algorithms machine learning computational geometry classification) <p>I have recently been asked in an interview to devise an algorithm that divides a set of points in a coordinate system so that half of the points lie on one side of the line, and t...
habedi/stack-exchange-dataset
12,112
Are there any problems in $APX - PTAS$ that are not $APX$-complete?
<p>I have a question about the structure of the complexity class $APX$. Obviously, unless $P=NP$, no problem in the class $PTAS$ can be $APX$-complete (under the AP-reduction). However, what about the rest of problems in $APX$? Are there any problems known that are in $APX$, do not have a $PTAS$ (unless $P=NP$) and at ...
complexity theory approximation complexity classes
1
Are there any problems in $APX - PTAS$ that are not $APX$-complete? -- (complexity theory approximation complexity classes) <p>I have a question about the structure of the complexity class $APX$. Obviously, unless $P=NP$, no problem in the class $PTAS$ can be $APX$-complete (under the AP-reduction). However, what about...
habedi/stack-exchange-dataset
12,113
Randomized Algorithms Probability
<p>I'm taking a grad level randomized algorithms course in the fall. The professor is known for being very detail oriented and mathematically rigorous, so I will be required to have an in-depth understanding of probability. What would be a good probability book to learn from that would be intuitive, but also have some ...
probability theory randomized algorithms
1
Randomized Algorithms Probability -- (probability theory randomized algorithms) <p>I'm taking a grad level randomized algorithms course in the fall. The professor is known for being very detail oriented and mathematically rigorous, so I will be required to have an in-depth understanding of probability. What would be a ...
habedi/stack-exchange-dataset
12,120
Shortest paths candidate
<p>Let $G = (V,E)$ be a directed graph with a weight function $w$ such that there are no negative-weight cycles, and let $v \in V$ be a vertex such that there is a path from $v$ to every other vertex. Let $f : V \to \mathbb R$ be a given function. Describe an algorithm that runs in $O(|V| + |E|)$ time that answers yes...
algorithms graphs shortest path
1
Shortest paths candidate -- (algorithms graphs shortest path) <p>Let $G = (V,E)$ be a directed graph with a weight function $w$ such that there are no negative-weight cycles, and let $v \in V$ be a vertex such that there is a path from $v$ to every other vertex. Let $f : V \to \mathbb R$ be a given function. Describe ...
habedi/stack-exchange-dataset
12,125
Trace dependents & precedents of a program in an imperative language
<p>We have some programs in a very basic imperative language, the programs contain some basic features: assignment, condition, loop, scalar variables, 1-dimensional arrays and 2-dimensional arrays... Note that a variable or an array may not be initialized (or already hold a value before the execution of a program).</p>...
programming languages formal methods
1
Trace dependents & precedents of a program in an imperative language -- (programming languages formal methods) <p>We have some programs in a very basic imperative language, the programs contain some basic features: assignment, condition, loop, scalar variables, 1-dimensional arrays and 2-dimensional arrays... Note that...
habedi/stack-exchange-dataset
12,129
Finding the path of a negative weight cycle using Bellman-Ford
<p>I wrote a program which implements Bellman-Ford, and identifies when negative weight cycles are present in a graph. However what I'm actually interested in, is given some starting vertex and a graph, which path do I actually trace to get to the original vertex having traveled a negative amount. </p>&#xA;&#xA;<p>So t...
algorithms graphs shortest path
1
Finding the path of a negative weight cycle using Bellman-Ford -- (algorithms graphs shortest path) <p>I wrote a program which implements Bellman-Ford, and identifies when negative weight cycles are present in a graph. However what I'm actually interested in, is given some starting vertex and a graph, which path do I a...
habedi/stack-exchange-dataset
12,130
Hanoi tower with forbidden direct move from source to destination
<p>I want to know what is algorithm and time complexity of Hanoi tower with forbidden direct move from source to destination (<em>it means you cannot move disk from source to destination directly and you instead of that should first move disk from source to middle and then from middle to destination</em>) and other rul...
algorithms recurrence relation board games
1
Hanoi tower with forbidden direct move from source to destination -- (algorithms recurrence relation board games) <p>I want to know what is algorithm and time complexity of Hanoi tower with forbidden direct move from source to destination (<em>it means you cannot move disk from source to destination directly and you in...
habedi/stack-exchange-dataset
12,135
Modeling the problem of finding all stable sets of an argumentation framework as SAT
<p>As a continuation of my previous <a href="https://cs.stackexchange.com/questions/12087/converting-math-problems-to-sat-instances?noredirect=1#comment25370_12087">question</a> i will try to explain my problem and how i am trying to convert my algorithm to a problem that can be expressed in a CNF form.</p>&#xA;&#xA;<p...
algorithms complexity theory time complexity np complete satisfiability
1
Modeling the problem of finding all stable sets of an argumentation framework as SAT -- (algorithms complexity theory time complexity np complete satisfiability) <p>As a continuation of my previous <a href="https://cs.stackexchange.com/questions/12087/converting-math-problems-to-sat-instances?noredirect=1#comment25370_...
habedi/stack-exchange-dataset
12,136
What randomness really is
<p>I'm a Computer Science student and am currently enrolled in System Simulation &amp; Modelling course. It involves dealing with everyday systems around us and simulating them in different scenarios by generating random numbers in different distributional curves, like IID, Gaussian etc. for instance. I've been working...
randomness modelling
1
What randomness really is -- (randomness modelling) <p>I'm a Computer Science student and am currently enrolled in System Simulation &amp; Modelling course. It involves dealing with everyday systems around us and simulating them in different scenarios by generating random numbers in different distributional curves, lik...
habedi/stack-exchange-dataset
12,139
Is the language of words containing equal number of 001 and 100 regular?
<p>I was wondering when languages which contained the same number of instances of two substrings would be regular. I know that the language containing equal number of 1s and 0s is not regular, but is a language such as $L$, where $L$ = $\{ w \mid$ number of instances of the substring "001" equals the number of instance...
formal languages regular languages pumping lemma
1
Is the language of words containing equal number of 001 and 100 regular? -- (formal languages regular languages pumping lemma) <p>I was wondering when languages which contained the same number of instances of two substrings would be regular. I know that the language containing equal number of 1s and 0s is not regular, ...
habedi/stack-exchange-dataset
12,148
Longest cycle contained in two cycles
<p>Is the following problem NP-complete? (I assume yes).</p>&#xA;<blockquote>&#xA;<p><strong>Input:</strong> <span class="math-container">$k \in \mathbb{N},G=(V,E)$</span> an undirected graph where the edge set can be decomposed into two edge-disjoint simple cycles (these are <strong>not</strong> a part of the input).<...
graphs np complete decision problem
1
Longest cycle contained in two cycles -- (graphs np complete decision problem) <p>Is the following problem NP-complete? (I assume yes).</p>&#xA;<blockquote>&#xA;<p><strong>Input:</strong> <span class="math-container">$k \in \mathbb{N},G=(V,E)$</span> an undirected graph where the edge set can be decomposed into two edg...
habedi/stack-exchange-dataset
12,150
Why do the sequent calculus NOT left and NOT right rules work?
<p>The rules I am considering are $\frac{\neg A, \ \Gamma \implies \Delta}{\Gamma \implies \Delta, \ A} (\neg L)$ and $\frac{\Gamma \implies \Delta, \ \neg A}{A, \ \Gamma \implies \Delta} (\neg R)$</p>&#xA;&#xA;<p>I am trying to get my head around some of the sequent calculus rules, and while I think I understand most ...
logic first order logic
1
Why do the sequent calculus NOT left and NOT right rules work? -- (logic first order logic) <p>The rules I am considering are $\frac{\neg A, \ \Gamma \implies \Delta}{\Gamma \implies \Delta, \ A} (\neg L)$ and $\frac{\Gamma \implies \Delta, \ \neg A}{A, \ \Gamma \implies \Delta} (\neg R)$</p>&#xA;&#xA;<p>I am trying to...
habedi/stack-exchange-dataset
12,154
Shortest path with odd weight
<p>Let G be a directed graph with non-negative weights. We call a path between two vertices an "odd path" if its weight is odd.</p>&#xA;&#xA;<p>We are looking for an algorithm for finding the weight of the shortest odd path between any two vertices in the graph.</p>&#xA;&#xA;<p>If possible, describe one algorithm that ...
algorithms graphs shortest path
1
Shortest path with odd weight -- (algorithms graphs shortest path) <p>Let G be a directed graph with non-negative weights. We call a path between two vertices an "odd path" if its weight is odd.</p>&#xA;&#xA;<p>We are looking for an algorithm for finding the weight of the shortest odd path between any two vertices in t...
habedi/stack-exchange-dataset
12,159
Principles of Distributed Computing - "processors" and "states"
<p>So I'm learning about distributed computing, and I do understand a lot of the prerequisite material on algorithms and automata and whatnot... but I'm curious about the definitions I'm seeing as I read my textbook.</p>&#xA;&#xA;<blockquote>&#xA; <p>A system consists of $n$ processors $p_{0},\dots,p_{n-1}$, where $i$...
distributed systems
1
Principles of Distributed Computing - "processors" and "states" -- (distributed systems) <p>So I'm learning about distributed computing, and I do understand a lot of the prerequisite material on algorithms and automata and whatnot... but I'm curious about the definitions I'm seeing as I read my textbook.</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
12,165
Load balancing. Why not use priority queues?
<p>I have recently learned about various randomized algorithms for load balancing. The model is always that there are $m$ balls and $n$ bins and the balls arrive one at a time. The task is to minimize the maximum load of any bin. However there is something I don't understand.</p>&#xA;&#xA;<p>Why not just keep a priori...
priority queues online algorithms balls and bins
1
Load balancing. Why not use priority queues? -- (priority queues online algorithms balls and bins) <p>I have recently learned about various randomized algorithms for load balancing. The model is always that there are $m$ balls and $n$ bins and the balls arrive one at a time. The task is to minimize the maximum load of ...
habedi/stack-exchange-dataset
12,166
DFA: Can the set of States Q be empty by definition?
<p>Can the set of states Q be empty by definition?</p>&#xA;&#xA;<p>I was wondering about this question when doing exercises in the pumping lemma for finite automaton.</p>&#xA;
terminology automata finite automata
1
DFA: Can the set of States Q be empty by definition? -- (terminology automata finite automata) <p>Can the set of states Q be empty by definition?</p>&#xA;&#xA;<p>I was wondering about this question when doing exercises in the pumping lemma for finite automaton.</p>&#xA;
habedi/stack-exchange-dataset
12,182
Lower-bound complexities for finding common elements between two unsorted arrays
<p>I'm facing some problems that deal with finding common elements between unsorted arrays and I'd like to know whether there are well-known lower-bounds for the <em>worst-case</em> and, eventually, what are these lower-bounds.</p>&#xA;&#xA;<p>The problems are pretty simple:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given two...
time complexity arrays lower bounds
1
Lower-bound complexities for finding common elements between two unsorted arrays -- (time complexity arrays lower bounds) <p>I'm facing some problems that deal with finding common elements between unsorted arrays and I'd like to know whether there are well-known lower-bounds for the <em>worst-case</em> and, eventually,...
habedi/stack-exchange-dataset
12,184
Is there a program to solve a metric TSP for 80 edges at optimum?
<p>i'm going to use the Christofides heuristic algorithm in order to solve a TSP for about 80 edges. Eventually i should have a solution, that is within the factor 1.5 of the optimum.</p>&#xA;&#xA;<p>But when i'm finished, i'd like to check my solution but i don't know how. So i thought about using a computer-program t...
complexity theory graphs
1
Is there a program to solve a metric TSP for 80 edges at optimum? -- (complexity theory graphs) <p>i'm going to use the Christofides heuristic algorithm in order to solve a TSP for about 80 edges. Eventually i should have a solution, that is within the factor 1.5 of the optimum.</p>&#xA;&#xA;<p>But when i'm finished, i...
habedi/stack-exchange-dataset
12,199
Randomized convex hull
<p>I've been recently studying Monte-Carlo and other randomized methods for a lot of applications, and one that popped into my mind was making an (approximate) convex hull by examining random points, and try to get them inside the convex hull. I would like to know if there are algorithms for convex hulls that can impro...
algorithms asymptotics computational geometry randomized algorithms
1
Randomized convex hull -- (algorithms asymptotics computational geometry randomized algorithms) <p>I've been recently studying Monte-Carlo and other randomized methods for a lot of applications, and one that popped into my mind was making an (approximate) convex hull by examining random points, and try to get them insi...
habedi/stack-exchange-dataset
12,200
Design a Turing Machine Checking if Apples and Bananas are Even
<p>I am having trouble with a past exam paper. I have to design a Turing Machine to do the following, but I don't really know where to start with this question. Any help would be very much appreciated.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Design a Turing Machine TM checking if the numbers of sold apples and bananas are even. ...
turing machines
1
Design a Turing Machine Checking if Apples and Bananas are Even -- (turing machines) <p>I am having trouble with a past exam paper. I have to design a Turing Machine to do the following, but I don't really know where to start with this question. Any help would be very much appreciated.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Des...
habedi/stack-exchange-dataset
12,202
Showing filling a container with rectangles is hard by reducing from SUBSET-SUM
<p>Given a set of rectangles, $D = \{ (a_1, b_1), (a_2, b_2) \dots , (a_n, b_n) \}$, where in each pair $(a_i, b_i)$, $a_i$ represents the height of the rectangle and $b_i$ the width, and given another pair $(w, h)$ representing the width and height of a container $C$, does exist a way that taking some of the squares i...
complexity theory np complete reductions np polynomial time
1
Showing filling a container with rectangles is hard by reducing from SUBSET-SUM -- (complexity theory np complete reductions np polynomial time) <p>Given a set of rectangles, $D = \{ (a_1, b_1), (a_2, b_2) \dots , (a_n, b_n) \}$, where in each pair $(a_i, b_i)$, $a_i$ represents the height of the rectangle and $b_i$ th...
habedi/stack-exchange-dataset
12,213
Why do most books say that a 1 bit branch predictor mispredicts on the first loop iteration?
<p>I am reading two books, <em>Computer organization and design</em> by <em>David A Patterson</em>, and <em>Digital Design and Computer Architecture</em> by <em>Harris and Harris</em>. These books claim that a 1 bit branch predictor mispredicts on the first and last iterations of every loop.<br>&#xA;I don't understand ...
computer architecture
1
Why do most books say that a 1 bit branch predictor mispredicts on the first loop iteration? -- (computer architecture) <p>I am reading two books, <em>Computer organization and design</em> by <em>David A Patterson</em>, and <em>Digital Design and Computer Architecture</em> by <em>Harris and Harris</em>. These books cla...
habedi/stack-exchange-dataset
12,218
"At least one" clause in Relational Algebra
<p>I'm fairly new to the syntax of relational algebra, and I'm having a hard time understanding how I could set a "at least one" clause. </p>&#xA;&#xA;<p>Example: I have:</p>&#xA;&#xA;<ul>&#xA;<li>a table with books (listing the title, year published and ID), </li>&#xA;<li>a table with authors (listing their name and I...
database theory databases relational algebra
1
"At least one" clause in Relational Algebra -- (database theory databases relational algebra) <p>I'm fairly new to the syntax of relational algebra, and I'm having a hard time understanding how I could set a "at least one" clause. </p>&#xA;&#xA;<p>Example: I have:</p>&#xA;&#xA;<ul>&#xA;<li>a table with books (listing t...
habedi/stack-exchange-dataset
12,223
Practical Applications of Radix Sort
<p>Radix sort is theoretically very fast when you know that the keys are in a certain limited range, say $n$ values in the range $[0\dots n^k -1]$ for example. If $k&lt;\lg n$ you just convert the values to base $n$ which takes $\Theta(n)$ time, do a base $n$ radix sort and then convert back to your original base for ...
algorithms sorting applied theory radix sort
1
Practical Applications of Radix Sort -- (algorithms sorting applied theory radix sort) <p>Radix sort is theoretically very fast when you know that the keys are in a certain limited range, say $n$ values in the range $[0\dots n^k -1]$ for example. If $k&lt;\lg n$ you just convert the values to base $n$ which takes $\Th...
habedi/stack-exchange-dataset
12,224
Efficiently map different codes to rotation-different codes
<p>Let $\mathbb{F}^n_2$ denote the set of $n$-bit 0-1 strings. How to construct an efficiently computable function $f:\mathbb{F}^n_2\to \mathbb{F}^m_2 (m&gt;n)$ satisfying that $\forall u\neq v$,$f(u)\neq f(v)$ and $f(u)$ is not a circular rotation of $f(v)$?</p>&#xA;&#xA;<p>$m$ is expected to be as small as possible.<...
coding theory
1
Efficiently map different codes to rotation-different codes -- (coding theory) <p>Let $\mathbb{F}^n_2$ denote the set of $n$-bit 0-1 strings. How to construct an efficiently computable function $f:\mathbb{F}^n_2\to \mathbb{F}^m_2 (m&gt;n)$ satisfying that $\forall u\neq v$,$f(u)\neq f(v)$ and $f(u)$ is not a circular r...
habedi/stack-exchange-dataset
12,232
Complexity of $Ax\geq 0$
<p>May be it's a stupid question (sorry if it's the case).</p>&#xA;&#xA;<p>What is the complexity the decision problem:</p>&#xA;&#xA;<p>Input: $A\in\mathcal{M}_{n,m}(\mathbb{Z})$</p>&#xA;&#xA;<p>does there exists $x\in\mathbb{N}^n,x&gt;0$ such that $Ax\geq 0$?</p>&#xA;&#xA;<p>Where $x\geq 0$ means for all $x_i\geq 0$ a...
complexity theory time complexity
1
Complexity of $Ax\geq 0$ -- (complexity theory time complexity) <p>May be it's a stupid question (sorry if it's the case).</p>&#xA;&#xA;<p>What is the complexity the decision problem:</p>&#xA;&#xA;<p>Input: $A\in\mathcal{M}_{n,m}(\mathbb{Z})$</p>&#xA;&#xA;<p>does there exists $x\in\mathbb{N}^n,x&gt;0$ such that $Ax\geq...
habedi/stack-exchange-dataset
12,233
Is the universe problem for one-counter automata with restricted alphabet size undecidable?
<p>Consider the following <em>universe problem</em>.</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>The universe problem.</strong> Given a finite set $\Sigma$ for a class of languages, and an automaton accepting the language $L$, decide if $L=\Sigma^*$.</p>&#xA;</blockquote>&#xA;&#xA;<p>In [1], it is stated and proved that...
formal languages reference request automata undecidability decision problem
1
Is the universe problem for one-counter automata with restricted alphabet size undecidable? -- (formal languages reference request automata undecidability decision problem) <p>Consider the following <em>universe problem</em>.</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>The universe problem.</strong> Given a finite set $...
habedi/stack-exchange-dataset
12,237
What's the difference between a stream and a queue?
<p>What's the difference between a stream and a queue? They both have the concept of an ordered set of elements, but tend to have different implementations and a different vocabulary of 'insert'/'extract' (streams) vs. 'enqueue'/'dequeue' (queue). Are these interchangable? Do they suggest different concepts or patterns...
terminology data structures
1
What's the difference between a stream and a queue? -- (terminology data structures) <p>What's the difference between a stream and a queue? They both have the concept of an ordered set of elements, but tend to have different implementations and a different vocabulary of 'insert'/'extract' (streams) vs. 'enqueue'/'deque...
habedi/stack-exchange-dataset
12,243
Finding all vertices on negative cycles
<p>Given a weighted digraph, I can check whether a given vertex belongs to a negative cycle in $O(|V|\cdot|E|)$ using Bellman-Ford. But what if I need to find all vertices on negative cycles? Is there a way to do it faster than Floyd-Warshall's $O(|V|^3)$?</p>&#xA;
algorithms graphs shortest path
1
Finding all vertices on negative cycles -- (algorithms graphs shortest path) <p>Given a weighted digraph, I can check whether a given vertex belongs to a negative cycle in $O(|V|\cdot|E|)$ using Bellman-Ford. But what if I need to find all vertices on negative cycles? Is there a way to do it faster than Floyd-Warshall'...
habedi/stack-exchange-dataset
12,252
Is it possible that the union of two undecidable languages is decidable?
<p>I'm trying to find two languages, $L_1, L_2 \in RE \setminus R$, such that $L_1 \cup L_2 \in R$.</p>&#xA;&#xA;<p>I have already proved that if $L_1\cap L_2 \in R$ <strong>and</strong> $L_1 \cup L_2 \in R$, such $L_1, L_2$ don't exist (because otherwise we'll be able to construct a Turing Machine $M_1$ which will dec...
formal languages turing machines undecidability
1
Is it possible that the union of two undecidable languages is decidable? -- (formal languages turing machines undecidability) <p>I'm trying to find two languages, $L_1, L_2 \in RE \setminus R$, such that $L_1 \cup L_2 \in R$.</p>&#xA;&#xA;<p>I have already proved that if $L_1\cap L_2 \in R$ <strong>and</strong> $L_1 \c...
habedi/stack-exchange-dataset
12,258
Is there a mistake in the expression for clean behavior in Pnueli's article from 81'?
<p>I am reading an article called <a href="http://www.sciencedirect.com/science?_ob=MiamiImageURL&amp;_cid=271538&amp;_user=32321&amp;_pii=0304397581901109&amp;_check=y&amp;_origin=article&amp;_zone=toolbar&amp;_coverDate=31-Dec-1981&amp;view=c&amp;originContentFamily=serial&amp;wchp=dGLzVlV-zSkWb&amp;md5=2073f527aa2be...
concurrency linear temporal logic
1
Is there a mistake in the expression for clean behavior in Pnueli's article from 81'? -- (concurrency linear temporal logic) <p>I am reading an article called <a href="http://www.sciencedirect.com/science?_ob=MiamiImageURL&amp;_cid=271538&amp;_user=32321&amp;_pii=0304397581901109&amp;_check=y&amp;_origin=article&amp;_z...
habedi/stack-exchange-dataset
12,263
construct a TM from a PDA
<p>Given a PDA $P=(Q,\sum,\delta,q_0,F)$ construct formally a TM that accepts $L(P)$.</p>&#xA;&#xA;<p>My idea is to construct a Turing machine with 2 tapes, one for the input and the other for the stack. Also to add $q_a$ for accept and $q_r$ for reject and to send to $q_a$ if the TM stops on states in $F$ and send to ...
machine learning turing machines machine models
1
construct a TM from a PDA -- (machine learning turing machines machine models) <p>Given a PDA $P=(Q,\sum,\delta,q_0,F)$ construct formally a TM that accepts $L(P)$.</p>&#xA;&#xA;<p>My idea is to construct a Turing machine with 2 tapes, one for the input and the other for the stack. Also to add $q_a$ for accept and $q_r...
habedi/stack-exchange-dataset
12,267
Algorithm to determine whether two regexes are equivalent
<p>Given two arbitrary regular expressions, is there an "efficient" algorithm to determine whether they match the same set of strings?</p>&#xA;&#xA;<p>More generally, can we compute the size of the intersection of the two match sets?</p>&#xA;&#xA;<p>What algorithms are there to do this, and what complexity class do the...
algorithms regular expressions
1
Algorithm to determine whether two regexes are equivalent -- (algorithms regular expressions) <p>Given two arbitrary regular expressions, is there an "efficient" algorithm to determine whether they match the same set of strings?</p>&#xA;&#xA;<p>More generally, can we compute the size of the intersection of the two matc...
habedi/stack-exchange-dataset
12,275
Team construction in tri-partite graph
<p>The government wants to create a team with one <em>alchemist</em>, one <em>builder</em>, and one <em>computer-scientist</em>. </p>&#xA;&#xA;<p>In order to have good cooperation, it is important that the 3 team-members like each other. </p>&#xA;&#xA;<p>Therefore, the government gathers $k$ candidates of each professi...
graphs combinatorics
1
Team construction in tri-partite graph -- (graphs combinatorics) <p>The government wants to create a team with one <em>alchemist</em>, one <em>builder</em>, and one <em>computer-scientist</em>. </p>&#xA;&#xA;<p>In order to have good cooperation, it is important that the 3 team-members like each other. </p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
12,276
Proving that $\text{PCP}(O(\log n),1)\subseteq \mathsf{P}$
<p>I'm studying the <a href="http://en.wikipedia.org/wiki/PCP_theorem" rel="nofollow">PCP theorem</a>. </p>&#xA;&#xA;<p>While it is easy to prove that $\mathsf{P}=\text{PCP}(O(\log n),0)$ , proving that $\text{PCP}(O(\log n),1)\subseteq \mathsf{P}$ i.e. PCP that uses $O(\log n)$ random bits and read 1 bit of the proof...
complexity theory randomness
1
Proving that $\text{PCP}(O(\log n),1)\subseteq \mathsf{P}$ -- (complexity theory randomness) <p>I'm studying the <a href="http://en.wikipedia.org/wiki/PCP_theorem" rel="nofollow">PCP theorem</a>. </p>&#xA;&#xA;<p>While it is easy to prove that $\mathsf{P}=\text{PCP}(O(\log n),0)$ , proving that $\text{PCP}(O(\log n),1)...
habedi/stack-exchange-dataset
12,288
Does reachability belong to P?
<p>Reachability is defined as follows:&#xA;a digraph $G = (V, E)$ and two vertices $v,w \in V$. Is there a directed path from $v$ to $w$ in $G$?</p>&#xA;&#xA;<p>Is it possible to write a polynomial time algorithm for it?</p>&#xA;&#xA;<p>I asked this question on mathematics and got no answer by far.</p>&#xA;
complexity theory graphs time complexity
1
Does reachability belong to P? -- (complexity theory graphs time complexity) <p>Reachability is defined as follows:&#xA;a digraph $G = (V, E)$ and two vertices $v,w \in V$. Is there a directed path from $v$ to $w$ in $G$?</p>&#xA;&#xA;<p>Is it possible to write a polynomial time algorithm for it?</p>&#xA;&#xA;<p>I aske...
habedi/stack-exchange-dataset
12,294
Can a Boolean circuit be considered an algorithm?
<p>Can a Boolean circuit by itself be considered an algorithm (a single step algorithm if you like)? For instance say you have a simple tree circuit with two AND gates as the input gates feeding a single OR gate for a depth two circuit. Now change the AND gates to XOR gates, is it correct to say that I now have a diffe...
algorithms terminology circuits
1
Can a Boolean circuit be considered an algorithm? -- (algorithms terminology circuits) <p>Can a Boolean circuit by itself be considered an algorithm (a single step algorithm if you like)? For instance say you have a simple tree circuit with two AND gates as the input gates feeding a single OR gate for a depth two circu...
habedi/stack-exchange-dataset
12,296
$\mathsf{RegExpEq_*} \in \mathsf{coNPC}$ but why isn't in $\mathsf{P}$
<p>Hello for a homework I have to show that deciding whether a regex over $\Sigma = \{0,1\}$ descibes $\Sigma^*$ is $\mathsf{coNP}$ complete (this is irrelevant for the question though).</p>&#xA;&#xA;<p>The thing which irrs me is that I think this problem is in $\mathsf{P}$.</p>&#xA;&#xA;<p>Here is my argumentation:</p...
complexity theory formal languages
1
$\mathsf{RegExpEq_*} \in \mathsf{coNPC}$ but why isn't in $\mathsf{P}$ -- (complexity theory formal languages) <p>Hello for a homework I have to show that deciding whether a regex over $\Sigma = \{0,1\}$ descibes $\Sigma^*$ is $\mathsf{coNP}$ complete (this is irrelevant for the question though).</p>&#xA;&#xA;<p>The th...
habedi/stack-exchange-dataset
12,300
Assuming NP $\neq$ P, are there NPI languages only P languages reduce to?
<p>let $L_c$ be the class of all languages that have a polynomial reduction to some language L, for example if $L=SAT$ then $SAT_c=NP$.</p>&#xA;&#xA;<p>Assuming know that $NP\neq P$ we know that there exist languages that are not NP-hard and not in P, i.e. those in NPI. My question is there a language L in NPI such tha...
complexity theory complexity classes
1
Assuming NP $\neq$ P, are there NPI languages only P languages reduce to? -- (complexity theory complexity classes) <p>let $L_c$ be the class of all languages that have a polynomial reduction to some language L, for example if $L=SAT$ then $SAT_c=NP$.</p>&#xA;&#xA;<p>Assuming know that $NP\neq P$ we know that there exi...
habedi/stack-exchange-dataset
12,304
Preventing oversell, allocation of limited resources with overlapping properties
<p>I am trying to solve problem of preventing oversell of limited resources.</p>&#xA;&#xA;<p>Consider resources (people) who are described by set of properties where each property belongs to different category (example properties from four categories: male, age 25-30, 2 children, interested in games).</p>&#xA;&#xA;<p>...
algorithms databases counting
1
Preventing oversell, allocation of limited resources with overlapping properties -- (algorithms databases counting) <p>I am trying to solve problem of preventing oversell of limited resources.</p>&#xA;&#xA;<p>Consider resources (people) who are described by set of properties where each property belongs to different cat...
habedi/stack-exchange-dataset
12,306
Can a perceptron forget?
<p>I would like to build an online web-based machine learning system, where users can continuously add classified samples, and have the model updated online. I would like to use a perceptron or a similar online-learning algorithm. </p>&#xA;&#xA;<p>But, users may make mistakes and insert irrelevant examples. In that cas...
machine learning online algorithms
1
Can a perceptron forget? -- (machine learning online algorithms) <p>I would like to build an online web-based machine learning system, where users can continuously add classified samples, and have the model updated online. I would like to use a perceptron or a similar online-learning algorithm. </p>&#xA;&#xA;<p>But, us...
habedi/stack-exchange-dataset
12,330
Looking for the English name of algorithm using a precomputed array for interval sum computation
<p>I am looking for the English name of the following algorithm:</p>&#xA;&#xA;<p>We are given an array <code>a</code> with numbers and we need to be able to efficiently retrieve the sum of a continuous interval <code>[f,t]</code> of numbers in that array. In order to do that we precompute an array <code>sums</code>(of ...
algorithms data structures
1
Looking for the English name of algorithm using a precomputed array for interval sum computation -- (algorithms data structures) <p>I am looking for the English name of the following algorithm:</p>&#xA;&#xA;<p>We are given an array <code>a</code> with numbers and we need to be able to efficiently retrieve the sum of a ...
habedi/stack-exchange-dataset
12,346
Is np-complete an equivalence class?
<p>So, there are multiple possible definitions of "np-complete", two of which being: </p>&#xA;&#xA;<ol>&#xA;<li><p>A decision problem $L$ is np-complete if and only if: $L \in \text{NP}$ and $\forall L' \in \text{NP}: L' \preceq_{p} L$</p></li>&#xA;<li><p>A decision problem $L$ is np-complete if and only if: $L \i...
complexity theory complexity classes reductions np np complete
1
Is np-complete an equivalence class? -- (complexity theory complexity classes reductions np np complete) <p>So, there are multiple possible definitions of "np-complete", two of which being: </p>&#xA;&#xA;<ol>&#xA;<li><p>A decision problem $L$ is np-complete if and only if: $L \in \text{NP}$ and $\forall L' \in \tex...
habedi/stack-exchange-dataset
12,354
Is it impossible to truly emulate a system if its actual clock speed is the same?
<p>As I understand emulation a rule of the thumb says that a computer must be around a order of magnitude more powerful to emulate another system without resorting to tricks. This is because for every clock cycle of the system to be emulated, the host machine must process that cycle in the correct time and also process...
simulation
1
Is it impossible to truly emulate a system if its actual clock speed is the same? -- (simulation) <p>As I understand emulation a rule of the thumb says that a computer must be around a order of magnitude more powerful to emulate another system without resorting to tricks. This is because for every clock cycle of the sy...
habedi/stack-exchange-dataset
12,359
$2k$ number assignment
<p>Given $k$ numbers $A_1 \leq A_2 \leq ... \leq A_k$ such that $\sum\limits_{i=1}^k A_i = k(2k + 1)$ is there an assignment of numbers $i_1, i_2, ... , i_{2k}$ which is a permutation of $1, 2, ... , 2k$ such that</p>&#xA;&#xA;<p>$i_1 + i_2 \leq A_1\\ i_3 + i_4 \leq A_2\\ .\\.\\.\\ i_{2k-1} + i_{2k} \leq A_k$</p>&#xA;&...
np complete decision problem
1
$2k$ number assignment -- (np complete decision problem) <p>Given $k$ numbers $A_1 \leq A_2 \leq ... \leq A_k$ such that $\sum\limits_{i=1}^k A_i = k(2k + 1)$ is there an assignment of numbers $i_1, i_2, ... , i_{2k}$ which is a permutation of $1, 2, ... , 2k$ such that</p>&#xA;&#xA;<p>$i_1 + i_2 \leq A_1\\ i_3 + i_4 \...
habedi/stack-exchange-dataset
12,365
Paper with proof that $L=\{ a^n b^n \mid n \geq 0 \} \cup \{ a^n b^{2n} \mid n \geq 0 \}$ is not Deterministic Context Free?
<p><a href="http://www.google.ca/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved=0CCwQFjAA&amp;url=http://www.cs.rpi.edu/~moorthy/Courses/modcomp/fall2005/slides/DPDA.ppt&amp;ei=qI6mUeD6KaKOigLr-YH4Cg&amp;usg=AFQjCNHdu1SacbRI9CaOjOvXxzNziaHtEQ&amp;sig2=DLSgGZ-VegxX1lFVSTZTCw&amp;bvm=bv....
formal languages reference request automata pushdown automata nondeterminism
1
Paper with proof that $L=\{ a^n b^n \mid n \geq 0 \} \cup \{ a^n b^{2n} \mid n \geq 0 \}$ is not Deterministic Context Free? -- (formal languages reference request automata pushdown automata nondeterminism) <p><a href="http://www.google.ca/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;ved...
habedi/stack-exchange-dataset
12,370
Is $L = \{a^jb^ia^{j-i}\mid i,j \ge 0\ , j > i\}$ context-free?
<p>I'm exercising for an upcoming exam and I find this exercise:</p>&#xA;&#xA;<blockquote>&#xA; <p>Say whether or not the language &#xA; $$L = \{a^jb^ia^{j-i}\mid i,j \ge 0\ , j &gt; i\}$$&#xA; is a context-free language. Justify your answer.</p>&#xA;</blockquote>&#xA;&#xA;<p>I have already tried (using the pumping ...
formal languages context free pumping lemma
1
Is $L = \{a^jb^ia^{j-i}\mid i,j \ge 0\ , j > i\}$ context-free? -- (formal languages context free pumping lemma) <p>I'm exercising for an upcoming exam and I find this exercise:</p>&#xA;&#xA;<blockquote>&#xA; <p>Say whether or not the language &#xA; $$L = \{a^jb^ia^{j-i}\mid i,j \ge 0\ , j &gt; i\}$$&#xA; is a conte...
habedi/stack-exchange-dataset
12,387
Traveling salesman problem - negative distances allowed
<p>I am interested in the following version of TSP:</p>&#xA;&#xA;<p><strong>Assumption:</strong> TSP where the distances are non-negative. We know the algorithm A which computes the optional solution for such instances of TSP.<br>&#xA;<strong>Task:</strong> State an algorithm that uses the algorithm A and computes an o...
complexity theory np complete traveling salesman
1
Traveling salesman problem - negative distances allowed -- (complexity theory np complete traveling salesman) <p>I am interested in the following version of TSP:</p>&#xA;&#xA;<p><strong>Assumption:</strong> TSP where the distances are non-negative. We know the algorithm A which computes the optional solution for such i...
habedi/stack-exchange-dataset
12,397
Exponential reduction vs Polynomial Reduction
<p>I'm having trouble understanding reduction. Lets say you have a decision problem A that is NP-Complete. Also, another problem B the can be reduced from A.</p>&#xA;&#xA;<p>What can you say about B if:</p>&#xA;&#xA;<p>1) The reduction is done in polynomial time<br>&#xA;2) The reduction is done in exponential time </p...
np complete reductions polynomial time
1
Exponential reduction vs Polynomial Reduction -- (np complete reductions polynomial time) <p>I'm having trouble understanding reduction. Lets say you have a decision problem A that is NP-Complete. Also, another problem B the can be reduced from A.</p>&#xA;&#xA;<p>What can you say about B if:</p>&#xA;&#xA;<p>1) The redu...
habedi/stack-exchange-dataset
12,401
Who are the legislators of Paxos?
<p>In the seminal distributed systems paper <a href="http://research.microsoft.com/en-us/um/people/lamport/pubs/lamport-paxos.pdf">The Part Time Parliament</a> (the Paxos protocol), Leslie Lamport names fictional legislators who are involved in the Paxon parliament protocol.</p>&#xA;&#xA;<p>According to <a href="http:/...
distributed systems history
1
Who are the legislators of Paxos? -- (distributed systems history) <p>In the seminal distributed systems paper <a href="http://research.microsoft.com/en-us/um/people/lamport/pubs/lamport-paxos.pdf">The Part Time Parliament</a> (the Paxos protocol), Leslie Lamport names fictional legislators who are involved in the Paxo...
habedi/stack-exchange-dataset
12,407
'Stones' game complexity
<p>I'm trying to find complexity class of finding winning strategy for first player in following game:</p>&#xA;&#xA;<p>Intance of 'Stones' game is:</p>&#xA;&#xA;<ul>&#xA;<li>finite set $X$</li>&#xA;<li>relation $R \subseteq X^3$</li>&#xA;<li>set $Y \subseteq X$ and node $f \in X$</li>&#xA;</ul>&#xA;&#xA;<p>At the beggi...
complexity theory space complexity complexity classes game theory
1
'Stones' game complexity -- (complexity theory space complexity complexity classes game theory) <p>I'm trying to find complexity class of finding winning strategy for first player in following game:</p>&#xA;&#xA;<p>Intance of 'Stones' game is:</p>&#xA;&#xA;<ul>&#xA;<li>finite set $X$</li>&#xA;<li>relation $R \subseteq ...
habedi/stack-exchange-dataset
12,415
Deterministic Turing Machine with infine tape in both directions
<p>Consider a deterministic Turing Machine $D$ which has an infinite tape in both directions. We don't have exact information about it; what we know is that its alphabet is $\{a, b, c\}$ and there are at least three states $q_1, q_s, q_f$ where $q_s$ is the start state, $q_f$ is the final state. At some step of the com...
turing machines
1
Deterministic Turing Machine with infine tape in both directions -- (turing machines) <p>Consider a deterministic Turing Machine $D$ which has an infinite tape in both directions. We don't have exact information about it; what we know is that its alphabet is $\{a, b, c\}$ and there are at least three states $q_1, q_s, ...
habedi/stack-exchange-dataset
12,418
Is it legal to use non-terminal twice in Backus-Naur grammar
<p>It's a school assignment:&#xA;The problem is:&#xA;Write a BN grammar for +67.</p>&#xA;&#xA;<p>The given solution I have been given is following:</p>&#xA;&#xA;<pre><code>&lt;digit&gt; ::= 6 | 7&#xA;&lt;number&gt; ::= &lt;digit&gt; | &lt;digit&gt; &lt;number&gt;&#xA;&lt;+67&gt; ::= + &lt;number&gt;&#xA;</code></pr...
terminology formal grammars
1
Is it legal to use non-terminal twice in Backus-Naur grammar -- (terminology formal grammars) <p>It's a school assignment:&#xA;The problem is:&#xA;Write a BN grammar for +67.</p>&#xA;&#xA;<p>The given solution I have been given is following:</p>&#xA;&#xA;<pre><code>&lt;digit&gt; ::= 6 | 7&#xA;&lt;number&gt; ::= &lt;di...
habedi/stack-exchange-dataset
12,421
What does the R superscript notation mean in regular/formal languages?
<p>What does the capital R superscript notation mean in regular languages? I am working on a homework assignment and don't recall my professor mentioning what the what the R superscript means. For example in this syntax:</p>&#xA;&#xA;<p>$L = \{ww^R\mid w \in \Sigma^{\ast} \}$</p>&#xA;
formal languages regular languages formal grammars notation
1
What does the R superscript notation mean in regular/formal languages? -- (formal languages regular languages formal grammars notation) <p>What does the capital R superscript notation mean in regular languages? I am working on a homework assignment and don't recall my professor mentioning what the what the R superscri...
habedi/stack-exchange-dataset
12,425
Definability of Truth Assignments
<p>I have a question about definability of truth assignments. Suppose that I am working in the context of propositional logic. Let me give some definitions first.</p>&#xA;&#xA;<p>Let $L$ be a propositional language with the set $Prop_{L}$ of propositional variables. A truth assignment is a map $v\colon Prop_{L}\to\{F,T...
logic
1
Definability of Truth Assignments -- (logic) <p>I have a question about definability of truth assignments. Suppose that I am working in the context of propositional logic. Let me give some definitions first.</p>&#xA;&#xA;<p>Let $L$ be a propositional language with the set $Prop_{L}$ of propositional variables. A truth ...
habedi/stack-exchange-dataset
12,436
In control flow graphs, what is the difference between a path and a branch?
<p>I'm studying for an exam on software testing and in my notes I found this:</p>&#xA;&#xA;<pre><code>Many more paths than branches. A pragmatic compromise will be needed&#xA;</code></pre>&#xA;&#xA;<p>I cannot understand the difference between paths and branches; each time I work out the paths and branches of a graph I...
algorithm analysis software testing
1
In control flow graphs, what is the difference between a path and a branch? -- (algorithm analysis software testing) <p>I'm studying for an exam on software testing and in my notes I found this:</p>&#xA;&#xA;<pre><code>Many more paths than branches. A pragmatic compromise will be needed&#xA;</code></pre>&#xA;&#xA;<p>I ...
habedi/stack-exchange-dataset
12,444
Bloom filter and perfect hashing
<p>A <a href="https://en.wikipedia.org/wiki/Bloom_filter" rel="nofollow">Bloom filter</a> uses a hash function to test membership in a given set $S$, by checking if an item is present of not at the specified position. </p>&#xA;&#xA;<p>To mitigate the effect of hash collision, multiple functions are used, yielding proba...
data structures hash probabilistic algorithms bloom filters dictionaries
1
Bloom filter and perfect hashing -- (data structures hash probabilistic algorithms bloom filters dictionaries) <p>A <a href="https://en.wikipedia.org/wiki/Bloom_filter" rel="nofollow">Bloom filter</a> uses a hash function to test membership in a given set $S$, by checking if an item is present of not at the specified p...
habedi/stack-exchange-dataset
12,445
Trouble understanding this dynamic programming solution
<p>Here is the question:</p>&#xA;&#xA;<p>I have a given tree with n nodes. The task is to find the number of subtrees of the given tree with outgoing edges to its complement less than or equal to a given number K.</p>&#xA;&#xA;<p>for example: If <code>n=3</code> and <code>k=1</code></p>&#xA;&#xA;<p>and the given tree i...
algorithms graphs dynamic programming trees
1
Trouble understanding this dynamic programming solution -- (algorithms graphs dynamic programming trees) <p>Here is the question:</p>&#xA;&#xA;<p>I have a given tree with n nodes. The task is to find the number of subtrees of the given tree with outgoing edges to its complement less than or equal to a given number K.</...
habedi/stack-exchange-dataset
12,447
Language independent software libraries
<p>When trying to decide on the choice of a programming language for a&#xA;specific task, people will often tell me: "use this language because it&#xA;has the best library for the type of problems you are addressing".</p>&#xA;&#xA;<p>I would rather choose my language for its intrinsic qualities as a&#xA;programming med...
programming languages formal methods typing
1
Language independent software libraries -- (programming languages formal methods typing) <p>When trying to decide on the choice of a programming language for a&#xA;specific task, people will often tell me: "use this language because it&#xA;has the best library for the type of problems you are addressing".</p>&#xA;&#xA;...
habedi/stack-exchange-dataset
12,450
Complexity of a hash tables with balanced trees in the buckets
<p>If I use a balanced tree instead of lists in a hash table implementation, and also after initializing my table I don't enlarge nor reduce the size of the table, what would be the worst case complexity?</p>&#xA;
time complexity hash hash tables
1
Complexity of a hash tables with balanced trees in the buckets -- (time complexity hash hash tables) <p>If I use a balanced tree instead of lists in a hash table implementation, and also after initializing my table I don't enlarge nor reduce the size of the table, what would be the worst case complexity?</p>&#xA;
habedi/stack-exchange-dataset
12,457
Doubts on Definition of Indistinguishable Encryption in the Textbook
<p>In the classic crypto textbook "Introduction to Modern Cryptography" by Jonathan Katz and Yehuda Lindell, there is a definition for indistinguishable encryption in the presence of an eavesdropper as such that for every probabilistic polynomial time adversary A there is a negligible function negl(n) such that</p>&#xA...
cryptography
1
Doubts on Definition of Indistinguishable Encryption in the Textbook -- (cryptography) <p>In the classic crypto textbook "Introduction to Modern Cryptography" by Jonathan Katz and Yehuda Lindell, there is a definition for indistinguishable encryption in the presence of an eavesdropper as such that for every probabilist...
habedi/stack-exchange-dataset
12,466
What is a Turing Machine in class coNP
<p>On the wikipedia article about the polynomial hierarchy <a href="http://en.wikipedia.org/wiki/Polynomial_hierarchy" rel="nofollow">http://en.wikipedia.org/wiki/Polynomial_hierarchy</a></p>&#xA;&#xA;<p>it says "$A^B$ is the set of decision problems solvable by a Turing machine in class A augmented by an oracle for so...
turing machines decision problem np polynomial time
1
What is a Turing Machine in class coNP -- (turing machines decision problem np polynomial time) <p>On the wikipedia article about the polynomial hierarchy <a href="http://en.wikipedia.org/wiki/Polynomial_hierarchy" rel="nofollow">http://en.wikipedia.org/wiki/Polynomial_hierarchy</a></p>&#xA;&#xA;<p>it says "$A^B$ is th...
habedi/stack-exchange-dataset
12,470
How to prove formally that grammar isn't LR(1)
<p>I want to prove that grammar&#xA;$$&#xA;\begin{cases}&#xA;S'\rightarrow S\\&#xA;S\rightarrow aSb ~|~ A\\&#xA;A\rightarrow bA~|~b&#xA;\end{cases}&#xA;$$&#xA;isn't $LR(1)$. I've constructed parser table and got Shift-Reduce conflict.</p>&#xA;&#xA;<p>I want to prove that without parser table, using another $LR(1)$ defi...
formal grammars parsers
1
How to prove formally that grammar isn't LR(1) -- (formal grammars parsers) <p>I want to prove that grammar&#xA;$$&#xA;\begin{cases}&#xA;S'\rightarrow S\\&#xA;S\rightarrow aSb ~|~ A\\&#xA;A\rightarrow bA~|~b&#xA;\end{cases}&#xA;$$&#xA;isn't $LR(1)$. I've constructed parser table and got Shift-Reduce conflict.</p>&#xA;&...
habedi/stack-exchange-dataset
12,471
Finding a winning strategy for toads and frogs
<p>Recently I got interested in a game called <a href="http://en.wikipedia.org/wiki/Toads_and_Frogs_%28game%29" rel="noreferrer">Toads and Frogs</a> and I'm trying my best to come up with some software which would be able to beat an average (i.e. not knowing the strategy) human though I'm struggling with the strategy.<...
algorithms combinatorics game theory
1
Finding a winning strategy for toads and frogs -- (algorithms combinatorics game theory) <p>Recently I got interested in a game called <a href="http://en.wikipedia.org/wiki/Toads_and_Frogs_%28game%29" rel="noreferrer">Toads and Frogs</a> and I'm trying my best to come up with some software which would be able to beat a...
habedi/stack-exchange-dataset
12,478
What is a preterm parser?
<p>I am working with HOL-Light parser and keeping seeing references to preterm parser. </p>&#xA;&#xA;<p>What is a preterm parser?</p>&#xA;&#xA;<p>The most informative statement I find is from the <a href="http://www.cl.cam.ac.uk/~jrh13/hol-light/reference.pdf" rel="nofollow">HOL-Light reference</a> for the parse_pretyp...
lambda calculus parsers type checking
1
What is a preterm parser? -- (lambda calculus parsers type checking) <p>I am working with HOL-Light parser and keeping seeing references to preterm parser. </p>&#xA;&#xA;<p>What is a preterm parser?</p>&#xA;&#xA;<p>The most informative statement I find is from the <a href="http://www.cl.cam.ac.uk/~jrh13/hol-light/refer...
habedi/stack-exchange-dataset
12,489
Proper terminology in Prolog/logical programming theory?
<p>I have a good understanding of how to program using logic languages, but I'm currently writing up a paper describing some of my work, and I wanted to ensure that I wasn't abusing the proper terminology when describing logic languages. I have a few questions:</p>&#xA;&#xA;<ol>&#xA;<li>What exactly is a predicate? How...
terminology programming languages logic programming prolog
1
Proper terminology in Prolog/logical programming theory? -- (terminology programming languages logic programming prolog) <p>I have a good understanding of how to program using logic languages, but I'm currently writing up a paper describing some of my work, and I wanted to ensure that I wasn't abusing the proper termin...
habedi/stack-exchange-dataset
12,492
Do undecidable languages exist in constructivist logic?
<p>Constructivist logic is a system which removes the Law of the Excluded Middle, as well as &#xA;Double Negation, as axioms. It's described on Wikipedia <a href="http://en.wikipedia.org/wiki/Constructivist_logic" rel="noreferrer">here</a> and <a href="http://en.wikipedia.org/wiki/Mathematical_constructivism" rel="nore...
formal languages turing machines logic proof techniques undecidability
1
Do undecidable languages exist in constructivist logic? -- (formal languages turing machines logic proof techniques undecidability) <p>Constructivist logic is a system which removes the Law of the Excluded Middle, as well as &#xA;Double Negation, as axioms. It's described on Wikipedia <a href="http://en.wikipedia.org/w...
habedi/stack-exchange-dataset
12,493
What are lattices used for?
<p>Wikipedia <a href="http://en.wikipedia.org/wiki/Complete_lattice">says</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Complete lattices appear in many applications in mathematics and computer science</p>&#xA;</blockquote>&#xA;&#xA;<p>Is it just referring to the fact that the standard Boolean algebra used in computation is ...
lattices order theory
1
What are lattices used for? -- (lattices order theory) <p>Wikipedia <a href="http://en.wikipedia.org/wiki/Complete_lattice">says</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Complete lattices appear in many applications in mathematics and computer science</p>&#xA;</blockquote>&#xA;&#xA;<p>Is it just referring to the fact th...
habedi/stack-exchange-dataset
12,515
Quasigroups, congruences and recognizable subsets
<p>My question refers to the draft of <a href="http://www.liafa.jussieu.fr/~jep/PDF/MPRI/MPRI.pdf" rel="nofollow">Mathematical Foundations of Automata Theory</a>, IV.2.1 (pages 89ff in the pdf). I will repeat everything necessary nevertheless:</p>&#xA;&#xA;<p>Let $M,N$ be monoids and $\varphi: M \rightarrow N $ a monoi...
formal languages reference request check my proof
1
Quasigroups, congruences and recognizable subsets -- (formal languages reference request check my proof) <p>My question refers to the draft of <a href="http://www.liafa.jussieu.fr/~jep/PDF/MPRI/MPRI.pdf" rel="nofollow">Mathematical Foundations of Automata Theory</a>, IV.2.1 (pages 89ff in the pdf). I will repeat everyt...
habedi/stack-exchange-dataset
12,516
Convex polygon formulation
<p>We have a sorted list of side lengths that can be used to form a polygon. There are $n$ such values ($n \le 1000$).</p>&#xA;&#xA;<p>Now we need to find if we can use any 10 of these values to form a non-degenerate convex polygon.</p>&#xA;&#xA;<p>How do we approach this? Anything up to the order of $O(n^2 \log n)$ is...
algorithms computational geometry
1
Convex polygon formulation -- (algorithms computational geometry) <p>We have a sorted list of side lengths that can be used to form a polygon. There are $n$ such values ($n \le 1000$).</p>&#xA;&#xA;<p>Now we need to find if we can use any 10 of these values to form a non-degenerate convex polygon.</p>&#xA;&#xA;<p>How d...
habedi/stack-exchange-dataset
12,521
What are degenerate polygons?
<p>What are degenerate polygons? How does one check whether a given pair of polygons is degenerate or not?</p>&#xA;
algorithms computational geometry
1
What are degenerate polygons? -- (algorithms computational geometry) <p>What are degenerate polygons? How does one check whether a given pair of polygons is degenerate or not?</p>&#xA;
habedi/stack-exchange-dataset
12,522
Permuting natural numbers
<p>We have two integers $z, k$ </p>&#xA;&#xA;<p>We form a sequence now of first z natural numbers. i.e. $1, 2, 3, 4, \ldots z$.</p>&#xA;&#xA;<p>Now we have to find total number of permutations of this sequence such that the sum of any two adjacent numbers is $ \le k$</p>&#xA;&#xA;<p>( $z \leq 10^6$, $\;\;z &lt; k &lt; ...
algorithms permutations mathematical programming
1
Permuting natural numbers -- (algorithms permutations mathematical programming) <p>We have two integers $z, k$ </p>&#xA;&#xA;<p>We form a sequence now of first z natural numbers. i.e. $1, 2, 3, 4, \ldots z$.</p>&#xA;&#xA;<p>Now we have to find total number of permutations of this sequence such that the sum of any two a...
habedi/stack-exchange-dataset
12,538
Halting problem
<p>I have some concerns about the Halting problem. This is the proof I know:</p>&#xA;&#xA;<p>Let $h(M, i)$ be a function, $M$ being Turing machine and $i$ input for the Turing machine. Let $h(M, i)$ output true whenever $M(i)$ halts. Let $h(M,i)$ output false if $M(i)$ does not halt.</p>&#xA;&#xA;<p>Then define $p(M)$ ...
turing machines halting problem
1
Halting problem -- (turing machines halting problem) <p>I have some concerns about the Halting problem. This is the proof I know:</p>&#xA;&#xA;<p>Let $h(M, i)$ be a function, $M$ being Turing machine and $i$ input for the Turing machine. Let $h(M, i)$ output true whenever $M(i)$ halts. Let $h(M,i)$ output false if $M(i...
habedi/stack-exchange-dataset