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
98,405
Are hash functions really quantum resistant for commitment schemes?
<p>It is commonly stated that hash functions remain secure in a post quantum world, the justification being that a quantum computer only has the advantage of Grover's search to give it a quadratic speedup.</p>&#xA;&#xA;<p>However, there is active research into, for example, commitments such as <a href="https://eprint.i...
hash quantum computing
1
Are hash functions really quantum resistant for commitment schemes? -- (hash quantum computing) <p>It is commonly stated that hash functions remain secure in a post quantum world, the justification being that a quantum computer only has the advantage of Grover's search to give it a quadratic speedup.</p>&#xA;&#xA;<p>Ho...
habedi/stack-exchange-dataset
98,406
Does Assembly Language depend on an Assembler or the family of processor?
<p>From what I understand, the x86 family of processors understands the same instruction set and x86-32, x86-16 machine code can be executed by an x-86-64 processor because of backwards compatibility.</p>&#xA;&#xA;<p>Now since Machine Code is usually produced from Assembly Language and we use an assembler for that purp...
computer architecture
1
Does Assembly Language depend on an Assembler or the family of processor? -- (computer architecture) <p>From what I understand, the x86 family of processors understands the same instruction set and x86-32, x86-16 machine code can be executed by an x-86-64 processor because of backwards compatibility.</p>&#xA;&#xA;<p>No...
habedi/stack-exchange-dataset
98,411
How can I solve the recurrence $T(n) = 4T(n/2) + n^2\log^2n$? (without master theorem)
<p>I can not find the appropriate variable to change the second part <span class="math-container">$n^2\mathrm{log}^2n$</span>.</p>&#xA;
asymptotics recurrence relation
1
How can I solve the recurrence $T(n) = 4T(n/2) + n^2\log^2n$? (without master theorem) -- (asymptotics recurrence relation) <p>I can not find the appropriate variable to change the second part <span class="math-container">$n^2\mathrm{log}^2n$</span>.</p>&#xA;
habedi/stack-exchange-dataset
98,416
PDA to accept language with more a's than b's and c's
<p>My question is similar to <a href="https://stackoverflow.com/questions/9930091/pda-to-accept-a-language-of-strings-containing-more-as-than-bs">this</a> one. I was wondering if a PDA exists, that accepts any words containing a's, b's and c's in a random order, where the total amount of a's is higher than the amount o...
formal languages automata context free pushdown automata
1
PDA to accept language with more a's than b's and c's -- (formal languages automata context free pushdown automata) <p>My question is similar to <a href="https://stackoverflow.com/questions/9930091/pda-to-accept-a-language-of-strings-containing-more-as-than-bs">this</a> one. I was wondering if a PDA exists, that accept...
habedi/stack-exchange-dataset
98,419
Is distinguishing Hadamard matrices _really_ NP-hard?
<p>In a few different places ( <a href="http://www.ams.org/journals/mcom/2004-73-246/S0025-5718-03-01539-4/S0025-5718-03-01539-4.pdf" rel="nofollow noreferrer">http://www.ams.org/journals/mcom/2004-73-246/S0025-5718-03-01539-4/S0025-5718-03-01539-4.pdf</a> and <a href="https://books.google.com/books?id=qYYKBwAAQBAJ&amp...
np complete reference request graph isomorphism
1
Is distinguishing Hadamard matrices _really_ NP-hard? -- (np complete reference request graph isomorphism) <p>In a few different places ( <a href="http://www.ams.org/journals/mcom/2004-73-246/S0025-5718-03-01539-4/S0025-5718-03-01539-4.pdf" rel="nofollow noreferrer">http://www.ams.org/journals/mcom/2004-73-246/S0025-57...
habedi/stack-exchange-dataset
98,427
Finding recurrence relations for dynamic programming algorithms
<p>Consider a function <span class="math-container">$f(n)$</span> whose definition requires one to compute <span class="math-container">$f(1),f(2),..f(n-1)$</span> in order to evaluate <span class="math-container">$f(n)$</span>. Suppose that some algorithm to compute <span class="math-container">$f(n)$</span> has time ...
dynamic programming recurrence relation
1
Finding recurrence relations for dynamic programming algorithms -- (dynamic programming recurrence relation) <p>Consider a function <span class="math-container">$f(n)$</span> whose definition requires one to compute <span class="math-container">$f(1),f(2),..f(n-1)$</span> in order to evaluate <span class="math-containe...
habedi/stack-exchange-dataset
98,437
Correctness proof for greedy algorithm based on ratio
<p>I've an issue stated as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>We have 10000 jobs to do, each with some length <span class="math-container">$l_i$</span> and weight&#xA; (importance) <span class="math-container">$w_i$</span>. Our goal is to arrange the schedule of doing these&#xA; jobs (in other words, the ord...
algorithms correctness proof greedy algorithms scheduling
1
Correctness proof for greedy algorithm based on ratio -- (algorithms correctness proof greedy algorithms scheduling) <p>I've an issue stated as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>We have 10000 jobs to do, each with some length <span class="math-container">$l_i$</span> and weight&#xA; (importance) <span class=...
habedi/stack-exchange-dataset
98,449
Are subsets of $PSPACE$ closed under common operations
<p>By "subsets of <span class="math-container">$PSPACE$</span>" I am referring to classes like <span class="math-container">$SPACE(n^k)$</span> for some constant <span class="math-container">$k$</span> (e.g. <span class="math-container">$k = 42$</span>).</p>&#xA;&#xA;<p>Under the union, intersection, and concatenation ...
complexity theory
1
Are subsets of $PSPACE$ closed under common operations -- (complexity theory) <p>By "subsets of <span class="math-container">$PSPACE$</span>" I am referring to classes like <span class="math-container">$SPACE(n^k)$</span> for some constant <span class="math-container">$k$</span> (e.g. <span class="math-container">$k = ...
habedi/stack-exchange-dataset
98,459
Can a node of Radix tree which represents a valid key have one child?
<p>Wikipedia says:</p>&#xA;&#xA;<blockquote>&#xA; <p>a radix tree is a data structure that represents a space-optimized trie (prefix tree) in which each node that is the only child is merged with its parent.</p>&#xA;</blockquote>&#xA;&#xA;<p>Now they are situations where the parent of the child represent a valid key i...
trees
1
Can a node of Radix tree which represents a valid key have one child? -- (trees) <p>Wikipedia says:</p>&#xA;&#xA;<blockquote>&#xA; <p>a radix tree is a data structure that represents a space-optimized trie (prefix tree) in which each node that is the only child is merged with its parent.</p>&#xA;</blockquote>&#xA;&#xA...
habedi/stack-exchange-dataset
98,460
Why cannot match $ Bool \equiv Bool $ with $ refl $ while $1 \equiv 1$ can?
<p>This code depends on agda-stdlib:</p>&#xA;&#xA;<pre><code>{-# OPTIONS --without-K #-}&#xA;open import Data.Nat&#xA;open import Data.Bool&#xA;&#xA;open import Relation.Binary.PropositionalEquality&#xA;&#xA;-- this code doesn't check, cannot match e with refl&#xA;why : (e : Bool ≡ Bool) -&gt; ℕ&#xA;why refl = zero&#xA...
proof assistants
1
Why cannot match $ Bool \equiv Bool $ with $ refl $ while $1 \equiv 1$ can? -- (proof assistants) <p>This code depends on agda-stdlib:</p>&#xA;&#xA;<pre><code>{-# OPTIONS --without-K #-}&#xA;open import Data.Nat&#xA;open import Data.Bool&#xA;&#xA;open import Relation.Binary.PropositionalEquality&#xA;&#xA;-- this code d...
habedi/stack-exchange-dataset
98,463
How does one formally show that two lambda functions are $\alpha$ equivalent?
<p>I was going through <a href="http://fsl.cs.illinois.edu/images/7/75/CS522-Fall-2018-Lambda-slides.pdf" rel="nofollow noreferrer">the following slides</a> and I wanted to show the following:</p>&#xA;&#xA;<p><span class="math-container">$$ \lambda x. x \equiv_{\alpha} \lambda y . y$$</span></p>&#xA;&#xA;<p>formally. T...
programming languages lambda calculus functional programming
1
How does one formally show that two lambda functions are $\alpha$ equivalent? -- (programming languages lambda calculus functional programming) <p>I was going through <a href="http://fsl.cs.illinois.edu/images/7/75/CS522-Fall-2018-Lambda-slides.pdf" rel="nofollow noreferrer">the following slides</a> and I wanted to sho...
habedi/stack-exchange-dataset
98,478
Merge Recurrence Analysis
<p>Say I have a dynamic array of the proper length <span class="math-container">$n$</span>. A sort pivot is given.</p>&#xA;&#xA;<p>I run the sort algorithm, wait, and get <span class="math-container">$j$</span> unbalanced pivots. Is the time complexity <span class="math-container">$O(n\log n)$</span> or has it destabil...
sorting
1
Merge Recurrence Analysis -- (sorting) <p>Say I have a dynamic array of the proper length <span class="math-container">$n$</span>. A sort pivot is given.</p>&#xA;&#xA;<p>I run the sort algorithm, wait, and get <span class="math-container">$j$</span> unbalanced pivots. Is the time complexity <span class="math-container"...
habedi/stack-exchange-dataset
98,481
Understanding how quicksort operates
<p>I am having a hard time understanding the quick sort partition operation.&#xA;I understand <em>what partition is supposed to do</em>, I just don't understand <em>how partition does it</em>. Specifically, I don't understand how the two subarrays (q-1, q+1) are constructed.&#xA;I have looked at various other SE articl...
algorithms algorithm analysis sorting quicksort
1
Understanding how quicksort operates -- (algorithms algorithm analysis sorting quicksort) <p>I am having a hard time understanding the quick sort partition operation.&#xA;I understand <em>what partition is supposed to do</em>, I just don't understand <em>how partition does it</em>. Specifically, I don't understand how ...
habedi/stack-exchange-dataset
98,483
Could someone check my recursive program correctness proof that returns $F(x, y) \rightarrow x + y$?
<p><a href="https://i.stack.imgur.com/YwmRN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YwmRN.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>For <span class="math-container">$k \in \mathbb N$</span>, we define <span class="math-container">$Q(k)$</span> as follows:</p>&#xA;&#xA;<p><s...
program correctness
1
Could someone check my recursive program correctness proof that returns $F(x, y) \rightarrow x + y$? -- (program correctness) <p><a href="https://i.stack.imgur.com/YwmRN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YwmRN.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>For <span class=...
habedi/stack-exchange-dataset
98,488
Alan Turing Halting Problem with C code which check how TM works
<p>If we want to write to write a C code, to check if halting problem halts on a given input, how it will be ? I tried this code as shown below but stuck</p>&#xA;&#xA;<blockquote>&#xA; <p>int main(int argc, char * argv[])</p>&#xA; &#xA; <p>{</p>&#xA;&#xA;<pre><code>if(argc &lt; 2){ printf("Please input an executable...
turing machines automata
1
Alan Turing Halting Problem with C code which check how TM works -- (turing machines automata) <p>If we want to write to write a C code, to check if halting problem halts on a given input, how it will be ? I tried this code as shown below but stuck</p>&#xA;&#xA;<blockquote>&#xA; <p>int main(int argc, char * argv[])</p...
habedi/stack-exchange-dataset
98,492
How to reduce a problem?
<p>I am a bit confused on how to reduce a problem. I'll give an example:&#xA;Let's say there is a problem called HALTEMPTY and we know it is undecidable.</p>&#xA;&#xA;<ul>&#xA;<li><span class="math-container">$HALTEMPTY_{TM} = \{\langle M\rangle \mid M \text{ is a Turing Machine that halts on input } \varepsilon\}$</sp...
computability reductions undecidability proof techniques
1
How to reduce a problem? -- (computability reductions undecidability proof techniques) <p>I am a bit confused on how to reduce a problem. I'll give an example:&#xA;Let's say there is a problem called HALTEMPTY and we know it is undecidable.</p>&#xA;&#xA;<ul>&#xA;<li><span class="math-container">$HALTEMPTY_{TM} = \{\lan...
habedi/stack-exchange-dataset
98,497
Karp hardness of a diameter-decreasing planted clique
<p>A diameter-decreasing planted clique in an undirected graph <span class="math-container">$G(V,E)$</span> is a set of vertices <span class="math-container">$\mathcal{C}\subseteq V$</span> such that if we add all the missing edges between any pair of vertices in <span class="math-container">$\mathcal{C}$</span> to tur...
np complete np hard np
1
Karp hardness of a diameter-decreasing planted clique -- (np complete np hard np) <p>A diameter-decreasing planted clique in an undirected graph <span class="math-container">$G(V,E)$</span> is a set of vertices <span class="math-container">$\mathcal{C}\subseteq V$</span> such that if we add all the missing edges betwee...
habedi/stack-exchange-dataset
98,511
What is the relation between Computer Graphics, Discrete Geometry, and Complexity Theory?
<p>I am a master computer science student, and I am interested in both geometry and complexity theory.&#xA;So I would like to know what is the relations between discrete geometry, computer graphics, and complexity theory ? </p>&#xA;&#xA;<p>I know the answer partially but I would like to have a clear answer since I do l...
algorithms complexity theory computational geometry discrete mathematics graphics
1
What is the relation between Computer Graphics, Discrete Geometry, and Complexity Theory? -- (algorithms complexity theory computational geometry discrete mathematics graphics) <p>I am a master computer science student, and I am interested in both geometry and complexity theory.&#xA;So I would like to know what is the ...
habedi/stack-exchange-dataset
98,512
Can an alphabet be $\{ε\}$ or $\mathbb{N}$?
<p>Hopcroft says it is a finite nonempty set of symbols.</p>&#xA;&#xA;<p><span class="math-container">$\varepsilon$</span> (empty string) is not an ordinary symbol.<br>&#xA;<span class="math-container">$\mathbb{N}$</span> is not finite.<br>&#xA;So, no to both?</p>&#xA;&#xA;<p>On the other hand, I do not see why <span c...
formal languages
1
Can an alphabet be $\{ε\}$ or $\mathbb{N}$? -- (formal languages) <p>Hopcroft says it is a finite nonempty set of symbols.</p>&#xA;&#xA;<p><span class="math-container">$\varepsilon$</span> (empty string) is not an ordinary symbol.<br>&#xA;<span class="math-container">$\mathbb{N}$</span> is not finite.<br>&#xA;So, no to...
habedi/stack-exchange-dataset
98,516
Why is Dijkstra's Algorithm more popular compared to Grassfire algorithm?
<p>Consider algorithms to find shortest paths in a graph. The grassfire algorithm has a complexity of <code>O(|V|)</code> where <code>V</code> is the number of nodes or vertices. The Dijkstra's algorithm has a complexity of <code>O((|V| + |E|) * log(|V|))</code> where <code>E</code> is the number of edges. Compared to ...
algorithms graphs time complexity shortest path greedy algorithms
1
Why is Dijkstra's Algorithm more popular compared to Grassfire algorithm? -- (algorithms graphs time complexity shortest path greedy algorithms) <p>Consider algorithms to find shortest paths in a graph. The grassfire algorithm has a complexity of <code>O(|V|)</code> where <code>V</code> is the number of nodes or vertic...
habedi/stack-exchange-dataset
98,518
Are Bad churches inhabited?
<p>In type theory, some inductively defined data types allow you to prove absurdity. For example</p>&#xA;&#xA;<pre><code>type Bad a = MkBad (Bad a -&gt; a)&#xA;extract : Bad a -&gt; a&#xA;extract val@(MkBad f) = f val&#xA;absurd : a&#xA;absurd = extract (MkBad extract)&#xA;</code></pre>&#xA;&#xA;<p>Now, when you church...
programming languages type theory
1
Are Bad churches inhabited? -- (programming languages type theory) <p>In type theory, some inductively defined data types allow you to prove absurdity. For example</p>&#xA;&#xA;<pre><code>type Bad a = MkBad (Bad a -&gt; a)&#xA;extract : Bad a -&gt; a&#xA;extract val@(MkBad f) = f val&#xA;absurd : a&#xA;absurd = extract...
habedi/stack-exchange-dataset
98,523
Algorithm complexity similar to Selection Sort
<p>I'm working on an algorithm that takes an array of <span class="math-container">$N$</span> values and it will iterate through each of the values and in each of them iterate through the rest of the array to the right. So the first value will check <span class="math-container">$N-1$</span> positions, the next one will...
complexity theory time complexity
1
Algorithm complexity similar to Selection Sort -- (complexity theory time complexity) <p>I'm working on an algorithm that takes an array of <span class="math-container">$N$</span> values and it will iterate through each of the values and in each of them iterate through the rest of the array to the right. So the first v...
habedi/stack-exchange-dataset
98,527
Evaluating two different Algorithms, which one will scale better?
<p>I'm evaluating two different algorithms to choose one for my implementation, they just do calculations on top of arrays, get some input of <span class="math-container">$n$</span> elements, and produce some output of <span class="math-container">$m$</span> elements, and I'm looking for an opinion about which one will...
algorithms time complexity
1
Evaluating two different Algorithms, which one will scale better? -- (algorithms time complexity) <p>I'm evaluating two different algorithms to choose one for my implementation, they just do calculations on top of arrays, get some input of <span class="math-container">$n$</span> elements, and produce some output of <sp...
habedi/stack-exchange-dataset
98,529
In Agda's GADT, are "parameterized" and "indexed" different semantically?
<p>I know they have different scoping:</p>&#xA;<pre><code>data a (n : Set) : Set where&#xA; introA : a n&#xA;&#xA;data b : Set -&gt; Set where&#xA; introB : {n : Set} -&gt; b n&#xA;</code></pre>&#xA;<p>That's <strong>not</strong> what I'm caring about. Are they different semantically?</p>&#xA;
inductive datatypes agda
1
In Agda's GADT, are "parameterized" and "indexed" different semantically? -- (inductive datatypes agda) <p>I know they have different scoping:</p>&#xA;<pre><code>data a (n : Set) : Set where&#xA; introA : a n&#xA;&#xA;data b : Set -&gt; Set where&#xA; introB : {n : Set} -&gt; b n&#xA;</code></pre>&#xA;<p>That's <...
habedi/stack-exchange-dataset
98,533
Why this pattern matching fails in Agda?
<p>Consider function <code>wa''</code> (need natural number definition, either in stdlib or <code>Agda.Builtin.Nat</code>):</p>&#xA;&#xA;<pre><code>postulate comm : ∀ m n -&gt; m + n ≡ n + m&#xA;&#xA;wa'' : ∀ m n -&gt; wa (m + n) ≡ wa (n + m)&#xA;wa'' m n with comm n m&#xA;... | refl = { }0&#xA;</code></pre>&#xA...
unification agda
1
Why this pattern matching fails in Agda? -- (unification agda) <p>Consider function <code>wa''</code> (need natural number definition, either in stdlib or <code>Agda.Builtin.Nat</code>):</p>&#xA;&#xA;<pre><code>postulate comm : ∀ m n -&gt; m + n ≡ n + m&#xA;&#xA;wa'' : ∀ m n -&gt; wa (m + n) ≡ wa (n + m)&#xA;wa'' m n w...
habedi/stack-exchange-dataset
98,536
Visit all vertices of a graph
<p><a href="https://i.stack.imgur.com/xtoz7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xtoz7.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>I need to find the fastest route passing in all vertices</p>&#xA;&#xA;<ul>&#xA;<li>Each vertex is a class.</li>&#xA;<li>I can choose the numbe...
algorithms graphs search algorithms
1
Visit all vertices of a graph -- (algorithms graphs search algorithms) <p><a href="https://i.stack.imgur.com/xtoz7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xtoz7.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>I need to find the fastest route passing in all vertices</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
98,537
Checking if a kernel is valid
<p>The kernel is <span class="math-container">$K(x,z) = \sum_{i=1}^D (x_i+z_i)$</span> </p>&#xA;&#xA;<p>My approach was trying to express <span class="math-container">$K = \phi(x)^T\phi(z) = (x_1 x_2 ... x_D \quad 1 1 ...1)(1 1 ...1\quad z_1 z_2 ... z_D )^T$</span> where <span class="math-container">$\phi$</span> is 2...
machine learning kernel functions
1
Checking if a kernel is valid -- (machine learning kernel functions) <p>The kernel is <span class="math-container">$K(x,z) = \sum_{i=1}^D (x_i+z_i)$</span> </p>&#xA;&#xA;<p>My approach was trying to express <span class="math-container">$K = \phi(x)^T\phi(z) = (x_1 x_2 ... x_D \quad 1 1 ...1)(1 1 ...1\quad z_1 z_2 ... ...
habedi/stack-exchange-dataset
98,545
Which one is the correct way to change functional notation while solving recurrence relation?
<p>In CLRS 3rd edition P. No 86, the relation </p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$T(2^{n}) = 2T(2^{n/2}) + n$</span></p>&#xA;</blockquote>&#xA;&#xA;<p>is changed to </p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$S(n) = 2S(n/2) + n$</span></p>&#xA;</blockquote>&#xA;&#xA;<...
recurrence relation
1
Which one is the correct way to change functional notation while solving recurrence relation? -- (recurrence relation) <p>In CLRS 3rd edition P. No 86, the relation </p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$T(2^{n}) = 2T(2^{n/2}) + n$</span></p>&#xA;</blockquote>&#xA;&#xA;<p>is changed to </p>&#...
habedi/stack-exchange-dataset
98,551
Give a $3$-state DFA for $(01 \cup 1)^∗$
<p><a href="https://i.stack.imgur.com/ROEnE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ROEnE.jpg" alt="enter image description here"></a></p>&#xA;&#xA;<p>How do I change the design to accept the given language, because I think my DFA can accept <span class="math-container">$001$</span> as well. ...
finite automata
1
Give a $3$-state DFA for $(01 \cup 1)^∗$ -- (finite automata) <p><a href="https://i.stack.imgur.com/ROEnE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ROEnE.jpg" alt="enter image description here"></a></p>&#xA;&#xA;<p>How do I change the design to accept the given language, because I think my DFA ...
habedi/stack-exchange-dataset
98,563
Decidability of equivalence of two context free grammars
<p>I got a question regarding the decidability of equivalence of two context free grammars:</p>&#xA;&#xA;<blockquote>&#xA; <p>Construct a Turing machine that decides whether <span class="math-container">$L(G) = L(H)$</span>, where <span class="math-container">$G$</span> and <span class="math-container">$H$</span> are ...
reductions undecidability
1
Decidability of equivalence of two context free grammars -- (reductions undecidability) <p>I got a question regarding the decidability of equivalence of two context free grammars:</p>&#xA;&#xA;<blockquote>&#xA; <p>Construct a Turing machine that decides whether <span class="math-container">$L(G) = L(H)$</span>, where ...
habedi/stack-exchange-dataset
98,575
Proving correctness of search algorithms
<p>I've seen correctness proofs for other searching algorithms; however, for this particular algorithm: search in a row-wise and column wise sorted matrix, I'm not able to generate a proper proof. </p>&#xA;&#xA;<p>The algorithm is </p>&#xA;&#xA;<pre><code>Let x = element we're trying to search for in the matrix,&#xA;...
algorithms correctness proof searching
1
Proving correctness of search algorithms -- (algorithms correctness proof searching) <p>I've seen correctness proofs for other searching algorithms; however, for this particular algorithm: search in a row-wise and column wise sorted matrix, I'm not able to generate a proper proof. </p>&#xA;&#xA;<p>The algorithm is </...
habedi/stack-exchange-dataset
98,577
How do I determine the basic operation of this algorithm?
<p>Admissions:</p>&#xA;&#xA;<ul>&#xA;<li>Yes, this is a homework assignment.</li>&#xA;<li>No, this is not me trying to outsource my homework to the internet.</li>&#xA;</ul>&#xA;&#xA;<p>I am honestly fazed by my teacher's explanation of the "basic operation", and the internet is not helpful either. I get lists that say ...
algorithms algorithm analysis
1
How do I determine the basic operation of this algorithm? -- (algorithms algorithm analysis) <p>Admissions:</p>&#xA;&#xA;<ul>&#xA;<li>Yes, this is a homework assignment.</li>&#xA;<li>No, this is not me trying to outsource my homework to the internet.</li>&#xA;</ul>&#xA;&#xA;<p>I am honestly fazed by my teacher's explan...
habedi/stack-exchange-dataset
98,594
KMP - longest palindromic prefix
<p>I wanted to ask if there is a way to use KMP (Knuth-Morris-Pratt) algorithm to find the longest palindromic prefix of a word.</p>&#xA;&#xA;<p>I've seen this algorithm used for determining if a word is rotation of the other for example. We can concatenate first word with itself and look for a pattern which would be t...
algorithms search algorithms string matching
1
KMP - longest palindromic prefix -- (algorithms search algorithms string matching) <p>I wanted to ask if there is a way to use KMP (Knuth-Morris-Pratt) algorithm to find the longest palindromic prefix of a word.</p>&#xA;&#xA;<p>I've seen this algorithm used for determining if a word is rotation of the other for example...
habedi/stack-exchange-dataset
98,596
Check if two items are equal after replacing
<p>Let's say that an item is either a natural number or a list of items. Examples of items are:</p>&#xA;&#xA;<ul>&#xA;<li>1</li>&#xA;<li>[2]</li>&#xA;<li>[4, [3, 1], 3, 4]</li>&#xA;</ul>&#xA;&#xA;<p>A rule states that two items are equal. For example:</p>&#xA;&#xA;<ul>&#xA;<li>1 = 2</li>&#xA;<li>3 = [3, 1]</li>&#xA;<li...
algorithms equality smt solvers
1
Check if two items are equal after replacing -- (algorithms equality smt solvers) <p>Let's say that an item is either a natural number or a list of items. Examples of items are:</p>&#xA;&#xA;<ul>&#xA;<li>1</li>&#xA;<li>[2]</li>&#xA;<li>[4, [3, 1], 3, 4]</li>&#xA;</ul>&#xA;&#xA;<p>A rule states that two items are equal....
habedi/stack-exchange-dataset
98,605
What's wrong with this grammar
<p><span class="math-container">$L = \{ w : w \in \{a, b\}^* \land |w|_a = |w|_b\}$</span> where <span class="math-container">$|w|_a$</span> means number of <span class="math-container">$a$</span> in string <span class="math-container">$w$</span>.</p>&#xA;&#xA;<p>I came up with this grammar:</p>&#xA;&#xA;<p><span clas...
context free formal grammars
1
What's wrong with this grammar -- (context free formal grammars) <p><span class="math-container">$L = \{ w : w \in \{a, b\}^* \land |w|_a = |w|_b\}$</span> where <span class="math-container">$|w|_a$</span> means number of <span class="math-container">$a$</span> in string <span class="math-container">$w$</span>.</p>&#x...
habedi/stack-exchange-dataset
98,606
Proving equivalent definitions for MSTs
<p>I am working on the following homework exercise:</p>&#xA;&#xA;<p>Let <span class="math-container">$G = (V,E)$</span> be an undirected graph and <span class="math-container">$c: E \rightarrow \mathbb{R}$</span> it's cost function. Further let <span class="math-container">$T = (V,E')$</span> be a spanning tree in G.</...
graphs minimum spanning tree spanning trees
1
Proving equivalent definitions for MSTs -- (graphs minimum spanning tree spanning trees) <p>I am working on the following homework exercise:</p>&#xA;&#xA;<p>Let <span class="math-container">$G = (V,E)$</span> be an undirected graph and <span class="math-container">$c: E \rightarrow \mathbb{R}$</span> it's cost function...
habedi/stack-exchange-dataset
98,630
Regularity of language of words containing a square
<p><span class="math-container">$$L = \{w\mid w\text{ contains a substring of form }yy\text{, where }y\text{ is any non-empty string}\}.$$</span> Is this language regular? We do not know what <span class="math-container">$y$</span> looks like in advance. And why is this language regular or not regular?</p>&#xA;
formal languages regular languages
1
Regularity of language of words containing a square -- (formal languages regular languages) <p><span class="math-container">$$L = \{w\mid w\text{ contains a substring of form }yy\text{, where }y\text{ is any non-empty string}\}.$$</span> Is this language regular? We do not know what <span class="math-container">$y$</sp...
habedi/stack-exchange-dataset
98,631
In most locality sensitive hashing implemensions of SimHash, why is the cosine distance used and not the euclidean distance?
<p>In Chapter 3 of Mining of Massive Datasets, the basis of locality sensitive hashing is explained. They notably mention simhash for the cosine distance, where random hyperplanes are generated, and for each hyperplane, the projection of the vector to be hashed onto the hyperplane's normal is used for hashing the vecto...
hash linear algebra hashing nearest neighbour euclidean distance
1
In most locality sensitive hashing implemensions of SimHash, why is the cosine distance used and not the euclidean distance? -- (hash linear algebra hashing nearest neighbour euclidean distance) <p>In Chapter 3 of Mining of Massive Datasets, the basis of locality sensitive hashing is explained. They notably mention sim...
habedi/stack-exchange-dataset
98,637
Probability that a random hash from a universal family is injective
<p>This is a homework question, I don't want an actual answer, but rather guidance on how to obtain the correct answer. The question is as follows: </p>&#xA;&#xA;<p>In class we saw universal hashing as the solution to processing N elements in the range {0,1,...u-1}, arriving&#xA;one at a time. Using universal hashing w...
algorithms hashing pseudocode
1
Probability that a random hash from a universal family is injective -- (algorithms hashing pseudocode) <p>This is a homework question, I don't want an actual answer, but rather guidance on how to obtain the correct answer. The question is as follows: </p>&#xA;&#xA;<p>In class we saw universal hashing as the solution to...
habedi/stack-exchange-dataset
98,638
What does "Giving an overall running time" mean in this context?
<p>In the following image&#xA;<img src="https://i.stack.imgur.com/j57Eh.png" alt="click me for an image because I need 10 rep first"></p>&#xA;&#xA;<p>The author refers to an overall running time linear to |E|. But the author then says this is at most O(n^2). This seems contradictory because O(n^2) is quadratic time. Di...
algorithms
1
What does "Giving an overall running time" mean in this context? -- (algorithms) <p>In the following image&#xA;<img src="https://i.stack.imgur.com/j57Eh.png" alt="click me for an image because I need 10 rep first"></p>&#xA;&#xA;<p>The author refers to an overall running time linear to |E|. But the author then says this...
habedi/stack-exchange-dataset
98,655
Given a sorted dictionary of words, find order of precedence of letters
<p>This question is found at: <a href="https://www.geeksforgeeks.org/given-sorted-dictionary-find-precedence-characters/" rel="nofollow noreferrer">https://www.geeksforgeeks.org/given-sorted-dictionary-find-precedence-characters/</a></p>&#xA;&#xA;<p>Given a sorted dictionary (array of words) of an alien language, find ...
graphs data structures
1
Given a sorted dictionary of words, find order of precedence of letters -- (graphs data structures) <p>This question is found at: <a href="https://www.geeksforgeeks.org/given-sorted-dictionary-find-precedence-characters/" rel="nofollow noreferrer">https://www.geeksforgeeks.org/given-sorted-dictionary-find-precedence-ch...
habedi/stack-exchange-dataset
98,672
Strengths and limitations of arrays
<p>What are the strengths and limitations of arrays? What considerations go into choosing an array over another data structure, or vice-versa?</p>&#xA;
data structures arrays
1
Strengths and limitations of arrays -- (data structures arrays) <p>What are the strengths and limitations of arrays? What considerations go into choosing an array over another data structure, or vice-versa?</p>&#xA;
habedi/stack-exchange-dataset
98,684
Is there an algorithm that can find a solution that solves the most number of equations in a linear system of equations?
<p>My apologies if this question makes no sense. I am trying to find an algorithm that can solve a linear system of equations. Unlike most problems like this, this algorithm does not need to find a solution set that solves the entire set of equations. It only needs to solve the MOST number of these equations. For examp...
algorithms optimization linear programming program optimization
1
Is there an algorithm that can find a solution that solves the most number of equations in a linear system of equations? -- (algorithms optimization linear programming program optimization) <p>My apologies if this question makes no sense. I am trying to find an algorithm that can solve a linear system of equations. Unl...
habedi/stack-exchange-dataset
98,692
Define a length function over $A^{*} \leftarrow{N}$ such that $length(l)$ outputs the length of $l$
<p>Consider the following definitions</p>&#xA;&#xA;<p>LIST:</p>&#xA;&#xA;<p><span class="math-container">$\overline{nil} \ \ \ \ \ \frac{l}{a \ l}$</span> <span class="math-container">$a \in A$</span></p>&#xA;&#xA;<p><span class="math-container">$A^* = \mu \widehat{LIST}, \ A^{\infty} = v \widehat{LIST}$</span></p>&#x...
correctness proof formal methods
1
Define a length function over $A^{*} \leftarrow{N}$ such that $length(l)$ outputs the length of $l$ -- (correctness proof formal methods) <p>Consider the following definitions</p>&#xA;&#xA;<p>LIST:</p>&#xA;&#xA;<p><span class="math-container">$\overline{nil} \ \ \ \ \ \frac{l}{a \ l}$</span> <span class="math-containe...
habedi/stack-exchange-dataset
98,700
Can the compiler convert recursive algorithm into a dynamic programming
<p>So I was going through the idea behind dynamic programming (memoization), and thought of this question. </p>&#xA;&#xA;<p>Can a compiler convert any recursion into a table filling DP solution, of course given the hint(like some keyword or macro) from the programmer that the following recursive function can be solved ...
dynamic programming compilers
1
Can the compiler convert recursive algorithm into a dynamic programming -- (dynamic programming compilers) <p>So I was going through the idea behind dynamic programming (memoization), and thought of this question. </p>&#xA;&#xA;<p>Can a compiler convert any recursion into a table filling DP solution, of course given th...
habedi/stack-exchange-dataset
98,704
Is $\{\langle G,x\rangle \mid x\in L(G)\}$ context-free?
<p>Our problem is:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a context-free grammar <span class="math-container">$G$</span> and a string <span class="math-container">$x$</span>, decide whether <span class="math-container">$x\in L(G)$</span>.</p>&#xA;</blockquote>&#xA;&#xA;<p>Is this language itself context-free?</p>&#xA...
complexity theory context free
1
Is $\{\langle G,x\rangle \mid x\in L(G)\}$ context-free? -- (complexity theory context free) <p>Our problem is:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a context-free grammar <span class="math-container">$G$</span> and a string <span class="math-container">$x$</span>, decide whether <span class="math-container">$x\in ...
habedi/stack-exchange-dataset
98,716
Is this algorithm for partial ordering of sets complete and sound?
<p>I need to build a partial order tree of sets for analysis.</p>&#xA;&#xA;<p>Where the order is defined as <code>A &lt;= B &lt;=&gt; for all x in A, y in B, x &lt;= y</code>.</p>&#xA;&#xA;<p>I realized that if I pre-sort all the maximal and minimal elements of the sets, like this:</p>&#xA;&#xA;<pre><code>// A [1,3]&#x...
algorithms sorting partial order
1
Is this algorithm for partial ordering of sets complete and sound? -- (algorithms sorting partial order) <p>I need to build a partial order tree of sets for analysis.</p>&#xA;&#xA;<p>Where the order is defined as <code>A &lt;= B &lt;=&gt; for all x in A, y in B, x &lt;= y</code>.</p>&#xA;&#xA;<p>I realized that if I pr...
habedi/stack-exchange-dataset
98,730
MST Of An Almost Tree
<p>A graph <span class="math-container">$G = (V,E)$</span> is called an <em>almost tree</em> if it is connected and has most <span class="math-container">$n + c$</span> edges where <span class="math-container">$n = |V|$</span> and <span class="math-container">$c$</span> is a small constant number. How would I go about ...
graphs minimum spanning tree
1
MST Of An Almost Tree -- (graphs minimum spanning tree) <p>A graph <span class="math-container">$G = (V,E)$</span> is called an <em>almost tree</em> if it is connected and has most <span class="math-container">$n + c$</span> edges where <span class="math-container">$n = |V|$</span> and <span class="math-container">$c$<...
habedi/stack-exchange-dataset
98,746
Lamport logical clock: what does partial mean in the concept of `Partial ordering`?
<p>In lamport's paper[1], he define two concept <code>The partial ordering</code> and <code>The totally ordering</code>.</p>&#xA;&#xA;<ol>&#xA;<li><p>What does partial mean in <code>partial ordering</code>? </p>&#xA;&#xA;<p>assumption: this ordering only handle two cases, one is to order events happening in single proc...
algorithms distributed systems synchronization clocks
1
Lamport logical clock: what does partial mean in the concept of `Partial ordering`? -- (algorithms distributed systems synchronization clocks) <p>In lamport's paper[1], he define two concept <code>The partial ordering</code> and <code>The totally ordering</code>.</p>&#xA;&#xA;<ol>&#xA;<li><p>What does partial mean in <...
habedi/stack-exchange-dataset
98,748
Lamport logical clock: why event occurs in a process with smaller pid is treated earlier?
<p>In lamport's paper<a href="https://i.stack.imgur.com/cpZ64.jpg" rel="nofollow noreferrer">1</a>, he define global local timestamp, which is composed of process id and local lamport timestamp.</p>&#xA;&#xA;<p>This timestamp is used to order all the events in a distributed system.</p>&#xA;&#xA;<p><a href="https://i.st...
algorithms distributed systems synchronization clocks
1
Lamport logical clock: why event occurs in a process with smaller pid is treated earlier? -- (algorithms distributed systems synchronization clocks) <p>In lamport's paper<a href="https://i.stack.imgur.com/cpZ64.jpg" rel="nofollow noreferrer">1</a>, he define global local timestamp, which is composed of process id and l...
habedi/stack-exchange-dataset
98,755
Robustness of non-context-free proof against trivial manipulation
<p>First, we state here a theorem that is well-known in computability theory:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$L=\{xx\mid x\in\Sigma^*\}\notin CFL$</span> for every fixed <span class="math-container">$|\Sigma|\geq2$</span></p>&#xA;</blockquote>&#xA;&#xA;<p>And, the standard proof is usin...
complexity theory computability context free
1
Robustness of non-context-free proof against trivial manipulation -- (complexity theory computability context free) <p>First, we state here a theorem that is well-known in computability theory:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$L=\{xx\mid x\in\Sigma^*\}\notin CFL$</span> for every fixed <...
habedi/stack-exchange-dataset
98,756
Sum of unique elements in all sub-arrays of an array
<p>Given an array <span class="math-container">$A$</span>, sum the number of unique elements for each sub-array of <span class="math-container">$A$</span>. If <span class="math-container">$A = \{1, 2, 1, 3\}$</span> the desired sum is <span class="math-container">$18$</span>.</p>&#xA;&#xA;<p>Subarrays:</p>&#xA;&#xA;<p...
algorithms combinatorics arrays counting substrings
1
Sum of unique elements in all sub-arrays of an array -- (algorithms combinatorics arrays counting substrings) <p>Given an array <span class="math-container">$A$</span>, sum the number of unique elements for each sub-array of <span class="math-container">$A$</span>. If <span class="math-container">$A = \{1, 2, 1, 3\}$<...
habedi/stack-exchange-dataset
98,757
Big-Oh vs Theta in recurrence tree method
<p>I am solving this problem from <a href="http://web.stanford.edu/class/archive/cs/cs161/cs161.1168/lecture5.pdf" rel="nofollow noreferrer">here.</a></p>&#xA;&#xA;<p>The given relation is </p>&#xA;&#xA;<p><span class="math-container">$$T(n) = 2 T(\frac{n}{2}) + n^2, \, T(1) = 1$$</span></p>&#xA;&#xA;<p>The solution vi...
asymptotics recurrence relation
1
Big-Oh vs Theta in recurrence tree method -- (asymptotics recurrence relation) <p>I am solving this problem from <a href="http://web.stanford.edu/class/archive/cs/cs161/cs161.1168/lecture5.pdf" rel="nofollow noreferrer">here.</a></p>&#xA;&#xA;<p>The given relation is </p>&#xA;&#xA;<p><span class="math-container">$$T(n)...
habedi/stack-exchange-dataset
98,762
Is this an $NP$-complete problem: Product-2-Partition
<p>I want to prove the NP-hardness of some problem <strong>P</strong> in scheduling theory. I was trying with <strong>Partition</strong>, <strong>3-Partition</strong> and <strong>Subset product</strong>, But neither was successful.</p>&#xA;&#xA;<p>Now, I can reduce a problem, say <strong>PRODUCT-2-PARTITION</strong> to...
np hard partitions subset sum
1
Is this an $NP$-complete problem: Product-2-Partition -- (np hard partitions subset sum) <p>I want to prove the NP-hardness of some problem <strong>P</strong> in scheduling theory. I was trying with <strong>Partition</strong>, <strong>3-Partition</strong> and <strong>Subset product</strong>, But neither was successful....
habedi/stack-exchange-dataset
98,765
Algorithm to organize a tournament where the team componentes change each round
<p>So, I was tasked with creating an app that generates the schedule of a <em>doubles</em> tennis tournament (i.e., teams of two) in a way that, by the end of it, everyone would have played against the rest of the players. The trick is every team should change in each round so that not only everyone played against ever...
combinatorics greedy algorithms search problem algorithm design backtracking
1
Algorithm to organize a tournament where the team componentes change each round -- (combinatorics greedy algorithms search problem algorithm design backtracking) <p>So, I was tasked with creating an app that generates the schedule of a <em>doubles</em> tennis tournament (i.e., teams of two) in a way that, by the end of...
habedi/stack-exchange-dataset
98,772
Decidability of $E_{TM}$ and $A_{TM}$ for "erasing" Turing machines
<p>Why is the <span class="math-container">$A_{ETM}$</span> for a variant of a Turing machine (an erasing Turing machine), where changing a tape symbol to a nonblank symbol is prohibited, decidable? Why does the following diagonalization argument not work:</p>&#xA;&#xA;<blockquote>&#xA; <p>Assume <span class="math-con...
turing machines undecidability
1
Decidability of $E_{TM}$ and $A_{TM}$ for "erasing" Turing machines -- (turing machines undecidability) <p>Why is the <span class="math-container">$A_{ETM}$</span> for a variant of a Turing machine (an erasing Turing machine), where changing a tape symbol to a nonblank symbol is prohibited, decidable? Why does the foll...
habedi/stack-exchange-dataset
98,774
Loading a word from byte-addressable cache
<p>I have asked a similar question at stack-overflow, but then I found <a href="https://cs.stackexchange.com/questions/42214/loading-a-word-from-a-byte-addressed-cache?newreg=dcfaec2f23f744b49eb8cb491578caa0">this question</a> here, and figured it should go here instead..&#xA;<br/>So, my question is pretty much the sam...
cpu cache memory access
1
Loading a word from byte-addressable cache -- (cpu cache memory access) <p>I have asked a similar question at stack-overflow, but then I found <a href="https://cs.stackexchange.com/questions/42214/loading-a-word-from-a-byte-addressed-cache?newreg=dcfaec2f23f744b49eb8cb491578caa0">this question</a> here, and figured it ...
habedi/stack-exchange-dataset
98,777
Is the complement of a semidecidable (r.e.) language always a semidecidable (r.e.) language?
<p>Is the complement of every semi-decidable language a semi-decidable language?</p>&#xA;
turing machines
1
Is the complement of a semidecidable (r.e.) language always a semidecidable (r.e.) language? -- (turing machines) <p>Is the complement of every semi-decidable language a semi-decidable language?</p>&#xA;
habedi/stack-exchange-dataset
98,784
When is the concatenation of a language $L$ with $\Sigma^*$ regular?
<p>I've been looking at questions about the regular concatenation of two languages; one question said that the concatenation of <span class="math-container">$\{0^n1^n|n\geq 0\}$</span> and <span class="math-container">$\Sigma^*$</span> was regular (over the alphabet <span class="math-container">$\Sigma = \{0,1\}$</span...
formal languages automata
1
When is the concatenation of a language $L$ with $\Sigma^*$ regular? -- (formal languages automata) <p>I've been looking at questions about the regular concatenation of two languages; one question said that the concatenation of <span class="math-container">$\{0^n1^n|n\geq 0\}$</span> and <span class="math-container">$\...
habedi/stack-exchange-dataset
98,794
Solving T(n)=T(n−1)+2T(n−2) using substitution
<p>I am trying to solve the following Recurrence relation using substitution method and I am stuck almost half way.&#xA;I know the answer is 2^n but I can't reach it.</p>&#xA;&#xA;<p>At first, my question is:&#xA;Who decicdes the base cases? when do we take <code>T(n)=1 for n=1</code> or <code>T(n)=1 for n=0</code>?</p...
recurrence relation
1
Solving T(n)=T(n−1)+2T(n−2) using substitution -- (recurrence relation) <p>I am trying to solve the following Recurrence relation using substitution method and I am stuck almost half way.&#xA;I know the answer is 2^n but I can't reach it.</p>&#xA;&#xA;<p>At first, my question is:&#xA;Who decicdes the base cases? when d...
habedi/stack-exchange-dataset
98,799
Is there a reason to NOT wrap preprocessor macros in parens?
<p>I'm writing a design document for a macro expansion language that is specifically intended for arithmetic operations on integers. I've already determined that not wrapping macros with parens can lead to unexpected behavior. Rather than expect users to practice impeccable code hygiene, implementing automatic parens w...
language design
1
Is there a reason to NOT wrap preprocessor macros in parens? -- (language design) <p>I'm writing a design document for a macro expansion language that is specifically intended for arithmetic operations on integers. I've already determined that not wrapping macros with parens can lead to unexpected behavior. Rather than...
habedi/stack-exchange-dataset
98,807
Which Peterson’s Solution is right?
<p>I have seen two different Peterson’s Solution to mutual exclusion, one is from <em>Modern Operating Systems</em>:</p>&#xA;&#xA;<pre><code>#define FALSE 0&#xA;#define TRUE 1&#xA;#define N 2&#xA;&#xA;int turn;&#xA;int interested[N];&#xA;&#xA;void enter_region(int process)&#xA;{&#xA; int other;&#xA; other = 1 - p...
operating systems concurrency
1
Which Peterson’s Solution is right? -- (operating systems concurrency) <p>I have seen two different Peterson’s Solution to mutual exclusion, one is from <em>Modern Operating Systems</em>:</p>&#xA;&#xA;<pre><code>#define FALSE 0&#xA;#define TRUE 1&#xA;#define N 2&#xA;&#xA;int turn;&#xA;int interested[N];&#xA;&#xA;void e...
habedi/stack-exchange-dataset
98,812
Is there a model of computation based on discrete event dynamic systems?
<p>I asked <a href="https://math.stackexchange.com/questions/2555997/event-based-rather-than-flow-based-systems">a question here</a> about <a href="https://en.wikipedia.org/wiki/Discrete_event_dynamic_system" rel="nofollow noreferrer">discrete event dynamic systems</a>. They are systems whose state evolution depends on...
computation models
1
Is there a model of computation based on discrete event dynamic systems? -- (computation models) <p>I asked <a href="https://math.stackexchange.com/questions/2555997/event-based-rather-than-flow-based-systems">a question here</a> about <a href="https://en.wikipedia.org/wiki/Discrete_event_dynamic_system" rel="nofollow ...
habedi/stack-exchange-dataset
98,814
Floating point number fractions excercise
<p>During my preparation for an exam, I've come across an exercise that was focused on precision calculation with floating point numbers. It goes like this:</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider the expression : <span class="math-container">$$\frac{1}{1-x}-\frac{1}{1+x}, x\neq \pm1$$</span>&#xA; For what range o...
floating point
1
Floating point number fractions excercise -- (floating point) <p>During my preparation for an exam, I've come across an exercise that was focused on precision calculation with floating point numbers. It goes like this:</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider the expression : <span class="math-container">$$\frac{1}{...
habedi/stack-exchange-dataset
98,832
Trying to do HW - not understanding what this author means by giving an efficient algorithm
<p>In this question, what exactly are they trying to ask? I.e. in the trivial case, just travel 200 miles regardless of how many miles posts there are. The penalty is always 0. What are my constraints? Am I missing something from this question that is giving me trouble about what the author means??</p>&#xA;&#xA;<p>See...
algorithms
1
Trying to do HW - not understanding what this author means by giving an efficient algorithm -- (algorithms) <p>In this question, what exactly are they trying to ask? I.e. in the trivial case, just travel 200 miles regardless of how many miles posts there are. The penalty is always 0. What are my constraints? Am I miss...
habedi/stack-exchange-dataset
98,835
Why Does The Division Alorithim Need [Register Size] + 1 Iterations
<p>Following this <a href="https://imgur.com/a/3yGZnLL" rel="nofollow noreferrer">flow diagram</a> for division hardware I made a program to "simulate" division on <span class="math-container">$N^+$</span>.</p>&#xA;&#xA;<pre><code># 4 bit version&#xA;def div(dividend, divisor)&#xA; quotient = 0&#xA; remainder = divid...
algorithms arithmetic memory hardware
1
Why Does The Division Alorithim Need [Register Size] + 1 Iterations -- (algorithms arithmetic memory hardware) <p>Following this <a href="https://imgur.com/a/3yGZnLL" rel="nofollow noreferrer">flow diagram</a> for division hardware I made a program to "simulate" division on <span class="math-container">$N^+$</span>.</p...
habedi/stack-exchange-dataset
98,844
Karp hardness of directed monochromatic triangle problem
<p><a href="https://en.wikipedia.org/wiki/Monochromatic_triangle" rel="nofollow noreferrer">Monochromatic problem</a> is a classic NP-complete problem.</p>&#xA;<p>Does the complexity stay NP-complete if we use directed graph?</p>&#xA;<p><strong>DIRECTED MONOCHROMATIC TRIANGLE</strong> problem:</p>&#xA;<blockquote>&#xA;...
graphs np complete np hard np partitions
1
Karp hardness of directed monochromatic triangle problem -- (graphs np complete np hard np partitions) <p><a href="https://en.wikipedia.org/wiki/Monochromatic_triangle" rel="nofollow noreferrer">Monochromatic problem</a> is a classic NP-complete problem.</p>&#xA;<p>Does the complexity stay NP-complete if we use directe...
habedi/stack-exchange-dataset
98,848
Does co-inductive and co-recursive types also have their recursors?
<p>I'm new to type theory, and recently read introductory materials where dependent type are discussed. One of my friend asked me, "Those dependent types are having recursors &amp; 'inductors'(dependent eliminators), but how about those types that is co-inductive/co-recursive?"</p>&#xA;&#xA;<p>Some related example is m...
type theory dependent types coinduction
1
Does co-inductive and co-recursive types also have their recursors? -- (type theory dependent types coinduction) <p>I'm new to type theory, and recently read introductory materials where dependent type are discussed. One of my friend asked me, "Those dependent types are having recursors &amp; 'inductors'(dependent elim...
habedi/stack-exchange-dataset
98,860
Bounded Quantification: Full F<: intuition
<p>I'm currently looking into Chapter 26 of <a href="https://www.cis.upenn.edu/~bcpierce/tapl/" rel="nofollow noreferrer">Types and Programming Languages</a> and am a bit confused by the "intuition" for <em>Full F&lt;:</em> (p. 395):</p>&#xA;&#xA;<blockquote>&#xA; <p>A type T = ∀X&lt;:T1.T2 describes a collection of f...
programming languages type theory
1
Bounded Quantification: Full F<: intuition -- (programming languages type theory) <p>I'm currently looking into Chapter 26 of <a href="https://www.cis.upenn.edu/~bcpierce/tapl/" rel="nofollow noreferrer">Types and Programming Languages</a> and am a bit confused by the "intuition" for <em>Full F&lt;:</em> (p. 395):</p>&...
habedi/stack-exchange-dataset
98,863
“Left identity” of Monad laws in Haskell is wrong
<p><a href="https://wiki.haskell.org/Monad_laws" rel="nofollow noreferrer">Monad laws in Haskell</a></p>&#xA;&#xA;<pre><code>Left identity: return a &gt;&gt;= f ≡ f a&#xA;Right identity: m &gt;&gt;= return ≡ m&#xA;Associativity: (m &gt;&gt;= f) &gt;&gt;= g ≡ m &gt;&gt;= (\x -&gt; f x &gt;&gt;= g)&#xA;</code></pre>&#xA...
functional programming category theory haskell
1
“Left identity” of Monad laws in Haskell is wrong -- (functional programming category theory haskell) <p><a href="https://wiki.haskell.org/Monad_laws" rel="nofollow noreferrer">Monad laws in Haskell</a></p>&#xA;&#xA;<pre><code>Left identity: return a &gt;&gt;= f ≡ f a&#xA;Right identity: m &gt;&gt;= return ≡ m&#xA;Ass...
habedi/stack-exchange-dataset
98,866
Showing that an equivalence relation on programs need not be a congruence
<p>An optional exercise from <em>Programming Language Foundations</em> asks</p>&#xA;&#xA;<blockquote>&#xA; <p>Can you think of a relation on commands that is an equivalence but not&#xA; a congruence?</p>&#xA;</blockquote>&#xA;&#xA;<p>An equivalence here refers to an ordinary equivalence relation. A congruence refers ...
programming languages
1
Showing that an equivalence relation on programs need not be a congruence -- (programming languages) <p>An optional exercise from <em>Programming Language Foundations</em> asks</p>&#xA;&#xA;<blockquote>&#xA; <p>Can you think of a relation on commands that is an equivalence but not&#xA; a congruence?</p>&#xA;</blockqu...
habedi/stack-exchange-dataset
98,869
Understanding the "ordering of the four types of edges" in DFS
<p>The following is Exercise 22.3-6 from CLRS (Introduction to Algorithms, the 3rd edition; Page 611).</p>&#xA;&#xA;<blockquote>&#xA; <p>Show that in an undirected graph, classifying an edge <span class="math-container">$(u,v)$</span> as a tree edge or a back edge according to whether <span class="math-container">$(u,...
graphs terminology graph traversal
1
Understanding the "ordering of the four types of edges" in DFS -- (graphs terminology graph traversal) <p>The following is Exercise 22.3-6 from CLRS (Introduction to Algorithms, the 3rd edition; Page 611).</p>&#xA;&#xA;<blockquote>&#xA; <p>Show that in an undirected graph, classifying an edge <span class="math-contain...
habedi/stack-exchange-dataset
98,881
Is exponentiation in P?
<p>I think the following problem belong to class P, but I don't know how I can prove it, could somebody help me?</p>&#xA;&#xA;<ul>&#xA;<li>Inputs: two numbers <span class="math-container">$(a,b) \in \mathbb{N}$</span></li>&#xA;<li>Output: <span class="math-container">$a^b$</span></li>&#xA;</ul>&#xA;
complexity theory complexity classes
1
Is exponentiation in P? -- (complexity theory complexity classes) <p>I think the following problem belong to class P, but I don't know how I can prove it, could somebody help me?</p>&#xA;&#xA;<ul>&#xA;<li>Inputs: two numbers <span class="math-container">$(a,b) \in \mathbb{N}$</span></li>&#xA;<li>Output: <span class="ma...
habedi/stack-exchange-dataset
98,882
Choosing correct action in bottom up parsing
<p>Using grammar:</p>&#xA;&#xA;<p><span class="math-container">$ &#xA;S \to aABe \\&#xA;A \to bcA \mid c \\&#xA;B \to b&#xA;$</span></p>&#xA;&#xA;<p>to bottom parse a string <span class="math-container">$abcccde$</span>, the course of action would be:&#xA;<span class="math-container">$&#xA;\begin{array}{c|c|c|c}&#xA;\h...
compilers parsers
1
Choosing correct action in bottom up parsing -- (compilers parsers) <p>Using grammar:</p>&#xA;&#xA;<p><span class="math-container">$ &#xA;S \to aABe \\&#xA;A \to bcA \mid c \\&#xA;B \to b&#xA;$</span></p>&#xA;&#xA;<p>to bottom parse a string <span class="math-container">$abcccde$</span>, the course of action would be:&...
habedi/stack-exchange-dataset
98,890
Context-Free Grammar from this language
<p>I'm having difficulties with an exercise in a theoretical CS class.&#xA;The problem is:</p>&#xA;&#xA;<p>let <span class="math-container">$L_{2}$</span> be a language defined as follows: after every "a" come atleast two "b" or after every "b" comes atleast one "a". </p>&#xA;&#xA;<p>What is the CFG that creates <span ...
formal languages context free formal grammars
1
Context-Free Grammar from this language -- (formal languages context free formal grammars) <p>I'm having difficulties with an exercise in a theoretical CS class.&#xA;The problem is:</p>&#xA;&#xA;<p>let <span class="math-container">$L_{2}$</span> be a language defined as follows: after every "a" come atleast two "b" or ...
habedi/stack-exchange-dataset
98,891
Inorder Traversal of the Ternary Tree
<p>According to <a href="https://en.wikipedia.org/wiki/Tree_traversal#In-order_(LNR)" rel="nofollow noreferrer">wikipedia</a> , Definition of In-order Traversal on Binary Tree :-</p>&#xA;&#xA;<blockquote>&#xA;<pre><code>1) Check if the current node is empty or null.&#xA;2) Traverse the left subtree by recursively calli...
algorithms data structures trees
1
Inorder Traversal of the Ternary Tree -- (algorithms data structures trees) <p>According to <a href="https://en.wikipedia.org/wiki/Tree_traversal#In-order_(LNR)" rel="nofollow noreferrer">wikipedia</a> , Definition of In-order Traversal on Binary Tree :-</p>&#xA;&#xA;<blockquote>&#xA;<pre><code>1) Check if the current ...
habedi/stack-exchange-dataset
98,914
Complexity of finding Exact Size Cut-Sets in Bipartite Graphs
<p>I am interested in the problem of deciding if a cut-set of a given size <span class="math-container">$k$</span> (i.e. the number of edges crossing the partitions is <span class="math-container">$k$</span>) exists in a given bipartite graph (both the graph and <span class="math-container">$k$</span> are part of the i...
complexity theory graphs np complete np max cut
1
Complexity of finding Exact Size Cut-Sets in Bipartite Graphs -- (complexity theory graphs np complete np max cut) <p>I am interested in the problem of deciding if a cut-set of a given size <span class="math-container">$k$</span> (i.e. the number of edges crossing the partitions is <span class="math-container">$k$</spa...
habedi/stack-exchange-dataset
98,915
Number of steps in worst Case
<p>we have to run a song on a Walkman,for that we need 2 full batteries.Let s say we have a mixed set of 30 batteries (15 are emtpy and and 15 are full)&#xA;and then only way to test if the battery full or empty is to put them in the Walkman and try it out.we can not tell which one is empty or full (one we put inside o...
algorithms efficiency
1
Number of steps in worst Case -- (algorithms efficiency) <p>we have to run a song on a Walkman,for that we need 2 full batteries.Let s say we have a mixed set of 30 batteries (15 are emtpy and and 15 are full)&#xA;and then only way to test if the battery full or empty is to put them in the Walkman and try it out.we can...
habedi/stack-exchange-dataset
98,916
distinguishing between CTL* formulas $A[FG p]$ and $AFAG p$ using transition system
<p>It is to show, using a transition system, that the two formulas <span class="math-container">$A[FG p]$</span> and <span class="math-container">$AFAG p$</span> are <strong>not</strong> equivalent.</p>&#xA;&#xA;<p>For me, it seems strange that they are not equivalent.</p>&#xA;&#xA;<p>As the first one says that any com...
linear temporal logic temporal logic
1
distinguishing between CTL* formulas $A[FG p]$ and $AFAG p$ using transition system -- (linear temporal logic temporal logic) <p>It is to show, using a transition system, that the two formulas <span class="math-container">$A[FG p]$</span> and <span class="math-container">$AFAG p$</span> are <strong>not</strong> equival...
habedi/stack-exchange-dataset
98,923
Double floating precision exercise
<p>today I had to deal with this exercise:</p>&#xA;&#xA;<blockquote>&#xA; <p>If <span class="math-container">$x \approx y$</span>, we might expect some cancellation in computing <span class="math-container">$log(x)- log(y)$</span>. On the other hand, <span class="math-container">$log(x) - log(y) = log(\frac{x}{y})$</s...
floating point
1
Double floating precision exercise -- (floating point) <p>today I had to deal with this exercise:</p>&#xA;&#xA;<blockquote>&#xA; <p>If <span class="math-container">$x \approx y$</span>, we might expect some cancellation in computing <span class="math-container">$log(x)- log(y)$</span>. On the other hand, <span class="...
habedi/stack-exchange-dataset
98,932
How do we translate first order logic's universal quantifier (the $\forall$) and the existential quantifier (the $\exists$) to Prolog?
<p>I'm trying to convert some English statements to first order logic statements and I'm trying to use Prolog to verify the translations. My question is: how do I convert a first order logic statement (having <span class="math-container">$\forall$</span> and <span class="math-container">$\exists$</span> quantifiers) in...
first order logic prolog
1
How do we translate first order logic's universal quantifier (the $\forall$) and the existential quantifier (the $\exists$) to Prolog? -- (first order logic prolog) <p>I'm trying to convert some English statements to first order logic statements and I'm trying to use Prolog to verify the translations. My question is: h...
habedi/stack-exchange-dataset
98,935
Find the number of strings in the language $(∅∅^∗ + ∅)$
<p>Consider the language <span class="math-container">$L = \emptyset\emptyset^∗ + \emptyset$</span>.</p>&#xA;&#xA;<p>How many words does <span class="math-container">$L$</span> contain? Zero or one?</p>&#xA;&#xA;<p><em>Note</em>: <span class="math-container">$\emptyset^∗ =\{\epsilon\}$</span>.</p>&#xA;
regular languages regular expressions strings kleene star
1
Find the number of strings in the language $(∅∅^∗ + ∅)$ -- (regular languages regular expressions strings kleene star) <p>Consider the language <span class="math-container">$L = \emptyset\emptyset^∗ + \emptyset$</span>.</p>&#xA;&#xA;<p>How many words does <span class="math-container">$L$</span> contain? Zero or one?</p...
habedi/stack-exchange-dataset
98,958
Why did Alan Turing have to define computation before demonstrating undecidability?
<p>It seems to me that Turing could've just presented the following argument:</p>&#xA;&#xA;<p>Theorem: Given a computational model <span class="math-container">$\mathcal{M}$</span> capable of conditional branching and indeterminate repetition the halting problem of <span class="math-container">$\mathcal{M}$</span> is u...
undecidability halting problem
1
Why did Alan Turing have to define computation before demonstrating undecidability? -- (undecidability halting problem) <p>It seems to me that Turing could've just presented the following argument:</p>&#xA;&#xA;<p>Theorem: Given a computational model <span class="math-container">$\mathcal{M}$</span> capable of conditio...
habedi/stack-exchange-dataset
98,959
is This reduction possible?
<blockquote>&#xA; <p>If we have <span class="math-container">$L \in p$</span> and <span class="math-container">$L' \neq \emptyset$</span> and , <span class="math-container">$L' \neq \Sigma^*$</span> . is <span class="math-container">$L \leq^p L' $</span> ?</p>&#xA;</blockquote>&#xA;&#xA;<p>I read this question <a href...
reductions
1
is This reduction possible? -- (reductions) <blockquote>&#xA; <p>If we have <span class="math-container">$L \in p$</span> and <span class="math-container">$L' \neq \emptyset$</span> and , <span class="math-container">$L' \neq \Sigma^*$</span> . is <span class="math-container">$L \leq^p L' $</span> ?</p>&#xA;</blockquo...
habedi/stack-exchange-dataset
98,971
Confirmation of alternative correctness proof for Floyd-Warshall's all-pair shortest-path algorithm
<p>The most common proof for Floyd-Warshall's algorithm is an induction proof on the outer-most loop, which says</p>&#xA;&#xA;<p><span class="math-container">$\delta^k(i,j)=\begin{cases}&#xA;\min\{\delta^{k-1}(i,j),\delta^{k-1}(i,k)+\delta^{k-1}(k,j)\} &amp; \text{for}\,k\geq 1\\&#xA;w(i,j) &amp; \text{for}\,k=0\,\text...
shortest path correctness proof
1
Confirmation of alternative correctness proof for Floyd-Warshall's all-pair shortest-path algorithm -- (shortest path correctness proof) <p>The most common proof for Floyd-Warshall's algorithm is an induction proof on the outer-most loop, which says</p>&#xA;&#xA;<p><span class="math-container">$\delta^k(i,j)=\begin{cas...
habedi/stack-exchange-dataset
98,972
Why do pushdown automata use a stack?
<p>I'm taking a computer theory class and my professor told us that a pushdown automaton cannot use data structures other than a stack (like a queue or multiple stacks). Why is that?</p>&#xA;
automata pushdown automata computation models
1
Why do pushdown automata use a stack? -- (automata pushdown automata computation models) <p>I'm taking a computer theory class and my professor told us that a pushdown automaton cannot use data structures other than a stack (like a queue or multiple stacks). Why is that?</p>&#xA;
habedi/stack-exchange-dataset
98,975
Construct a Deterministic Pushdown Automaton for unequal number of elements
<p>Can anyone help me construct a deterministic PDA for the following language:</p>&#xA;&#xA;<p><span class="math-container">$$L=\{w\in(a,b)^* \mid \#_a(w)\neq \#_b(w)\}$$</span></p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/WZW9v.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WZW9v.jpg" alt="e...
context free pushdown automata
1
Construct a Deterministic Pushdown Automaton for unequal number of elements -- (context free pushdown automata) <p>Can anyone help me construct a deterministic PDA for the following language:</p>&#xA;&#xA;<p><span class="math-container">$$L=\{w\in(a,b)^* \mid \#_a(w)\neq \#_b(w)\}$$</span></p>&#xA;&#xA;<p><a href="http...
habedi/stack-exchange-dataset
98,990
why not just one header in TCP/IP?
<p>I was reading through the computer network fundamentals. I noticed that there are headers added at each layer in the OSI model. However, can we not have just one header above the App layer that defines the header details of every layer ? </p>&#xA;&#xA;<p>I would think answer would be No. But any reasons why ?</p>&#x...
computer networks tcp
1
why not just one header in TCP/IP? -- (computer networks tcp) <p>I was reading through the computer network fundamentals. I noticed that there are headers added at each layer in the OSI model. However, can we not have just one header above the App layer that defines the header details of every layer ? </p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
98,992
Big O and constants
<p>I've already asked this question on stack overflow, but guys have suggested me to ask my question here.</p>&#xA;&#xA;<p>Let's consider classic big O notation definition (<a href="http://www.phil.uu.nl/datastructuren/10-11/knuth_big_omicron.pdf" rel="nofollow noreferrer">proof link</a>):</p>&#xA;&#xA;<p>The <span cla...
complexity theory asymptotics
1
Big O and constants -- (complexity theory asymptotics) <p>I've already asked this question on stack overflow, but guys have suggested me to ask my question here.</p>&#xA;&#xA;<p>Let's consider classic big O notation definition (<a href="http://www.phil.uu.nl/datastructuren/10-11/knuth_big_omicron.pdf" rel="nofollow nor...
habedi/stack-exchange-dataset
99,007
how does $PATH$ being $NL$-complete help to prove $NL = coNL$
<p>There is a proof in Sipser showing that <span class="math-container">$NL = coNL$</span> (theorem 8.27 in the 3rd edition).</p>&#xA;&#xA;<p>In the proof idea, the first sentence is: "We show that <span class="math-container">$\overline{PATH}$</span> is in <span class="math-container">$NL$</span>, and thereby establis...
complexity theory
1
how does $PATH$ being $NL$-complete help to prove $NL = coNL$ -- (complexity theory) <p>There is a proof in Sipser showing that <span class="math-container">$NL = coNL$</span> (theorem 8.27 in the 3rd edition).</p>&#xA;&#xA;<p>In the proof idea, the first sentence is: "We show that <span class="math-container">$\overli...
habedi/stack-exchange-dataset
99,011
Coin Change Problem Recurrence Relation with one parameter
<p>I have been looking through the recursive formulation for the coin change problem <a href="http://www.algorithmist.com/index.php/Coin_Change#Recursive_Formulation" rel="nofollow noreferrer">here</a> and am wondering if it is possible to define the function <span class="math-container">$ C(N, m) $</span> in one param...
recurrence relation coin change
1
Coin Change Problem Recurrence Relation with one parameter -- (recurrence relation coin change) <p>I have been looking through the recursive formulation for the coin change problem <a href="http://www.algorithmist.com/index.php/Coin_Change#Recursive_Formulation" rel="nofollow noreferrer">here</a> and am wondering if it...
habedi/stack-exchange-dataset
99,019
Is the runtime of binary search big omega of logarithm of n?
<p>My question is that can we say that runtime of the binary search is <span class="math-container">$\Omega(\log n)$</span>? </p>&#xA;&#xA;<p>I know it is both <span class="math-container">$\Omega(1)$</span> and <span class="math-container">$O(1)$</span> for the best case, and <span class="math-container">$\Omega(\log ...
algorithm analysis time complexity asymptotics runtime analysis
1
Is the runtime of binary search big omega of logarithm of n? -- (algorithm analysis time complexity asymptotics runtime analysis) <p>My question is that can we say that runtime of the binary search is <span class="math-container">$\Omega(\log n)$</span>? </p>&#xA;&#xA;<p>I know it is both <span class="math-container">$...
habedi/stack-exchange-dataset
99,030
The min number of distinct sequence numbers required to ensure correct operation of the ARQ scheme is
<p>In a sliding window ARQ scheme, the transmitter's window size is N and the receiver's window size is M. The minimum number of distinct sequence numbers required to ensure correct operation of the ARQ scheme is</p>&#xA;&#xA;<ol>&#xA;<li>min(M,N)</li>&#xA;<li>max(M,N)</li>&#xA;<li>M+N</li>&#xA;<li>MN&#xA;Answer given ...
computer networks network flow
1
The min number of distinct sequence numbers required to ensure correct operation of the ARQ scheme is -- (computer networks network flow) <p>In a sliding window ARQ scheme, the transmitter's window size is N and the receiver's window size is M. The minimum number of distinct sequence numbers required to ensure correct ...
habedi/stack-exchange-dataset
99,039
What is a min-max theorem in graph theory?
<p>I'm currently studying a paper which uses extensively the term '<code>min-max theorems</code>' in graph theory, and claims to present a tool allowing to generalize these theorems. (here is the <a href="http://acta.bibl.u-szeged.hu/38618/1/math_041_fasc_001_002.pdf#page=65" rel="nofollow noreferrer">link</a> to the p...
graphs duality
1
What is a min-max theorem in graph theory? -- (graphs duality) <p>I'm currently studying a paper which uses extensively the term '<code>min-max theorems</code>' in graph theory, and claims to present a tool allowing to generalize these theorems. (here is the <a href="http://acta.bibl.u-szeged.hu/38618/1/math_041_fasc_0...
habedi/stack-exchange-dataset
99,041
Relationship between complexity classes XP and W[1]?
<p>I am reading the introductory chapter in <a href="http://parameterized-algorithms.mimuw.edu.pl/" rel="nofollow noreferrer">Parameterized Algorithms</a> by Cygan <em>et al.</em> and I am having some problems with the distinction between complexity classes <span class="math-container">$\mathsf{W[1]}$</span> and <span ...
complexity theory complexity classes parameterized complexity
1
Relationship between complexity classes XP and W[1]? -- (complexity theory complexity classes parameterized complexity) <p>I am reading the introductory chapter in <a href="http://parameterized-algorithms.mimuw.edu.pl/" rel="nofollow noreferrer">Parameterized Algorithms</a> by Cygan <em>et al.</em> and I am having some...
habedi/stack-exchange-dataset
99,045
Kosaraju with connections between SSCs (strongly connected components)
<p><em>First of all I did find similar questions here on Computer Science but nothing what would provide real answer for this problem.</em></p>&#xA;&#xA;<p><strong>I have a graph which i condense into SSC (strongly connected components) by Kosaraju's algorithm. Now what I need is to find connections between those SSCs....
algorithms graphs
1
Kosaraju with connections between SSCs (strongly connected components) -- (algorithms graphs) <p><em>First of all I did find similar questions here on Computer Science but nothing what would provide real answer for this problem.</em></p>&#xA;&#xA;<p><strong>I have a graph which i condense into SSC (strongly connected c...
habedi/stack-exchange-dataset
99,057
Is it possible to define a pairwise function that can either append to a tuple or make a tuple, potentially with nested tuples?
<p>I lack the vocabulary to appropriately express the question succinctly, so I apologize if the title question is confusing.</p>&#xA;&#xA;<p>Suppose you can define a binary infix operator that produces tuples, and you want this operator to be able to simultaneously:</p>&#xA;&#xA;<ol>&#xA;<li>Extend a tuple to arbitrar...
programming languages meta programming
1
Is it possible to define a pairwise function that can either append to a tuple or make a tuple, potentially with nested tuples? -- (programming languages meta programming) <p>I lack the vocabulary to appropriately express the question succinctly, so I apologize if the title question is confusing.</p>&#xA;&#xA;<p>Suppos...
habedi/stack-exchange-dataset
99,066
How to find sets of polynomially bounded numbers whose subset sums are different?
<p>Let <span class="math-container">$n$</span> be any positibe integer and set <span class="math-container">$N=\{1,\dots,n\}$</span>. Now select two arbitrary but different subsets of <span class="math-container">$N$</span>, say <span class="math-container">$S$</span> and <span class="math-container">$S'$</span>. We ar...
asymptotics sets polynomials subset sum upper bound
1
How to find sets of polynomially bounded numbers whose subset sums are different? -- (asymptotics sets polynomials subset sum upper bound) <p>Let <span class="math-container">$n$</span> be any positibe integer and set <span class="math-container">$N=\{1,\dots,n\}$</span>. Now select two arbitrary but different subsets ...
habedi/stack-exchange-dataset
99,070
Understanding Interval Schedulling problem requirement
<p>Here is a modification of the weighted interval scheduling problem.</p>&#xA;&#xA;<p>Given <span class="math-container">$n$</span> intervals by their end points <span class="math-container">$s_i$</span> and <span class="math-container">$t_i$</span> for <span class="math-container">$1 ≤ i ≤ n$</span>, I want to minimi...
algorithms
1
Understanding Interval Schedulling problem requirement -- (algorithms) <p>Here is a modification of the weighted interval scheduling problem.</p>&#xA;&#xA;<p>Given <span class="math-container">$n$</span> intervals by their end points <span class="math-container">$s_i$</span> and <span class="math-container">$t_i$</span...
habedi/stack-exchange-dataset
99,078
How to produce nonzero absolute differences between neighboring numbers on a circle as long as possible?
<p>I apologize for the lack of an even better title. The main reason I couldn't find a better one is because I have a problem that I cannot find reference anywhere. I am pretty sure it has a name, but I'm afraid I simply don't know it.</p>&#xA;<p>I'm given an algorithm that starts with four numbers <span class="math-co...
algorithms optimization
1
How to produce nonzero absolute differences between neighboring numbers on a circle as long as possible? -- (algorithms optimization) <p>I apologize for the lack of an even better title. The main reason I couldn't find a better one is because I have a problem that I cannot find reference anywhere. I am pretty sure it h...
habedi/stack-exchange-dataset