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
106,033
Is every X3SAT instance with no cycles satisfiable?
<p>Exactly 1 in 3 SAT (X3SAT) is a variation of the Boolean Satisfiability problem. Given a set of clauses, where each clause has three literals, is there an assignment such that in each clause exactly one literal is true? X3SAT is NP-hard even if we assume all literals are positive (monotone) and no two clauses have ...
satisfiability boolean algebra 3 sat constraint satisfaction bipartite graph
1
Is every X3SAT instance with no cycles satisfiable? -- (satisfiability boolean algebra 3 sat constraint satisfaction bipartite graph) <p>Exactly 1 in 3 SAT (X3SAT) is a variation of the Boolean Satisfiability problem. Given a set of clauses, where each clause has three literals, is there an assignment such that in each...
habedi/stack-exchange-dataset
106,040
Approximation ratio of greedy algorithm for makespan
<p>In the course notes for Stanford MS&amp;E-319: <a href="https://web.stanford.edu/class/msande319/lec1.pdf" rel="nofollow noreferrer">https://web.stanford.edu/class/msande319/lec1.pdf</a></p>&#xA;&#xA;<p>Lemma 5 is given as:</p>&#xA;&#xA;<p>The approximation factor of the modified greedy [scheduling] algorithm is 4/3...
algorithms approximation scheduling
1
Approximation ratio of greedy algorithm for makespan -- (algorithms approximation scheduling) <p>In the course notes for Stanford MS&amp;E-319: <a href="https://web.stanford.edu/class/msande319/lec1.pdf" rel="nofollow noreferrer">https://web.stanford.edu/class/msande319/lec1.pdf</a></p>&#xA;&#xA;<p>Lemma 5 is given as:...
habedi/stack-exchange-dataset
106,048
Regularity of a language contains more 1's than 0's
<p>The language of all bitstrings with more 1s than 0s, i.e.,</p>&#xA;&#xA;<p><span class="math-container">$ A = \{x: 2\Sigma_{i}^{|x|} x_{i} &gt; |x|\}$</span> is regular.</p>&#xA;&#xA;<p>I know I should apply Pumping Lemma and the proof as well, what I cannot understand is' the meaning of question itself. To be more ...
formal languages regular languages pumping lemma
1
Regularity of a language contains more 1's than 0's -- (formal languages regular languages pumping lemma) <p>The language of all bitstrings with more 1s than 0s, i.e.,</p>&#xA;&#xA;<p><span class="math-container">$ A = \{x: 2\Sigma_{i}^{|x|} x_{i} &gt; |x|\}$</span> is regular.</p>&#xA;&#xA;<p>I know I should apply Pum...
habedi/stack-exchange-dataset
106,056
The time complexity of finding the kth smallest number using buckets
<p>I've implemented kth smallest number using buckets representing the <code>current</code> nibble value of each element in the array where <code>current</code> is a value starting possibly at 64 (for 64 bits integers at most) and decrements each iteration by 4 (nibble size).</p>&#xA;&#xA;<p>I was wondering what is the...
algorithms time complexity arrays
1
The time complexity of finding the kth smallest number using buckets -- (algorithms time complexity arrays) <p>I've implemented kth smallest number using buckets representing the <code>current</code> nibble value of each element in the array where <code>current</code> is a value starting possibly at 64 (for 64 bits int...
habedi/stack-exchange-dataset
106,059
shortest form $s$ to $t$ stopping at $u$
<blockquote>&#xA; <p>Suppose you want to go from vertex <span class="math-container">$s$</span> to vertex <span class="math-container">$t$</span> in an unweighted graph <span class="math-container">$(V, E)$</span>, but you would like to stop by vextex <span class="math-container">$u$</span> if it is possible to do so ...
algorithms complexity theory graphs optimization
1
shortest form $s$ to $t$ stopping at $u$ -- (algorithms complexity theory graphs optimization) <blockquote>&#xA; <p>Suppose you want to go from vertex <span class="math-container">$s$</span> to vertex <span class="math-container">$t$</span> in an unweighted graph <span class="math-container">$(V, E)$</span>, but you w...
habedi/stack-exchange-dataset
106,066
What does the intersection symbol (∩) mean when applied to two non-set elements?
<p>I came across a piece of literature in which I saw the intersection symbol (∩) being used on two non-set elements in the definition of an equivalence relation; I have posted it below for reference. The elements in question are meant to represent different files on a computer. What could that intersection symbol mean...
sets
1
What does the intersection symbol (∩) mean when applied to two non-set elements? -- (sets) <p>I came across a piece of literature in which I saw the intersection symbol (∩) being used on two non-set elements in the definition of an equivalence relation; I have posted it below for reference. The elements in question are...
habedi/stack-exchange-dataset
106,069
what is the difference between Operating system and Window Systems?
<p>Quoting from Tannenbaum_Operating_Systems_Design :</p>&#xA;&#xA;<blockquote>&#xA; <p>On top of the operating system is the rest of the system software.&#xA; Here we find the command interpreter (shell), <strong>window systems</strong>,&#xA; compilers, editors, and similar application-independent programs. It&#xA;...
operating systems
1
what is the difference between Operating system and Window Systems? -- (operating systems) <p>Quoting from Tannenbaum_Operating_Systems_Design :</p>&#xA;&#xA;<blockquote>&#xA; <p>On top of the operating system is the rest of the system software.&#xA; Here we find the command interpreter (shell), <strong>window system...
habedi/stack-exchange-dataset
106,073
Sphere packing inequality for error-correcting codes
<p>i am wondering if the following inequality is correct:</p>&#xA;&#xA;<p>if a code allows repairing of no more than k errors (inclusive, included) and m is the number of information bits and r the check bits, then <span class="math-container">$$∑^k_{i=1}\binom{m+r}{i}+1≤2^r$$</span></p>&#xA;&#xA;<p>holds true?</p>&#xA...
information theory coding theory error correcting codes
1
Sphere packing inequality for error-correcting codes -- (information theory coding theory error correcting codes) <p>i am wondering if the following inequality is correct:</p>&#xA;&#xA;<p>if a code allows repairing of no more than k errors (inclusive, included) and m is the number of information bits and r the check bi...
habedi/stack-exchange-dataset
106,096
Do all DFA's containing an "accepting path containing a cycle" accept infinite languages?
<p>So I've seen this claim being made on different questions:</p>&#xA;&#xA;<p><a href="https://cs.stackexchange.com/questions/8982/do-self-loops-in-dfa-cause-infinite-languages">Do self-loops in DFA cause infinite languages?</a></p>&#xA;&#xA;<p>I'd like to find formal proof for this.</p>&#xA;&#xA;<p>I think I should al...
computability automata finite automata
1
Do all DFA's containing an "accepting path containing a cycle" accept infinite languages? -- (computability automata finite automata) <p>So I've seen this claim being made on different questions:</p>&#xA;&#xA;<p><a href="https://cs.stackexchange.com/questions/8982/do-self-loops-in-dfa-cause-infinite-languages">Do self-...
habedi/stack-exchange-dataset
106,097
Turing Machine that both halts and loops in NP
<p>This is in regards to a specific TM:</p>&#xA;&#xA;<p><span class="math-container">$UNIQUE: \{$</span> TM | TM loops on at least an input, and TM also halts on at least one input <span class="math-container">$\}$</span></p>&#xA;&#xA;<p>This is a play on the Halting Problem, where it basically combines <span class="ma...
complexity theory turing machines np hard
1
Turing Machine that both halts and loops in NP -- (complexity theory turing machines np hard) <p>This is in regards to a specific TM:</p>&#xA;&#xA;<p><span class="math-container">$UNIQUE: \{$</span> TM | TM loops on at least an input, and TM also halts on at least one input <span class="math-container">$\}$</span></p>&...
habedi/stack-exchange-dataset
106,098
Turing Machine which will double every 'b' in all inputted string
<p>I am trying to construct a Turing machine which will double every 'b' in all inputted strings over{c,b}.&#xA;How can I double 'b' in inputted string? because I cannot replace b with bb because one cell of tape can contain only one character.</p>&#xA;
turing machines
1
Turing Machine which will double every 'b' in all inputted string -- (turing machines) <p>I am trying to construct a Turing machine which will double every 'b' in all inputted strings over{c,b}.&#xA;How can I double 'b' in inputted string? because I cannot replace b with bb because one cell of tape can contain only on...
habedi/stack-exchange-dataset
106,106
Irregularity of language of prefixes of decimal expansion of pi
<p>Let <span class="math-container">$L_{\pi}$</span> be the language consisting of prefixes of the decimal expansion of <span class="math-container">$\pi$</span>:&#xA;<span class="math-container">$$L_\pi = \{3, 31, 314, 3141, 31415, 314159, \ldots\}.$$</span>&#xA;Prove that Lπ is not DFA-recognizable. You may use the f...
regular languages finite automata pumping lemma discrete mathematics
1
Irregularity of language of prefixes of decimal expansion of pi -- (regular languages finite automata pumping lemma discrete mathematics) <p>Let <span class="math-container">$L_{\pi}$</span> be the language consisting of prefixes of the decimal expansion of <span class="math-container">$\pi$</span>:&#xA;<span class="ma...
habedi/stack-exchange-dataset
106,109
Is a kind of reverse Kleene star of a context-free language context-free?
<p>Recently I had a question on one of my assignments asking to prove or disprove the following: </p>&#xA;&#xA;<p>Let <span class="math-container">$L$</span> be a language. If <span class="math-container">$L^*$</span> is context-free then <span class="math-container">$L$</span> is context-free.</p>&#xA;&#xA;<p>Now obvi...
context free kleene star
1
Is a kind of reverse Kleene star of a context-free language context-free? -- (context free kleene star) <p>Recently I had a question on one of my assignments asking to prove or disprove the following: </p>&#xA;&#xA;<p>Let <span class="math-container">$L$</span> be a language. If <span class="math-container">$L^*$</span...
habedi/stack-exchange-dataset
106,121
Can a greedy algorithm have more than one subproblems to solve after making greedy choice?
<p>For example:&#xA;<code>s = &lt;s1 s2 s3&gt;</code> is my problem,</p>&#xA;&#xA;<p>I make greedy choice <code>s2</code> and solve <code>s1</code> and <code>s3</code> in a greedy way.</p>&#xA;&#xA;<p>In CLRS, it was mentioned regarding "designing greedy algorithms"</p>&#xA;&#xA;<blockquote>&#xA; <p>Cast the optimizat...
algorithms greedy algorithms algorithm design
1
Can a greedy algorithm have more than one subproblems to solve after making greedy choice? -- (algorithms greedy algorithms algorithm design) <p>For example:&#xA;<code>s = &lt;s1 s2 s3&gt;</code> is my problem,</p>&#xA;&#xA;<p>I make greedy choice <code>s2</code> and solve <code>s1</code> and <code>s3</code> in a greed...
habedi/stack-exchange-dataset
106,135
How do I describe formally complexity of 2-sum problem algorithm?
<p>I have algorithm that finds if there are two elements in sorted array that have sum zero.</p>&#xA;&#xA;<pre><code>1.ZeroSumPair(A[1..n]) // A[1..n] &lt;-- sorted&#xA;2. l &lt;- 1, r &lt;- n&#xA;3. while(l &lt; r)&#xA;4. while(l &lt; r or A[l] + A[r] &gt; 0)&#xA;5. r--&#xA;6. if(A[l] + ...
algorithms algorithm analysis asymptotics
1
How do I describe formally complexity of 2-sum problem algorithm? -- (algorithms algorithm analysis asymptotics) <p>I have algorithm that finds if there are two elements in sorted array that have sum zero.</p>&#xA;&#xA;<pre><code>1.ZeroSumPair(A[1..n]) // A[1..n] &lt;-- sorted&#xA;2. l &lt;- 1, r &lt;- n&#xA;3. w...
habedi/stack-exchange-dataset
106,140
Is this problem NP-Complete (Bin packing with seperable items and penalty)?
<p>The problem is a bit like bin-packing, so I'll describe it with similar naming:</p>&#xA;&#xA;<ul>&#xA;<li><p>You have <span class="math-container">$N$</span> bins, with the same size, <span class="math-container">$V$</span>, where <span class="math-container">$V$</span> is a positive integer</p></li>&#xA;<li><p>This...
algorithms np complete reductions
1
Is this problem NP-Complete (Bin packing with seperable items and penalty)? -- (algorithms np complete reductions) <p>The problem is a bit like bin-packing, so I'll describe it with similar naming:</p>&#xA;&#xA;<ul>&#xA;<li><p>You have <span class="math-container">$N$</span> bins, with the same size, <span class="math-...
habedi/stack-exchange-dataset
106,145
Finding two languages satisfying conditions
<blockquote>&#xA; <p>Let <span class="math-container">$$E_{TM} = \left \{ \langle M\rangle \mid L(M) = \emptyset \right\}$$</span></p>&#xA; &#xA; <p>Prove that there are two languages <span class="math-container">$L_1, L_2$</span> such that </p>&#xA; &#xA; <ol>&#xA; <li><span class="math-container">$L_1, L_2 $</s...
formal languages turing machines computability
1
Finding two languages satisfying conditions -- (formal languages turing machines computability) <blockquote>&#xA; <p>Let <span class="math-container">$$E_{TM} = \left \{ \langle M\rangle \mid L(M) = \emptyset \right\}$$</span></p>&#xA; &#xA; <p>Prove that there are two languages <span class="math-container">$L_1, L_...
habedi/stack-exchange-dataset
106,149
Are all hypothetical machine models for calculating runing time of an alogrithm same?
<p>Im learning about time complexity analysis, and cant seem to figure out why do we consider a hypothetical machine that takes 1 unit of time for arithemitic and logical instructions and 1 unit of time to for assignment and return statements.</p>&#xA;&#xA;<p><strong>Q)</strong> why does it have to be 1 unit of time?</...
time complexity runtime analysis
1
Are all hypothetical machine models for calculating runing time of an alogrithm same? -- (time complexity runtime analysis) <p>Im learning about time complexity analysis, and cant seem to figure out why do we consider a hypothetical machine that takes 1 unit of time for arithemitic and logical instructions and 1 unit o...
habedi/stack-exchange-dataset
106,156
Under what conditions does the function C = f(A,B) satisfy H(C|A) = H(B)?
<p>Suppose we have a function <span class="math-container">$f$</span>,</p>&#xA;&#xA;<p><span class="math-container">$$&#xA;C = f(A,B),&#xA;$$</span></p>&#xA;&#xA;<p>where <span class="math-container">$A$</span>, <span class="math-container">$B$</span> and <span class="math-container">$C$</span> are random variables.</p...
information theory
1
Under what conditions does the function C = f(A,B) satisfy H(C|A) = H(B)? -- (information theory) <p>Suppose we have a function <span class="math-container">$f$</span>,</p>&#xA;&#xA;<p><span class="math-container">$$&#xA;C = f(A,B),&#xA;$$</span></p>&#xA;&#xA;<p>where <span class="math-container">$A$</span>, <span clas...
habedi/stack-exchange-dataset
106,164
How to represent calculable real numbers?
<p>Suppose I want to do arithmetic without any loss of precision. Floats and doubles are inappropriate. I want to use dynamic memory allocations to store any real number obtained after a finite amount of finite operations (addition, subtraction, multiplication, division), starting from natural numbers without ever losi...
arithmetic
1
How to represent calculable real numbers? -- (arithmetic) <p>Suppose I want to do arithmetic without any loss of precision. Floats and doubles are inappropriate. I want to use dynamic memory allocations to store any real number obtained after a finite amount of finite operations (addition, subtraction, multiplication, ...
habedi/stack-exchange-dataset
106,167
Prove/disprove - reverse topological sort transpose graph
<p>I need to prove or disprove the following statement:</p>&#xA;&#xA;<p><strong><em>"Let <span class="math-container">$G$</span> be a directed acyclic graph, and <span class="math-container">$v_1v_2...v_k$</span> a topological sort of <span class="math-container">$G$</span>.&#xA;Then <span class="math-container">$v_kv_...
algorithms graphs
1
Prove/disprove - reverse topological sort transpose graph -- (algorithms graphs) <p>I need to prove or disprove the following statement:</p>&#xA;&#xA;<p><strong><em>"Let <span class="math-container">$G$</span> be a directed acyclic graph, and <span class="math-container">$v_1v_2...v_k$</span> a topological sort of <spa...
habedi/stack-exchange-dataset
106,189
Is it possible to balance a already constructed un-balanced AVL tree, with no prior information of last insert?
<p>Im learning about tree data structures, and had a question that i couldnt find answer to so I came here.</p>&#xA;&#xA;<p>Usually when we balance a tree, we insert keys and keep checking balance factor, as soon as it exceeds the given limit of <code>(-1,0,1)</code> we immediately balance it and continue to insert key...
data structures trees avl trees
1
Is it possible to balance a already constructed un-balanced AVL tree, with no prior information of last insert? -- (data structures trees avl trees) <p>Im learning about tree data structures, and had a question that i couldnt find answer to so I came here.</p>&#xA;&#xA;<p>Usually when we balance a tree, we insert keys ...
habedi/stack-exchange-dataset
106,202
Whats the best way to sort a dataset into groups by using a facial recognition algorithm that compares only 2 images at a time?
<p>I have a facial recognition algorithm that compares two images A and B and returns the likelihood that they match.</p>&#xA;&#xA;<p>I also have 50,000 images, and I would like to sort these images into groups.</p>&#xA;&#xA;<p>Here's the immediate way I thought of to do this:</p>&#xA;&#xA;<ol>&#xA;<li>Start with image...
algorithms graphs sorting
1
Whats the best way to sort a dataset into groups by using a facial recognition algorithm that compares only 2 images at a time? -- (algorithms graphs sorting) <p>I have a facial recognition algorithm that compares two images A and B and returns the likelihood that they match.</p>&#xA;&#xA;<p>I also have 50,000 images, ...
habedi/stack-exchange-dataset
106,204
One counter automaton as a function
<p>We can associate a one counter finite automaton with a function <span class="math-container">$f:\Sigma^* \to \mathbb{N} \times \{0,1\}$</span>, where <span class="math-container">$f(x)=(n,b)$</span> describes the state where the automaton terminates when fed an input word <span class="math-container">$x \in \Sigma^*...
computability finite automata undecidability
1
One counter automaton as a function -- (computability finite automata undecidability) <p>We can associate a one counter finite automaton with a function <span class="math-container">$f:\Sigma^* \to \mathbb{N} \times \{0,1\}$</span>, where <span class="math-container">$f(x)=(n,b)$</span> describes the state where the au...
habedi/stack-exchange-dataset
106,207
How are problems classified in Complexity Theory?
<p>I'm reading Sipser's Introduction to the Theory of Computation (3rd edition). In chapter 0 (pg. 2), he says we don't know the answer to "<em>what makes some problems computationally hard and others easy</em>," however, he then states that "<em>researchers have&#xA;discovered an elegant scheme for classifying problem...
complexity theory
1
How are problems classified in Complexity Theory? -- (complexity theory) <p>I'm reading Sipser's Introduction to the Theory of Computation (3rd edition). In chapter 0 (pg. 2), he says we don't know the answer to "<em>what makes some problems computationally hard and others easy</em>," however, he then states that "<em>...
habedi/stack-exchange-dataset
106,212
Reducing Exact Cover to Subset Sum in practise!
<p>The reduction of Exact Cover to Subset Sum has previously been discussed at this forum. What I'm interested in is the practicality of this reduction, which I will discuss in <strong>section 2</strong> of this post. For you who are not familiar with these problems I will define them and show the reduction Exact Cover...
reductions
1
Reducing Exact Cover to Subset Sum in practise! -- (reductions) <p>The reduction of Exact Cover to Subset Sum has previously been discussed at this forum. What I'm interested in is the practicality of this reduction, which I will discuss in <strong>section 2</strong> of this post. For you who are not familiar with thes...
habedi/stack-exchange-dataset
106,214
find separate pairs of points with minimal total distance
<p>I am looking for suitable algorithm how to solve the following problem.</p>&#xA;&#xA;<p>For finite set <span class="math-container">$S \subset \mathbb{R}$</span> (<span class="math-container">$|S| = N_{S}$</span>) we need to find its disjunctive separation <span class="math-container">$S = A \cup B$</span> (<span cl...
assignment problem
1
find separate pairs of points with minimal total distance -- (assignment problem) <p>I am looking for suitable algorithm how to solve the following problem.</p>&#xA;&#xA;<p>For finite set <span class="math-container">$S \subset \mathbb{R}$</span> (<span class="math-container">$|S| = N_{S}$</span>) we need to find its d...
habedi/stack-exchange-dataset
106,222
Given directed connected weighted graph, check if d(v) = delta(s,v)
<p>I'm having some hard time with this problem. &#xA;Can someone give me some clue/guidance?</p>&#xA;&#xA;<p>This is an homework question, so please don't just solve it.</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a weighted directed connected graph <span class="math-container">$G = (V,E)$</span> and given another&#xA; ...
graphs shortest path weighted graphs
1
Given directed connected weighted graph, check if d(v) = delta(s,v) -- (graphs shortest path weighted graphs) <p>I'm having some hard time with this problem. &#xA;Can someone give me some clue/guidance?</p>&#xA;&#xA;<p>This is an homework question, so please don't just solve it.</p>&#xA;&#xA;<blockquote>&#xA; <p>Given...
habedi/stack-exchange-dataset
106,233
Is Breadth First Search Space Complexity on a Grid different?
<p>Is the Space Complexity O(number_rows + number_cols) for Breadth First Search on a <strong>Grid</strong>. This is an attempt to show my reasoning:</p>&#xA;&#xA;<p>For example, the flood fill question is described here:</p>&#xA;&#xA;<p><a href="https://www.geeksforgeeks.org/flood-fill-algorithm-implement-fill-paint/"...
graphs data structures trees space complexity queues
1
Is Breadth First Search Space Complexity on a Grid different? -- (graphs data structures trees space complexity queues) <p>Is the Space Complexity O(number_rows + number_cols) for Breadth First Search on a <strong>Grid</strong>. This is an attempt to show my reasoning:</p>&#xA;&#xA;<p>For example, the flood fill questi...
habedi/stack-exchange-dataset
106,241
Permutation of n-size array with possible repeated elements. E.g [1, 2, 1]
<p>What would it be a recursive algorithm to get permutations for any list of <strong><code>n</code></strong> elements that might contain or not repeated elements?</p>&#xA;&#xA;<p>For the following 3-element list <code>[1, 1, 2]</code> I would expect the following result:</p>&#xA;&#xA;<pre><code>[1, 1, 2]&#xA;[1, 2, 1]...
algorithms data structures combinatorics permutations
1
Permutation of n-size array with possible repeated elements. E.g [1, 2, 1] -- (algorithms data structures combinatorics permutations) <p>What would it be a recursive algorithm to get permutations for any list of <strong><code>n</code></strong> elements that might contain or not repeated elements?</p>&#xA;&#xA;<p>For th...
habedi/stack-exchange-dataset
106,242
Expected number of iterations for bozo sort opt algorithm
<p>I'm trying to figure out the upper bound for the number of iterations of the bozo sort opt algorithm, described in this paper on section 3.2:&#xA;<a href="http://www.hermann-gruber.com/pdf/fun07-final.html" rel="nofollow noreferrer">http://www.hermann-gruber.com/pdf/fun07-final.html</a></p>&#xA;&#xA;<p>I know the ma...
algorithms algorithm analysis sorting
1
Expected number of iterations for bozo sort opt algorithm -- (algorithms algorithm analysis sorting) <p>I'm trying to figure out the upper bound for the number of iterations of the bozo sort opt algorithm, described in this paper on section 3.2:&#xA;<a href="http://www.hermann-gruber.com/pdf/fun07-final.html" rel="nofo...
habedi/stack-exchange-dataset
106,244
Single processor system supporting two running processes, A and B, with the following sequential execution patterns
<p>Can anyone please help me with the following question?</p>&#xA;&#xA;<p>Consider a single processor system supporting two running processes, A and B, with the following sequential execution patterns:</p>&#xA;&#xA;<p>A: [CPU 8 ms; IO 1 ms; CPU 8 ms; IO 1 ms; CPU 8 ms]</p>&#xA;&#xA;<p>B: [CPU 2 ms; IO 1 ms; CPU 2 ms; I...
operating systems
1
Single processor system supporting two running processes, A and B, with the following sequential execution patterns -- (operating systems) <p>Can anyone please help me with the following question?</p>&#xA;&#xA;<p>Consider a single processor system supporting two running processes, A and B, with the following sequential...
habedi/stack-exchange-dataset
106,246
prove by induction that the complete recursion tree for computing the nth Fibonacci number has n leaves
<p>I have referenced this similar question: <a href="https://cs.stackexchange.com/questions/14025/prove-correctness-of-recursive-fibonacci-algorithm-using-proof-by-induction">Prove correctness of recursive Fibonacci algorithm, using proof by induction</a></p>&#xA;&#xA;<p>*Edit: my professor had a significant typo in th...
trees proof techniques recursion induction
1
prove by induction that the complete recursion tree for computing the nth Fibonacci number has n leaves -- (trees proof techniques recursion induction) <p>I have referenced this similar question: <a href="https://cs.stackexchange.com/questions/14025/prove-correctness-of-recursive-fibonacci-algorithm-using-proof-by-indu...
habedi/stack-exchange-dataset
106,247
How to solve a DP problem that minimizes a sum of cubic powers?
<p>I am trying to practice some coding problems and I came upon this problem: </p>&#xA;&#xA;<p>As electricity prices are soaring, there must be a way to reduce wastage by increasing the utilization of heavy duty machines, such as elevators.<br>&#xA;We formulate the problem as follows.<br>&#xA;There are <span class="mat...
dynamic programming
1
How to solve a DP problem that minimizes a sum of cubic powers? -- (dynamic programming) <p>I am trying to practice some coding problems and I came upon this problem: </p>&#xA;&#xA;<p>As electricity prices are soaring, there must be a way to reduce wastage by increasing the utilization of heavy duty machines, such as e...
habedi/stack-exchange-dataset
106,258
Is there a way to calculate the number of all the languages over an alphabet?
<p>Let <span class="math-container">$\Sigma = \{ a,b,c \}$</span> be an alphabet.</p>&#xA;&#xA;<p>How should I calculate the number of Languages over <span class="math-container">$\Sigma$</span>?</p>&#xA;
automata
1
Is there a way to calculate the number of all the languages over an alphabet? -- (automata) <p>Let <span class="math-container">$\Sigma = \{ a,b,c \}$</span> be an alphabet.</p>&#xA;&#xA;<p>How should I calculate the number of Languages over <span class="math-container">$\Sigma$</span>?</p>&#xA;
habedi/stack-exchange-dataset
106,261
What is the importance of the condition "| xy | < p" in pumping lemma?
<p>Let L be a language. w <span class="math-container">$\in$</span> L , and w could be broken in xyz. </p>&#xA;&#xA;<p>Then if L is regular, there exists a pumping length p such that:</p>&#xA;&#xA;<ol>&#xA;<li>|y| <span class="math-container">$\gt$</span> 0</li>&#xA;<li>|xy| <span class="math-container">$\le$</span> p ...
automata pumping lemma
1
What is the importance of the condition "| xy | < p" in pumping lemma? -- (automata pumping lemma) <p>Let L be a language. w <span class="math-container">$\in$</span> L , and w could be broken in xyz. </p>&#xA;&#xA;<p>Then if L is regular, there exists a pumping length p such that:</p>&#xA;&#xA;<ol>&#xA;<li>|y| <span c...
habedi/stack-exchange-dataset
106,279
When do we use parallel algorithms for enumerating combinations?
<p>I know that combination is used in many areas. But do we really need parallel version of algorithms for that? If so, where do they used?</p>&#xA;&#xA;<p>Here is a famous example of parallel algorithms, <a href="https://academic.oup.com/comjnl/article-pdf/30/5/433/1046607/30-5-433.pdf" rel="nofollow noreferrer"><em>A...
combinatorics parallel computing enumeration
1
When do we use parallel algorithms for enumerating combinations? -- (combinatorics parallel computing enumeration) <p>I know that combination is used in many areas. But do we really need parallel version of algorithms for that? If so, where do they used?</p>&#xA;&#xA;<p>Here is a famous example of parallel algorithms, ...
habedi/stack-exchange-dataset
106,280
Algorithm for searching in BST with only <
<p>How could one construct an algorithm for finding a node in a binary search tree that only requires the presence of <span class="math-container">$&lt;$</span> on the key type. The ones I can easily also requires <span class="math-container">$=$</span>.</p>&#xA;
search algorithms binary search trees
1
Algorithm for searching in BST with only < -- (search algorithms binary search trees) <p>How could one construct an algorithm for finding a node in a binary search tree that only requires the presence of <span class="math-container">$&lt;$</span> on the key type. The ones I can easily also requires <span class="math-co...
habedi/stack-exchange-dataset
106,287
How do I do a subtraction question on turing machine
<p>For example, 111-11</p>&#xA;&#xA;<p>I want to have the output as 111-11=1</p>&#xA;&#xA;<p>I am a beginner at TM and am having a hard time trying to solve this question.</p>&#xA;
turing machines
1
How do I do a subtraction question on turing machine -- (turing machines) <p>For example, 111-11</p>&#xA;&#xA;<p>I want to have the output as 111-11=1</p>&#xA;&#xA;<p>I am a beginner at TM and am having a hard time trying to solve this question.</p>&#xA;
habedi/stack-exchange-dataset
106,289
Can someone explain this formula for calculating Manhattan distance?
<p>This is from a <a href="https://codingcompetitions.withgoogle.com/kickstart/round/0000000000050e01/000000000006987d" rel="noreferrer">Kickstart problem</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Note: The <a href="https://en.wikipedia.org/wiki/Taxicab_geometry" rel="noreferrer">Manhattan distance</a> between two square...
square grid
1
Can someone explain this formula for calculating Manhattan distance? -- (square grid) <p>This is from a <a href="https://codingcompetitions.withgoogle.com/kickstart/round/0000000000050e01/000000000006987d" rel="noreferrer">Kickstart problem</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Note: The <a href="https://en.wikipedia...
habedi/stack-exchange-dataset
106,293
is it possible to reduce $HALT_{TM}$ to $E_{TM}$?
<p>I am wondering, if it is even possible: is it possible to reduce <span class="math-container">$HALT_{\text{TM}}$</span> to <span class="math-container">$E_{\text{TM}}$</span>?</p>&#xA;&#xA;<p><span class="math-container">$HALT_{\text{TM}}=\{\langle M,w\rangle\mid M\text{ is a }TM\text{ and }M\text{ halts on input }w...
complexity theory turing machines computability reductions
1
is it possible to reduce $HALT_{TM}$ to $E_{TM}$? -- (complexity theory turing machines computability reductions) <p>I am wondering, if it is even possible: is it possible to reduce <span class="math-container">$HALT_{\text{TM}}$</span> to <span class="math-container">$E_{\text{TM}}$</span>?</p>&#xA;&#xA;<p><span class...
habedi/stack-exchange-dataset
106,296
Maximal size of a set of ordered words such that no pair of letters occurs twice
<p>Consider an alphabet <span class="math-container">$\Sigma=\{1,\dots,n\}$</span>.&#xA;An ordered word is a word <span class="math-container">$w=w_1w_2\dots w_k\in\Sigma^*$</span> such that <span class="math-container">$w_1&lt;w_2&lt;\dots&lt;w_k$</span>. In other words, an ordered word is a strictly increasing sequen...
combinatorics word combinatorics
1
Maximal size of a set of ordered words such that no pair of letters occurs twice -- (combinatorics word combinatorics) <p>Consider an alphabet <span class="math-container">$\Sigma=\{1,\dots,n\}$</span>.&#xA;An ordered word is a word <span class="math-container">$w=w_1w_2\dots w_k\in\Sigma^*$</span> such that <span clas...
habedi/stack-exchange-dataset
106,300
How to calculate information gain in ID3?
<p>I am trying to implement a decision tree classifier using <a href="https://en.wikipedia.org/wiki/ID3_algorithm" rel="nofollow noreferrer">ID3 algorithm</a>. According to <em>Aritificial Intelligence - A Modern Approach</em>, information gain of attribute <code>A</code> is given by:</p>&#xA;&#xA;<p><code>Gain(A) = B(...
machine learning information theory entropy decision tree
1
How to calculate information gain in ID3? -- (machine learning information theory entropy decision tree) <p>I am trying to implement a decision tree classifier using <a href="https://en.wikipedia.org/wiki/ID3_algorithm" rel="nofollow noreferrer">ID3 algorithm</a>. According to <em>Aritificial Intelligence - A Modern Ap...
habedi/stack-exchange-dataset
106,327
Is substitution done to all occurrences?
<p>In a CFG, we might have :<span class="math-container">$A \rightarrow AA$</span> and <span class="math-container">$A \rightarrow a$</span> where <span class="math-container">$a$</span> is a terminal and <span class="math-container">$A$</span> is a variable.</p>&#xA;&#xA;<p>Then if we apply the first rule, and then t...
context free formal grammars
1
Is substitution done to all occurrences? -- (context free formal grammars) <p>In a CFG, we might have :<span class="math-container">$A \rightarrow AA$</span> and <span class="math-container">$A \rightarrow a$</span> where <span class="math-container">$a$</span> is a terminal and <span class="math-container">$A$</span> ...
habedi/stack-exchange-dataset
106,329
Fastest algorithm to decide whether a (always halting) TM accepts a general string
<p>Given a TM <span class="math-container">$M$</span> that halts on all inputs, and a general string <span class="math-container">$w$</span>, consider the most trivial algorithm (Call it <span class="math-container">$A$</span>) to decide whether <span class="math-container">$M$</span> accepts <span class="math-containe...
turing machines time complexity
1
Fastest algorithm to decide whether a (always halting) TM accepts a general string -- (turing machines time complexity) <p>Given a TM <span class="math-container">$M$</span> that halts on all inputs, and a general string <span class="math-container">$w$</span>, consider the most trivial algorithm (Call it <span class="...
habedi/stack-exchange-dataset
106,333
Greedy algorithm Packing problem
<p>Assume that <span class="math-container">$A$</span> is the set of objects such that each object <span class="math-container">$x_i \in A$</span> has value <span class="math-container">$w_i$</span>. We wish to pack these objects into group, each pack containing <strong>at least</strong> <span class="math-container">$...
algorithms packing
1
Greedy algorithm Packing problem -- (algorithms packing) <p>Assume that <span class="math-container">$A$</span> is the set of objects such that each object <span class="math-container">$x_i \in A$</span> has value <span class="math-container">$w_i$</span>. We wish to pack these objects into group, each pack containing...
habedi/stack-exchange-dataset
106,337
Find a path from s to t using as few red nodes as possible
<p>Was doing a little interview prep. Given an undirected graph G, such that each node is colored red or blue and |E|≥|V|, find a path in O(|E|) time such that starting and ending at 2 blue nodes, s and t, that you pass through as few red nodes as possible.</p>&#xA;&#xA;<p>Initial Impressions: Since |E|≥|V|, O(|E|) tim...
graphs
1
Find a path from s to t using as few red nodes as possible -- (graphs) <p>Was doing a little interview prep. Given an undirected graph G, such that each node is colored red or blue and |E|≥|V|, find a path in O(|E|) time such that starting and ending at 2 blue nodes, s and t, that you pass through as few red nodes as p...
habedi/stack-exchange-dataset
106,346
Can someone give me the definition of #Monotone-2SAT?
<p>In the decision problem, I set all variables to true and see if the formula is satisfiable.</p>&#xA;&#xA;<p>My question is because I do not understand how there can be multiple solutions, though all variables are true.</p>&#xA;
complexity theory satisfiability counting
1
Can someone give me the definition of #Monotone-2SAT? -- (complexity theory satisfiability counting) <p>In the decision problem, I set all variables to true and see if the formula is satisfiable.</p>&#xA;&#xA;<p>My question is because I do not understand how there can be multiple solutions, though all variables are tru...
habedi/stack-exchange-dataset
106,349
Worst-case input for median-of-medians with groups of size 3
<p>Typically, <a href="https://en.wikipedia.org/wiki/Median_of_medians" rel="nofollow noreferrer">median of medians algorithm</a> is written with groups of size <span class="math-container">$5$</span> or <span class="math-container">$7$</span> to ensure worst-case linear performance. The argument against groups of size...
algorithm analysis recursion
1
Worst-case input for median-of-medians with groups of size 3 -- (algorithm analysis recursion) <p>Typically, <a href="https://en.wikipedia.org/wiki/Median_of_medians" rel="nofollow noreferrer">median of medians algorithm</a> is written with groups of size <span class="math-container">$5$</span> or <span class="math-con...
habedi/stack-exchange-dataset
106,350
Time complexity of a tree-based algorithm
<p>I solved a practice interview problem that was sent me by Daily Coding Problem mailing list. I am now curious about the exact time complexity of my solution.</p>&#xA;&#xA;<h2>Problem Statement</h2>&#xA;&#xA;<blockquote>&#xA; <p>Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ...
complexity theory time complexity trees
1
Time complexity of a tree-based algorithm -- (complexity theory time complexity trees) <p>I solved a practice interview problem that was sent me by Daily Coding Problem mailing list. I am now curious about the exact time complexity of my solution.</p>&#xA;&#xA;<h2>Problem Statement</h2>&#xA;&#xA;<blockquote>&#xA; <p>G...
habedi/stack-exchange-dataset
106,356
Rice's Theorem - usage on $DFA$ or $LBA$
<p>I have read about Rice's Theorem on Sipser's <a href="https://rads.stackoverflow.com/amzn/click/com/113318779X" rel="nofollow noreferrer" rel="nofollow noreferrer">book</a>, and I think I understand it quite well. I understand that it can be used to show that a language is not decidable. </p>&#xA;&#xA;<p>However I a...
turing machines computability rice theorem
1
Rice's Theorem - usage on $DFA$ or $LBA$ -- (turing machines computability rice theorem) <p>I have read about Rice's Theorem on Sipser's <a href="https://rads.stackoverflow.com/amzn/click/com/113318779X" rel="nofollow noreferrer" rel="nofollow noreferrer">book</a>, and I think I understand it quite well. I understand t...
habedi/stack-exchange-dataset
106,362
Why 'let' can not be reduce to a lambda application in (extended) Calculus of Constructions
<p>I do not understand the difference highlighted in the <a href="https://leanprover.github.io/theorem_proving_in_lean/dependent_type_theory.html#local-definitions" rel="noreferrer">chapter 2.5</a> of the book Theorem Proving in Lean:</p>&#xA;&#xA;<blockquote>&#xA; <p>Notice that the meaning of the expression let a :=...
lambda calculus calculus of constructions
1
Why 'let' can not be reduce to a lambda application in (extended) Calculus of Constructions -- (lambda calculus calculus of constructions) <p>I do not understand the difference highlighted in the <a href="https://leanprover.github.io/theorem_proving_in_lean/dependent_type_theory.html#local-definitions" rel="noreferrer"...
habedi/stack-exchange-dataset
106,363
Why finding the difference between the adjacent elements of the array to find the maximum difference?
<p>I want to understand a tricky method to find the maximum difference between two elements such that larger element appears after the smaller number. I found easy solution keeping track of the minimum array but I don't get the following solution which first find the difference between the adjacent elements of the arra...
algorithms arrays maximum subarray
1
Why finding the difference between the adjacent elements of the array to find the maximum difference? -- (algorithms arrays maximum subarray) <p>I want to understand a tricky method to find the maximum difference between two elements such that larger element appears after the smaller number. I found easy solution keepi...
habedi/stack-exchange-dataset
106,367
Can you always prove the asymptotic bound of a recurrence of the form aT(n/b) + f(n) using the substitution method?
<p>To make my question more concrete, here is an example I am stuck on.</p>&#xA;&#xA;<p>I want to prove that <span class="math-container">$T(n) = 8T(\frac{n}{2}) + n^3$</span> is asymptotic bound by <span class="math-container">$n^3\log(n)$</span> using the substution method. That is <span class="math-container">$T(n)$...
time complexity recurrence relation
1
Can you always prove the asymptotic bound of a recurrence of the form aT(n/b) + f(n) using the substitution method? -- (time complexity recurrence relation) <p>To make my question more concrete, here is an example I am stuck on.</p>&#xA;&#xA;<p>I want to prove that <span class="math-container">$T(n) = 8T(\frac{n}{2}) +...
habedi/stack-exchange-dataset
106,373
Find binary number with max hamming distance wrt given set of binary numbers
<p>Suppose we have a set <span class="math-container">$A$</span> of binary numbers with the same length <span class="math-container">$n$</span>.&#xA;For example (with <span class="math-container">$n=8$</span>):</p>&#xA;&#xA;<p><span class="math-container">$A = \{ 10010011, 01011011, 00010010, 11110001\}$</span></p>&#xA...
algorithms hamming distance
1
Find binary number with max hamming distance wrt given set of binary numbers -- (algorithms hamming distance) <p>Suppose we have a set <span class="math-container">$A$</span> of binary numbers with the same length <span class="math-container">$n$</span>.&#xA;For example (with <span class="math-container">$n=8$</span>):...
habedi/stack-exchange-dataset
106,390
How to prove the set of Turing machines that accept a string and its mirror is undecidable?
<p>I'm trying to prove the undecidability of the following language. </p>&#xA;&#xA;<p><span class="math-container">$$L=\{\langle M \rangle\mid M\text{ is a Turing machine and there is a string }w\\\text{ s.t. }M\text{ accepts }w\text{ and }M\text{ rejects }w'\},$$</span> &#xA;where <span class="math-container">$w'$</sp...
turing machines undecidability
1
How to prove the set of Turing machines that accept a string and its mirror is undecidable? -- (turing machines undecidability) <p>I'm trying to prove the undecidability of the following language. </p>&#xA;&#xA;<p><span class="math-container">$$L=\{\langle M \rangle\mid M\text{ is a Turing machine and there is a string...
habedi/stack-exchange-dataset
106,406
Enumerators and recognizers
<p>I got confused by this a bit... the words of any recursively enumerable language <span class="math-container">$\mathcal{L}_{RE}$</span> can be enumerated by an enumerator <span class="math-container">$E$</span>, i.e. there is an effective procedure (using lexicographic ordering of inputs) for all words <span class="...
turing machines computability enumeration
1
Enumerators and recognizers -- (turing machines computability enumeration) <p>I got confused by this a bit... the words of any recursively enumerable language <span class="math-container">$\mathcal{L}_{RE}$</span> can be enumerated by an enumerator <span class="math-container">$E$</span>, i.e. there is an effective pro...
habedi/stack-exchange-dataset
106,408
Loop-Invariant for a program fragment
<p>Q) Consider the following program fragment:</p>&#xA;&#xA;<pre><code>var x,y:integer; &#xA;x:=1; y:=0; &#xA;while y &lt; x do &#xA;begin &#xA; x:=2∗x; &#xA; y:=y+1; &#xA;end;&#xA;</code></pre>&#xA;&#xA;<p>For the above fragment , which of the following is a loop-invariant ?</p>&#xA;&#xA;<p>A) x=y+1<br>&#xA;B)...
algorithms loop invariants
1
Loop-Invariant for a program fragment -- (algorithms loop invariants) <p>Q) Consider the following program fragment:</p>&#xA;&#xA;<pre><code>var x,y:integer; &#xA;x:=1; y:=0; &#xA;while y &lt; x do &#xA;begin &#xA; x:=2∗x; &#xA; y:=y+1; &#xA;end;&#xA;</code></pre>&#xA;&#xA;<p>For the above fragment , which of t...
habedi/stack-exchange-dataset
106,411
Maximize the sum of chosen numbers
<p>I have 2 problems that derive from a simple problem. I'll explain the simple one with the solution I found and after that the modified problem.</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose there is a game with 2 players, A and B and a list of&#xA; positive integers. Player A starts by taking out a number from the lis...
algorithms greedy algorithms
1
Maximize the sum of chosen numbers -- (algorithms greedy algorithms) <p>I have 2 problems that derive from a simple problem. I'll explain the simple one with the solution I found and after that the modified problem.</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose there is a game with 2 players, A and B and a list of&#xA; p...
habedi/stack-exchange-dataset
106,420
Is finding a path with more red vertices than blue vertices NP-hard?
<p>Given a connected, directed graph <span class="math-container">$G=(V,E)$</span>, vertices <span class="math-container">$s,t \in V$</span> and a coloring, s.t. <span class="math-container">$s$</span> and <span class="math-container">$t$</span> are black and all other vertices are either <strong>red</strong> or <stron...
complexity theory graphs
1
Is finding a path with more red vertices than blue vertices NP-hard? -- (complexity theory graphs) <p>Given a connected, directed graph <span class="math-container">$G=(V,E)$</span>, vertices <span class="math-container">$s,t \in V$</span> and a coloring, s.t. <span class="math-container">$s$</span> and <span class="ma...
habedi/stack-exchange-dataset
106,427
Can a TM recognize whether another TM recognizes a non-empty language?
<p>Let <span class="math-container">$$L_1 = \{\langle M\rangle\mid M \text{ is a Turing Machine and }L(M)\ne\emptyset\}.$$</span> &#xA;Is <span class="math-container">$L_1$</span> recognizable? If so, can you give me a pseudo-algorithm?</p>&#xA;&#xA;<p>My attempt:</p>&#xA;&#xA;<p>I wanted to study reachability the same...
formal languages turing machines computability
1
Can a TM recognize whether another TM recognizes a non-empty language? -- (formal languages turing machines computability) <p>Let <span class="math-container">$$L_1 = \{\langle M\rangle\mid M \text{ is a Turing Machine and }L(M)\ne\emptyset\}.$$</span> &#xA;Is <span class="math-container">$L_1$</span> recognizable? If ...
habedi/stack-exchange-dataset
106,433
When binary search algorithm will be $O(1)$
<p>I had an exam today, and there was a question that said: </p>&#xA;&#xA;<blockquote>&#xA; <p>Based on the definition of binary search algorithm, discuss when the algorithm time will be <span class="math-container">$O(1)$</span> and when it will be <span class="math-container">$O(\log(n))$</span>.</p>&#xA;</blockquot...
algorithms time complexity
1
When binary search algorithm will be $O(1)$ -- (algorithms time complexity) <p>I had an exam today, and there was a question that said: </p>&#xA;&#xA;<blockquote>&#xA; <p>Based on the definition of binary search algorithm, discuss when the algorithm time will be <span class="math-container">$O(1)$</span> and when it w...
habedi/stack-exchange-dataset
106,436
If my algorithm has complexity O(n!*n), can I just write O(n!), or do I have to keep it like O(n!*n)?
<p>Just as I asked in the title: if my algorithm has complexity <span class="math-container">$O(n!\times n)$</span>, can I just write <span class="math-container">$O(n!)$</span>, or I have to keep it like <span class="math-container">$O(n!\times n)$</span>?</p>&#xA;
asymptotics landau notation
1
If my algorithm has complexity O(n!*n), can I just write O(n!), or do I have to keep it like O(n!*n)? -- (asymptotics landau notation) <p>Just as I asked in the title: if my algorithm has complexity <span class="math-container">$O(n!\times n)$</span>, can I just write <span class="math-container">$O(n!)$</span>, or I h...
habedi/stack-exchange-dataset
106,443
Minimal paths as solution of a linear program of a special network flow
<p>Let <span class="math-container">$G= (V,E)$</span> be a given directed weighted graph, and <span class="math-container">$s,t$</span> two specified nodes, so that there is no negative cycle reachable from <span class="math-container">$s$</span>, and <span class="math-container">$t$</span> is reachable from <span clas...
shortest path linear programming check my answer
1
Minimal paths as solution of a linear program of a special network flow -- (shortest path linear programming check my answer) <p>Let <span class="math-container">$G= (V,E)$</span> be a given directed weighted graph, and <span class="math-container">$s,t$</span> two specified nodes, so that there is no negative cycle re...
habedi/stack-exchange-dataset
106,447
Non-existence of PSPACE-hard unary language
<p>I'm trying to prove that unless <span class="math-container">$\mathsf{P}=\mathsf{PSPACE}$</span>, there is no unary language which is <span class="math-container">$\mathsf{PSPACE}$</span>-hard.</p>&#xA;&#xA;<p>Assuming there is an unary language <span class="math-container">$A$</span> which is <span class="math-cont...
complexity theory space complexity
1
Non-existence of PSPACE-hard unary language -- (complexity theory space complexity) <p>I'm trying to prove that unless <span class="math-container">$\mathsf{P}=\mathsf{PSPACE}$</span>, there is no unary language which is <span class="math-container">$\mathsf{PSPACE}$</span>-hard.</p>&#xA;&#xA;<p>Assuming there is an un...
habedi/stack-exchange-dataset
106,455
Are two CCS processes equivalent with respect to weak bisimilarity if and only if they satisfy exactly the same set of HML formulas?
<p>I was skimming <a href="https://link.springer.com/chapter/10.1007/978-3-319-89366-2_12" rel="nofollow noreferrer">this recent paper</a> and I was struck by the following statement:</p>&#xA;&#xA;<blockquote>&#xA; <p>two processes are equivalent with respect to weak bisimilarity if and only if they satisfy exactly th...
concurrency model checking pi calculus ccs
1
Are two CCS processes equivalent with respect to weak bisimilarity if and only if they satisfy exactly the same set of HML formulas? -- (concurrency model checking pi calculus ccs) <p>I was skimming <a href="https://link.springer.com/chapter/10.1007/978-3-319-89366-2_12" rel="nofollow noreferrer">this recent paper</a> ...
habedi/stack-exchange-dataset
106,457
Maximal Minimum Spanning Tree by Removing $k$ Edges
<p>The problem is as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider a connected, undirected, and weighted graph <span class="math-container">$G = (V, E, w)$</span> and an integer <span class="math-container">$0 &lt; k &lt; |E| - |V| + 1$</span>. Describe and analyze and efficient algorithm to remove <em>at most</...
algorithms graphs weighted graphs minimum spanning tree
1
Maximal Minimum Spanning Tree by Removing $k$ Edges -- (algorithms graphs weighted graphs minimum spanning tree) <p>The problem is as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider a connected, undirected, and weighted graph <span class="math-container">$G = (V, E, w)$</span> and an integer <span class="math-cont...
habedi/stack-exchange-dataset
106,459
expected length of linked list
<p>Consider a datatype whose objects will be sequences of elements that has the following two methods</p>&#xA;&#xA;<p>prepend(<span class="math-container">$x, T$</span>) which will insert an element to x to the beginning of the sequence T</p>&#xA;&#xA;<p>search(<span class="math-container">$T, i$</span>) which returns ...
probability theory
1
expected length of linked list -- (probability theory) <p>Consider a datatype whose objects will be sequences of elements that has the following two methods</p>&#xA;&#xA;<p>prepend(<span class="math-container">$x, T$</span>) which will insert an element to x to the beginning of the sequence T</p>&#xA;&#xA;<p>search(<sp...
habedi/stack-exchange-dataset
106,472
Response time of scheduling a DAG where each vertex is a task
<p>Suppose I have a directed acyclic graph where each vertex <span class="math-container">$v$</span> represents a task with a certain execution time and the edges represent precendence constraints between the tasks. I.e. task <span class="math-container">$v_i$</span> has to execute before task <span class="math-contain...
graphs parallel computing scheduling
1
Response time of scheduling a DAG where each vertex is a task -- (graphs parallel computing scheduling) <p>Suppose I have a directed acyclic graph where each vertex <span class="math-container">$v$</span> represents a task with a certain execution time and the edges represent precendence constraints between the tasks. ...
habedi/stack-exchange-dataset
106,474
Finding the Range of Solutions for KSum Variation
<h1>Preface</h1>&#xA;&#xA;<p>I asked a question <a href="https://cs.stackexchange.com/questions/103302/check-if-k-sum-variation-is-np-complete">before</a> where I was looking to understand the complexity class of the following problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a range of integers <span class="math-conta...
algorithms subset sum constant time
1
Finding the Range of Solutions for KSum Variation -- (algorithms subset sum constant time) <h1>Preface</h1>&#xA;&#xA;<p>I asked a question <a href="https://cs.stackexchange.com/questions/103302/check-if-k-sum-variation-is-np-complete">before</a> where I was looking to understand the complexity class of the following pr...
habedi/stack-exchange-dataset
106,480
Context Sensitive Grammar for the language $\{a^n b^n c^{2+k}\mid n \ge 1, 0 \le k\le 1\}$
<p>I'm studying for my final exam and come up with this exercise with no idea how to find the production rule of this grammar.</p>&#xA;&#xA;<p>I need help. Thanks all of you! :)</p>&#xA;
formal languages context free
1
Context Sensitive Grammar for the language $\{a^n b^n c^{2+k}\mid n \ge 1, 0 \le k\le 1\}$ -- (formal languages context free) <p>I'm studying for my final exam and come up with this exercise with no idea how to find the production rule of this grammar.</p>&#xA;&#xA;<p>I need help. Thanks all of you! :)</p>&#xA;
habedi/stack-exchange-dataset
106,486
Modelling of minimal NOR-circuit problem with CP
<p>I'm currently working on a Constraint Programming problem which I find difficult to model.</p>&#xA;&#xA;<p>Here 's the definition of the problem :</p>&#xA;&#xA;<p>" Given a specification of a Boolean function f(x1, ..., xn) in the form of a truth table, to find a NOR-circuit (meaning only NOR gates) satisfying the s...
optimization integer programming constraint programming
1
Modelling of minimal NOR-circuit problem with CP -- (optimization integer programming constraint programming) <p>I'm currently working on a Constraint Programming problem which I find difficult to model.</p>&#xA;&#xA;<p>Here 's the definition of the problem :</p>&#xA;&#xA;<p>" Given a specification of a Boolean functio...
habedi/stack-exchange-dataset
106,491
Consensus/ranked ordering algorithm
<p>Say I have a set of numbers, for example <code>{1, 2, 3, 4, 5}</code>. Is there an algorithm that allows these numbers to be put into a consensus ordering based on a ranked vote? For example, if 3 people vote and their votes are <code>[1, 2, 3, 4, 5]</code>, <code>[2, 1, 3, 4, 5]</code>, and <code>[1, 2, 3, 5, 4]</c...
algorithms sorting consensus
1
Consensus/ranked ordering algorithm -- (algorithms sorting consensus) <p>Say I have a set of numbers, for example <code>{1, 2, 3, 4, 5}</code>. Is there an algorithm that allows these numbers to be put into a consensus ordering based on a ranked vote? For example, if 3 people vote and their votes are <code>[1, 2, 3, 4,...
habedi/stack-exchange-dataset
106,492
How to prove SPACE-TMSAT is PSPACE-hard?
<p>I understand that the language:</p>&#xA;&#xA;<p><span class="math-container">$\operatorname{SPACE-TMSAT} = \{⟨M, w, 1^n⟩ : \text{DTM $M$ accepts $w$ in space $n$}\}$</span></p>&#xA;&#xA;<p>is in PSPACE since it doesn't use more than <span class="math-container">$n$</span> space. But to prove that it is PSPACE-comple...
complexity theory reductions space complexity
1
How to prove SPACE-TMSAT is PSPACE-hard? -- (complexity theory reductions space complexity) <p>I understand that the language:</p>&#xA;&#xA;<p><span class="math-container">$\operatorname{SPACE-TMSAT} = \{⟨M, w, 1^n⟩ : \text{DTM $M$ accepts $w$ in space $n$}\}$</span></p>&#xA;&#xA;<p>is in PSPACE since it doesn't use mo...
habedi/stack-exchange-dataset
106,495
Complete the following table by specifying the scope of each declaration
<p>I'm having a hard time understanding this question. Can each declaration have more than one scope or can a declaration have more than one scope?</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/6TUoW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6TUoW.png" alt="enter image description here"></...
c c++
1
Complete the following table by specifying the scope of each declaration -- (c c++) <p>I'm having a hard time understanding this question. Can each declaration have more than one scope or can a declaration have more than one scope?</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/6TUoW.png" rel="nofollow noreferrer">...
habedi/stack-exchange-dataset
106,512
Reversible Merge of Integer Hash Values
<p>Context:</p>&#xA;&#xA;<p>I am working with a tree-like data structure. I would like every node in the tree to have an integer hash value that is the result of combining the integer hash values for the node's children. Additionally, I'd like to be able to replace one of the node's children in constant time (i.e., not...
algorithms trees hash integers
1
Reversible Merge of Integer Hash Values -- (algorithms trees hash integers) <p>Context:</p>&#xA;&#xA;<p>I am working with a tree-like data structure. I would like every node in the tree to have an integer hash value that is the result of combining the integer hash values for the node's children. Additionally, I'd like ...
habedi/stack-exchange-dataset
106,518
Approximation algorithm for weighted set cover, using multiplicative weights
<p>It is known that the problem of fractional set cover&#xA; can be rephrased as a linear programming problem and be approximated using the multiplicative weights method, for instance <a href="https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/notes/lecture17.pdf" rel="nofollow noreferrer">this lecture ...
approximation linear programming set cover online algorithms
1
Approximation algorithm for weighted set cover, using multiplicative weights -- (approximation linear programming set cover online algorithms) <p>It is known that the problem of fractional set cover&#xA; can be rephrased as a linear programming problem and be approximated using the multiplicative weights method, for in...
habedi/stack-exchange-dataset
106,519
How can I solve $T(n) = 2T(\sqrt{n-1} + 2) + 1$ recurrence using tree method?
<p>The recurrence I have is</p>&#xA;&#xA;<p><span class="math-container">$T(n) = 2T(\sqrt{n-1} + 2) + 1$</span></p>&#xA;&#xA;<p>I don't know how to solve it. I didn't find much on the internet with square roots in recurrences especially with constants inside of it. I'm supposed to find the height of the tree but I have...
trees recurrence relation
1
How can I solve $T(n) = 2T(\sqrt{n-1} + 2) + 1$ recurrence using tree method? -- (trees recurrence relation) <p>The recurrence I have is</p>&#xA;&#xA;<p><span class="math-container">$T(n) = 2T(\sqrt{n-1} + 2) + 1$</span></p>&#xA;&#xA;<p>I don't know how to solve it. I didn't find much on the internet with square roots ...
habedi/stack-exchange-dataset
106,521
Computability - Can a Turing Machine calculate the input's length?
<p>I have looked for an answer for this question which seems trivial, but I didn't find any.</p>&#xA;&#xA;<blockquote>&#xA; <p>Can a Turing machine, given a word <span class="math-container">$w$</span>, calculate the length of the word?</p>&#xA;</blockquote>&#xA;
complexity theory turing machines
1
Computability - Can a Turing Machine calculate the input's length? -- (complexity theory turing machines) <p>I have looked for an answer for this question which seems trivial, but I didn't find any.</p>&#xA;&#xA;<blockquote>&#xA; <p>Can a Turing machine, given a word <span class="math-container">$w$</span>, calculate ...
habedi/stack-exchange-dataset
106,532
Is the language of words with equal number of 010s and 101s as substrings regular?
<p>Is the language of words containing same number of 101s and 010s regular?&#xA;If yes, how can I design a DFA for it?</p>&#xA;&#xA;<p>In general, is the language of words containing equal number of strings which one is "one's complement" of the other one is regular (like the language of words containing equal number ...
regular languages finite automata
1
Is the language of words with equal number of 010s and 101s as substrings regular? -- (regular languages finite automata) <p>Is the language of words containing same number of 101s and 010s regular?&#xA;If yes, how can I design a DFA for it?</p>&#xA;&#xA;<p>In general, is the language of words containing equal number o...
habedi/stack-exchange-dataset
106,534
Assigning books to boxes
<p>I am trying to model the following problem correctly as a min-cut network flow problem. I have <span class="math-container">$n$</span> books and 2 boxes. I also have books that I know must go in one of the two boxes. In addition, each book has a certain profit if I put it in the same box with another book. So for in...
algorithms graphs optimization
1
Assigning books to boxes -- (algorithms graphs optimization) <p>I am trying to model the following problem correctly as a min-cut network flow problem. I have <span class="math-container">$n$</span> books and 2 boxes. I also have books that I know must go in one of the two boxes. In addition, each book has a certain pr...
habedi/stack-exchange-dataset
106,542
Where's the flaw in my algorithm? (Linear program to solve NP-hard problem)
<p>The problem (copy-pasted from <a href="https://cs.stackexchange.com/questions/106420/is-finding-a-path-with-more-red-vertices-than-blue-vertices-np-hard">this question on cs.stackexchange</a>):</p>&#xA;&#xA;<p>Given a connected, directed graph <span class="math-container">$G=(V,E)$</span>, vertices <span class="math...
graphs linear programming
1
Where's the flaw in my algorithm? (Linear program to solve NP-hard problem) -- (graphs linear programming) <p>The problem (copy-pasted from <a href="https://cs.stackexchange.com/questions/106420/is-finding-a-path-with-more-red-vertices-than-blue-vertices-np-hard">this question on cs.stackexchange</a>):</p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
106,546
Dynamic programming approach for finding perfect square subsequence
<p>Given an array of numbers <span class="math-container">$a_i$</span> with length <span class="math-container">$n$</span>, such that <span class="math-container">$0&lt;a_i&lt;30$</span>, how can we find the number of subsequences that the product of numbers is perfect square.</p>&#xA;&#xA;<p>I have tried to find a dyn...
algorithms
1
Dynamic programming approach for finding perfect square subsequence -- (algorithms) <p>Given an array of numbers <span class="math-container">$a_i$</span> with length <span class="math-container">$n$</span>, such that <span class="math-container">$0&lt;a_i&lt;30$</span>, how can we find the number of subsequences that ...
habedi/stack-exchange-dataset
106,557
Turing machine algorithms for $\{0^n1^n\}$ using one and two tapes
<p>I was tasked with finding a way to decide the language <span class="math-container">$A=\{0^k1^k \mid k\ge 0\}$</span> in <span class="math-container">$O(n\log n)$</span> time, and then to implement it on a deterministic Turing machine with one tape. Additionally, I was asked to check if it is possible to reduce the ...
algorithms algorithm analysis turing machines time complexity
1
Turing machine algorithms for $\{0^n1^n\}$ using one and two tapes -- (algorithms algorithm analysis turing machines time complexity) <p>I was tasked with finding a way to decide the language <span class="math-container">$A=\{0^k1^k \mid k\ge 0\}$</span> in <span class="math-container">$O(n\log n)$</span> time, and the...
habedi/stack-exchange-dataset
106,562
The Clique vs. Independent Set Problem
<p>Suppose you have an undirected graph <span class="math-container">$G = (V, E)$</span>, known to both Alice and Bob, Alice gets an independent set of <span class="math-container">$G$</span>. Bob gets a Clique <span class="math-container">$B ⊆ V$</span>.</p>&#xA;&#xA;<p>Is there any algorithm in <span class="math-cont...
algorithms graphs communication complexity
1
The Clique vs. Independent Set Problem -- (algorithms graphs communication complexity) <p>Suppose you have an undirected graph <span class="math-container">$G = (V, E)$</span>, known to both Alice and Bob, Alice gets an independent set of <span class="math-container">$G$</span>. Bob gets a Clique <span class="math-cont...
habedi/stack-exchange-dataset
106,567
Sizeof function definition in a system
<p>Why sizeof(int) and sizeof(int *) takes different value in a system? I mean generally size of integer is 4 B, but size of integer pointer is 8 B. But why they cannot take same value, although their return type is same?</p>&#xA;
programming languages c
1
Sizeof function definition in a system -- (programming languages c) <p>Why sizeof(int) and sizeof(int *) takes different value in a system? I mean generally size of integer is 4 B, but size of integer pointer is 8 B. But why they cannot take same value, although their return type is same?</p>&#xA;
habedi/stack-exchange-dataset
106,572
Why is a Tree a concrete data structure and not abstract?
<p>It seems to me that a tree or a heap is a concept and not a concrete implementation of some other abstract data structure.</p>&#xA;&#xA;<p>For example a heap can be implemented with a table. Then why it is not considered abstract?</p>&#xA;
data structures
1
Why is a Tree a concrete data structure and not abstract? -- (data structures) <p>It seems to me that a tree or a heap is a concept and not a concrete implementation of some other abstract data structure.</p>&#xA;&#xA;<p>For example a heap can be implemented with a table. Then why it is not considered abstract?</p>&#xA...
habedi/stack-exchange-dataset
106,574
Prove that NP is closed under karp reduction?
<p>A complexity class <span class="math-container">$\mathbb{C}$</span> is said to be closed under a reduction if:</p>&#xA;&#xA;<p><span class="math-container">$A$</span> reduces to <span class="math-container">$B$</span> and <span class="math-container">$B \in \mathbb{C}$</span> <span class="math-container">$\implies$<...
complexity theory
1
Prove that NP is closed under karp reduction? -- (complexity theory) <p>A complexity class <span class="math-container">$\mathbb{C}$</span> is said to be closed under a reduction if:</p>&#xA;&#xA;<p><span class="math-container">$A$</span> reduces to <span class="math-container">$B$</span> and <span class="math-containe...
habedi/stack-exchange-dataset
106,590
A tricky P=NP problem
<blockquote>&#xA; <p>Define an operator <span class="math-container">$\pi(\cdot)$</span>: for a language <span class="math-container">$L$</span>, <span class="math-container">$\pi (L)$</span> is the set of all prefixes of strings in <span class="math-container">$L$</span> with length at least half of the original stri...
complexity theory np decision problem p vs np
1
A tricky P=NP problem -- (complexity theory np decision problem p vs np) <blockquote>&#xA; <p>Define an operator <span class="math-container">$\pi(\cdot)$</span>: for a language <span class="math-container">$L$</span>, <span class="math-container">$\pi (L)$</span> is the set of all prefixes of strings in <span class="...
habedi/stack-exchange-dataset
106,591
Does $E_{TM}$ accpets the empty word $\varepsilon$?
<p>Let <span class="math-container">$L = E_{TM} = \left\{ \left&lt;M \right&gt; | M \text{ is a TM and L(M)} = \emptyset \right\}$</span>. </p>&#xA;&#xA;<p>Does <span class="math-container">$L$</span> accepts the empty word <span class="math-container">$\varepsilon$</span>? </p>&#xA;&#xA;<p>In other words, is <span ...
turing machines computability
1
Does $E_{TM}$ accpets the empty word $\varepsilon$? -- (turing machines computability) <p>Let <span class="math-container">$L = E_{TM} = \left\{ \left&lt;M \right&gt; | M \text{ is a TM and L(M)} = \emptyset \right\}$</span>. </p>&#xA;&#xA;<p>Does <span class="math-container">$L$</span> accepts the empty word <span ...
habedi/stack-exchange-dataset
106,595
Coding for data compression with large target's symbol set (where the target symbol set is larger than the source symbol set)
<p>For data compression, every codding that I've seen is binary. It means we convert a language with <span class="math-container">$N$</span> symbol size to a language with <span class="math-container">$M=2$</span> symbol size. For example, in Huffman coding, the goal is to find a binary coding (<span class="math-contai...
information theory data compression coding theory
1
Coding for data compression with large target's symbol set (where the target symbol set is larger than the source symbol set) -- (information theory data compression coding theory) <p>For data compression, every codding that I've seen is binary. It means we convert a language with <span class="math-container">$N$</span...
habedi/stack-exchange-dataset
106,608
Why CLRS example on residual networks does not follows its formula?
<p>I am learning algorithms to solve Maximum Flow problem by reading the CLRS book and confused by the following figure:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/1wna8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1wna8.png" alt="figure 26.4"></a></p>&#xA;&#xA;<p>That is:</p>&#xA;&#xA;<bl...
algorithms network flow
1
Why CLRS example on residual networks does not follows its formula? -- (algorithms network flow) <p>I am learning algorithms to solve Maximum Flow problem by reading the CLRS book and confused by the following figure:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/1wna8.png" rel="nofollow noreferrer"><img src="http...
habedi/stack-exchange-dataset
106,610
How to count the biggest size of the problem during some time period?
<p>We assume that time of solving the problem <span class="math-container">$=f(n)$$\mu$</span>s.&#xA;Now we have to calculate how big problem we can calculate for each time periods.</p>&#xA;&#xA;<p>So there are:&#xA;<span class="math-container">$\lg n,&#xA;\sqrt{n},&#xA;n,&#xA;n\lg n,&#xA;n^2,&#xA;n^3,&#xA;2^n,&#xA;n!$...
complexity theory algorithm analysis
1
How to count the biggest size of the problem during some time period? -- (complexity theory algorithm analysis) <p>We assume that time of solving the problem <span class="math-container">$=f(n)$$\mu$</span>s.&#xA;Now we have to calculate how big problem we can calculate for each time periods.</p>&#xA;&#xA;<p>So there a...
habedi/stack-exchange-dataset
106,613
Finding a mapping reduction from $A_{TM}$ to $\overline{CF_{TM}}$
<p>I am trying to find a mapping reduction from <span class="math-container">$A_{TM}$</span> to <span class="math-container">$\overline{CF_{TM}}$</span>, but I can't seem to find one.</p>&#xA;&#xA;<p>Definitions:&#xA;<span class="math-container">$$\begin{align*}&#xA;CF_{TM} &amp;= \left\{ \langle M \rangle \mid \text{$...
turing machines computability context free reductions
1
Finding a mapping reduction from $A_{TM}$ to $\overline{CF_{TM}}$ -- (turing machines computability context free reductions) <p>I am trying to find a mapping reduction from <span class="math-container">$A_{TM}$</span> to <span class="math-container">$\overline{CF_{TM}}$</span>, but I can't seem to find one.</p>&#xA;&#x...
habedi/stack-exchange-dataset
106,614
Compute hash value according to multiplication method
<p>In "Introduction to Algorithms" by C. E. Leiserson, R. L. Rivest and C. Stein (ISBN: 978-0262033848), p. 264 they state this:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/8VUjM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8VUjM.png" alt="enter image description here"></a></p>&#xA;&#xA;<p...
hash python
1
Compute hash value according to multiplication method -- (hash python) <p>In "Introduction to Algorithms" by C. E. Leiserson, R. L. Rivest and C. Stein (ISBN: 978-0262033848), p. 264 they state this:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/8VUjM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur...
habedi/stack-exchange-dataset
106,617
Multiple Source Shortest Paths in a weighted graph
<p>In an unweighted graph, we can find Multiple Source Shortest Paths using the Breadth-First Search algorithm by setting the distance of all starting vertices to zero and pushing them into the queue at the beginning of the algorithm. </p>&#xA;&#xA;<p>However, I'm wondering if we can use the same technique to solve Mul...
graphs shortest path weighted graphs
1
Multiple Source Shortest Paths in a weighted graph -- (graphs shortest path weighted graphs) <p>In an unweighted graph, we can find Multiple Source Shortest Paths using the Breadth-First Search algorithm by setting the distance of all starting vertices to zero and pushing them into the queue at the beginning of the alg...
habedi/stack-exchange-dataset
106,620
How to correctly describe this action, deleting an edge that "shortcut" some vertices
<p>Haven't written a proof in years, not sure how to describe an algorithm like this ? Let us what we have a graph. like this below:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/M4aoI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M4aoI.png" alt="enter image description here"></a></p>&#xA;&#xA...
algorithms formal languages graphs proof techniques
1
How to correctly describe this action, deleting an edge that "shortcut" some vertices -- (algorithms formal languages graphs proof techniques) <p>Haven't written a proof in years, not sure how to describe an algorithm like this ? Let us what we have a graph. like this below:</p>&#xA;&#xA;<p><a href="https://i.stack.img...
habedi/stack-exchange-dataset
106,626
Does iterated PSPACE trace equal ELEMENTARY?
<p>I have the following feeling (I wouldn't even call it a conjecture yet) which I'd like to ask whether it's true in some form.</p>&#xA;&#xA;<p>Take the class of all programs running in polynomial space.</p>&#xA;&#xA;<p>Surprisingly or not, they can still output an exponentially large output: at each step of their run...
complexity theory
1
Does iterated PSPACE trace equal ELEMENTARY? -- (complexity theory) <p>I have the following feeling (I wouldn't even call it a conjecture yet) which I'd like to ask whether it's true in some form.</p>&#xA;&#xA;<p>Take the class of all programs running in polynomial space.</p>&#xA;&#xA;<p>Surprisingly or not, they can s...
habedi/stack-exchange-dataset
106,629
Isoecursive Types When to Fold and Unfold
<p>I'm trying to implement recursive types into my programming language. I've implemented extensible rows and was hoping to add some recursive typing in order to get something like <code>this</code> or <code>self</code> within a record (thus imitating objects). Recursive types would only occur in record definitions, li...
type theory type inference
1
Isoecursive Types When to Fold and Unfold -- (type theory type inference) <p>I'm trying to implement recursive types into my programming language. I've implemented extensible rows and was hoping to add some recursive typing in order to get something like <code>this</code> or <code>self</code> within a record (thus imit...
habedi/stack-exchange-dataset
106,633
Recurrence Relation Mergesort
<p>I was reading <em>Algorithms 4th Edition</em> by Sedgewick et al. and I found this statement when discussing about the analysis of mergesort:</p>&#xA;&#xA;<blockquote>&#xA; <p>The number of compares is at most n and no less than <span class="math-container">$\lfloor n/2 \rfloor$</span>.</p>&#xA;</blockquote>&#xA;&#...
algorithms sorting mergesort
1
Recurrence Relation Mergesort -- (algorithms sorting mergesort) <p>I was reading <em>Algorithms 4th Edition</em> by Sedgewick et al. and I found this statement when discussing about the analysis of mergesort:</p>&#xA;&#xA;<blockquote>&#xA; <p>The number of compares is at most n and no less than <span class="math-conta...
habedi/stack-exchange-dataset