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
68,499
every DCFL has an LR(1), an LALR(1) and even an SLR(1) grammar
<p><a href="http://www.verycomputer.com/101_1d28d7be0d929e8a_2.htm" rel="nofollow noreferrer">Here</a> is one discussion that says, &quot;every DCFL has an LR(1), an LALR(1) and even an SLR(1) grammar.&quot;</p>&#xA;<p>And <a href="https://en.wikipedia.org/wiki/LR_parser#Theory" rel="nofollow noreferrer">wiki says</a>,...
formal languages context free formal grammars
1
every DCFL has an LR(1), an LALR(1) and even an SLR(1) grammar -- (formal languages context free formal grammars) <p><a href="http://www.verycomputer.com/101_1d28d7be0d929e8a_2.htm" rel="nofollow noreferrer">Here</a> is one discussion that says, &quot;every DCFL has an LR(1), an LALR(1) and even an SLR(1) grammar.&quot...
habedi/stack-exchange-dataset
68,517
Time complexity of a greedy approach for Independent Set: the Heaviest-First Algorithm
<p>The heaviest-first algorithm is a greedy approximation algorithm that finds an independent set $S$ of nodes in a graph $G=(V,E)$, so that the sum of the weights of the nodes in $S$ is as large as possible.</p>&#xA;&#xA;<p>My question is that I want to find the time complexity of the following algorithm (when applied...
graphs greedy algorithms
1
Time complexity of a greedy approach for Independent Set: the Heaviest-First Algorithm -- (graphs greedy algorithms) <p>The heaviest-first algorithm is a greedy approximation algorithm that finds an independent set $S$ of nodes in a graph $G=(V,E)$, so that the sum of the weights of the nodes in $S$ is as large as poss...
habedi/stack-exchange-dataset
68,519
Knapsack variant
<p>In my line of work, I have encountered the following variant of discrete knapsack and I was wondering if it has already been studied.&#xA;E.g. We are given a set of 3 items (A,B,C). The goal is to maximize the value carried for a given weight constraint. The variant has the following additional constraints:</p>&#xA;...
knapsack problems
1
Knapsack variant -- (knapsack problems) <p>In my line of work, I have encountered the following variant of discrete knapsack and I was wondering if it has already been studied.&#xA;E.g. We are given a set of 3 items (A,B,C). The goal is to maximize the value carried for a given weight constraint. The variant has the fo...
habedi/stack-exchange-dataset
68,533
Example of unrestricted grammar which produces non-context-sensitive language
<p>I'm talking about Type-0 (Chomsky hierarchy) <a href="https://en.wikipedia.org/wiki/Unrestricted_grammar" rel="nofollow noreferrer"><em>unrestricted grammar</em></a>, where production rules of grammar are of the form $\alpha\rightarrow\beta$, where $\alpha,\beta\in N\cup\Sigma$.</p>&#xA;&#xA;<p>I can not find any ex...
formal languages turing machines formal grammars
1
Example of unrestricted grammar which produces non-context-sensitive language -- (formal languages turing machines formal grammars) <p>I'm talking about Type-0 (Chomsky hierarchy) <a href="https://en.wikipedia.org/wiki/Unrestricted_grammar" rel="nofollow noreferrer"><em>unrestricted grammar</em></a>, where production r...
habedi/stack-exchange-dataset
68,534
Language of TMs that accept some x in less than 50 steps. Is it in co-RE?
<p>L = {M | M is a TM and there exists an input that the TM M accepts in&#xA;less than 50 steps}</p>&#xA;&#xA;<p>I need to find a minimal &#xA;class it belongs to between R/ RE/ co-RE/ not in RE∪co-RE. I managed to show that it is in RE with a TM. I think its not in co-RE, because it has to check every input to know wh...
computability turing machines semi decidability
1
Language of TMs that accept some x in less than 50 steps. Is it in co-RE? -- (computability turing machines semi decidability) <p>L = {M | M is a TM and there exists an input that the TM M accepts in&#xA;less than 50 steps}</p>&#xA;&#xA;<p>I need to find a minimal &#xA;class it belongs to between R/ RE/ co-RE/ not in R...
habedi/stack-exchange-dataset
68,538
How to classify simple priority queue algorithm
<p>I have a simple priority queue algorithm that I implemented, and I doubt it's new&#xA;but I haven't been able to classify it. Wondering if I could get some help with classifying it! Once I classify it I can read more about how to implement it properly, etc.</p>&#xA;&#xA;<p>Assuming the implementation is sound, I am ...
priority queues queueing theory
1
How to classify simple priority queue algorithm -- (priority queues queueing theory) <p>I have a simple priority queue algorithm that I implemented, and I doubt it's new&#xA;but I haven't been able to classify it. Wondering if I could get some help with classifying it! Once I classify it I can read more about how to im...
habedi/stack-exchange-dataset
68,551
Find sets with given union
<p>We are given positive integers $n$, $m$ and a set $S$ of subsets of the set $\{1,2,...,n\}$ with $|S| = m$. </p>&#xA;&#xA;<p>For example:</p>&#xA;&#xA;<p>$n = 5,\,\, m = 4,\,\, S = \{\, \{1,2\}, \{1,3\}, \{4,5\}, \{2,3\} \,\}.$</p>&#xA;&#xA;<p>What is the fastest way to find the minimal subset $S'$ of $S$ such that ...
algorithms time complexity
1
Find sets with given union -- (algorithms time complexity) <p>We are given positive integers $n$, $m$ and a set $S$ of subsets of the set $\{1,2,...,n\}$ with $|S| = m$. </p>&#xA;&#xA;<p>For example:</p>&#xA;&#xA;<p>$n = 5,\,\, m = 4,\,\, S = \{\, \{1,2\}, \{1,3\}, \{4,5\}, \{2,3\} \,\}.$</p>&#xA;&#xA;<p>What is the fa...
habedi/stack-exchange-dataset
68,568
Can FPSPACE give exponentially long outputs?
<p>I can't comment on <a href="https://cs.stackexchange.com/questions/39816/fnp-%E2%8A%82-fpspace-or-fnp-%E2%8A%86-fpspace">this</a> question, so I ask it here as a new question:</p>&#xA;&#xA;<p>Ricky Demer states there in a comment to the first answer</p>&#xA;&#xA;<p>"[...] since FPSPACE can give exponentially long ou...
complexity theory space complexity
1
Can FPSPACE give exponentially long outputs? -- (complexity theory space complexity) <p>I can't comment on <a href="https://cs.stackexchange.com/questions/39816/fnp-%E2%8A%82-fpspace-or-fnp-%E2%8A%86-fpspace">this</a> question, so I ask it here as a new question:</p>&#xA;&#xA;<p>Ricky Demer states there in a comment to...
habedi/stack-exchange-dataset
68,572
Are there any LTL to _non_ deterministic Rabin automaton translators?
<p>I know of two translators LTL -> deterministic Rabin automaton:</p>&#xA;&#xA;<ul>&#xA;<li><a href="https://rabinizer.informatik.tu-muenchen.de/" rel="nofollow noreferrer">Rabinizer3</a></li>&#xA;<li><a href="http://ltl2dstar.de/" rel="nofollow noreferrer">ltl2dstar</a></li>&#xA;</ul>&#xA;&#xA;<p>They produce <em>det...
automata reference request simulation linear temporal logic
1
Are there any LTL to _non_ deterministic Rabin automaton translators? -- (automata reference request simulation linear temporal logic) <p>I know of two translators LTL -> deterministic Rabin automaton:</p>&#xA;&#xA;<ul>&#xA;<li><a href="https://rabinizer.informatik.tu-muenchen.de/" rel="nofollow noreferrer">Rabinizer3<...
habedi/stack-exchange-dataset
68,575
Steps to convert regular expressions directly to regular grammars and vice versa
<p>I came across following intuitive rules to convert basic/minimal regular expressions directly to regular grammar (RLG for Right Linear Grammars, LLG for Left Linear Grammars):</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/6AEYK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6AEYK.png" alt="enter imag...
regular languages formal grammars regular expressions simulation
1
Steps to convert regular expressions directly to regular grammars and vice versa -- (regular languages formal grammars regular expressions simulation) <p>I came across following intuitive rules to convert basic/minimal regular expressions directly to regular grammar (RLG for Right Linear Grammars, LLG for Left Linear G...
habedi/stack-exchange-dataset
68,579
decision tree redundancy optimization
<p>First question in the computer science section. I am currently working on a solution that optimizes decision tree redundancy. </p>&#xA;&#xA;<p>the following is an example of optimization:</p>&#xA;&#xA;<pre><code>| D1 | D2 | Outcome |&#xA;| true | false | Yes |&#xA;| false | false | No |&#xA;| true...
optimization decision problem
1
decision tree redundancy optimization -- (optimization decision problem) <p>First question in the computer science section. I am currently working on a solution that optimizes decision tree redundancy. </p>&#xA;&#xA;<p>the following is an example of optimization:</p>&#xA;&#xA;<pre><code>| D1 | D2 | Outcome |&#xA...
habedi/stack-exchange-dataset
68,580
Hamiltonian path in grid graph
<p>Here is my situation. I have a grid-type graph with obstacles. Every move (horizontally, vertically or diagonally with a range of 1) has a cost of exactly 1 (the graph is not weighted) provided that neither the source or the destination is an obstacle.</p>&#xA;&#xA;<p>I need to, provided a starting node (a square), ...
algorithms graphs optimization hamiltonian path
1
Hamiltonian path in grid graph -- (algorithms graphs optimization hamiltonian path) <p>Here is my situation. I have a grid-type graph with obstacles. Every move (horizontally, vertically or diagonally with a range of 1) has a cost of exactly 1 (the graph is not weighted) provided that neither the source or the destinat...
habedi/stack-exchange-dataset
68,581
Generating Pairs of Random Numbers
<p>Please consider the following probability density function of two variables.&#xA;\begin{eqnarray*}&#xA;f(x_1,x_2) &amp;=&amp; \begin{cases}&#xA; 2(x_1+x_2) &amp; \text{for} \,\, 0 \le x_1 \le x_2 \le 1\\&#xA; 0 &amp;\text{ otherwise } \\&#xA; \end{cases}&#xA;\end{eqnarray*}&#xA;I would like to generate two ...
randomness numerical algorithms numerical analysis random number generator
1
Generating Pairs of Random Numbers -- (randomness numerical algorithms numerical analysis random number generator) <p>Please consider the following probability density function of two variables.&#xA;\begin{eqnarray*}&#xA;f(x_1,x_2) &amp;=&amp; \begin{cases}&#xA; 2(x_1+x_2) &amp; \text{for} \,\, 0 \le x_1 \le x_2 \le...
habedi/stack-exchange-dataset
68,582
Does a reduction from sorting imply an $\Omega(n \log n)$ time bound?
<p>I have come across a proof where a certain function ("compute a straight skeleton") is shown to take $\Omega(n \log n)$ time by reducing the problem of sorting to it. The overhead for the reduction itself is linear, thus negligible.</p>&#xA;&#xA;<p><em>Now my question is: is this a valid argument?</em></p>&#xA;&#xA;...
complexity theory reductions sorting
1
Does a reduction from sorting imply an $\Omega(n \log n)$ time bound? -- (complexity theory reductions sorting) <p>I have come across a proof where a certain function ("compute a straight skeleton") is shown to take $\Omega(n \log n)$ time by reducing the problem of sorting to it. The overhead for the reduction itself ...
habedi/stack-exchange-dataset
68,593
How does MCTS handle games with large numbers of poor moves?
<p>I am trying to understand how pure Monte Carlo tree search (<a href="https://en.wikipedia.org/wiki/Monte_Carlo_tree_search" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Monte_Carlo_tree_search</a>) handles games where random playout will likely result in a loss easily avoided by other types of agents.</p>...
board games monte carlo
1
How does MCTS handle games with large numbers of poor moves? -- (board games monte carlo) <p>I am trying to understand how pure Monte Carlo tree search (<a href="https://en.wikipedia.org/wiki/Monte_Carlo_tree_search" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Monte_Carlo_tree_search</a>) handles games wher...
habedi/stack-exchange-dataset
68,606
Pick matrices such that each partial sum is positive
<p>There is a sequence of $n$ sets, each set contains a constant number of constant-size vectors, e.g:</p>&#xA;&#xA;<ul>&#xA;<li>$\{M_{1,1},M_{1,2},M_{1,3},M_{1,4}\}$</li>&#xA;<li>$\{M_{2,1},M_{2,2},M_{2,3},M_{2,4}\}$</li>&#xA;<li>...</li>&#xA;<li>$\{M_{n,1},M_{n,2},M_{n,3},M_{n,4}\}$</li>&#xA;</ul>&#xA;&#xA;<p>The tas...
algorithms matrices searching
1
Pick matrices such that each partial sum is positive -- (algorithms matrices searching) <p>There is a sequence of $n$ sets, each set contains a constant number of constant-size vectors, e.g:</p>&#xA;&#xA;<ul>&#xA;<li>$\{M_{1,1},M_{1,2},M_{1,3},M_{1,4}\}$</li>&#xA;<li>$\{M_{2,1},M_{2,2},M_{2,3},M_{2,4}\}$</li>&#xA;<li>....
habedi/stack-exchange-dataset
68,610
Condition for infinitude of the language of a finite state automaton
<p>There is a theorem which says that:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a finite state automaton having $n$ states, if there exists a string $w$ whose length satisfies $n \leq |w| \leq 2n-1$ then the language accepted by the automaton is infinite.</p>&#xA;</blockquote>&#xA;&#xA;<p>I understand the constraint $|...
automata finite automata
1
Condition for infinitude of the language of a finite state automaton -- (automata finite automata) <p>There is a theorem which says that:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a finite state automaton having $n$ states, if there exists a string $w$ whose length satisfies $n \leq |w| \leq 2n-1$ then the language acce...
habedi/stack-exchange-dataset
68,628
What is the difference between control flow and control logic?
<p>I'm trying to learn about declarative programming, and while reading the wiki it said the following: </p>&#xA;&#xA;<blockquote>&#xA; <p>In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the <strong>logic</strong>...
terminology programming languages logic programming
1
What is the difference between control flow and control logic? -- (terminology programming languages logic programming) <p>I'm trying to learn about declarative programming, and while reading the wiki it said the following: </p>&#xA;&#xA;<blockquote>&#xA; <p>In computer science, declarative programming is a programmin...
habedi/stack-exchange-dataset
68,635
Why don't compilers automatically insert deallocations?
<p>In languages like C, the programmer is expected to insert calls to free. Why doesn't the compiler do this automatically? Humans do it in a reasonable amount of time(ignoring bugs), so it is not impossible.</p>&#xA;&#xA;<p>EDIT: For future reference, <a href="https://softwareengineering.stackexchange.com/a/311975">he...
compilers memory management garbage collection
1
Why don't compilers automatically insert deallocations? -- (compilers memory management garbage collection) <p>In languages like C, the programmer is expected to insert calls to free. Why doesn't the compiler do this automatically? Humans do it in a reasonable amount of time(ignoring bugs), so it is not impossible.</p>...
habedi/stack-exchange-dataset
68,667
How does an image classifier select relevant features?
<p>I am trying to understand cascade classifiers for computer vision. I use OpenCV Traincascade for now and successfully trained some cascades.</p>&#xA;&#xA;<p>However I am trying to grasp the whole process. One thing I do not understand about the cascade training is how the features are selected on each stage.</p>&#xA...
image processing computer vision classification features
1
How does an image classifier select relevant features? -- (image processing computer vision classification features) <p>I am trying to understand cascade classifiers for computer vision. I use OpenCV Traincascade for now and successfully trained some cascades.</p>&#xA;&#xA;<p>However I am trying to grasp the whole proc...
habedi/stack-exchange-dataset
68,678
Does Bellman–Ford algorithm can handle zero-weight cycles?
<p>According to my understanding, the Bellman–Ford algorithm can handle cyclic graphs with negative weights. but it cannot have negative cycles. But can it handle zero weight cycles? </p>&#xA;
algorithms graphs
1
Does Bellman–Ford algorithm can handle zero-weight cycles? -- (algorithms graphs) <p>According to my understanding, the Bellman–Ford algorithm can handle cyclic graphs with negative weights. but it cannot have negative cycles. But can it handle zero weight cycles? </p>&#xA;
habedi/stack-exchange-dataset
68,683
Minimum hamming distance of multiple binary words
<p>Our task is to compute the <strong>minimum hamming distance</strong> for the following 16-bit words:</p>&#xA;&#xA;<pre><code>0000000000000000 &#xA;0011001100110011&#xA;0101010101010101&#xA;0000111111110000 &#xA;0011111111000000 &#xA;1100110000000000 &#xA;1111111111111111&#xA;</code></pre>&#xA;&#xA;<p>This minimum di...
algorithms hamming code
1
Minimum hamming distance of multiple binary words -- (algorithms hamming code) <p>Our task is to compute the <strong>minimum hamming distance</strong> for the following 16-bit words:</p>&#xA;&#xA;<pre><code>0000000000000000 &#xA;0011001100110011&#xA;0101010101010101&#xA;0000111111110000 &#xA;0011111111000000 &#xA;11001...
habedi/stack-exchange-dataset
68,693
Finding a Simple Distribution In a Binary String
<p>Unsupervised feature discovery of text that started with its bit string representation would need to discover octets were the first-order parse of such a bit string. This raises a question:</p>&#xA;&#xA;<p>What is the technique called that can discover that a binary string, for example:</p>&#xA;&#xA;<p><code>010010...
machine learning pattern recognition
1
Finding a Simple Distribution In a Binary String -- (machine learning pattern recognition) <p>Unsupervised feature discovery of text that started with its bit string representation would need to discover octets were the first-order parse of such a bit string. This raises a question:</p>&#xA;&#xA;<p>What is the techniq...
habedi/stack-exchange-dataset
68,705
Version of knap sack problem
<blockquote>&#xA; <p>The are <a href="https://en.wikipedia.org/wiki/Cuisenaire_rods" rel="nofollow noreferrer">cuisenaire rods</a> with N differnt lengthes $x_1,x_2,...,x_n$ (each length is a natural number), the number of the Cuisenaire rods is unlimited. Given a natural number B. you should tell if you can pick a bu...
algorithms dynamic programming knapsack problems java
1
Version of knap sack problem -- (algorithms dynamic programming knapsack problems java) <blockquote>&#xA; <p>The are <a href="https://en.wikipedia.org/wiki/Cuisenaire_rods" rel="nofollow noreferrer">cuisenaire rods</a> with N differnt lengthes $x_1,x_2,...,x_n$ (each length is a natural number), the number of the Cuis...
habedi/stack-exchange-dataset
68,706
What are applications of Coin Change problem?
<p>I've read so many about the <strong>Coin Change problem</strong>, debates about wheather it is solvable using <em>Greedy</em>, <em>Dynamic Programming</em> and so on.</p>&#xA;&#xA;<p>Nevertheless I cannot find an application of this problem.</p>&#xA;&#xA;<p>What are applications of Coin Change problem?</p>&#xA;
algorithms applications coin change
1
What are applications of Coin Change problem? -- (algorithms applications coin change) <p>I've read so many about the <strong>Coin Change problem</strong>, debates about wheather it is solvable using <em>Greedy</em>, <em>Dynamic Programming</em> and so on.</p>&#xA;&#xA;<p>Nevertheless I cannot find an application of th...
habedi/stack-exchange-dataset
68,720
Proof that language is not context-free with Parikh's theorem
<p>I want to prove that the language $L = \{ a^{n}(ab)^{{n}^{2}}b^{n} \mid n \geq 0 \}$ is not context-free by using Parikh's theorem.</p>&#xA;&#xA;<p>My first assumption is that the $(ab)^{{n}^{2}}$ part cannot be written as a subset of linear vectors. &#xA;From this it follows that $\psi(L)$ is not semi-linear.</p>&#...
formal languages context free proof techniques
1
Proof that language is not context-free with Parikh's theorem -- (formal languages context free proof techniques) <p>I want to prove that the language $L = \{ a^{n}(ab)^{{n}^{2}}b^{n} \mid n \geq 0 \}$ is not context-free by using Parikh's theorem.</p>&#xA;&#xA;<p>My first assumption is that the $(ab)^{{n}^{2}}$ part c...
habedi/stack-exchange-dataset
68,729
Language is non-empty is recursively enumerable (intuitive way)
<p>$M$ is some Turing machine, $\left&lt;M\right&gt;$ is the code of the Turing machine.</p>&#xA;&#xA;<p>$L =\{\left&lt;T\right&gt; | L(T) \ne \emptyset\}$</p>&#xA;&#xA;<p>How to see <strong>intuitively</strong> that $L$ is partially decidable?</p>&#xA;&#xA;<p>We can try running a given $M$ on all strings and accept if...
computability turing machines
1
Language is non-empty is recursively enumerable (intuitive way) -- (computability turing machines) <p>$M$ is some Turing machine, $\left&lt;M\right&gt;$ is the code of the Turing machine.</p>&#xA;&#xA;<p>$L =\{\left&lt;T\right&gt; | L(T) \ne \emptyset\}$</p>&#xA;&#xA;<p>How to see <strong>intuitively</strong> that $L$ ...
habedi/stack-exchange-dataset
68,738
Is O(|A| + |B|) the size of the union of two synchronized DFAs A and B?
<p>In general, the size of the DFA resulting from the union of two DFAs A and B is O(|A|.|B|) in the worst case (usually the product construction is used to compute the union).</p>&#xA;&#xA;<p>Let's consider the class of 'synchronized DFAs' as the class of DFAs having a synchronizing word : <a href="https://en.wikipedi...
automata finite automata
1
Is O(|A| + |B|) the size of the union of two synchronized DFAs A and B? -- (automata finite automata) <p>In general, the size of the DFA resulting from the union of two DFAs A and B is O(|A|.|B|) in the worst case (usually the product construction is used to compute the union).</p>&#xA;&#xA;<p>Let's consider the class ...
habedi/stack-exchange-dataset
68,751
Recursive type encoding on System F (and other pure type systems)
<p>I am studying pure type systems, particularly the calculus of constructions, and trying to use an encoding for recursive types on it, which, <a href="http://homepages.inf.ed.ac.uk/wadler/papers/free-rectypes/free-rectypes.txt" rel="noreferrer">according to Philip Wadler, is possible</a>. As an example, I'm using the...
lambda calculus type theory
1
Recursive type encoding on System F (and other pure type systems) -- (lambda calculus type theory) <p>I am studying pure type systems, particularly the calculus of constructions, and trying to use an encoding for recursive types on it, which, <a href="http://homepages.inf.ed.ac.uk/wadler/papers/free-rectypes/free-recty...
habedi/stack-exchange-dataset
68,769
print the nodes of an immutable single-linked list in reverse order
<p>Assume you have a single-linked list of length n. The list is immutable. A node <code>node</code> has a method <code>next</code> and <code>node.next()</code> returns a reference to the successor of <code>node</code>. <code>node.print()</code> prints the value of node <code>node</code> or does some other stuff, such...
data structures
1
print the nodes of an immutable single-linked list in reverse order -- (data structures) <p>Assume you have a single-linked list of length n. The list is immutable. A node <code>node</code> has a method <code>next</code> and <code>node.next()</code> returns a reference to the successor of <code>node</code>. <code>node...
habedi/stack-exchange-dataset
68,787
Find longest overlapping interval
<p>Given a set $S$ of $n$ overlapping intervals, where each interval is in the range of [1..O(n)], preprocess $S$ so we can efficiently answer the following query: &#xA;Given an interval [i,j] output the interval from $S$ that has the longest overlap with [i,j] (i.e., their intersection is as large as possible). Note t...
algorithms data structures computational geometry trees intervals
1
Find longest overlapping interval -- (algorithms data structures computational geometry trees intervals) <p>Given a set $S$ of $n$ overlapping intervals, where each interval is in the range of [1..O(n)], preprocess $S$ so we can efficiently answer the following query: &#xA;Given an interval [i,j] output the interval fr...
habedi/stack-exchange-dataset
68,794
Does the smallest DFA equivalent to this NFA requires at least $O(2^n)$ state?
<p>The wikipedia page <a href="https://en.wikipedia.org/wiki/Powerset_construction" rel="nofollow noreferrer"><em>Powerset construction</em></a> says that the DFA equivalent to this $(n + 1)$-state NFA (with $n=4$ here) "requires $2^n$ states, one for each $n$-character suffix of the input".</p>&#xA;&#xA;<p><a href="ht...
finite automata nondeterminism
1
Does the smallest DFA equivalent to this NFA requires at least $O(2^n)$ state? -- (finite automata nondeterminism) <p>The wikipedia page <a href="https://en.wikipedia.org/wiki/Powerset_construction" rel="nofollow noreferrer"><em>Powerset construction</em></a> says that the DFA equivalent to this $(n + 1)$-state NFA (wi...
habedi/stack-exchange-dataset
68,797
Height of data structures
<p>Why the height complexity of a data structure, generally expressed in terms of $\log n$, do not contain a ceiling or floor ?</p>&#xA;
data structures balanced search trees
1
Height of data structures -- (data structures balanced search trees) <p>Why the height complexity of a data structure, generally expressed in terms of $\log n$, do not contain a ceiling or floor ?</p>&#xA;
habedi/stack-exchange-dataset
68,800
Is it possible to turn an eulerian NFA into a linear size DFA?
<p>In general, there exists NFAs of size n whose smallest equivalent DFA requires 2^n states.</p>&#xA;&#xA;<p>But if we restrict ourselves to NFAs whose graph is eulerian, is it possible to turn any such NFA of size n into a DFA of size at most O(n) ?</p>&#xA;&#xA;<p>If so, does it hold also for a NFAs whose graph is s...
automata finite automata nondeterminism eulerian paths connected
1
Is it possible to turn an eulerian NFA into a linear size DFA? -- (automata finite automata nondeterminism eulerian paths connected) <p>In general, there exists NFAs of size n whose smallest equivalent DFA requires 2^n states.</p>&#xA;&#xA;<p>But if we restrict ourselves to NFAs whose graph is eulerian, is it possible ...
habedi/stack-exchange-dataset
68,808
Why Church-encoded types aren't sufficient to express inductive proofs?
<p>I've heard some claims that the calculus of constructions without inductive types isn't powerful enough to express proofs by induction. Is that correct? If so, why isn't the Church-encoding sufficient for that?</p>&#xA;
proof techniques functional programming automated theorem proving curry howard
1
Why Church-encoded types aren't sufficient to express inductive proofs? -- (proof techniques functional programming automated theorem proving curry howard) <p>I've heard some claims that the calculus of constructions without inductive types isn't powerful enough to express proofs by induction. Is that correct? If so, w...
habedi/stack-exchange-dataset
68,814
shortest distance vs shortest path
<p>This question might be <a href="https://cs.stackexchange.com/questions/32036/what-is-the-difference-between-shortest-distance-and-shortest-path">redundant</a> but I want to verify my understanding further. Suppose I have this linear directed graph:</p>&#xA;&#xA;<p>$$S \overset{2}{\to} A \overset{1}{\to} B \overset{3...
graphs
1
shortest distance vs shortest path -- (graphs) <p>This question might be <a href="https://cs.stackexchange.com/questions/32036/what-is-the-difference-between-shortest-distance-and-shortest-path">redundant</a> but I want to verify my understanding further. Suppose I have this linear directed graph:</p>&#xA;&#xA;<p>$$S \...
habedi/stack-exchange-dataset
68,828
Is there a different resolution of the "dangling else" problem other than "match closest"?
<p>The following context-free grammar presents a "dangling else" type ambiguity (imagine that $a$ stands for <code>if expr then</code> and $b$ stands for <code>else</code> and $c$ stands for some other kind of instruction or block):&#xA;$$&#xA;\begin{aligned}&#xA;S &amp;\rightarrow aSbS \;|\; aS \;|\; c\\&#xA;\end{alig...
context free formal grammars parsers ambiguity
1
Is there a different resolution of the "dangling else" problem other than "match closest"? -- (context free formal grammars parsers ambiguity) <p>The following context-free grammar presents a "dangling else" type ambiguity (imagine that $a$ stands for <code>if expr then</code> and $b$ stands for <code>else</code> and $...
habedi/stack-exchange-dataset
68,834
Is a bitstring easier to compress if it has lower Kolmogorov complexity?
<p>I have two bitstrings that are 100 bits long. Bitstring A has a Kolmogorov complexity (KC) of 90 and bitstring B has a KC of 10. Intuitively, I think bitstring B is probably easier to compress than bitstring A.</p>&#xA;&#xA;<p>"Easier to compress" means a larger proportion of 100 bit bitstrings with B's KC can be ...
data compression kolmogorov complexity
1
Is a bitstring easier to compress if it has lower Kolmogorov complexity? -- (data compression kolmogorov complexity) <p>I have two bitstrings that are 100 bits long. Bitstring A has a Kolmogorov complexity (KC) of 90 and bitstring B has a KC of 10. Intuitively, I think bitstring B is probably easier to compress than ...
habedi/stack-exchange-dataset
68,835
How to select a subset of columns in a given matrix to satisfy a condition?
<p>Let $a_{kn}$ be positive real numbers for all $k\in\{1,\dots,K\}$ and $n\in\{1,\dots,N\}$ and let $t&gt;0$. I need to find a subset $S$ of $\{1,\dots,N\}$ of minimum size&#xA; such that:</p>&#xA;&#xA;<ul>&#xA;<li>if $|S|=1$ then $a_{ki}\geq t$ for all $k\in\{1,\dots,K\}$ and $i\in S$.</li>&#xA;<li>if $|S|&gt;1$ then...
algorithms complexity theory
1
How to select a subset of columns in a given matrix to satisfy a condition? -- (algorithms complexity theory) <p>Let $a_{kn}$ be positive real numbers for all $k\in\{1,\dots,K\}$ and $n\in\{1,\dots,N\}$ and let $t&gt;0$. I need to find a subset $S$ of $\{1,\dots,N\}$ of minimum size&#xA; such that:</p>&#xA;&#xA;<ul>&#x...
habedi/stack-exchange-dataset
68,847
Matching algorithm, match pairs: what would be the right way to do it?
<p>How would you solve the following problem...&#xA;Theres a table filled with data like this:</p>&#xA;&#xA;<pre><code>Data1: 50 51 48 55 50&#xA;Data2: 51 49 52 50 51&#xA;Data3: 49 53 50 51 48&#xA;Data4: 48 50 52 51 53&#xA;Data5: 47 50 51 54 49&#xA;Data6: 50 48 50 49 52&#xA;Data7: 51 50 51 49 51&#xA;Data8: 48 51 49 50 ...
algorithms sorting
1
Matching algorithm, match pairs: what would be the right way to do it? -- (algorithms sorting) <p>How would you solve the following problem...&#xA;Theres a table filled with data like this:</p>&#xA;&#xA;<pre><code>Data1: 50 51 48 55 50&#xA;Data2: 51 49 52 50 51&#xA;Data3: 49 53 50 51 48&#xA;Data4: 48 50 52 51 53&#xA;Da...
habedi/stack-exchange-dataset
68,853
Trouble Replicating Proof of The Lambda Calculus Fixed Point Theorem
<p>From pg. 35 of <em>Lambda Calculus and Combinators An Introduction</em>:</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>Corollary 3.3.1</strong> in $\lambda$ and $CL$: for every $Z$ and $n \ge 0$, the equation</p>&#xA; &#xA; <p>$$ xy_1 \ldots y_n = Z $$</p>&#xA; &#xA; <p>can be solved for $x$. That is, there is a te...
lambda calculus combinatory logic
1
Trouble Replicating Proof of The Lambda Calculus Fixed Point Theorem -- (lambda calculus combinatory logic) <p>From pg. 35 of <em>Lambda Calculus and Combinators An Introduction</em>:</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>Corollary 3.3.1</strong> in $\lambda$ and $CL$: for every $Z$ and $n \ge 0$, the equation</p>...
habedi/stack-exchange-dataset
68,861
Show that there are $(n-1)!/2$ distinct tours for a Euclidean traveling salesman problem on $n$ points?
<p>The question is to show that there are $(n-1)!/2$ distinct tours for a Euclidean traveling salesman problem (ETSP) on $n$ points.</p>&#xA;&#xA;<p>My attempt was using induction. So I start by:</p>&#xA;&#xA;<ul>&#xA;<li>If $n=3$, then we have a triangle and there is only one tour.</li>&#xA;<li><p>Assume that there ar...
traveling salesman
1
Show that there are $(n-1)!/2$ distinct tours for a Euclidean traveling salesman problem on $n$ points? -- (traveling salesman) <p>The question is to show that there are $(n-1)!/2$ distinct tours for a Euclidean traveling salesman problem (ETSP) on $n$ points.</p>&#xA;&#xA;<p>My attempt was using induction. So I start ...
habedi/stack-exchange-dataset
68,868
Regular Expressions to Automaton
<p>Is there any systematic (algorithmic) method to convert a regular expression like </p>&#xA;&#xA;<p>$(a^*)(b)(b^*)(a^*)c$</p>&#xA;&#xA;<p>to an automaton (let's say a Buchi automaton)?</p>&#xA;
automata regular expressions
1
Regular Expressions to Automaton -- (automata regular expressions) <p>Is there any systematic (algorithmic) method to convert a regular expression like </p>&#xA;&#xA;<p>$(a^*)(b)(b^*)(a^*)c$</p>&#xA;&#xA;<p>to an automaton (let's say a Buchi automaton)?</p>&#xA;
habedi/stack-exchange-dataset
68,869
Minimum bits needed when representing a value in a set
<p>I'm reading a paper entitled <a href="http://people.csail.mit.edu/mip/papers/succinct/succinct.pdf" rel="nofollow noreferrer">"Succincter"</a> which discusses a compression scheme that involves encoding a value as a sequence of $M$ bits, along with a "spillover" value which can be recursively encoded.</p>&#xA;&#xA;<...
information theory data compression
1
Minimum bits needed when representing a value in a set -- (information theory data compression) <p>I'm reading a paper entitled <a href="http://people.csail.mit.edu/mip/papers/succinct/succinct.pdf" rel="nofollow noreferrer">"Succincter"</a> which discusses a compression scheme that involves encoding a value as a seque...
habedi/stack-exchange-dataset
68,872
Why does the program counter increment before an instruction is completed?
<p>During the fetch, decode, execute cycle, the Program Counter (PC) increments after the operand is copied from the Memory Data Register (MDR), and then carries on with the processing of the instruction. </p>&#xA;&#xA;<p>Why does the PC increment in the middle of the cycle rather than at the end?</p>&#xA;&#xA;<p>My on...
computer architecture cpu
1
Why does the program counter increment before an instruction is completed? -- (computer architecture cpu) <p>During the fetch, decode, execute cycle, the Program Counter (PC) increments after the operand is copied from the Memory Data Register (MDR), and then carries on with the processing of the instruction. </p>&#xA;...
habedi/stack-exchange-dataset
68,882
Efficient algorithm to check if a vector exists in the span of a subset of vectors
<p>I have a binary vector $v \in \mathbb{F}_2^m$ and a set of binary vectors $Q=\{q_1,q_2,\dots,q_n\}$ each belonging to $\mathbb{F}_2^m$ and I know that $v \in \text{span}\{Q\}$ but I want to know if there exists a subset $Q_k \subset Q$ of at most $k$ vectors ( i.e. $|Q_k| \le k &lt; n$ ) such that $v \in \text{span}...
algorithms linear algebra
1
Efficient algorithm to check if a vector exists in the span of a subset of vectors -- (algorithms linear algebra) <p>I have a binary vector $v \in \mathbb{F}_2^m$ and a set of binary vectors $Q=\{q_1,q_2,\dots,q_n\}$ each belonging to $\mathbb{F}_2^m$ and I know that $v \in \text{span}\{Q\}$ but I want to know if there...
habedi/stack-exchange-dataset
68,886
What does the algorithm calculate?
<p>We have the following </p>&#xA;&#xA;<pre><code>i &lt;- 0 &#xA;j &lt;- 0 &#xA;x &lt;- 1 &#xA;y &lt;- 1 &#xA;z &lt;- 1 &#xA;c &lt;- 1 &#xA;u &lt;- 1 &#xA;while i&lt;n do &#xA; i &lt;- i+1 &#xA; j &lt;- i &#xA; x &lt;- x*i &#xA; z &lt;- x &#xA; y &lt;- i+1 &#xA; y &lt;- x*y &#xA; while j&lt;2*i do &#xA; ...
algorithms correctness proof loop invariants
1
What does the algorithm calculate? -- (algorithms correctness proof loop invariants) <p>We have the following </p>&#xA;&#xA;<pre><code>i &lt;- 0 &#xA;j &lt;- 0 &#xA;x &lt;- 1 &#xA;y &lt;- 1 &#xA;z &lt;- 1 &#xA;c &lt;- 1 &#xA;u &lt;- 1 &#xA;while i&lt;n do &#xA; i &lt;- i+1 &#xA; j &lt;- i &#xA; x &lt;- x*i &#xA; ...
habedi/stack-exchange-dataset
68,888
How is this sorting algorithm Θ(n³) and not Θ(n²), worst-case?
<p>I just starting taking a course on Data Structures and Algorithms and my teaching assistant gave us the following pseudo-code for sorting an array of integers:</p>&#xA;&#xA;<pre><code>void F3() {&#xA; for (int i = 1; i &lt; n; i++) {&#xA; if (A[i-1] &gt; A[i]) {&#xA; swap(i-1, i)&#xA; ...
algorithm analysis asymptotics runtime analysis sorting
1
How is this sorting algorithm Θ(n³) and not Θ(n²), worst-case? -- (algorithm analysis asymptotics runtime analysis sorting) <p>I just starting taking a course on Data Structures and Algorithms and my teaching assistant gave us the following pseudo-code for sorting an array of integers:</p>&#xA;&#xA;<pre><code>void F3()...
habedi/stack-exchange-dataset
68,894
Is the optimal order of graph vertices s.t. minimizes edges to later vertices a well-known problem?
<p>I'm a little unfamiliar with graph theory, and I found an interesting problem in my work that I do not know if its already well-known or can be easily mapped to another one. If I were to express the problem more formally:</p>&#xA;&#xA;<p>Given a directed unweighted graph $\langle V,E \rangle$, find a total order bet...
algorithms graphs smt solvers
1
Is the optimal order of graph vertices s.t. minimizes edges to later vertices a well-known problem? -- (algorithms graphs smt solvers) <p>I'm a little unfamiliar with graph theory, and I found an interesting problem in my work that I do not know if its already well-known or can be easily mapped to another one. If I wer...
habedi/stack-exchange-dataset
68,896
Time complexity of functions that call each other
<p>I'm having trouble reasoning about the time complexity of these mutually recursive functions. This was asked on SO <a href="https://stackoverflow.com/questions/27640990/calculating-time-complexity-of-functions-when-both-contain-each-other/" title="here">here</a> but the answer there didn't help me. I tried substitut...
complexity theory time complexity asymptotics
1
Time complexity of functions that call each other -- (complexity theory time complexity asymptotics) <p>I'm having trouble reasoning about the time complexity of these mutually recursive functions. This was asked on SO <a href="https://stackoverflow.com/questions/27640990/calculating-time-complexity-of-functions-when-b...
habedi/stack-exchange-dataset
68,907
$\omega$-regular expression to LTL
<p>Is there any systematic (algorithmic) method to convert an $\omega$-regular expression like</p>&#xA;&#xA;<p>$&#xA;(a^∗)(b)(b^∗)(a^∗)(c^\omega)&#xA;$</p>&#xA;&#xA;<p>to an LTL property?</p>&#xA;
regular expressions linear temporal logic
1
$\omega$-regular expression to LTL -- (regular expressions linear temporal logic) <p>Is there any systematic (algorithmic) method to convert an $\omega$-regular expression like</p>&#xA;&#xA;<p>$&#xA;(a^∗)(b)(b^∗)(a^∗)(c^\omega)&#xA;$</p>&#xA;&#xA;<p>to an LTL property?</p>&#xA;
habedi/stack-exchange-dataset
68,914
How to find total number of minimum spanning trees in a graph with n edges?
<p>I had this question on my final exam so sadly I don't have the question but as far as I remember, the question was saying:</p>&#xA;&#xA;<blockquote>&#xA; <p>How many minimum spanning trees does a graph with 20 edges have.</p>&#xA;</blockquote>&#xA;&#xA;<p>I know that we can find minimum spanning trees with algorith...
graphs spanning trees
1
How to find total number of minimum spanning trees in a graph with n edges? -- (graphs spanning trees) <p>I had this question on my final exam so sadly I don't have the question but as far as I remember, the question was saying:</p>&#xA;&#xA;<blockquote>&#xA; <p>How many minimum spanning trees does a graph with 20 edg...
habedi/stack-exchange-dataset
68,921
Do formulas involving fewer repetitions of variables give higher numerical precision?
<p>I'm having some trouble doing SICP exercise 2.15. Please note that this question is not closed related to Lisp. Instead, it's closely related to numerical analysis.</p>&#xA;&#xA;<blockquote>&#xA; <p><a href="https://mitpress.mit.edu/sicp/full-text/book/book-Z-H-14.html#%25_thm_2.15" rel="nofollow noreferrer">Exerci...
algorithms proof techniques computation models mathematical analysis numerical analysis
1
Do formulas involving fewer repetitions of variables give higher numerical precision? -- (algorithms proof techniques computation models mathematical analysis numerical analysis) <p>I'm having some trouble doing SICP exercise 2.15. Please note that this question is not closed related to Lisp. Instead, it's closely rela...
habedi/stack-exchange-dataset
68,932
Is it possible to build short proofs of arbitrary folds over a huge list?
<p>With the use of Merkle Trees, you can prove the presence of an element of a very big list, with an amount of information close to just logarithm of the size of the whole tree. Merkle proofs, thus, probabilistically confirm the result of this specific fold:</p>&#xA;&#xA;<pre><code>isMember :: ∀ t . List t -&gt; Bool&...
proof techniques cryptography automated theorem proving
1
Is it possible to build short proofs of arbitrary folds over a huge list? -- (proof techniques cryptography automated theorem proving) <p>With the use of Merkle Trees, you can prove the presence of an element of a very big list, with an amount of information close to just logarithm of the size of the whole tree. Merkle...
habedi/stack-exchange-dataset
68,938
Shouldn't every algorithm run in pseudo-polynomial time?
<p>Wiki says&#xA;a numeric algorithm runs in pseudo-polynomial time if its running time is polynomial in the numeric value of the input, but is exponential in the length of the input – the number of bits required to represent it.</p>&#xA;&#xA;<p><a href="https://stackoverflow.com/a/19647659/2374691">This answer</a> ver...
complexity theory pseudo polynomial
1
Shouldn't every algorithm run in pseudo-polynomial time? -- (complexity theory pseudo polynomial) <p>Wiki says&#xA;a numeric algorithm runs in pseudo-polynomial time if its running time is polynomial in the numeric value of the input, but is exponential in the length of the input – the number of bits required to repres...
habedi/stack-exchange-dataset
68,943
Proving $a^{2+n}a^{n}$ is regular using the Pumping Lemma
<p>So I'm trying to practice (and learn, clearly) use of the Pumping Lemma, and this is my current equation. It's clearly regular- it can be simplified:</p>&#xA;&#xA;<p>$a^{2+n}a^{n} = a^{2+2n}$ and from there it's fairly easy to derive the regular language $aa(aa)*$</p>&#xA;&#xA;<p>However, I'm trying to explicitly so...
regular languages pumping lemma
1
Proving $a^{2+n}a^{n}$ is regular using the Pumping Lemma -- (regular languages pumping lemma) <p>So I'm trying to practice (and learn, clearly) use of the Pumping Lemma, and this is my current equation. It's clearly regular- it can be simplified:</p>&#xA;&#xA;<p>$a^{2+n}a^{n} = a^{2+2n}$ and from there it's fairly eas...
habedi/stack-exchange-dataset
68,945
Given the hash of a collection, H(X), can I build a proof that F(X) == Y, without having X?
<p>Given a cryptographic fingerprint of a collection, <code>K == hash(X)</code>, an arbitrary function <code>F</code>, and a value <code>Y</code>, is it possible to build a short proof that <code>F(X) == Y</code> that doesn't require having <code>X</code>? I.e., a proof that <code>Y</code> is the result of applying <co...
proof techniques cryptography
1
Given the hash of a collection, H(X), can I build a proof that F(X) == Y, without having X? -- (proof techniques cryptography) <p>Given a cryptographic fingerprint of a collection, <code>K == hash(X)</code>, an arbitrary function <code>F</code>, and a value <code>Y</code>, is it possible to build a short proof that <co...
habedi/stack-exchange-dataset
68,951
Counting trees in a graph
<p>I would like to know how to modify DFS/BFS in order to return the number of the trees present in a graph. I know that a tree is an acyclic connected graph, and I think that I have to initialize a counter somewhere, but I don't know where. I made the procedure "is-tree(G)" where G is the graph. It returns true if the...
algorithms graphs
1
Counting trees in a graph -- (algorithms graphs) <p>I would like to know how to modify DFS/BFS in order to return the number of the trees present in a graph. I know that a tree is an acyclic connected graph, and I think that I have to initialize a counter somewhere, but I don't know where. I made the procedure "is-tree...
habedi/stack-exchange-dataset
68,956
Can we use exponential function in a reduction?
<p>If I have an NP-complete graph problem $P1$ whose instance, say, a graph $G$ and a positive integer $k$ and I have another graph problem $P2$ whose instance is a graph $G'$ and a positive integer $k'$. I would like to prove that $P2$ is NP-complete. The reduction is as follows:</p>&#xA;&#xA;<ul>&#xA;<li>set $G'= G$ ...
complexity theory reductions
1
Can we use exponential function in a reduction? -- (complexity theory reductions) <p>If I have an NP-complete graph problem $P1$ whose instance, say, a graph $G$ and a positive integer $k$ and I have another graph problem $P2$ whose instance is a graph $G'$ and a positive integer $k'$. I would like to prove that $P2$ i...
habedi/stack-exchange-dataset
68,960
Prove that if x has a predecessor, this predecessor has a right child
<blockquote>&#xA; <p>In a BST, Let <code>x</code> be a leaf node, which is a left child of node <code>y</code>. Prove that if <code>x</code> has a predecessor, this predecessor has a right child.</p>&#xA;</blockquote>&#xA;&#xA;<p>How can I tackle this question? I'm not even sure from where to start.</p>&#xA;
binary search trees
1
Prove that if x has a predecessor, this predecessor has a right child -- (binary search trees) <blockquote>&#xA; <p>In a BST, Let <code>x</code> be a leaf node, which is a left child of node <code>y</code>. Prove that if <code>x</code> has a predecessor, this predecessor has a right child.</p>&#xA;</blockquote>&#xA;&#...
habedi/stack-exchange-dataset
68,969
Why are combinators important in lambda calculus?
<p>I just recently learned a little about the lambda calculus, from the brief intro in the text <em>Programming Language Pragmatics</em> and <a href="https://www.youtube.com/watch?v=_kYGDJSm0gE" rel="noreferrer">this outstanding 4-video sequence from Adam Doupé</a>. Basically I learned the gist of lambda calculus, $\al...
lambda calculus combinatory logic
1
Why are combinators important in lambda calculus? -- (lambda calculus combinatory logic) <p>I just recently learned a little about the lambda calculus, from the brief intro in the text <em>Programming Language Pragmatics</em> and <a href="https://www.youtube.com/watch?v=_kYGDJSm0gE" rel="noreferrer">this outstanding 4-...
habedi/stack-exchange-dataset
68,973
Maximum number of states in NFA concluded from the converted DFA
<p>Assume I have a DFA with 20 states, is it possible to know the maximum number of states of the NFA which it was converted from?</p>&#xA;&#xA;<p>I know that the <em>minimal</em> number of states would be 5 (because you cannot have created a DFA with 20 states from an NFA with 4 states).</p>&#xA;&#xA;<p>But I don't re...
automata finite automata
1
Maximum number of states in NFA concluded from the converted DFA -- (automata finite automata) <p>Assume I have a DFA with 20 states, is it possible to know the maximum number of states of the NFA which it was converted from?</p>&#xA;&#xA;<p>I know that the <em>minimal</em> number of states would be 5 (because you cann...
habedi/stack-exchange-dataset
68,974
Correctness proof of the algoritm to generate permutations in lexicographic order
<p>The following algorithm generates the next permutation lexicographically after a given permutation. It changes the given permutation in-place.</p>&#xA;&#xA;<ol>&#xA;<li>Find the largest index k such that a[k] &lt; a[k + 1]. If no such index exists, the permutation is the last permutation.</li>&#xA;<li>Find the large...
correctness proof permutations
1
Correctness proof of the algoritm to generate permutations in lexicographic order -- (correctness proof permutations) <p>The following algorithm generates the next permutation lexicographically after a given permutation. It changes the given permutation in-place.</p>&#xA;&#xA;<ol>&#xA;<li>Find the largest index k such ...
habedi/stack-exchange-dataset
68,982
Push down automaton for Language of same number of as and bs
<p><strong>The task</strong></p>&#xA;&#xA;<blockquote>&#xA; <p>Find a pushdown automaton $M$, so that $L(M)=\{w \in \{a,b\}^*\ |\ |w|_a=|w|_b\}$, where $|w|_a$ denotes the number of $a$s in a word $w$.</p>&#xA;</blockquote>&#xA;&#xA;<p><strong>My solution</strong></p>&#xA;&#xA;<p>I'm using the <a href="https://en.wiki...
context free automata pushdown automata
1
Push down automaton for Language of same number of as and bs -- (context free automata pushdown automata) <p><strong>The task</strong></p>&#xA;&#xA;<blockquote>&#xA; <p>Find a pushdown automaton $M$, so that $L(M)=\{w \in \{a,b\}^*\ |\ |w|_a=|w|_b\}$, where $|w|_a$ denotes the number of $a$s in a word $w$.</p>&#xA;</b...
habedi/stack-exchange-dataset
68,983
TM - reject definition and complement
<p>I have couple of questions about Turing machines:</p>&#xA;&#xA;<ol>&#xA;<li>What is the definition of the "reject" state in TM?&#xA;If the input was very small and, after one step, the machine gets to the end of the input, but it stands on regular state, it counts as "reject"? Or there is a special "reject" state, a...
complexity theory turing machines space complexity
1
TM - reject definition and complement -- (complexity theory turing machines space complexity) <p>I have couple of questions about Turing machines:</p>&#xA;&#xA;<ol>&#xA;<li>What is the definition of the "reject" state in TM?&#xA;If the input was very small and, after one step, the machine gets to the end of the input, ...
habedi/stack-exchange-dataset
68,996
Explanation of an explanation of Turing's proof to the halting problem?
<p>I am reading the <a href="http://www.scottaaronson.com/democritus/lec3.html" rel="nofollow noreferrer">transcription of a lecture</a> from a professor Scott Aaronson, specifically the section titled <em>Turing Machines</em>. In this section he describes Turing's proof of the <a href="https://en.wikipedia.org/wiki/Ha...
turing machines halting problem
1
Explanation of an explanation of Turing's proof to the halting problem? -- (turing machines halting problem) <p>I am reading the <a href="http://www.scottaaronson.com/democritus/lec3.html" rel="nofollow noreferrer">transcription of a lecture</a> from a professor Scott Aaronson, specifically the section titled <em>Turin...
habedi/stack-exchange-dataset
68,997
Shuffle an array based on some rules
<p>I have a set of images. The length is variable. It could be anything up to about 30 images. Each image can have up to 10 tags. Images may share some, all or none of their tags. I need to select a random 5 from this set of images. This selection should follow the following rules in order of high priority to low:</p>&...
arrays randomized algorithms
1
Shuffle an array based on some rules -- (arrays randomized algorithms) <p>I have a set of images. The length is variable. It could be anything up to about 30 images. Each image can have up to 10 tags. Images may share some, all or none of their tags. I need to select a random 5 from this set of images. This selection s...
habedi/stack-exchange-dataset
69,021
Clarifying "operation" in the definition of data type
<p>A definition of data type I've seen is along the lines of "a <strong>set of values</strong> and a <strong>set of operations</strong>".</p>&#xA;&#xA;<p>What exactly does an operation in this set comprise?</p>&#xA;&#xA;<p>For instance, might an operation be considered as:</p>&#xA;&#xA;<ul>&#xA;<li><p>an identifier (e....
terminology type theory
1
Clarifying "operation" in the definition of data type -- (terminology type theory) <p>A definition of data type I've seen is along the lines of "a <strong>set of values</strong> and a <strong>set of operations</strong>".</p>&#xA;&#xA;<p>What exactly does an operation in this set comprise?</p>&#xA;&#xA;<p>For instance, ...
habedi/stack-exchange-dataset
69,026
How many decision problems do exist?
<p>Are there countable infinte decision problems or uncountable infinite?</p>&#xA;&#xA;<p>Thank you</p>&#xA;
decision problem
1
How many decision problems do exist? -- (decision problem) <p>Are there countable infinte decision problems or uncountable infinite?</p>&#xA;&#xA;<p>Thank you</p>&#xA;
habedi/stack-exchange-dataset
69,031
How to solve F(n)+1 = (F(n-1)+1)*(F(n-2)+1) this recurrence relation?
<p>I am trying to solve this recurrence relation for a while but not getting anywhere. Actually, the sequence is given as,</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>F(n) = F(n-1) + F(n-2) + F(n-1)*F(n-2)</strong></p>&#xA;</blockquote>&#xA;&#xA;<p>where, F(0) and F(1) will be given. I added 1 on both sides to factorize...
recurrence relation mathematical programming
1
How to solve F(n)+1 = (F(n-1)+1)*(F(n-2)+1) this recurrence relation? -- (recurrence relation mathematical programming) <p>I am trying to solve this recurrence relation for a while but not getting anywhere. Actually, the sequence is given as,</p>&#xA;&#xA;<blockquote>&#xA; <p><strong>F(n) = F(n-1) + F(n-2) + F(n-1)*F(...
habedi/stack-exchange-dataset
69,037
Superscript on complexity class?
<p>What does it mean when one complexity class has another complexity class superscript?</p>&#xA;&#xA;<p>For example, sometimes in papers I see $P^P$ or $P^{NP}$.</p>&#xA;
complexity theory np oracle machines
1
Superscript on complexity class? -- (complexity theory np oracle machines) <p>What does it mean when one complexity class has another complexity class superscript?</p>&#xA;&#xA;<p>For example, sometimes in papers I see $P^P$ or $P^{NP}$.</p>&#xA;
habedi/stack-exchange-dataset
69,041
Recover PRNG description from consecutive outputs
<p>Given the outputs of the pseudorandom numbers generator how can one determine the type (e.g. Linear Feedback Shift Register), Multiply-With-Carry, Linear Congruential Generator etc.) and recover the function and the seed?</p>&#xA;&#xA;<p>The given array of numbers is for sure generated by PRNG (not Cryptographically...
algorithms pseudo random generators
1
Recover PRNG description from consecutive outputs -- (algorithms pseudo random generators) <p>Given the outputs of the pseudorandom numbers generator how can one determine the type (e.g. Linear Feedback Shift Register), Multiply-With-Carry, Linear Congruential Generator etc.) and recover the function and the seed?</p>&...
habedi/stack-exchange-dataset
69,042
Any ideas on implementation of a certain image process?
<p>I recently found <a href="https://www.youtube.com/watch?v=Z5j3CORfxmw" rel="nofollow noreferrer">this music video</a>. While the music is mislabeled, the video part caught my eye. It seems to be transitioning between two images based on shape? I think its a fade-in/fade-out with the images being streched and transfo...
image processing
1
Any ideas on implementation of a certain image process? -- (image processing) <p>I recently found <a href="https://www.youtube.com/watch?v=Z5j3CORfxmw" rel="nofollow noreferrer">this music video</a>. While the music is mislabeled, the video part caught my eye. It seems to be transitioning between two images based on sh...
habedi/stack-exchange-dataset
69,050
find if a string is periodic using a suffix tree, and prove it
<p>A string <code>s</code> of length <code>n</code> is periodic if there is a string $u$ of length &lt;= n/2 such that $s = u^ku'$, where $k$ is an integer >=2, $u^k$ is the concatenation of k copies of $u$ , and $u'$ is a &#xA;prefix of u. </p>&#xA;&#xA;<p>The smallest period of $s$ is the shortest $u$ (...
correctness proof suffix trees
1
find if a string is periodic using a suffix tree, and prove it -- (correctness proof suffix trees) <p>A string <code>s</code> of length <code>n</code> is periodic if there is a string $u$ of length &lt;= n/2 such that $s = u^ku'$, where $k$ is an integer >=2, $u^k$ is the concatenation of k copies of $u$ ...
habedi/stack-exchange-dataset
69,051
How is Dijkstra's algorithm related to breadth first search(BFS)?
<p>I've read in Introduction to algorithms(CLRS) that Dijkstra's algorithm uses ideas similar to those of BFS? I think it really makes sense with respect to Dijkstra's algorithm with relationship to BFS when there are multiple short paths. &#xA;<a href="https://stackoverflow.com/questions/13249057/dijkstra-find-shorte...
algorithms graphs greedy algorithms
1
How is Dijkstra's algorithm related to breadth first search(BFS)? -- (algorithms graphs greedy algorithms) <p>I've read in Introduction to algorithms(CLRS) that Dijkstra's algorithm uses ideas similar to those of BFS? I think it really makes sense with respect to Dijkstra's algorithm with relationship to BFS when ther...
habedi/stack-exchange-dataset
69,054
Pre-requisite knowledge before diving into algorithms
<p>I'm having some difficulty trying to follow what the authors of some of the more highly recommended books on algorithms. I ran into the same problem when trying out some online courses. My goal is to prepare myself to start learning fundamental algorithms for use in low-level languages by means of understanding them...
algorithms education mathematical foundations
1
Pre-requisite knowledge before diving into algorithms -- (algorithms education mathematical foundations) <p>I'm having some difficulty trying to follow what the authors of some of the more highly recommended books on algorithms. I ran into the same problem when trying out some online courses. My goal is to prepare myse...
habedi/stack-exchange-dataset
69,074
How to solve variable sized bin packing when the items have equal weights, or is it still NP-hard?
<p>Consider the variable sized bin packing </p>&#xA;&#xA;<p>$$&#xA; \begin{align*}\tag{P1a}\label{P1a}&#xA; &amp; {\underset{\mathbf{ x }, \mathbf{ y }}{\text{minimize}}}&#xA; &amp; &amp; \sum_{j=1}^nf_jy_j\\[3pt]&#xA; &amp; \text{subject to}&#xA; &amp; &amp; \sum_{i=1}^{m} w_{i}x_{ij} \leqslant ...
algorithms np hard
1
How to solve variable sized bin packing when the items have equal weights, or is it still NP-hard? -- (algorithms np hard) <p>Consider the variable sized bin packing </p>&#xA;&#xA;<p>$$&#xA; \begin{align*}\tag{P1a}\label{P1a}&#xA; &amp; {\underset{\mathbf{ x }, \mathbf{ y }}{\text{minimize}}}&#xA; &amp; &a...
habedi/stack-exchange-dataset
69,086
Static prediction of branch prediction
<p>If we have a static implementation of branch prediction and we always fetch the next sequential instruction isn't inefficient to do that if we, at a future point verify if the prediction was correctly done? We just evaluate the branch in future... Why don't we just simply verify this thing every time we encounter a ...
cpu
1
Static prediction of branch prediction -- (cpu) <p>If we have a static implementation of branch prediction and we always fetch the next sequential instruction isn't inefficient to do that if we, at a future point verify if the prediction was correctly done? We just evaluate the branch in future... Why don't we just sim...
habedi/stack-exchange-dataset
69,088
Bellman-Ford: Find all nodes that have minus infinite distance to source
<p>Given a weighted, directed graph (V, E) may contains some negative cycles and a source node <code>s</code>, I would like to know for all node <code>u</code>, if there is a path from <code>s</code> to <code>u</code> but there is no shortest path from <code>s</code> to <code>u</code> (the distance from <code>s</code> ...
algorithms graphs shortest path
1
Bellman-Ford: Find all nodes that have minus infinite distance to source -- (algorithms graphs shortest path) <p>Given a weighted, directed graph (V, E) may contains some negative cycles and a source node <code>s</code>, I would like to know for all node <code>u</code>, if there is a path from <code>s</code> to <code>u...
habedi/stack-exchange-dataset
69,091
To which character or characters does a Kleene star apply?
<p>If you have a Kleene star applying to a set of characters not in any closure, does it apply to that whole string, or just the one character it belongs to? Any examples I search don't specify.</p>&#xA;&#xA;<p>For example:</p>&#xA;&#xA;<p>(A)BB*</p>&#xA;&#xA;<p>Does this mean 1: one A followed by zero to an infinite n...
regular expressions kleene star
1
To which character or characters does a Kleene star apply? -- (regular expressions kleene star) <p>If you have a Kleene star applying to a set of characters not in any closure, does it apply to that whole string, or just the one character it belongs to? Any examples I search don't specify.</p>&#xA;&#xA;<p>For example:<...
habedi/stack-exchange-dataset
69,092
Showing a problem on a specific graph is NP-hard
<p>Maybe there is a trivial answer to my question or maybe there is not any. But I ask it here and appreciate if anyone can give me a clear answer.</p>&#xA;&#xA;<p>We know that a set of problems like minimum clique cover problem, coloring problem, vertex cover, ... are NP-hard for general graphs, but maybe polynomial-t...
complexity theory graphs np complete np hard
1
Showing a problem on a specific graph is NP-hard -- (complexity theory graphs np complete np hard) <p>Maybe there is a trivial answer to my question or maybe there is not any. But I ask it here and appreciate if anyone can give me a clear answer.</p>&#xA;&#xA;<p>We know that a set of problems like minimum clique cover ...
habedi/stack-exchange-dataset
69,095
Counting Total Number of Non-Equivalent Configurations in a 2-D Grid
<p>This is a challenging question I've been trying (unsuccessfully) to solve via programming, math or both. </p>&#xA;&#xA;<p>Suppose you're given a 2D grid, whose width and height, $w$ and $h$, can each range from $1$ thru $12$ inclusive. Each cell in this grid can be in any of $k$ states (where $k$ ranges from $2$ thr...
combinatorics dynamic programming recursion divide and conquer
1
Counting Total Number of Non-Equivalent Configurations in a 2-D Grid -- (combinatorics dynamic programming recursion divide and conquer) <p>This is a challenging question I've been trying (unsuccessfully) to solve via programming, math or both. </p>&#xA;&#xA;<p>Suppose you're given a 2D grid, whose width and height, $w...
habedi/stack-exchange-dataset
69,098
Is function with finite amount of $\Phi_x(x+1)$ occurrences Turing computable?
<p>I'm studying for my exam from Logic and Computability and we have to face following kind of examples:</p>&#xA;&#xA;<p>$$f(x) = \begin{cases}&#xA; \ 1 &amp;\text{if }\Phi_x(x+1)\!\downarrow\text{ and }x\leq50\\&#xA; \ 0 &amp;\text{otherwise.}&#xA;\end{cases}$$</p>&#xA;&#xA;<p>Unfortunatelly I'm not re...
computability turing machines undecidability
1
Is function with finite amount of $\Phi_x(x+1)$ occurrences Turing computable? -- (computability turing machines undecidability) <p>I'm studying for my exam from Logic and Computability and we have to face following kind of examples:</p>&#xA;&#xA;<p>$$f(x) = \begin{cases}&#xA; \ 1 &amp;\text{if }\Phi_x(x+1)\!\d...
habedi/stack-exchange-dataset
69,105
Term for number of edges in a graph
<p>Is there a single-word term for "the number of edges in a graph"? Something along the lines of "arity" for function parameters.</p>&#xA;
graphs
1
Term for number of edges in a graph -- (graphs) <p>Is there a single-word term for "the number of edges in a graph"? Something along the lines of "arity" for function parameters.</p>&#xA;
habedi/stack-exchange-dataset
69,118
Finding minimum spanning tree of a special form graph
<p>I'm trying to find an efficient algorithm that will find me the <strong>minimum spanning tree</strong> of an <strong>undirected</strong>, <strong>weighted graph</strong> of this particular form:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/6uxWJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.co...
algorithms graphs correctness proof weighted graphs minimum spanning tree
1
Finding minimum spanning tree of a special form graph -- (algorithms graphs correctness proof weighted graphs minimum spanning tree) <p>I'm trying to find an efficient algorithm that will find me the <strong>minimum spanning tree</strong> of an <strong>undirected</strong>, <strong>weighted graph</strong> of this partic...
habedi/stack-exchange-dataset
69,119
Direct encoding of the solution into the chromosomes in a Random-Key Genetic Algorithm
<p>In a random key genetic algorithm<a href="https://link.springer.com/article/10.1007/s10732-010-9143-1" rel="nofollow noreferrer">1</a>, the chromosomes consist in a sequence of real numbers (initially randomly generated) in the interval $[0,1]$. </p>&#xA;&#xA;<p>I've been told by my teacher that in these kinds of ge...
optimization genetic algorithms
1
Direct encoding of the solution into the chromosomes in a Random-Key Genetic Algorithm -- (optimization genetic algorithms) <p>In a random key genetic algorithm<a href="https://link.springer.com/article/10.1007/s10732-010-9143-1" rel="nofollow noreferrer">1</a>, the chromosomes consist in a sequence of real numbers (in...
habedi/stack-exchange-dataset
69,128
Max flow not min cut?
<p>I understand the relation between max flow and min cut, however I made this (simplified) graph, and I cant figure out why max flow seems to be different from my min cut. Im probably overlooking something simple, but I've been staring at this for 10 minutes now...&#xA;Can anyone explain what Im missing?&#xA;<img src=...
network flow minimum cuts
1
Max flow not min cut? -- (network flow minimum cuts) <p>I understand the relation between max flow and min cut, however I made this (simplified) graph, and I cant figure out why max flow seems to be different from my min cut. Im probably overlooking something simple, but I've been staring at this for 10 minutes now...&...
habedi/stack-exchange-dataset
69,129
Branch wrong prediction pipeline
<p>Let's say we have a pipeline with 20 stages. If the testing for the jump condition is done at stage 14 and we have a wrong prediction, then the instructions processed in those 14 stages, that shouldn't have been processed due to the wrong prediction made the processor lose 14 cycles. We know that the jump instructio...
cpu cpu pipelines
1
Branch wrong prediction pipeline -- (cpu cpu pipelines) <p>Let's say we have a pipeline with 20 stages. If the testing for the jump condition is done at stage 14 and we have a wrong prediction, then the instructions processed in those 14 stages, that shouldn't have been processed due to the wrong prediction made the pr...
habedi/stack-exchange-dataset
69,134
How to show the function is not Turing computable?
<p>Having the function:</p>&#xA;&#xA;<p>$$f(y) = \begin{cases}&#xA; \ 1 &amp;\text{if }\forall n \Phi_y(n)=n\lor \Phi_y(n) \!\uparrow\\&#xA; \ 0 &amp;\text{otherwise.}&#xA;\end{cases}$$</p>&#xA;&#xA;<p>By the rule of thumb it should not be computable. How to prove it formally?&#xA;If it's computable, I ...
computability turing machines
1
How to show the function is not Turing computable? -- (computability turing machines) <p>Having the function:</p>&#xA;&#xA;<p>$$f(y) = \begin{cases}&#xA; \ 1 &amp;\text{if }\forall n \Phi_y(n)=n\lor \Phi_y(n) \!\uparrow\\&#xA; \ 0 &amp;\text{otherwise.}&#xA;\end{cases}$$</p>&#xA;&#xA;<p>By the rule of t...
habedi/stack-exchange-dataset
69,141
Calculate how much segements the system can handle
<p>I am a bit lost calculating how much segments will the system handle in a memory segmented system (without virtual memory). The problem says that the system has a word length of 32 bits and the address are 6 hexadecimal numbers, 3 of them are the segment identifier. We have a segment size of 4KiB</p>&#xA;&#xA;<p>I t...
memory management
1
Calculate how much segements the system can handle -- (memory management) <p>I am a bit lost calculating how much segments will the system handle in a memory segmented system (without virtual memory). The problem says that the system has a word length of 32 bits and the address are 6 hexadecimal numbers, 3 of them are ...
habedi/stack-exchange-dataset
69,142
How can Karger's algorithm (and other randomized algorithms) be used in practice?
<p>Suppose I am given the following problem (the source is <a href="https://www.careercup.com/question?id=5104398418051072" rel="nofollow noreferrer">here</a>):</p>&#xA;&#xA;<blockquote>&#xA; <p>Disconnect two nodes in a graph by removing minimum number of edges.</p>&#xA;</blockquote>&#xA;&#xA;<p>I would apply Karger'...
probability theory randomized algorithms
1
How can Karger's algorithm (and other randomized algorithms) be used in practice? -- (probability theory randomized algorithms) <p>Suppose I am given the following problem (the source is <a href="https://www.careercup.com/question?id=5104398418051072" rel="nofollow noreferrer">here</a>):</p>&#xA;&#xA;<blockquote>&#xA; ...
habedi/stack-exchange-dataset
69,143
Recover NLFSR description from given output
<p>Given Fibonacci's Nonlinear Feedback Shift Register output, how can I recover the description (nonlinear feedback function and current seed)?</p>&#xA;&#xA;<p>The clean output of consecutive and unmodified is large and the generator is available to ask for next values. The source code of PRNG is not available, the se...
algorithms pseudo random generators
1
Recover NLFSR description from given output -- (algorithms pseudo random generators) <p>Given Fibonacci's Nonlinear Feedback Shift Register output, how can I recover the description (nonlinear feedback function and current seed)?</p>&#xA;&#xA;<p>The clean output of consecutive and unmodified is large and the generator ...
habedi/stack-exchange-dataset
69,148
Two addresses point to the same data - is the data then stored 2 times in the cache?
<p>Let's say a program reads the addresses <code>0x00 cd 10 54</code>and<code>0x00 cd 10 50</code>. The tag size and and index size added are just 4 bits, the cache has 8 blocks to 8 Bytes and thus 4 together make a set. The CPU is 32 bit. </p>&#xA;&#xA;<p>Then above addresses would point to: </p>&#xA;&#xA;<pre><code>0...
cpu cache
1
Two addresses point to the same data - is the data then stored 2 times in the cache? -- (cpu cache) <p>Let's say a program reads the addresses <code>0x00 cd 10 54</code>and<code>0x00 cd 10 50</code>. The tag size and and index size added are just 4 bits, the cache has 8 blocks to 8 Bytes and thus 4 together make a set....
habedi/stack-exchange-dataset
69,152
What's the purpose of Karger's algorithm?
<p>Suppose I'm given an undirected graph and two nodes: <strong><em>v</em></strong> and <strong><em>u</em></strong>.</p>&#xA;&#xA;<p>If I understand Karger's algorithm correctly, it's used to find a minimum cut of a graph, not the ("the" because there is only one for any given graph) minimum cut such that <strong><em>v...
algorithms graphs partitions
1
What's the purpose of Karger's algorithm? -- (algorithms graphs partitions) <p>Suppose I'm given an undirected graph and two nodes: <strong><em>v</em></strong> and <strong><em>u</em></strong>.</p>&#xA;&#xA;<p>If I understand Karger's algorithm correctly, it's used to find a minimum cut of a graph, not the ("the" becaus...
habedi/stack-exchange-dataset
69,159
Boolean Algebra: Operation Linkage Laws
<p>Im studying some properties of Boolean Algebra and found the Operation Linkage Laws.</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/IYCcN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IYCcN.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>Im not able to understand how this laws a...
boolean algebra
1
Boolean Algebra: Operation Linkage Laws -- (boolean algebra) <p>Im studying some properties of Boolean Algebra and found the Operation Linkage Laws.</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/IYCcN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IYCcN.png" alt="enter image description here"><...
habedi/stack-exchange-dataset
69,175
How to represent text for a program to add punctuation to a block of text?
<p>I want to try and make a program where I remove the punctuation from a block of text and it then inputs it in the correct places.&#xA;I have started with a simpler element of just using text and spaces, no commas, full stops etc.&#xA;The first angle I have been taking this is with machine learning, neural networks a...
machine learning natural language processing
1
How to represent text for a program to add punctuation to a block of text? -- (machine learning natural language processing) <p>I want to try and make a program where I remove the punctuation from a block of text and it then inputs it in the correct places.&#xA;I have started with a simpler element of just using text a...
habedi/stack-exchange-dataset
69,176
Is potential causality relation equals to set of consistent happens before relations?
<p>In a book dedicated to distributed algorithms, I found the following definition - potential causality diagram is consistent with happens before diagram if potential causality relation between system events is a subset of happens-before relation. So far so good.</p>&#xA;&#xA;<p>But then I have read following claim po...
algorithms distributed systems clocks
1
Is potential causality relation equals to set of consistent happens before relations? -- (algorithms distributed systems clocks) <p>In a book dedicated to distributed algorithms, I found the following definition - potential causality diagram is consistent with happens before diagram if potential causality relation betw...
habedi/stack-exchange-dataset
69,178
Finding path that minimizes largest of the sum of weights of each group in a directed multigraph
<p>Given a directed multigraph with $n$ groups of edges and without cycles, can we find the path that minimizes the largest of the sum of weights of each group? All weights are non-negative integers in the range 0..30,000.</p>&#xA;&#xA;<p>Let me put an example for $n=2$ groups to understand it better:</p>&#xA;&#xA;<p>...
algorithms graphs weighted graphs
1
Finding path that minimizes largest of the sum of weights of each group in a directed multigraph -- (algorithms graphs weighted graphs) <p>Given a directed multigraph with $n$ groups of edges and without cycles, can we find the path that minimizes the largest of the sum of weights of each group? All weights are non-ne...
habedi/stack-exchange-dataset
69,186
What these simple rules of logical implications mean
<p>Their are many rules of logics, predicate calculus, inferences and syllogisms which haunt me always. It feels better when I find some sensible name to particular rule which also gives me intuition about the meaning of the rule. Recently I came across some simple tautologies:</p>&#xA;&#xA;<ol>&#xA;<li>$((x \rightarro...
logic propositional logic
1
What these simple rules of logical implications mean -- (logic propositional logic) <p>Their are many rules of logics, predicate calculus, inferences and syllogisms which haunt me always. It feels better when I find some sensible name to particular rule which also gives me intuition about the meaning of the rule. Recen...
habedi/stack-exchange-dataset
69,192
Comparison Procedure in Robinson's Unification Algorithm
<p>I'm studying the Principal Type (PT) Algorithm in Basic Simple Type Theory by J. Roger Hindley.&#xA;One step to find the PT of a term is the Unification of types. The Robinson's Unification Algorithm uses a comparison procedure like as follow:</p>&#xA;&#xA;<p>Comparison Procedure</p>&#xA;&#xA;<p>Given a pair $(u, v)...
lambda calculus type inference unification
1
Comparison Procedure in Robinson's Unification Algorithm -- (lambda calculus type inference unification) <p>I'm studying the Principal Type (PT) Algorithm in Basic Simple Type Theory by J. Roger Hindley.&#xA;One step to find the PT of a term is the Unification of types. The Robinson's Unification Algorithm uses a compa...
habedi/stack-exchange-dataset