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
9,330
Time complexity of generating the first n primes and their product
<p>Suppose that I have a turing machine that receives as input the string $1^{n\times n}$ (unary input), what is the time complexity of writing $p_1,...,p_n$ on the output tape, where $p_i$ is the i-th prime number (written in binary)? And writing the first $n$ primes followed by their product (all written in binary)?...
time complexity turing machines
1
Time complexity of generating the first n primes and their product -- (time complexity turing machines) <p>Suppose that I have a turing machine that receives as input the string $1^{n\times n}$ (unary input), what is the time complexity of writing $p_1,...,p_n$ on the output tape, where $p_i$ is the i-th prime number (...
habedi/stack-exchange-dataset
9,336
median filter one after the other
<p>Operate on an image by performing Median Filtering in a 3x3 window.<br>&#xA;Operate on the resulting image by performing, again, Median Filtering in a 3x3 window.<br>&#xA;Can the resulting image be obtained from a single Median filtering?</p>&#xA;&#xA;<p>my initial thought is that it can be done with the right mask....
image processing
1
median filter one after the other -- (image processing) <p>Operate on an image by performing Median Filtering in a 3x3 window.<br>&#xA;Operate on the resulting image by performing, again, Median Filtering in a 3x3 window.<br>&#xA;Can the resulting image be obtained from a single Median filtering?</p>&#xA;&#xA;<p>my ini...
habedi/stack-exchange-dataset
9,340
Convergence of Simulated Annealing Based Algorithms
<p>I designed a simulated annealing-based optimization algorithm. My simulation shows that it converge fast. I am looking for some sort of proof to show that simulation annealing-based algorithm converge fast (based on satisfying some properties) to global/local optimal point and doesn't oscillate in the optimal points...
algorithms reference request proof techniques optimization
1
Convergence of Simulated Annealing Based Algorithms -- (algorithms reference request proof techniques optimization) <p>I designed a simulated annealing-based optimization algorithm. My simulation shows that it converge fast. I am looking for some sort of proof to show that simulation annealing-based algorithm converge ...
habedi/stack-exchange-dataset
9,344
What is $R_\min$ in this formulat for optimal buffer size?
<p>I read a question from my recitation about optimal buffer size. As solution there is a furmula for calculating the optimal buffer size; I'm not sure about one of its parameters. The formula is</p>&#xA;&#xA;<p>$\quad \operatorname{Buffer}_{\text{optimal}} = \frac{\operatorname{Buffer}_{\text{current}}}{1-\frac{R_{\t...
computer networks
1
What is $R_\min$ in this formulat for optimal buffer size? -- (computer networks) <p>I read a question from my recitation about optimal buffer size. As solution there is a furmula for calculating the optimal buffer size; I'm not sure about one of its parameters. The formula is</p>&#xA;&#xA;<p>$\quad \operatorname{Buffe...
habedi/stack-exchange-dataset
9,349
Is it possible to decide if a given algorithm is asymptotically optimal?
<p>Is there an algorithm for the following problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a Turing machine $M_1$ that decides a language $L$,<br>&#xA; Is there a Turing machine $M_2$ deciding $L$ such that&#xA; $t_2(n) = o(t_1(n))$?</p>&#xA;</blockquote>&#xA;&#xA;<p>The functions $t_1$ and $t_2$ are the worst-case...
complexity theory computability undecidability decision problem
1
Is it possible to decide if a given algorithm is asymptotically optimal? -- (complexity theory computability undecidability decision problem) <p>Is there an algorithm for the following problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a Turing machine $M_1$ that decides a language $L$,<br>&#xA; Is there a Turing machi...
habedi/stack-exchange-dataset
9,350
Which is more computationally efficient: multiplication or 0 padding?
<p>On a PC I am implementing an algorithm in which a number from a look table will be chosen randomly, and will be multiplied by 1000 or 10000. Instead of multiplying by 1000 or 10000 I am thinking of simply padding the numbers with the required 0s. This padding will be nothing but some write operations (though random ...
efficiency binary arithmetic
1
Which is more computationally efficient: multiplication or 0 padding? -- (efficiency binary arithmetic) <p>On a PC I am implementing an algorithm in which a number from a look table will be chosen randomly, and will be multiplied by 1000 or 10000. Instead of multiplying by 1000 or 10000 I am thinking of simply padding ...
habedi/stack-exchange-dataset
9,354
What mechanisms prevent a process from taking over the processor forever?
<p>Suppose a process keeps running code (e.g. an infinite loop). How can other programs take over? What prevents the process from remaining active forever?</p>&#xA;
operating systems process scheduling
1
What mechanisms prevent a process from taking over the processor forever? -- (operating systems process scheduling) <p>Suppose a process keeps running code (e.g. an infinite loop). How can other programs take over? What prevents the process from remaining active forever?</p>&#xA;
habedi/stack-exchange-dataset
9,363
What is the decision version of independent set?
<p>I always read that finding an independent set of size $k$ in a graph is $\mathsf{NP}$-complete. However, this only requires looking for all combinations of $k$ vertices and this is a polynomial procedure of order $k$.</p>&#xA;&#xA;<p>I know that we can reduce directly SAT to independent set, with $k$ the number of c...
complexity theory terminology decision problem
1
What is the decision version of independent set? -- (complexity theory terminology decision problem) <p>I always read that finding an independent set of size $k$ in a graph is $\mathsf{NP}$-complete. However, this only requires looking for all combinations of $k$ vertices and this is a polynomial procedure of order $k$...
habedi/stack-exchange-dataset
9,377
Subtracting an integer from an ASCII number
<p>Theoretically, if I were to subtract the number 10 from the ASCII character 10 (which is really 00110001 00110000), what would I get?</p>&#xA;&#xA;<p>Does the computer add both ASCII characters and subtract? </p>&#xA;
binary arithmetic
1
Subtracting an integer from an ASCII number -- (binary arithmetic) <p>Theoretically, if I were to subtract the number 10 from the ASCII character 10 (which is really 00110001 00110000), what would I get?</p>&#xA;&#xA;<p>Does the computer add both ASCII characters and subtract? </p>&#xA;
habedi/stack-exchange-dataset
9,380
Why is push_back in C++ vectors constant amortized?
<p>I am learning C++ and noticed that the running time for the push_back function for vectors is constant "amortized." The documentation further notes that "If a reallocation happens, the reallocation is itself up to linear in the entire size."</p>&#xA;&#xA;<p>Shouldn't this mean the push_back function is $O(n)$, where...
algorithms time complexity amortized analysis
1
Why is push_back in C++ vectors constant amortized? -- (algorithms time complexity amortized analysis) <p>I am learning C++ and noticed that the running time for the push_back function for vectors is constant "amortized." The documentation further notes that "If a reallocation happens, the reallocation is itself up to ...
habedi/stack-exchange-dataset
9,389
Can we say DFA is more efficient than NFA?
<p>I just started reading about theory of computation. If we compare which is more powerful (in accepting strings), both are same. But what about efficiency ? DFA will be fast compared to NFA, since it has only one outgoing edge &amp; there will be no ambiguity. But in case of NFA we have to check all possible cases &a...
finite automata efficiency nondeterminism
1
Can we say DFA is more efficient than NFA? -- (finite automata efficiency nondeterminism) <p>I just started reading about theory of computation. If we compare which is more powerful (in accepting strings), both are same. But what about efficiency ? DFA will be fast compared to NFA, since it has only one outgoing edge &...
habedi/stack-exchange-dataset
9,390
How to the examples for using the master theorem in Cormen work?
<p>I'm reading Cormen's Introduction to Algorithms 3rd edition, and in examples of Master Method recursion solving Cormen gives two examples</p>&#xA;&#xA;<ol>&#xA;<li>$3T( \frac{n}{4} ) + n\log(n)$</li>&#xA;<li>$2T( \frac{n}{2} ) + n\log(n)$</li>&#xA;</ol>&#xA;&#xA;<p>For the first example we have $a=3$ and $b=4$ so $...
asymptotics recurrence relation master theorem
1
How to the examples for using the master theorem in Cormen work? -- (asymptotics recurrence relation master theorem) <p>I'm reading Cormen's Introduction to Algorithms 3rd edition, and in examples of Master Method recursion solving Cormen gives two examples</p>&#xA;&#xA;<ol>&#xA;<li>$3T( \frac{n}{4} ) + n\log(n)$</li>&...
habedi/stack-exchange-dataset
9,396
How can $ww = www$ hold for any word $w$?
<p>Speaking in terms of automata and regular languages, how would it be possible for a string repeating some $w$ twice equal a string repeating that same $w$ thrice? That is, why is the language</p>&#xA;&#xA;<p>$\qquad L = \{w \in \Sigma^ * \mid ww = www\}$</p>&#xA;&#xA;<p>not empty? The only thing I can think of is $w...
formal languages regular languages automata
1
How can $ww = www$ hold for any word $w$? -- (formal languages regular languages automata) <p>Speaking in terms of automata and regular languages, how would it be possible for a string repeating some $w$ twice equal a string repeating that same $w$ thrice? That is, why is the language</p>&#xA;&#xA;<p>$\qquad L = \{w \i...
habedi/stack-exchange-dataset
9,407
How can SML infer types like this?
<p><a href="http://en.wikipedia.org/wiki/Standard_ML" rel="nofollow">Wikipedia says</a>:</p>&#xA;&#xA;<pre><code>fun factorial n = &#xA; if n = 0 then 1 else n * factorial (n-1) &#xA;</code></pre>&#xA;&#xA;<blockquote>&#xA; <p>A Standard ML compiler is required to infer the static type int -> int of this function&#...
compilers functional programming type theory type inference
1
How can SML infer types like this? -- (compilers functional programming type theory type inference) <p><a href="http://en.wikipedia.org/wiki/Standard_ML" rel="nofollow">Wikipedia says</a>:</p>&#xA;&#xA;<pre><code>fun factorial n = &#xA; if n = 0 then 1 else n * factorial (n-1) &#xA;</code></pre>&#xA;&#xA;<blockquote...
habedi/stack-exchange-dataset
9,418
Give a grammar to show whether a language is regular or context-free
<p>I have to generate a grammar for the language $L = \{ w \in \{ a, b\}^* \mid |w| \in 2\mathbb{N}, w \neq w^R\}$ and give the type of the language.</p>&#xA;&#xA;<p>I've generated the grammar</p>&#xA;&#xA;<p>$\qquad \begin{align}&#xA; S &amp;\to aSa \mid bSb \mid aAb \mid bAa \\&#xA; A &amp;\to abA \mid baA \mid aa...
formal languages formal grammars context free
1
Give a grammar to show whether a language is regular or context-free -- (formal languages formal grammars context free) <p>I have to generate a grammar for the language $L = \{ w \in \{ a, b\}^* \mid |w| \in 2\mathbb{N}, w \neq w^R\}$ and give the type of the language.</p>&#xA;&#xA;<p>I've generated the grammar</p>&#x...
habedi/stack-exchange-dataset
9,442
Regular expression for binary words with few zeros
<p>What is the regular expression for the set of binary strings with the property that</p>&#xA;&#xA;<ol>&#xA;<li>every $0$ is followed by <em>exactly</em> $m$ times $1$ and </li>&#xA;<li>every $0$ is preceded by <em>at least</em> $n$ times $1$? </li>&#xA;</ol>&#xA;&#xA;<p>$m$ and $n$ are integers.</p>&#xA;
formal languages regular languages regular expressions
1
Regular expression for binary words with few zeros -- (formal languages regular languages regular expressions) <p>What is the regular expression for the set of binary strings with the property that</p>&#xA;&#xA;<ol>&#xA;<li>every $0$ is followed by <em>exactly</em> $m$ times $1$ and </li>&#xA;<li>every $0$ is preceded ...
habedi/stack-exchange-dataset
9,444
MinHeap represented by an array - two simple statements
<p>I'm trying to prove/disprove two statements. I just want to make sure with you I'm on the right line.</p>&#xA;&#xA;<p>These are the following statements:</p>&#xA;&#xA;<p><strong>Preface :</strong> Let A[n] be an array of min-heap (a min-heap represented by an array], whereas all the elements in the heap are differen...
data structures binary trees arrays heaps
1
MinHeap represented by an array - two simple statements -- (data structures binary trees arrays heaps) <p>I'm trying to prove/disprove two statements. I just want to make sure with you I'm on the right line.</p>&#xA;&#xA;<p>These are the following statements:</p>&#xA;&#xA;<p><strong>Preface :</strong> Let A[n] be an ar...
habedi/stack-exchange-dataset
9,447
Algorithm for building a suffix array in time $O(n \log^2 n)$
<p>I've been working with suffix arrays lately, and I can't find an efficient algorithm for building a suffix array which is easy to understand. I have seen in many sites that there is an $O(n \log^2 n)$ algorithm, but I can't understand it, as many important details are omitted. There's an example at <a href="http:/...
algorithms data structures strings
1
Algorithm for building a suffix array in time $O(n \log^2 n)$ -- (algorithms data structures strings) <p>I've been working with suffix arrays lately, and I can't find an efficient algorithm for building a suffix array which is easy to understand. I have seen in many sites that there is an $O(n \log^2 n)$ algorithm, bu...
habedi/stack-exchange-dataset
9,449
Transform inverse result
<p>let us assume that:<br>&#xA; <strong>f</strong> is a grayscale image of size NxN, and <strong>F</strong> is the Fourier transform of <strong>f</strong>.&#xA;<br>&#xA;<strong>G</strong> is a 2Nx2N transform obtained by inserting 0 between every value in <strong>F</strong>:&#xA;<img src="https://i.stack.imgur.com/iE9E...
image processing
1
Transform inverse result -- (image processing) <p>let us assume that:<br>&#xA; <strong>f</strong> is a grayscale image of size NxN, and <strong>F</strong> is the Fourier transform of <strong>f</strong>.&#xA;<br>&#xA;<strong>G</strong> is a 2Nx2N transform obtained by inserting 0 between every value in <strong>F</strong...
habedi/stack-exchange-dataset
9,451
General start rule question for a context free grammar
<p>Suppose I have a context free grammar described: </p>&#xA;&#xA;<blockquote>&#xA; <p>$S \rightarrow 0SS1$<br>&#xA; $S \rightarrow 1$<br>&#xA; $S \rightarrow \epsilon$ </p>&#xA;</blockquote>&#xA;&#xA;<p>Because the first rule is considered the start rule does that mean that this grammar could never generate...
context free
1
General start rule question for a context free grammar -- (context free) <p>Suppose I have a context free grammar described: </p>&#xA;&#xA;<blockquote>&#xA; <p>$S \rightarrow 0SS1$<br>&#xA; $S \rightarrow 1$<br>&#xA; $S \rightarrow \epsilon$ </p>&#xA;</blockquote>&#xA;&#xA;<p>Because the first rule is consid...
habedi/stack-exchange-dataset
9,457
Why is binary subtraction referred to as the invert-add-shift-add method?
<p>I'm being asked this question for my computer conceptes class, can't find anything about this in my text book, and have only been able to find half-baked answers googling it.</p>&#xA;&#xA;<p>Why is binary subtraction referred to as the invert-add-shift-add method?</p>&#xA;
binary arithmetic
1
Why is binary subtraction referred to as the invert-add-shift-add method? -- (binary arithmetic) <p>I'm being asked this question for my computer conceptes class, can't find anything about this in my text book, and have only been able to find half-baked answers googling it.</p>&#xA;&#xA;<p>Why is binary subtraction ref...
habedi/stack-exchange-dataset
9,461
Analyzing programs with multiple for-loops
<p>If they were all linked to make a condition such as ($1 &lt; i &lt; j &lt; k &lt; n$), I know how to solve, but the last loop is disconnected so I have no clue on how to do these...</p>&#xA;&#xA;<p>the ones like</p>&#xA;&#xA;<pre><code>for(i = 1 to n);&#xA; for(j = i to n);&#xA; x++;&#xA;</code></pre>&#xA;&#x...
algorithm analysis runtime analysis loops
1
Analyzing programs with multiple for-loops -- (algorithm analysis runtime analysis loops) <p>If they were all linked to make a condition such as ($1 &lt; i &lt; j &lt; k &lt; n$), I know how to solve, but the last loop is disconnected so I have no clue on how to do these...</p>&#xA;&#xA;<p>the ones like</p>&#xA;&#xA;<p...
habedi/stack-exchange-dataset
9,467
Is matching with mismatches a special(parametrized) case of Closest String problem?
<p>I am a bit confused. Somehow I have a problem connecting two problems together. The Closest String problem and the problem of matching with mismatches. They seam to be related but, I fail to see the connection. The Closest String problem is defined as :</p>&#xA;<blockquote>&#xA;<p><em>Instance:</em> Strings <span cl...
np complete decision problem matching
1
Is matching with mismatches a special(parametrized) case of Closest String problem? -- (np complete decision problem matching) <p>I am a bit confused. Somehow I have a problem connecting two problems together. The Closest String problem and the problem of matching with mismatches. They seam to be related but, I fail to...
habedi/stack-exchange-dataset
9,471
The amount of ROM needed to implement a 4-bit multiplier?
<p>For a 4-bit multiplier there are $2^4 \cdot 2^4 = 2^8$ combinations.</p>&#xA;&#xA;<p>The output of 4-bit multiplication is 8 bits, so the amount of ROM needed is $2^8 \cdot 8 = 2048$ bits.</p>&#xA;&#xA;<p>Why is that? Why does the ROM need all the combinations embedded into it?</p>&#xA;&#xA;<p>What will be the case...
computer architecture
1
The amount of ROM needed to implement a 4-bit multiplier? -- (computer architecture) <p>For a 4-bit multiplier there are $2^4 \cdot 2^4 = 2^8$ combinations.</p>&#xA;&#xA;<p>The output of 4-bit multiplication is 8 bits, so the amount of ROM needed is $2^8 \cdot 8 = 2048$ bits.</p>&#xA;&#xA;<p>Why is that? Why does the ...
habedi/stack-exchange-dataset
9,478
Regular expression for $\{a^k b^m c^n \mid k+m+n \text{ is odd} \}$
<p>I have to make a regular expression from the following laguage:</p>&#xA;&#xA;<blockquote>&#xA; <p>{$a^kb^mc^n : $ where <em>k</em> + <em>m</em> + <em>n</em> is odd}</p>&#xA;</blockquote>&#xA;&#xA;<p>Is is possible for the sum of three numbers to be odd (other than three consecutive odd numbers)?</p>&#xA;&#xA;<p>I h...
formal languages regular expressions
1
Regular expression for $\{a^k b^m c^n \mid k+m+n \text{ is odd} \}$ -- (formal languages regular expressions) <p>I have to make a regular expression from the following laguage:</p>&#xA;&#xA;<blockquote>&#xA; <p>{$a^kb^mc^n : $ where <em>k</em> + <em>m</em> + <em>n</em> is odd}</p>&#xA;</blockquote>&#xA;&#xA;<p>Is is p...
habedi/stack-exchange-dataset
9,495
Can a CFG end have a non-terminal symbol in the middle of it?
<p>What is the correct way to write a CFG?</p>&#xA;&#xA;<pre><code>A -&gt; B C' E&#xA;C' -&gt; C&#xA;C' -&gt; null&#xA;</code></pre>&#xA;&#xA;<p>or</p>&#xA;&#xA;<pre><code>A -&gt; B C'&#xA;C' -&gt; C E&#xA;C' -&gt; E&#xA;</code></pre>&#xA;
terminology formal grammars context free
1
Can a CFG end have a non-terminal symbol in the middle of it? -- (terminology formal grammars context free) <p>What is the correct way to write a CFG?</p>&#xA;&#xA;<pre><code>A -&gt; B C' E&#xA;C' -&gt; C&#xA;C' -&gt; null&#xA;</code></pre>&#xA;&#xA;<p>or</p>&#xA;&#xA;<pre><code>A -&gt; B C'&#xA;C' -&gt; C E&#xA;C' -&g...
habedi/stack-exchange-dataset
9,506
Infinite chain of big $O's$
<p>First, let me write the definition of big $O$ just to make things explicit.</p>&#xA;&#xA;<p>$f(n)\in O(g(n))\iff \exists c, n_0\gt 0$ such that $0\le f(n)\le cg(n), \forall n\ge n_0$</p>&#xA;&#xA;<p>Let's say we have a finite number of functions: $f_1,f_2,\dots f_n$ satisftying:</p>&#xA;&#xA;<p>$O(f_1)\subseteq O(f_...
asymptotics landau notation
1
Infinite chain of big $O's$ -- (asymptotics landau notation) <p>First, let me write the definition of big $O$ just to make things explicit.</p>&#xA;&#xA;<p>$f(n)\in O(g(n))\iff \exists c, n_0\gt 0$ such that $0\le f(n)\le cg(n), \forall n\ge n_0$</p>&#xA;&#xA;<p>Let's say we have a finite number of functions: $f_1,f_2,...
habedi/stack-exchange-dataset
9,519
Does reduction from an NP-complete problem to some problem $X$ imply that $X\in NP$?
<p>I am having problems resolving the following question:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given some problem $X$. If there exists a polynomial time reduction from (for example) $\mbox{SAT}$ to $X$, $(\mbox{SAT} \leq_{p} X)$ and since we know that $\mbox{SAT}$ is $\mbox{NP-complete}$, to show that $X$ is $\mbox{NP-co...
complexity theory terminology reductions np
1
Does reduction from an NP-complete problem to some problem $X$ imply that $X\in NP$? -- (complexity theory terminology reductions np) <p>I am having problems resolving the following question:</p>&#xA;&#xA;<blockquote>&#xA; <p>Given some problem $X$. If there exists a polynomial time reduction from (for example) $\mbox...
habedi/stack-exchange-dataset
9,523
Is O(mn) considered "linear" or "quadratic" growth?
<p>If I have some function whose time complexity is O(<em>mn</em>), where <em>m</em> and <em>n</em> are the sizes of its two inputs, would we call its time complexity "linear" (since it's linear in both <em>m</em> and <em>n</em>) or "quadratic" (since it's a product of two sizes)? Or something else?</p>&#xA;&#xA;<p>I f...
terminology asymptotics landau notation
1
Is O(mn) considered "linear" or "quadratic" growth? -- (terminology asymptotics landau notation) <p>If I have some function whose time complexity is O(<em>mn</em>), where <em>m</em> and <em>n</em> are the sizes of its two inputs, would we call its time complexity "linear" (since it's linear in both <em>m</em> and <em>n...
habedi/stack-exchange-dataset
9,531
Finding the minimum subset of intervals covering the whole set
<p>Suppose we have a set $A$ of pairs $(a,b)$ such that $a$ and $b$ are real numbers and $a &lt; b$. What is the most efficient algorithm to find the smallest subset $B \subseteq A$ such that, for any value within the range of any pair in $A$, the value is also within the range of any pair in $B$. </p>&#xA;&#xA;<p>I am...
algorithms sets
1
Finding the minimum subset of intervals covering the whole set -- (algorithms sets) <p>Suppose we have a set $A$ of pairs $(a,b)$ such that $a$ and $b$ are real numbers and $a &lt; b$. What is the most efficient algorithm to find the smallest subset $B \subseteq A$ such that, for any value within the range of any pair ...
habedi/stack-exchange-dataset
9,532
Why is the Shannon entropy 0.94 in this example?
<p>Suppose I have a decision tree in which there is a label $L$ under which is the attribute $A$ as shown below. I am given that the Shannon entropy of label $L$ is $H(L) = 0.95$.</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/21iRT.png" alt="enter image description here"></p>&#xA;&#xA;<p>I must find the Shannon e...
artificial intelligence entropy
1
Why is the Shannon entropy 0.94 in this example? -- (artificial intelligence entropy) <p>Suppose I have a decision tree in which there is a label $L$ under which is the attribute $A$ as shown below. I am given that the Shannon entropy of label $L$ is $H(L) = 0.95$.</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/21...
habedi/stack-exchange-dataset
9,537
Finite automaton for the language of words whose second letter is b
<p>How can I build a finite automaton that accepts only the language of all words in which <code>b</code> is the second letter?</p>&#xA;&#xA;<p>This is my solution so far but I'm not sure if it's correct.</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/f5Rcj.gif" alt=""></p>&#xA;
finite automata
1
Finite automaton for the language of words whose second letter is b -- (finite automata) <p>How can I build a finite automaton that accepts only the language of all words in which <code>b</code> is the second letter?</p>&#xA;&#xA;<p>This is my solution so far but I'm not sure if it's correct.</p>&#xA;&#xA;<p><img src="...
habedi/stack-exchange-dataset
9,547
Can someone help me understand cache conscience radix sort? (excerpt from journal article attached)
<p><em><strong>Article:</em></strong> </p>&#xA;&#xA;<h1>CC-Radix: a Cache Conscious Sorting Based on Radix sort</h1>&#xA;&#xA;<p><strong>(IEEE 2003)</strong></p>&#xA;&#xA;<p>I'm trying to figure out what the author means by this section:</p>&#xA;&#xA;<blockquote>&#xA; <p>Explanation of CC-Radix For clarity reasons, w...
algorithms sorting
1
Can someone help me understand cache conscience radix sort? (excerpt from journal article attached) -- (algorithms sorting) <p><em><strong>Article:</em></strong> </p>&#xA;&#xA;<h1>CC-Radix: a Cache Conscious Sorting Based on Radix sort</h1>&#xA;&#xA;<p><strong>(IEEE 2003)</strong></p>&#xA;&#xA;<p>I'm trying to figure ...
habedi/stack-exchange-dataset
9,555
Computing the longest common substring of two strings using suffix arrays
<p>After I learned how to build a suffix array in $O(N)$ complexity, I am interested in discovering the applications of the suffix arrays. One of these is finding the longest common substring between two strings, in $O(N)$ time. I found on the internet the following algorithm:</p>&#xA;&#xA;<ol>&#xA;<li>merge the two st...
algorithms suffix array
1
Computing the longest common substring of two strings using suffix arrays -- (algorithms suffix array) <p>After I learned how to build a suffix array in $O(N)$ complexity, I am interested in discovering the applications of the suffix arrays. One of these is finding the longest common substring between two strings, in $...
habedi/stack-exchange-dataset
9,556
What is the definition of P, NP, NP-complete and NP-hard?
<p>I'm in a course about <em>computing</em> and <em>complexity</em>, and am unable to understand what these terms mean. </p>&#xA;&#xA;<p>All I know is that NP is a subset of NP-complete, which is a subset of NP-hard, but I have no idea what they actually mean. <a href="https://en.wikipedia.org/wiki/Complexity_class" re...
complexity theory terminology complexity classes p vs np reference question
1
What is the definition of P, NP, NP-complete and NP-hard? -- (complexity theory terminology complexity classes p vs np reference question) <p>I'm in a course about <em>computing</em> and <em>complexity</em>, and am unable to understand what these terms mean. </p>&#xA;&#xA;<p>All I know is that NP is a subset of NP-comp...
habedi/stack-exchange-dataset
9,569
Rigorous proof for validity of assumption $n=b^k$ when using the Master theorem
<p>The Master theorem is a beautiful tool for <a href="https://cs.stackexchange.com/a/2823/98">solving certain kinds of recurrences</a>. However, we often gloss over an integral part when applying it. For example, during the analysis of Mergesort we happily go from</p>&#xA;&#xA;<p>$\qquad T(n) = T\left(\left\lfloor \fr...
asymptotics proof techniques recurrence relation master theorem
1
Rigorous proof for validity of assumption $n=b^k$ when using the Master theorem -- (asymptotics proof techniques recurrence relation master theorem) <p>The Master theorem is a beautiful tool for <a href="https://cs.stackexchange.com/a/2823/98">solving certain kinds of recurrences</a>. However, we often gloss over an in...
habedi/stack-exchange-dataset
9,572
Independent set on cubic triangle-free graphs
<p>I know that maximum independent set on cubic triangle-free graphs is NP-complete. </p>&#xA;&#xA;<p>Is it still NP-complete in case we require the independent set to be of size exactly $|V|/2$?</p>&#xA;&#xA;<p>Basiclly, YES instance of independent set problem on cubic triangle-free graphs problem must have exactly $|...
complexity theory np complete
1
Independent set on cubic triangle-free graphs -- (complexity theory np complete) <p>I know that maximum independent set on cubic triangle-free graphs is NP-complete. </p>&#xA;&#xA;<p>Is it still NP-complete in case we require the independent set to be of size exactly $|V|/2$?</p>&#xA;&#xA;<p>Basiclly, YES instance of i...
habedi/stack-exchange-dataset
9,573
Show that the Turing Machine domain can be viewed as a classical planning domain
<p>This is one of my assignments. I am not able to comprehend how to reduce the Turing machine domain to Classical planning domain. My understanding is that we have to essentially perform complexity analysis of classical planning domain. So I have defined these two languages </p>&#xA;&#xA;<p>a) PLAN-EXISTENCE(D) = {P ...
complexity theory turing machines artificial intelligence
1
Show that the Turing Machine domain can be viewed as a classical planning domain -- (complexity theory turing machines artificial intelligence) <p>This is one of my assignments. I am not able to comprehend how to reduce the Turing machine domain to Classical planning domain. My understanding is that we have to essentia...
habedi/stack-exchange-dataset
9,585
P, NP and specialised Turing Machines
<p>I'm sort of new, but very interested to the field of computing and complexity theory, and I want to clarify my understanding about how to class problems, and how strongly the problems relate to the machine being used to solve them.</p>&#xA;&#xA;<p><strong>My Understanding</strong></p>&#xA;&#xA;<ul>&#xA;<li>Standard ...
complexity theory computability terminology turing machines complexity classes
1
P, NP and specialised Turing Machines -- (complexity theory computability terminology turing machines complexity classes) <p>I'm sort of new, but very interested to the field of computing and complexity theory, and I want to clarify my understanding about how to class problems, and how strongly the problems relate to t...
habedi/stack-exchange-dataset
9,586
Problems that are Cook-reducible to a problem in NP $\cap$ co-NP
<p>Let $\mathcal{A}$ be a problem in $\text{NP} \cap \text{co}$-$\text{NP}$.</p>&#xA;&#xA;<p>Now assume we can reduce another problem $\mathcal{B}$ to it using Cook reduction.</p>&#xA;&#xA;<p>What conclusions can we draw about $\mathcal{B}$? Does this question even make sense?</p>&#xA;&#xA;<p>I'm asking because from wh...
complexity theory reductions np
1
Problems that are Cook-reducible to a problem in NP $\cap$ co-NP -- (complexity theory reductions np) <p>Let $\mathcal{A}$ be a problem in $\text{NP} \cap \text{co}$-$\text{NP}$.</p>&#xA;&#xA;<p>Now assume we can reduce another problem $\mathcal{B}$ to it using Cook reduction.</p>&#xA;&#xA;<p>What conclusions can we dr...
habedi/stack-exchange-dataset
9,587
Difference between Data point, attribute, feature?
<p>Can anyone tell me the difference between the following in data mining? I am taking a class this semester and the professor is using the terms so frequently, I don't know what these mean anymore.</p>&#xA;&#xA;<ul>&#xA;<li>Data point </li>&#xA;<li>attribute </li>&#xA;<li>feature</li>&#xA;</ul>&#xA;
terminology data mining
1
Difference between Data point, attribute, feature? -- (terminology data mining) <p>Can anyone tell me the difference between the following in data mining? I am taking a class this semester and the professor is using the terms so frequently, I don't know what these mean anymore.</p>&#xA;&#xA;<ul>&#xA;<li>Data point </li...
habedi/stack-exchange-dataset
9,590
Why does backtracking work the way it does?
<p>I just recently started learning in a CS context (as opposed to a programming context) about simple recursive functions, along with the combinatorial applications, and techniques such as Backtracking and Divide et Impera.</p>&#xA;&#xA;<p>The example problem that I chose for my questions is the n queens problem (give...
algorithms recursion backtracking
1
Why does backtracking work the way it does? -- (algorithms recursion backtracking) <p>I just recently started learning in a CS context (as opposed to a programming context) about simple recursive functions, along with the combinatorial applications, and techniques such as Backtracking and Divide et Impera.</p>&#xA;&#xA...
habedi/stack-exchange-dataset
9,604
Clear, intuitive derivation of the fixed-point combinator (Y combinator)?
<p>The fixed-point combinator FIX (aka the Y combinator) in the (untyped) lambda calculus ($\lambda$) is defined as:</p>&#xA;&#xA;<p>FIX $\triangleq \lambda f.(\lambda x. f~(\lambda y. x~x~y))~(\lambda x. f~(\lambda y. x~x~y))$</p>&#xA;&#xA;<p>I understand its purpose and I can trace the execution of its application pe...
computability logic programming languages lambda calculus combinatory logic
1
Clear, intuitive derivation of the fixed-point combinator (Y combinator)? -- (computability logic programming languages lambda calculus combinatory logic) <p>The fixed-point combinator FIX (aka the Y combinator) in the (untyped) lambda calculus ($\lambda$) is defined as:</p>&#xA;&#xA;<p>FIX $\triangleq \lambda f.(\lamb...
habedi/stack-exchange-dataset
9,611
Finding the minimum subset within a cycle
<p>Suppose we have a set $A$ of pairs $(a,b)$ such that $a$ and $b$ are real numbers defined in the interval $[c,d]$. Assume no two values are identical. For $(a,b)$, if $a &gt; b$, the range is $[a,d] \cup [c,b]$; otherwise, it is $[a,b]$. What is the most efficient algorithm to find the smallest subset $B \subseteq A...
algorithms
1
Finding the minimum subset within a cycle -- (algorithms) <p>Suppose we have a set $A$ of pairs $(a,b)$ such that $a$ and $b$ are real numbers defined in the interval $[c,d]$. Assume no two values are identical. For $(a,b)$, if $a &gt; b$, the range is $[a,d] \cup [c,b]$; otherwise, it is $[a,b]$. What is the most effi...
habedi/stack-exchange-dataset
9,612
Look Ahead buffer vs Translation Look aside buffer
<p>I know that <strong>Translation look aside buffer</strong> is used for address translation in paging to achieve better performance.</p>&#xA;&#xA;<p>I came across term called <strong>Look Ahead buffer</strong> in a document which said it implements Temporal locality.</p>&#xA;&#xA;<p>I tried searching for <strong>Loo...
operating systems paging virtual memory
1
Look Ahead buffer vs Translation Look aside buffer -- (operating systems paging virtual memory) <p>I know that <strong>Translation look aside buffer</strong> is used for address translation in paging to achieve better performance.</p>&#xA;&#xA;<p>I came across term called <strong>Look Ahead buffer</strong> in a docume...
habedi/stack-exchange-dataset
9,613
Big O time complexity
<p>I have a question if I have my $k=300$&#xA;and my loop is like this :</p>&#xA;&#xA;<pre><code>for( int x = 0 ; x&lt;n ; x--){&#xA; for(int y=0 ; y&lt;k; y++){&#xA; ...&#xA; }&#xA;}&#xA;</code></pre>&#xA;&#xA;<p>Is this still $O(n^2)$? If no, why?&#xA;Thank you :)</p>&#xA;
time complexity landau notation
1
Big O time complexity -- (time complexity landau notation) <p>I have a question if I have my $k=300$&#xA;and my loop is like this :</p>&#xA;&#xA;<pre><code>for( int x = 0 ; x&lt;n ; x--){&#xA; for(int y=0 ; y&lt;k; y++){&#xA; ...&#xA; }&#xA;}&#xA;</code></pre>&#xA;&#xA;<p>Is this still $O(n^2)$? If no, why...
habedi/stack-exchange-dataset
9,618
Quick union and heuristic by size
<p>Studying Quick-Find and Quick-Union heuristic I've found clear that:</p>&#xA;&#xA;<ul>&#xA;<li><p>with quick find trees and a union based on the size of the trees we can make a union in $T_{am}(n)=O(\log(n))$</p></li>&#xA;<li><p>with quick find trees and a union based on the height of the trees we can make a find in...
algorithms heuristics union find
1
Quick union and heuristic by size -- (algorithms heuristics union find) <p>Studying Quick-Find and Quick-Union heuristic I've found clear that:</p>&#xA;&#xA;<ul>&#xA;<li><p>with quick find trees and a union based on the size of the trees we can make a union in $T_{am}(n)=O(\log(n))$</p></li>&#xA;<li><p>with quick find ...
habedi/stack-exchange-dataset
9,620
Creating a logical circuit
<p><strong>Task</strong>:&#xA;Design a 2 bit comparator.</p>&#xA;&#xA;<p>Input: 2x 2 bit (I take it as 2 2-bit values, let them be unsigned for simplicity) &#xA;Output: 1 if result input1>input2 is true, 0 otherwise</p>&#xA;&#xA;<p>Develop truth table and derive circuits.</p>&#xA;&#xA;<p><strong>The problem</strong>: I...
logic circuits
1
Creating a logical circuit -- (logic circuits) <p><strong>Task</strong>:&#xA;Design a 2 bit comparator.</p>&#xA;&#xA;<p>Input: 2x 2 bit (I take it as 2 2-bit values, let them be unsigned for simplicity) &#xA;Output: 1 if result input1>input2 is true, 0 otherwise</p>&#xA;&#xA;<p>Develop truth table and derive circuits.<...
habedi/stack-exchange-dataset
9,621
Unique tilings of squares
<p>We want to tile $m\times m$-square using two types of tiles: $1 \times 1$-square tile and $2 \times 2$-square tile such that every underlying square is covered without overlapping. Let us define a function $f(n)$ that gives the size of largest uniquely tillable square using $n$ $1\times 1$-squares and any number of ...
computability combinatorics
1
Unique tilings of squares -- (computability combinatorics) <p>We want to tile $m\times m$-square using two types of tiles: $1 \times 1$-square tile and $2 \times 2$-square tile such that every underlying square is covered without overlapping. Let us define a function $f(n)$ that gives the size of largest uniquely tilla...
habedi/stack-exchange-dataset
9,625
Does $\mathsf{NSPACE}( f (n)) = \mathsf{coNSPACE}( f (n))$ hold for $ f(n) < \log (n) $?
<p>It's known that for $f(n) \geq \log n$, $\mathsf{NSPACE}(f(n)) = \mathsf{coNSPACE}(f(n))$.</p>&#xA;&#xA;<p>What if $f(n)&lt;\log n$? Are they also equal?</p>&#xA;
complexity theory space complexity
1
Does $\mathsf{NSPACE}( f (n)) = \mathsf{coNSPACE}( f (n))$ hold for $ f(n) < \log (n) $? -- (complexity theory space complexity) <p>It's known that for $f(n) \geq \log n$, $\mathsf{NSPACE}(f(n)) = \mathsf{coNSPACE}(f(n))$.</p>&#xA;&#xA;<p>What if $f(n)&lt;\log n$? Are they also equal?</p>&#xA;
habedi/stack-exchange-dataset
9,633
Why are there more non-computable functions than computable ones?
<p>I'm currently reading a book in algorithms and complexity. At the moment I'm, reading about computable and non-computable functions, and my book states that there are many more functions that are non-computable than computable, in fact the majority is non-computable it says. In some sense I can intuitively accept th...
computability turing machines combinatorics
1
Why are there more non-computable functions than computable ones? -- (computability turing machines combinatorics) <p>I'm currently reading a book in algorithms and complexity. At the moment I'm, reading about computable and non-computable functions, and my book states that there are many more functions that are non-co...
habedi/stack-exchange-dataset
9,642
Quadratic residue and integer factoring
<p>I often read that deciding whether or not a number $r$ is a quadratic residue modulo $n$ is an interesting (and hard) problem from number theory (especially if $n$ is not prime). </p>&#xA;&#xA;<p>I am looking at the following special case of this problem: Let $p$ and $q$ be two different prime numbers and $n:=pq$. G...
cryptography number theory
1
Quadratic residue and integer factoring -- (cryptography number theory) <p>I often read that deciding whether or not a number $r$ is a quadratic residue modulo $n$ is an interesting (and hard) problem from number theory (especially if $n$ is not prime). </p>&#xA;&#xA;<p>I am looking at the following special case of thi...
habedi/stack-exchange-dataset
9,648
What use are groups, monoids, and rings in database computations?
<p>Why would a company like Twitter be interested in algebraic concepts like groups, monoids and rings? See their repository at <a href="https://github.com/twitter/algebird?" rel="noreferrer">github:twitter/algebird</a>. </p>&#xA;&#xA;<p>All I could find is:</p>&#xA;&#xA;<blockquote>&#xA; <p>Implementations of Monoids...
reference request discrete mathematics database theory applied theory group theory
1
What use are groups, monoids, and rings in database computations? -- (reference request discrete mathematics database theory applied theory group theory) <p>Why would a company like Twitter be interested in algebraic concepts like groups, monoids and rings? See their repository at <a href="https://github.com/twitter/al...
habedi/stack-exchange-dataset
9,655
anonymous lambda functions (functional programming)
<p>What are anonymous (lambda) functions? What is the formal definition of an anonymous function in a functional programming language? </p>&#xA;&#xA;<p>In my simple terms, when I am programming in scheme/lisp I would say an anonymous (lambda) function is a function that is not bound to an identifier.</p>&#xA;&#xA;<p>Is...
logic programming languages lambda calculus functional programming
1
anonymous lambda functions (functional programming) -- (logic programming languages lambda calculus functional programming) <p>What are anonymous (lambda) functions? What is the formal definition of an anonymous function in a functional programming language? </p>&#xA;&#xA;<p>In my simple terms, when I am programming in...
habedi/stack-exchange-dataset
9,657
Difference between Normative annexes and Informative annexes in ADA 95
<p>I was reading the ADA 95 reference manual. I came across these two words in annexes &#xA; Normative and informative . I couldnt find the difference between those. Your help will be much appreciated.</p>&#xA;
reference request programming languages books
1
Difference between Normative annexes and Informative annexes in ADA 95 -- (reference request programming languages books) <p>I was reading the ADA 95 reference manual. I came across these two words in annexes &#xA; Normative and informative . I couldnt find the difference between those. Your help will be much appreci...
habedi/stack-exchange-dataset
9,664
Is it necessary for NP problems to be decision problems?
<p>Professor Tim Roughgarden from Stanford University while teaching a <a href="https://class.coursera.org/algo2-2012-001/class/index" rel="nofollow">MOOC</a> said that solutions to problems in the class NP must be polynomial in length. But the <a href="https://en.wikipedia.org/wiki/NP_%28complexity%29" rel="nofollow">...
algorithms np p vs np
1
Is it necessary for NP problems to be decision problems? -- (algorithms np p vs np) <p>Professor Tim Roughgarden from Stanford University while teaching a <a href="https://class.coursera.org/algo2-2012-001/class/index" rel="nofollow">MOOC</a> said that solutions to problems in the class NP must be polynomial in length....
habedi/stack-exchange-dataset
9,669
HamCycle to HamPath reduction
<p>I've seen a reduction that's done by adding another vertex to the graph and creating a path through that vertex.</p>&#xA;&#xA;<p>Why do I need to add a vertex? Cant I just remove an edge? Lets say the graph with the HamCycle is G,s,t when removing the edge between s and t dont I get a path the goes through all the v...
complexity theory np complete reductions
1
HamCycle to HamPath reduction -- (complexity theory np complete reductions) <p>I've seen a reduction that's done by adding another vertex to the graph and creating a path through that vertex.</p>&#xA;&#xA;<p>Why do I need to add a vertex? Cant I just remove an edge? Lets say the graph with the HamCycle is G,s,t when re...
habedi/stack-exchange-dataset
9,676
The purpose of grey node in graph depth-first search
<p>In many implementations of depth-first search that I saw (for example: <a href="http://ramos.elo.utfsm.cl/~lsb/elo320/aplicaciones/aplicaciones/CS460AlgorithmsandComplexity/lecture9/COMP460%20Algorithms%20and%20Complexity%20Lecture%209.htm">here</a>), the code distinguish between a grey vertex (discovered, but not a...
algorithms graphs search algorithms graph traversal
1
The purpose of grey node in graph depth-first search -- (algorithms graphs search algorithms graph traversal) <p>In many implementations of depth-first search that I saw (for example: <a href="http://ramos.elo.utfsm.cl/~lsb/elo320/aplicaciones/aplicaciones/CS460AlgorithmsandComplexity/lecture9/COMP460%20Algorithms%20an...
habedi/stack-exchange-dataset
9,678
Complexity of GF(2) and applications to cryptography
<p>If I have a system of N polynomial equations with N unknowns in GF(2):</p>&#xA;&#xA;<ul>&#xA;<li>What are some good methods to solve them?</li>&#xA;<li>What's the highest value of N that can be reasonable solved?</li>&#xA;</ul>&#xA;&#xA;<p>Now, my root interest isn't GF, it's crypto. Here's my reasoning:</p>&#xA;&#...
algorithms
1
Complexity of GF(2) and applications to cryptography -- (algorithms) <p>If I have a system of N polynomial equations with N unknowns in GF(2):</p>&#xA;&#xA;<ul>&#xA;<li>What are some good methods to solve them?</li>&#xA;<li>What's the highest value of N that can be reasonable solved?</li>&#xA;</ul>&#xA;&#xA;<p>Now, my ...
habedi/stack-exchange-dataset
9,691
Looking for non-entry level implementation of foundational algorithms and data structures in python. where to look?
<p>I'm an autodidact who works best with a mix of theory and implementation examples. I'm having a hard time finding resources on implementing algorithms and data structures in Python (2.7-3.X preferably). I found a text ...mastering basic algorithms in the python language but I find it to be far too introductory and ...
algorithms algorithm analysis
1
Looking for non-entry level implementation of foundational algorithms and data structures in python. where to look? -- (algorithms algorithm analysis) <p>I'm an autodidact who works best with a mix of theory and implementation examples. I'm having a hard time finding resources on implementing algorithms and data struct...
habedi/stack-exchange-dataset
9,693
Bipartite graph question
<p>Assume you are given a bipartite graph $G = (U, V, E)$ and you are given an integer $n$. Assume also that for each $v \in V$, you are given two integers $v_{min}$ and $v_{max}$ (where $v_{min} \le v_{max}$).</p>&#xA;&#xA;<p>The problem is to find a subset $U'$ of $U$ of size $n$ such that for each $v \in V$, the num...
algorithms graphs bipartite matching
1
Bipartite graph question -- (algorithms graphs bipartite matching) <p>Assume you are given a bipartite graph $G = (U, V, E)$ and you are given an integer $n$. Assume also that for each $v \in V$, you are given two integers $v_{min}$ and $v_{max}$ (where $v_{min} \le v_{max}$).</p>&#xA;&#xA;<p>The problem is to find a s...
habedi/stack-exchange-dataset
9,699
Meaning of the Halting problem
<p>The Halting Problem is defined as:</p>&#xA;&#xA;<p>$H_{TM} = \{ \langle M, w \rangle \mid \text{\(M\) halts on input \(w\)}\}$</p>&#xA;&#xA;<p>I'm not sure what it means. Is $H_{TM}$ a collection of Turing Machines such that all of them accept/reject the word $w$? Is that a specific word? Or does that mean any word ...
computability turing machines
1
Meaning of the Halting problem -- (computability turing machines) <p>The Halting Problem is defined as:</p>&#xA;&#xA;<p>$H_{TM} = \{ \langle M, w \rangle \mid \text{\(M\) halts on input \(w\)}\}$</p>&#xA;&#xA;<p>I'm not sure what it means. Is $H_{TM}$ a collection of Turing Machines such that all of them accept/reject ...
habedi/stack-exchange-dataset
9,703
Intuition about decidability
<p>Given a language, how do you go about deciding if it's decidable or not? For example:</p>&#xA;&#xA;<p>Given a DFA $A_0$ and a TM $M_0$</p>&#xA;&#xA;<p>$L_1 = \{ \langle M \rangle \, | \, M \mbox{ is a TM and }L(M) = L(A_0) \}$</p>&#xA;&#xA;<p>$L_2 = \{ \langle A \rangle \, | \, A \mbox{ is a DFA and }L(A) = L(M_0) \...
turing machines undecidability
1
Intuition about decidability -- (turing machines undecidability) <p>Given a language, how do you go about deciding if it's decidable or not? For example:</p>&#xA;&#xA;<p>Given a DFA $A_0$ and a TM $M_0$</p>&#xA;&#xA;<p>$L_1 = \{ \langle M \rangle \, | \, M \mbox{ is a TM and }L(M) = L(A_0) \}$</p>&#xA;&#xA;<p>$L_2 = \{...
habedi/stack-exchange-dataset
9,704
Which non-regular languages are in $AC^0$?
<p>For example, I know that the non-regular language $a^nb^n$ is in $AC^0$. I would like to know more examples like this.</p>&#xA;
complexity theory regular languages circuits
1
Which non-regular languages are in $AC^0$? -- (complexity theory regular languages circuits) <p>For example, I know that the non-regular language $a^nb^n$ is in $AC^0$. I would like to know more examples like this.</p>&#xA;
habedi/stack-exchange-dataset
9,706
Non-deterministic Turing machine that halts on at least one branches of computation
<p>I'm looking at my textbook here from Michael Sipser and he says that a <strong>nondeterministic Turing machine is a decider if all its computation branches halt on all inputs.</strong> I think I recall seeing somewhere what you'd call a nondeterministic Turing machine that halts on at least one branch for all inputs...
turing machines nondeterminism
1
Non-deterministic Turing machine that halts on at least one branches of computation -- (turing machines nondeterminism) <p>I'm looking at my textbook here from Michael Sipser and he says that a <strong>nondeterministic Turing machine is a decider if all its computation branches halt on all inputs.</strong> I think I re...
habedi/stack-exchange-dataset
9,711
design of self-loops and final states in fsm
<p>I am learning about automata and finite state machines. Consider the following automaton, that accepts the word 'ab', does not have to be infinite, just once:</p>&#xA;&#xA;<p>alphabet: 'a','b'&#xA;states: 1,2, 3 (3 is the final state and 1 is the initial state)</p>&#xA;&#xA;<p>transitions:</p>&#xA;&#xA;<pre><code>st...
finite automata
1
design of self-loops and final states in fsm -- (finite automata) <p>I am learning about automata and finite state machines. Consider the following automaton, that accepts the word 'ab', does not have to be infinite, just once:</p>&#xA;&#xA;<p>alphabet: 'a','b'&#xA;states: 1,2, 3 (3 is the final state and 1 is the init...
habedi/stack-exchange-dataset
9,714
Running time of a nested loop with $\sum i \log i$ term
<p>So I have the following pseudo-code:</p>&#xA;&#xA;<pre><code>Function(n):&#xA;for (i = 4 to n^2):&#xA; for (j = 5 to floor(3ilog(i))):&#xA; // Some math that executes in constant time&#xA;</code></pre>&#xA;&#xA;<p>So far, I know that to find this i will be calculating</p>&#xA;&#xA;<p>$\sum_{i=4}^{n^2}\sum_...
time complexity algorithm analysis asymptotics
1
Running time of a nested loop with $\sum i \log i$ term -- (time complexity algorithm analysis asymptotics) <p>So I have the following pseudo-code:</p>&#xA;&#xA;<pre><code>Function(n):&#xA;for (i = 4 to n^2):&#xA; for (j = 5 to floor(3ilog(i))):&#xA; // Some math that executes in constant time&#xA;</code></pr...
habedi/stack-exchange-dataset
9,727
Process graphs and finding infinite processes
<p>I am reading on concurrent processes and algorithms which find infinite processes by searching the process graph recursively. </p>&#xA;&#xA;<p>Most of the material I have found is not for beginners. I am looking for references / algorithms that can help me understand:</p>&#xA;&#xA;<ol>&#xA;<li>What are process graph...
reference request concurrency process algebras
1
Process graphs and finding infinite processes -- (reference request concurrency process algebras) <p>I am reading on concurrent processes and algorithms which find infinite processes by searching the process graph recursively. </p>&#xA;&#xA;<p>Most of the material I have found is not for beginners. I am looking for ref...
habedi/stack-exchange-dataset
9,734
Can we make a problem harder than NP and coNP if they are not equal?
<p>Let us assume that $\mathsf{NP} \neq \mathsf{coNP}$. Consider the graph 3-colorability problem.</p>&#xA;&#xA;<p>Since $\mathsf{NP} \neq \mathsf{coNP}$ implies $\mathsf{P} \neq \mathsf{NP}$ and 3-coloribility is $\mathsf{NP}$-complete and its complement is $\mathsf{coNP}$-complete , we have:</p>&#xA;&#xA;<ol>&#xA;<li...
complexity theory complexity classes
1
Can we make a problem harder than NP and coNP if they are not equal? -- (complexity theory complexity classes) <p>Let us assume that $\mathsf{NP} \neq \mathsf{coNP}$. Consider the graph 3-colorability problem.</p>&#xA;&#xA;<p>Since $\mathsf{NP} \neq \mathsf{coNP}$ implies $\mathsf{P} \neq \mathsf{NP}$ and 3-coloribilit...
habedi/stack-exchange-dataset
9,744
Definition of Strongly Parsimonious Reduction
<p>There is a well known definition of <strong>parsimonious reduction</strong>.</p>&#xA;&#xA;<p>The standard definition of parsimonious reduction is very intuitive. It simply means that the two problem have the same number of solutions, when on input of one of them we applied function $f$.</p>&#xA;&#xA;<p>We say there ...
complexity theory reductions
1
Definition of Strongly Parsimonious Reduction -- (complexity theory reductions) <p>There is a well known definition of <strong>parsimonious reduction</strong>.</p>&#xA;&#xA;<p>The standard definition of parsimonious reduction is very intuitive. It simply means that the two problem have the same number of solutions, whe...
habedi/stack-exchange-dataset
9,753
What do time complexity reductions prove?
<p>I may have missed something in my classes - but with $A\leq_{P}B$... Does this show that, if $A\in \textbf{NP-Complete}$, that $B\in \textbf{NP}$ or $B\in \textbf{NP-Complete}$?</p>&#xA;&#xA;<p>Or maybe I got things backwards. If $A$ is polynomial-time-reducable to $B$, and $B$ is $\textbf{NP}$-complete, does that m...
complexity theory terminology reductions
1
What do time complexity reductions prove? -- (complexity theory terminology reductions) <p>I may have missed something in my classes - but with $A\leq_{P}B$... Does this show that, if $A\in \textbf{NP-Complete}$, that $B\in \textbf{NP}$ or $B\in \textbf{NP-Complete}$?</p>&#xA;&#xA;<p>Or maybe I got things backwards. If...
habedi/stack-exchange-dataset
9,756
How are programming languages and foundations of mathematics related?
<p>Basically I am aware of three foundations for math</p>&#xA;&#xA;<ol>&#xA;<li>Set theory</li>&#xA;<li>Type theory</li>&#xA;<li>Category theory</li>&#xA;</ol>&#xA;&#xA;<p>So in what ways are programming languages and foundations of mathematics related?</p>&#xA;&#xA;<p>EDIT</p>&#xA;&#xA;<p>The original question was "Pr...
programming languages history type theory category theory
1
How are programming languages and foundations of mathematics related? -- (programming languages history type theory category theory) <p>Basically I am aware of three foundations for math</p>&#xA;&#xA;<ol>&#xA;<li>Set theory</li>&#xA;<li>Type theory</li>&#xA;<li>Category theory</li>&#xA;</ol>&#xA;&#xA;<p>So in what ways...
habedi/stack-exchange-dataset
9,758
Polynomial time reductions
<p>I'm having a very hard time understanding what's what.</p>&#xA;&#xA;<p>$$L_{1}\leq_{p}L_{2}$$</p>&#xA;&#xA;<p>If $L_2$ is stated to be in $\textbf{NP}$, is it necessarily true that $L_1$ is $\textbf{NP}$-Complete? I need to show the following for an assignment, but I'm having a dispute with a fellow student because ...
complexity theory terminology np complete reductions
1
Polynomial time reductions -- (complexity theory terminology np complete reductions) <p>I'm having a very hard time understanding what's what.</p>&#xA;&#xA;<p>$$L_{1}\leq_{p}L_{2}$$</p>&#xA;&#xA;<p>If $L_2$ is stated to be in $\textbf{NP}$, is it necessarily true that $L_1$ is $\textbf{NP}$-Complete? I need to show the...
habedi/stack-exchange-dataset
9,761
How does "δ:Q×Σ→Q" read in the definition of a DFA (deterministic finite acceptor)?
<p>How do you say $\delta\colon Q \times \Sigma \to Q$ in English? Describing what $\times$" and $\to$ mean would also help.</p>&#xA;
formal languages finite automata
1
How does "δ:Q×Σ→Q" read in the definition of a DFA (deterministic finite acceptor)? -- (formal languages finite automata) <p>How do you say $\delta\colon Q \times \Sigma \to Q$ in English? Describing what $\times$" and $\to$ mean would also help.</p>&#xA;
habedi/stack-exchange-dataset
9,769
What is the relation between functors in SML and Category theory?
<p>Along the same thinking as this statement by <a href="https://cs.stackexchange.com/users/1329/andrej-bauer">Andrej Bauer</a> in this <a href="https://cs.stackexchange.com/a/9763/268">answer</a></p>&#xA;&#xA;<blockquote>&#xA; <p>The Haskell community has developed a number of techniques inspired by&#xA; category th...
programming languages functional programming category theory
1
What is the relation between functors in SML and Category theory? -- (programming languages functional programming category theory) <p>Along the same thinking as this statement by <a href="https://cs.stackexchange.com/users/1329/andrej-bauer">Andrej Bauer</a> in this <a href="https://cs.stackexchange.com/a/9763/268">an...
habedi/stack-exchange-dataset
9,780
A variant of the busy beaver function
<p>Reading this question "<a href="https://cs.stackexchange.com/questions/9772/natural-re-undecidable-problems-but-not-turing-complete">Natural RE undecidable problems but not Turing-complete</a>" the following language came to my mind:</p>&#xA;&#xA;<p>If $\Sigma(\cdot)$ is the busy beaver function (maximum attainable ...
computability turing machines
1
A variant of the busy beaver function -- (computability turing machines) <p>Reading this question "<a href="https://cs.stackexchange.com/questions/9772/natural-re-undecidable-problems-but-not-turing-complete">Natural RE undecidable problems but not Turing-complete</a>" the following language came to my mind:</p>&#xA;&#...
habedi/stack-exchange-dataset
9,781
How to find $L_q = \emptyset$, a state that is not reachable for any given string?
<p>In the book <a href="https://rads.stackoverflow.com/amzn/click/com/0072322004" rel="nofollow noreferrer" rel="nofollow noreferrer">Introduction to Languages and the Theory of Computation</a>, I'm reading section 2.6 on how to minimize the number of states in an FA.</p>&#xA;<p>I'm having trouble understanding a notat...
automata finite automata
1
How to find $L_q = \emptyset$, a state that is not reachable for any given string? -- (automata finite automata) <p>In the book <a href="https://rads.stackoverflow.com/amzn/click/com/0072322004" rel="nofollow noreferrer" rel="nofollow noreferrer">Introduction to Languages and the Theory of Computation</a>, I'm reading ...
habedi/stack-exchange-dataset
9,783
Simple lower bounds against AC0
<p>It is known that $Parity \notin AC^0$ (nonuniform), but the proof is rather involved and combinatorial. Are there simpler, but weaker lower bounds, say for $NP \not \subseteq AC^0$ or $NEXP \not \subseteq AC^0$?</p>&#xA;&#xA;<p>For example, can nontrivial simplifications be obtained in the proof of $NEXP \not \subse...
complexity theory lower bounds circuits
1
Simple lower bounds against AC0 -- (complexity theory lower bounds circuits) <p>It is known that $Parity \notin AC^0$ (nonuniform), but the proof is rather involved and combinatorial. Are there simpler, but weaker lower bounds, say for $NP \not \subseteq AC^0$ or $NEXP \not \subseteq AC^0$?</p>&#xA;&#xA;<p>For example,...
habedi/stack-exchange-dataset
9,788
Not able to convert from NFA to DFA
<p>I have a simple problem of making a DFA which accepts all inputs starting with double letters (aa, bb) or ending with double letters (aa, bb), given <span class="math-container">$\Sigma =\{a, b\}$</span> is the alphabet set of the given language.</p>&#xA;<p>I tried to solve it in a roundabout way by:</p>&#xA;<ol>&#x...
automata finite automata
1
Not able to convert from NFA to DFA -- (automata finite automata) <p>I have a simple problem of making a DFA which accepts all inputs starting with double letters (aa, bb) or ending with double letters (aa, bb), given <span class="math-container">$\Sigma =\{a, b\}$</span> is the alphabet set of the given language.</p>&...
habedi/stack-exchange-dataset
9,790
"Definition of NP via relations and quantifiers; not via NTMs"
<p>I have the following question on an assignment, and despite asking my prof, I can't get a grasp on it..</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $L_1, L_2$ be languages in ${\sf NP}$. Using the definition of ${\sf NP}$ via relations and quantifiers (not the non-deterministic Turing machines) prove that the following l...
complexity theory closure properties
1
"Definition of NP via relations and quantifiers; not via NTMs" -- (complexity theory closure properties) <p>I have the following question on an assignment, and despite asking my prof, I can't get a grasp on it..</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $L_1, L_2$ be languages in ${\sf NP}$. Using the definition of ${\sf ...
habedi/stack-exchange-dataset
9,795
Is the open question NP=co-NP the same as P=NP?
<p>I'm wondering this based on several places online that call $\sf NP=$ co-$\sf NP$ a major open problem... but I can't find any indication as to whether or not this is the same as $\sf P=NP$ problem...</p>&#xA;
complexity theory complexity classes p vs np
1
Is the open question NP=co-NP the same as P=NP? -- (complexity theory complexity classes p vs np) <p>I'm wondering this based on several places online that call $\sf NP=$ co-$\sf NP$ a major open problem... but I can't find any indication as to whether or not this is the same as $\sf P=NP$ problem...</p>&#xA;
habedi/stack-exchange-dataset
9,800
Are semantic networks ontologies?
<p>I struggle with few definitions in knowledge representation and seek credible help to distinguish between them. I have been searching on wikipedia and many websites for the difference between ontologies and semantic networks (not to be confused with semantic web). While the <a href="http://en.wikipedia.org/wiki/Sema...
terminology knowledge representation ontologies
1
Are semantic networks ontologies? -- (terminology knowledge representation ontologies) <p>I struggle with few definitions in knowledge representation and seek credible help to distinguish between them. I have been searching on wikipedia and many websites for the difference between ontologies and semantic networks (not ...
habedi/stack-exchange-dataset
9,804
Context Free Grammar for {a^ib^j | i,j ≥ 0; i ≠ 2j}
<p>Can someone help with this: </p>&#xA;&#xA;<p>$L=\{a^ib^j \mid i,j \ge 0 \text{ and } i \ne 2j\}$ </p>&#xA;&#xA;<p>I'm trying to write a grammar for this language?&#xA;I don't know how to do this.&#xA;I tried this:<br>&#xA;$S \rightarrow aaAb \mid aA \\&#xA;A \rightarrow aA \mid a$</p>&#xA;
formal languages context free formal grammars
1
Context Free Grammar for {a^ib^j | i,j ≥ 0; i ≠ 2j} -- (formal languages context free formal grammars) <p>Can someone help with this: </p>&#xA;&#xA;<p>$L=\{a^ib^j \mid i,j \ge 0 \text{ and } i \ne 2j\}$ </p>&#xA;&#xA;<p>I'm trying to write a grammar for this language?&#xA;I don't know how to do this.&#xA;I tried this...
habedi/stack-exchange-dataset
9,806
How do I explain that a polynomial time reduction is in fact polynomial time?
<p>I have as an assignment question to show that $QuadSat=\{\langle\phi\rangle\mid\phi$ is a satisfiable 3CNF formula with at least 4 satisfying assignments$\}$ is $\sf NP$-Complete.</p>&#xA;&#xA;<p>My solution is as follows, which is pretty much copied almost 100% from a textbook example with only an extra requirement...
complexity theory np complete reductions proof techniques
1
How do I explain that a polynomial time reduction is in fact polynomial time? -- (complexity theory np complete reductions proof techniques) <p>I have as an assignment question to show that $QuadSat=\{\langle\phi\rangle\mid\phi$ is a satisfiable 3CNF formula with at least 4 satisfying assignments$\}$ is $\sf NP$-Comple...
habedi/stack-exchange-dataset
9,810
Hardness of approximating 0-1 integer programs
<p>Given a $0,1$ (binary) integer program of the form:</p>&#xA;&#xA;<p>$$&#xA;\begin{array}{lll}&#xA;\text{min} &amp; f(x) &amp; \\&#xA;\text{s.t.} &amp; A x = b \\&#xA; &amp; x_i \ge 0 &amp; \quad \forall i\\&#xA; &amp; x_i \in \{0,1\} &amp; \quad \forall i&#xA;\end{array}&#xA;$$</p>&#xA;&#xA;<p>Note that the size of ...
complexity theory np complete approximation integer programming
1
Hardness of approximating 0-1 integer programs -- (complexity theory np complete approximation integer programming) <p>Given a $0,1$ (binary) integer program of the form:</p>&#xA;&#xA;<p>$$&#xA;\begin{array}{lll}&#xA;\text{min} &amp; f(x) &amp; \\&#xA;\text{s.t.} &amp; A x = b \\&#xA; &amp; x_i \ge 0 &amp; \quad \foral...
habedi/stack-exchange-dataset
9,813
Are there subexponential-time algorithms for NP-complete problems?
<p>Are there NP-complete problems which have proven subexponential-time algorithms? </p>&#xA;&#xA;<p>I am asking for the general case inputs, I am not talking about tractable special cases here. </p>&#xA;&#xA;<p>By sub-exponential, I mean an order of growth above polynomials, but less than exponential, for example $n^{...
complexity theory np complete np
1
Are there subexponential-time algorithms for NP-complete problems? -- (complexity theory np complete np) <p>Are there NP-complete problems which have proven subexponential-time algorithms? </p>&#xA;&#xA;<p>I am asking for the general case inputs, I am not talking about tractable special cases here. </p>&#xA;&#xA;<p>By ...
habedi/stack-exchange-dataset
9,818
What is meant by Category theory doesn't yet know how to deal with higher-order functions?
<p>In reading <a href="https://cs.stackexchange.com/users/207/uday-reddy">Uday Reddy's</a> <a href="https://cs.stackexchange.com/a/9815/268">answer</a> to <a href="https://cs.stackexchange.com/q/9769/268">What is the relation between functors in SML and Category theory?</a> Uday states</p>&#xA;&#xA;<blockquote>&#xA; <...
functional programming category theory
1
What is meant by Category theory doesn't yet know how to deal with higher-order functions? -- (functional programming category theory) <p>In reading <a href="https://cs.stackexchange.com/users/207/uday-reddy">Uday Reddy's</a> <a href="https://cs.stackexchange.com/a/9815/268">answer</a> to <a href="https://cs.stackexcha...
habedi/stack-exchange-dataset
9,820
How does the runtime of the Ukkonen's algorithm depend on the alphabet size?
<p>I am concerned with the question of <strong>the asymptotic running time of the Ukkonen's algorithm</strong>, perhaps the most popular algorithm for constructing <strong>suffix trees</strong> in linear (?) time.</p>&#xA;&#xA;<p>Here is a citation from the book "Algorithms on strings, trees and sequences" by Dan Gusfi...
algorithms data structures algorithm analysis strings
1
How does the runtime of the Ukkonen's algorithm depend on the alphabet size? -- (algorithms data structures algorithm analysis strings) <p>I am concerned with the question of <strong>the asymptotic running time of the Ukkonen's algorithm</strong>, perhaps the most popular algorithm for constructing <strong>suffix trees...
habedi/stack-exchange-dataset
9,829
Is $A$ regular if $A^{2}$ is regular?
<p>If <span class="math-container">$A^2$</span> is regular, does it follow that <span class="math-container">$A$</span> is regular?</p>&#xA;<p>My attempt on a proof:</p>&#xA;<blockquote>&#xA;<p>Yes, for contradiction assume that <span class="math-container">$A$</span> is not regular. Then <span class="math-container">...
formal languages regular languages closure properties
1
Is $A$ regular if $A^{2}$ is regular? -- (formal languages regular languages closure properties) <p>If <span class="math-container">$A^2$</span> is regular, does it follow that <span class="math-container">$A$</span> is regular?</p>&#xA;<p>My attempt on a proof:</p>&#xA;<blockquote>&#xA;<p>Yes, for contradiction assume...
habedi/stack-exchange-dataset
9,844
What is the difference between "for infinitely many n" and "for all n"?
<p>I have read some complexity papers in which "for infinitely many input sizes" is used.</p>&#xA;&#xA;<p>What is the difference in the computational complexity context between "for infinitely many input sizes" and "for all input sizes"?</p>&#xA;
complexity theory terminology
1
What is the difference between "for infinitely many n" and "for all n"? -- (complexity theory terminology) <p>I have read some complexity papers in which "for infinitely many input sizes" is used.</p>&#xA;&#xA;<p>What is the difference in the computational complexity context between "for infinitely many input sizes" an...
habedi/stack-exchange-dataset
9,847
What is the difference between these terms?
<p>Between my textbook and various online sources (namely wikipedia), I'm very confused... can somebody clear up which words are synonymous and which mean different things?</p>&#xA;&#xA;<ul>&#xA;<li>Many-to-one reduction</li>&#xA;<li>Mapping reduction</li>&#xA;<li>Turing reduction</li>&#xA;<li>Cook reduction</li>&#xA;<...
complexity theory computability terminology reductions
1
What is the difference between these terms? -- (complexity theory computability terminology reductions) <p>Between my textbook and various online sources (namely wikipedia), I'm very confused... can somebody clear up which words are synonymous and which mean different things?</p>&#xA;&#xA;<ul>&#xA;<li>Many-to-one reduc...
habedi/stack-exchange-dataset
9,852
Why is $(\log(n))^{99} = o(n^{\frac{1}{99}})$
<p>I am trying to find out why $(\log(n))^{99} = o(n^{\frac{1}{99}})$. I tried to find the limit as this fraction goes to zero.</p>&#xA;&#xA;<p>$$&#xA;\lim_{n \to \infty} \frac{ (\log(n))^{99} }{n^{\frac{1}{99}}}&#xA;$$</p>&#xA;&#xA;<p>But I'm not sure how I can reduce this expression.</p>&#xA;
asymptotics landau notation
1
Why is $(\log(n))^{99} = o(n^{\frac{1}{99}})$ -- (asymptotics landau notation) <p>I am trying to find out why $(\log(n))^{99} = o(n^{\frac{1}{99}})$. I tried to find the limit as this fraction goes to zero.</p>&#xA;&#xA;<p>$$&#xA;\lim_{n \to \infty} \frac{ (\log(n))^{99} }{n^{\frac{1}{99}}}&#xA;$$</p>&#xA;&#xA;<p>But I...
habedi/stack-exchange-dataset
9,858
Counting Inversions Using Merge Sort
<p>In Corman, Introduction To Algorithms, 3rd edition, question 2-4 it asks to count the number of inversions in a list of numbers in $\theta( n \lg n )$ time. He uses a modified Merge Sort to accomplish this. However, there is something in his algorithm which seems redundant / unnecessary to me:</p>&#xA;&#xA;<pre><c...
algorithms algorithm analysis sorting program correctness
1
Counting Inversions Using Merge Sort -- (algorithms algorithm analysis sorting program correctness) <p>In Corman, Introduction To Algorithms, 3rd edition, question 2-4 it asks to count the number of inversions in a list of numbers in $\theta( n \lg n )$ time. He uses a modified Merge Sort to accomplish this. However,...
habedi/stack-exchange-dataset
9,863
Showing that minimal vertex deletion to a bipartite graph is NP-complete
<p>Consider the following problem whose input instance is a simple graph $G$ and a natural integer $k$.</p>&#xA;&#xA;<blockquote>&#xA; <p>Is there a set $S \subseteq V(G)$ such that $G - S$ is bipartite and $|S| \leq k$?</p>&#xA;</blockquote>&#xA;&#xA;<p>I would like to show that this problem is $\rm{NP}$-complete by ...
complexity theory np complete reductions
1
Showing that minimal vertex deletion to a bipartite graph is NP-complete -- (complexity theory np complete reductions) <p>Consider the following problem whose input instance is a simple graph $G$ and a natural integer $k$.</p>&#xA;&#xA;<blockquote>&#xA; <p>Is there a set $S \subseteq V(G)$ such that $G - S$ is biparti...
habedi/stack-exchange-dataset
9,866
Minimizing the full adder - where did this XOR come from?
<p>When minimizing the full adder, I don't understand why $A(\bar{B}\bar{C} + BC)$ reduces to $A\overline{(B\oplus{C})}.$</p>&#xA;&#xA;<p>$(\bar{B}\bar{C} + BC)\to (B\oplus{C})$ is partially decipherable, but why is $(B\oplus{C})$ inverted to $\overline{(B\oplus{C})}?$</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Full adder simplific...
binary arithmetic xor
1
Minimizing the full adder - where did this XOR come from? -- (binary arithmetic xor) <p>When minimizing the full adder, I don't understand why $A(\bar{B}\bar{C} + BC)$ reduces to $A\overline{(B\oplus{C})}.$</p>&#xA;&#xA;<p>$(\bar{B}\bar{C} + BC)\to (B\oplus{C})$ is partially decipherable, but why is $(B\oplus{C})$ inve...
habedi/stack-exchange-dataset
9,871
Substitution by structural recursion
<p><em>Following the article's notation, I write $\mathcal{F}$ for the&#xA;category of presheaves on a (suitable) category $\mathbb{F}$, $TV$ for the&#xA;presheaf of terms, $\delta$ for the context extension, and&#xA;$\bullet$ for the product of the $\mathcal{F}$-monoid.</em></p>&#xA;&#xA;<p>In <a href="http://www.dcs....
lambda calculus category theory
1
Substitution by structural recursion -- (lambda calculus category theory) <p><em>Following the article's notation, I write $\mathcal{F}$ for the&#xA;category of presheaves on a (suitable) category $\mathbb{F}$, $TV$ for the&#xA;presheaf of terms, $\delta$ for the context extension, and&#xA;$\bullet$ for the product of ...
habedi/stack-exchange-dataset
9,875
Computing inverse matrix when an element changes
<p>Given an $n \times n$ matrix $\mathbf{A}$. Let the inverse matrix of $\mathbf{A}$ be $\mathbf{A}^{-1}$ (that is, $\mathbf{A}\mathbf{A}^{-1} = \mathbf{I}$). Assume that one element in $\mathbf{A}$ is changed (let's say $a _{ij}$ to $a' _{ij}$). The objective is to find $\mathbf{A}^{-1}$ after this change. Is there a ...
algorithms numerical analysis online algorithms
1
Computing inverse matrix when an element changes -- (algorithms numerical analysis online algorithms) <p>Given an $n \times n$ matrix $\mathbf{A}$. Let the inverse matrix of $\mathbf{A}$ be $\mathbf{A}^{-1}$ (that is, $\mathbf{A}\mathbf{A}^{-1} = \mathbf{I}$). Assume that one element in $\mathbf{A}$ is changed (let's s...
habedi/stack-exchange-dataset
9,876
Worst case analysis of bucket sort using insertion sort for the buckets
<p>Suppose I am using the <a href="http://en.wikipedia.org/wiki/Bucket_sort#Pseudocode" rel="nofollow">Bucket-Sort</a> algorithm, and on each bucket/list I sort with insertion sort (replace nextSort with insertion sort in the wikipedia pseudocode).</p>&#xA;&#xA;<p>In the worst case, this would imply that we would have ...
algorithms algorithm analysis runtime analysis sorting
1
Worst case analysis of bucket sort using insertion sort for the buckets -- (algorithms algorithm analysis runtime analysis sorting) <p>Suppose I am using the <a href="http://en.wikipedia.org/wiki/Bucket_sort#Pseudocode" rel="nofollow">Bucket-Sort</a> algorithm, and on each bucket/list I sort with insertion sort (replac...
habedi/stack-exchange-dataset
9,885
Finding the number of iterations to a recurrence
<p>I have an algorithm where the number of items in my set decrease by $\sigma/(1+\sigma)$ on each iteration until all items are exhausted.</p>&#xA;&#xA;<p>$$&#xA;\begin{align*}&#xA;S_0 &amp;= S \\&#xA;S_{k+1} &amp;= S_k - S_k \frac{\sigma}{1+\sigma}&#xA;\end{align*}&#xA;$$</p>&#xA;&#xA;<p>Here $\sigma$ is a small valu...
time complexity recurrence relation discrete mathematics
1
Finding the number of iterations to a recurrence -- (time complexity recurrence relation discrete mathematics) <p>I have an algorithm where the number of items in my set decrease by $\sigma/(1+\sigma)$ on each iteration until all items are exhausted.</p>&#xA;&#xA;<p>$$&#xA;\begin{align*}&#xA;S_0 &amp;= S \\&#xA;S_{k+1}...
habedi/stack-exchange-dataset
9,888
Algorithm to find the mode in a unimodal array
<p>I am given the following problem in an Algorithms class:</p>&#xA;&#xA;<blockquote>&#xA; <p>Assume that you are given an array A[1 . . . n] of distinct numbers.&#xA; You are told that the sequence of numbers in the array is unimodal, in&#xA; other words, there is an index i such that the sequence A[1 . . . i]&#xA;...
algorithms algorithm analysis arrays
1
Algorithm to find the mode in a unimodal array -- (algorithms algorithm analysis arrays) <p>I am given the following problem in an Algorithms class:</p>&#xA;&#xA;<blockquote>&#xA; <p>Assume that you are given an array A[1 . . . n] of distinct numbers.&#xA; You are told that the sequence of numbers in the array is uni...
habedi/stack-exchange-dataset