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 |
|---|---|---|---|---|---|---|
67,840 | Are DFAs unique? | <p>For a given regular is expression, once we construct a deterministic finite automaton: is that automaton unique for that expression? In a sense, that no other DFA (different number of vertices or transitions) can be constructed from that same regular expression.</p>
 | finite automata | 1 | Are DFAs unique? -- (finite automata)
<p>For a given regular is expression, once we construct a deterministic finite automaton: is that automaton unique for that expression? In a sense, that no other DFA (different number of vertices or transitions) can be constructed from that same regular expression.</p>
 | habedi/stack-exchange-dataset |
67,841 | How the closure properties of the formal languages dictate decidability of their problem | <p>Consider the following problem:</p>
<blockquote>
<p>Is <span class="math-container">$L_1 * L_2$</span> is of <span class="math-container">$LType$</span>?</p>
<p>where we know that both <span class="math-container">$L_1$</span> and <span class="math-container">$L_2$</span> are of type <span class="math-c... | formal languages automata undecidability decision problem chomsky hierarchy | 1 | How the closure properties of the formal languages dictate decidability of their problem -- (formal languages automata undecidability decision problem chomsky hierarchy)
<p>Consider the following problem:</p>
<blockquote>
<p>Is <span class="math-container">$L_1 * L_2$</span> is of <span class="math-container">$... | habedi/stack-exchange-dataset |
67,847 | Finding longest chain in poset in subquadratic time | <p>Let $(A,\leq)$ be some finite poset. For $a,a' \in A$ we can determine in constant time whether or not $a \leq a'$. The <em>height</em> of an $A$ is by definition the greatest $n$ such that there are elements
$$
a_0 < a_1 < \cdots < a_n
$$
of $A$. By treating $(A,\leq)$ as a directed acyclic... | algorithms complexity theory partial order | 1 | Finding longest chain in poset in subquadratic time -- (algorithms complexity theory partial order)
<p>Let $(A,\leq)$ be some finite poset. For $a,a' \in A$ we can determine in constant time whether or not $a \leq a'$. The <em>height</em> of an $A$ is by definition the greatest $n$ such that there are elements
$$&#... | habedi/stack-exchange-dataset |
67,849 | What do you call a DAG with a single root/source? | <p>What's the name for a DAG (directed acyclic graph) that has a unique <em>root</em> or <em>source</em> node from which every other node can be reached?</p>

<p>Alternatively, if you change the direction of the arrows, what's the name for a DAG that has some unique <em>sink</em> node that is reachable from eve... | graphs | 1 | What do you call a DAG with a single root/source? -- (graphs)
<p>What's the name for a DAG (directed acyclic graph) that has a unique <em>root</em> or <em>source</em> node from which every other node can be reached?</p>

<p>Alternatively, if you change the direction of the arrows, what's the name for a DAG that... | habedi/stack-exchange-dataset |
67,858 | Learning dynamics | <p>I recently learned about Q-learning, a reinforcement learning technique that directly estimates the expected value of taking an action in a state. </p>

<p>I'm wondering if there exists techniques to do "dynamics learning", in order to estimate the dynamics of a system. A "dynamics learning" agent might choo... | machine learning physics | 1 | Learning dynamics -- (machine learning physics)
<p>I recently learned about Q-learning, a reinforcement learning technique that directly estimates the expected value of taking an action in a state. </p>

<p>I'm wondering if there exists techniques to do "dynamics learning", in order to estimate the dynamics of ... | habedi/stack-exchange-dataset |
67,859 | removing write protection | <p>I tried to format my 32 GB SanDisk pendrive. But it showed me that " the disk is write protected" . I tried using CMD but it failed. I can't format it even using safe mode. Please help me to recover from this issue</p>
 | computer architecture | 1 | removing write protection -- (computer architecture)
<p>I tried to format my 32 GB SanDisk pendrive. But it showed me that " the disk is write protected" . I tried using CMD but it failed. I can't format it even using safe mode. Please help me to recover from this issue</p>
 | habedi/stack-exchange-dataset |
67,869 | Why computer take long time to open huge text files? | <p>Im not sure if this the right place to ask but I'm wondering why a computer takes forever to open huge text file like 1GB but if I open a video file (mkv) for example with 10GB like a movie it will be opened very fast.</p>

<p>Why the computer doing this ? What is the difference between the two operations?</... | optimization performance | 1 | Why computer take long time to open huge text files? -- (optimization performance)
<p>Im not sure if this the right place to ask but I'm wondering why a computer takes forever to open huge text file like 1GB but if I open a video file (mkv) for example with 10GB like a movie it will be opened very fast.</p>

<p... | habedi/stack-exchange-dataset |
67,877 | Comparing dual of a canonical primal program - Directly and by dual of the standard program | <p>I have it as a homework question to compare dual programs in the following way:</p>

<ol>
<li>Take a canonical program and write its dual</li>
<li>Take the same canonical program, write it as a standard program, take the dual of the latter, then write it as a canonical program.</li>
</ol>
&#x... | linear programming duality | 1 | Comparing dual of a canonical primal program - Directly and by dual of the standard program -- (linear programming duality)
<p>I have it as a homework question to compare dual programs in the following way:</p>

<ol>
<li>Take a canonical program and write its dual</li>
<li>Take the same canonical progra... | habedi/stack-exchange-dataset |
67,878 | Equivalence of PDA and a counting PDA | <p>Lets define a counting PDA as equivalent to a PDA except that the transition relation can use the stack size.</p>

<p>Formally, let's define the transition relation as
$\Delta:Q\times (\Sigma \cup \{ \epsilon \}) \times (\Gamma\cup\{\epsilon\})\times \mathbb{N} \to P(Q\times (\Gamma\cup \{ \epsilon \}) )... | automata pushdown automata | 1 | Equivalence of PDA and a counting PDA -- (automata pushdown automata)
<p>Lets define a counting PDA as equivalent to a PDA except that the transition relation can use the stack size.</p>

<p>Formally, let's define the transition relation as
$\Delta:Q\times (\Sigma \cup \{ \epsilon \}) \times (\Gamma\cup\{\e... | habedi/stack-exchange-dataset |
67,884 | Runtime of good suffix table creation in Boyer-Moore algorithm | <p>According to <a href="https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm#The_Good_Suffix_Rule" rel="nofollow noreferrer">Wikipedia</a>, both bad character table and good suffix table can be created in $O(n)$ time, where $n$ is the length of the pattern. It is pretty obvious how bad character t... | strings exact string matching | 1 | Runtime of good suffix table creation in Boyer-Moore algorithm -- (strings exact string matching)
<p>According to <a href="https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm#The_Good_Suffix_Rule" rel="nofollow noreferrer">Wikipedia</a>, both bad character table and good suffix table can be create... | habedi/stack-exchange-dataset |
67,889 | Characterize an OS as multiprogrammed OS | <p>Which of the following features will characterize an OS as multiprogrammed OS?</p>

<ol>
<li>More than one program may be loaded into main memory at the same
time. </li>
<li>If a program waits for certain event another program is
 immediately scheduled. </li>
<li>If the execution of a ... | computer architecture operating systems memory management process scheduling | 1 | Characterize an OS as multiprogrammed OS -- (computer architecture operating systems memory management process scheduling)
<p>Which of the following features will characterize an OS as multiprogrammed OS?</p>

<ol>
<li>More than one program may be loaded into main memory at the same
time. </li>
<li>... | habedi/stack-exchange-dataset |
67,897 | Iteration can replace Recursion? | <p>I've been seeing all over stack Overflow, e.g <a href="https://stackoverflow.com/a/15688084/5023488">here</a>, <a href="https://stackoverflow.com/a/15688097/5023488">here</a>, <a href="https://stackoverflow.com/a/21616651/5023488">here</a>, <a href="https://stackoverflow.com/a/15688101/5023488">here</a>, <a href="ht... | computability recursion iteration | 1 | Iteration can replace Recursion? -- (computability recursion iteration)
<p>I've been seeing all over stack Overflow, e.g <a href="https://stackoverflow.com/a/15688084/5023488">here</a>, <a href="https://stackoverflow.com/a/15688097/5023488">here</a>, <a href="https://stackoverflow.com/a/21616651/5023488">here</a>, <a h... | habedi/stack-exchange-dataset |
67,901 | Understanding x64 and x86 OS with 64bit cpu | <p>Kinda stupid question, but makes me a bit confused. If my OS (Win 7) is 64-bit type system and my CPU is 64-bit, why Program Files directory is marked (x86), x86 stands for 32-bit OS?</p>
 | operating systems cpu | 1 | Understanding x64 and x86 OS with 64bit cpu -- (operating systems cpu)
<p>Kinda stupid question, but makes me a bit confused. If my OS (Win 7) is 64-bit type system and my CPU is 64-bit, why Program Files directory is marked (x86), x86 stands for 32-bit OS?</p>
 | habedi/stack-exchange-dataset |
67,904 | I am a little bit confused about how to calculate the memory capacity | <p>I am a little bit confused about how to calculate the memory capacity.</p>

<pre><code>word=data lines size
byte=8 bit
n=adresse lines size
</code></pre>

<blockquote>
 <p>Most of the people use this formula to calculate the capacity of the
 memory: C=(2^n*word)/8 octet</p>
... | computer architecture memory hardware | 1 | I am a little bit confused about how to calculate the memory capacity -- (computer architecture memory hardware)
<p>I am a little bit confused about how to calculate the memory capacity.</p>

<pre><code>word=data lines size
byte=8 bit
n=adresse lines size
</code></pre>

<blockquote>
 <p... | habedi/stack-exchange-dataset |
67,906 | What can be said about the given language? | <p>$L = \left \{ ab^{n}a^{n}|n>0 \right \} \bigcup \left \{ aab^ka^{2k} | k>0 \right \}$</p>

<hr>

<p>What can be said about the given language L ?</p>

<hr>

<p>According to me, I think it is CFL and not DCFL as I tried to somehow parse it through a NPDA but not sure though.</p>... | pushdown automata nondeterminism | 1 | What can be said about the given language? -- (pushdown automata nondeterminism)
<p>$L = \left \{ ab^{n}a^{n}|n>0 \right \} \bigcup \left \{ aab^ka^{2k} | k>0 \right \}$</p>

<hr>

<p>What can be said about the given language L ?</p>

<hr>

<p>According to me, I think it is CFL an... | habedi/stack-exchange-dataset |
67,909 | Improve Java Experience | <p>In exactly a month I will face a Java exam. My problem is that even if I know all Java theory (the exam won't face GUI), I have problems creating programs: sometimes I can't understand how to make a fast program or how to implement what I want my program to do. So how can I improve my Java habilities? What kind of e... | education | 1 | Improve Java Experience -- (education)
<p>In exactly a month I will face a Java exam. My problem is that even if I know all Java theory (the exam won't face GUI), I have problems creating programs: sometimes I can't understand how to make a fast program or how to implement what I want my program to do. So how can I imp... | habedi/stack-exchange-dataset |
67,919 | Prove that $\{\langle M, n, w\rangle \mid \text{$M$ has $n$ states, $w ∈ \Sigma^*$ and $M ∈ B(n,w)$}\}$ is undecidable | <p>I want to prove that:
$\{\langle M, n, w\rangle \mid \text{$M$ has $n$ states, $w ∈ \Sigma^*$ and $M ∈ B(n,w)$}\}$ is undecidable.</p>

<p>Here $w$ is a string and $B(n,w)$ is the set of all $n$-state machines that halt on input $w$ after exactly the maximum number of steps. I don't know how to prove thi... | turing machines undecidability computation models | 1 | Prove that $\{\langle M, n, w\rangle \mid \text{$M$ has $n$ states, $w ∈ \Sigma^*$ and $M ∈ B(n,w)$}\}$ is undecidable -- (turing machines undecidability computation models)
<p>I want to prove that:
$\{\langle M, n, w\rangle \mid \text{$M$ has $n$ states, $w ∈ \Sigma^*$ and $M ∈ B(n,w)$}\}$ is undecidable.</p>
... | habedi/stack-exchange-dataset |
67,932 | stages of compilation | <p>gcc is a collection of compilers, based on the file extension it compiles a source file. But compilers are only supposed to convert a preprocessed code into assembly code. And after that assembling and linking is done and an executable is generated.
But several definitions says that compilers are the ones who co... | compilers | 1 | stages of compilation -- (compilers)
<p>gcc is a collection of compilers, based on the file extension it compiles a source file. But compilers are only supposed to convert a preprocessed code into assembly code. And after that assembling and linking is done and an executable is generated.
But several definitions sa... | habedi/stack-exchange-dataset |
67,947 | What features of a problem make it NP-complete/hard? | <p>This isn't a question about what NP-completeness or hardness is, but about what, in general and informally, make a problem NP-complete? That is to say, what features of a problem might make me suspect a problem is NP-complete/hard?</p>

<p>To elaborate, for instance, lets say I’m seeing the graph coloring pr... | algorithms complexity theory np complete | 1 | What features of a problem make it NP-complete/hard? -- (algorithms complexity theory np complete)
<p>This isn't a question about what NP-completeness or hardness is, but about what, in general and informally, make a problem NP-complete? That is to say, what features of a problem might make me suspect a problem is NP-c... | habedi/stack-exchange-dataset |
67,948 | An O(n log sqrt(n)) sorting algorithm? Skiena TADM 2nd Question 4-28 | <p>Skiena writes:</p>

<blockquote>
 <p>In one of my research papers [Ski88], I discovered a comparison-based sorting
 algorithm that runs in $O(n\log\sqrt{n})$. Given the existence of an $\Omega(n \log n)$ lower bound for sorting, how can this be possible?</p>
</blockquote>

<p>I believe ... | sorting | 1 | An O(n log sqrt(n)) sorting algorithm? Skiena TADM 2nd Question 4-28 -- (sorting)
<p>Skiena writes:</p>

<blockquote>
 <p>In one of my research papers [Ski88], I discovered a comparison-based sorting
 algorithm that runs in $O(n\log\sqrt{n})$. Given the existence of an $\Omega(n \log n)$ lower bound f... | habedi/stack-exchange-dataset |
67,949 | Efficent deterministic algorithm to sort n numbers with many duplicates ( distinct integers $O(\log n)$) | <p>I seek to sort a sequence S of n integers with many duplications, such that
the number of distinct integers in S is <span class="math-container">$O(\log n)$</span>. Give an <span class="math-container">$O(n \log \log n)$</span> worst-case time algorithm to sort such sequences. 
I tried quick-sort, Merge-sort... | algorithms sorting | 1 | Efficent deterministic algorithm to sort n numbers with many duplicates ( distinct integers $O(\log n)$) -- (algorithms sorting)
<p>I seek to sort a sequence S of n integers with many duplications, such that
the number of distinct integers in S is <span class="math-container">$O(\log n)$</span>. Give an <span class... | habedi/stack-exchange-dataset |
67,957 | Find most valuable subset of a node weighed tree | <p>Suppose you got a <a href="https://en.wikipedia.org/wiki/Directed_acyclic_graph" rel="nofollow noreferrer">directed acyclic graph</a> of positvely and negatively weighed nodes $T\hspace{-0.02 in}$.
<br>
Now I have to find the the subset $M\subseteq T$ such that the sum of
<br>
the weights of the ... | algorithms graphs optimization | 1 | Find most valuable subset of a node weighed tree -- (algorithms graphs optimization)
<p>Suppose you got a <a href="https://en.wikipedia.org/wiki/Directed_acyclic_graph" rel="nofollow noreferrer">directed acyclic graph</a> of positvely and negatively weighed nodes $T\hspace{-0.02 in}$.
<br>
Now I have to find th... | habedi/stack-exchange-dataset |
67,973 | Time Complexity of Shifting | <p>I'm developing a IMHO very interesting algorithm for integer division. This algorithm uses boolean shifting(It shifts left for multiplication by 2). I'm wondering if <code><< c</code> is $O(c)$ or $O(n)$. I'm hearing it depends on architecture. Algorithms ideally should be architecture independent. So for the ... | algorithms algorithm analysis | 1 | Time Complexity of Shifting -- (algorithms algorithm analysis)
<p>I'm developing a IMHO very interesting algorithm for integer division. This algorithm uses boolean shifting(It shifts left for multiplication by 2). I'm wondering if <code><< c</code> is $O(c)$ or $O(n)$. I'm hearing it depends on architecture. Alg... | habedi/stack-exchange-dataset |
67,977 | What is the initial state of DFA equivalent to an $\epsilon$-NFA? | <p>I am unsure I expressed myself correctly.</p>

<p>Anyway, I want to figure out what is the initial state of an automata who had its epsilon transitions removed and who was determinised. </p>

<p>In my text book it is stated, that suppose A is NFA with $\epsilon$-moves, suppose $q_0$ its initial state... | finite automata | 1 | What is the initial state of DFA equivalent to an $\epsilon$-NFA? -- (finite automata)
<p>I am unsure I expressed myself correctly.</p>

<p>Anyway, I want to figure out what is the initial state of an automata who had its epsilon transitions removed and who was determinised. </p>

<p>In my text book it ... | habedi/stack-exchange-dataset |
67,990 | Is "Feral Concurrency Control" a disparaging description? | <p>The paper <a href="http://www.bailis.org/papers/feral-sigmod2015.pdf" rel="nofollow noreferrer">Feral Concurrency Control:
An Empirical Investigation of Modern Application Integrity</a> uses the term "feral" in a way I have never seen before.</p>

<blockquote>
 <p>Rails has developed a range of conc... | terminology | 1 | Is "Feral Concurrency Control" a disparaging description? -- (terminology)
<p>The paper <a href="http://www.bailis.org/papers/feral-sigmod2015.pdf" rel="nofollow noreferrer">Feral Concurrency Control:
An Empirical Investigation of Modern Application Integrity</a> uses the term "feral" in a way I have never seen bef... | habedi/stack-exchange-dataset |
67,999 | How fast is this Division Algorithm | <p>I wrote an algorithm for integer division. I'm wondering how fast it is asymptotically. I used RAM model myself to asymptotically analyse it, but I found out that:</p>

<blockquote>
 <p>Elementary CPU instructions like shifting and adding, are not constant as the integers grow arbitrarily large. </p>... | algorithms algorithm analysis asymptotics | 1 | How fast is this Division Algorithm -- (algorithms algorithm analysis asymptotics)
<p>I wrote an algorithm for integer division. I'm wondering how fast it is asymptotically. I used RAM model myself to asymptotically analyse it, but I found out that:</p>

<blockquote>
 <p>Elementary CPU instructions like sh... | habedi/stack-exchange-dataset |
68,001 | Bit operations; Treating a number like an array | <p>Are there features in programming languages that allow you to directly access the $k^{th}$ bit of a number. Treating it like an integer.</p>

<p>I'm not talking of using bit shifting to retrieve a number. But directly access the bit at index $i$ of a number as if it were an array.</p>

<p>I'm looking... | programming languages | 1 | Bit operations; Treating a number like an array -- (programming languages)
<p>Are there features in programming languages that allow you to directly access the $k^{th}$ bit of a number. Treating it like an integer.</p>

<p>I'm not talking of using bit shifting to retrieve a number. But directly access the bit a... | habedi/stack-exchange-dataset |
68,010 | Online algorithms and changing past decisions | <p>We know that for some online problems, algorithms can decrease their competitive ratio greatly if they are allowed to change some of their past decisions (see <a href="http://epubs.siam.org/doi/pdf/10.1137/1.9781611973402.35" rel="nofollow noreferrer">http://epubs.siam.org/doi/pdf/10.1137/1.9781611973402.35</a>).</p... | algorithms optimization reference request online algorithms | 1 | Online algorithms and changing past decisions -- (algorithms optimization reference request online algorithms)
<p>We know that for some online problems, algorithms can decrease their competitive ratio greatly if they are allowed to change some of their past decisions (see <a href="http://epubs.siam.org/doi/pdf/10.1137/... | habedi/stack-exchange-dataset |
68,014 | What is a super universe? | <p>I'm reading this well-known paper <a href="http://www2.math.uu.se/~palmgren/universe.pdf" rel="noreferrer"><em>On Universes in Type Theory</em></a>.
At first I expected something similar to <code>Setω</code> in Agda, but it turns out that it's even something more general.
It seems to generalize the universe ... | lambda calculus type theory | 1 | What is a super universe? -- (lambda calculus type theory)
<p>I'm reading this well-known paper <a href="http://www2.math.uu.se/~palmgren/universe.pdf" rel="noreferrer"><em>On Universes in Type Theory</em></a>.
At first I expected something similar to <code>Setω</code> in Agda, but it turns out that it's even somet... | habedi/stack-exchange-dataset |
68,015 | How is this expression a valid lambda expression? | <p>Can you explain how this expression follows the grammar of the lambda calculus?</p>

<p>$$\lambda x.x((\lambda y.yy)x)x = λx.x(xx)x$$</p>

<p>I am not sure why we have the parentheses following the $.x$ (on both sides of the equation).</p>
 | lambda calculus | 1 | How is this expression a valid lambda expression? -- (lambda calculus)
<p>Can you explain how this expression follows the grammar of the lambda calculus?</p>

<p>$$\lambda x.x((\lambda y.yy)x)x = λx.x(xx)x$$</p>

<p>I am not sure why we have the parentheses following the $.x$ (on both sides of the equat... | habedi/stack-exchange-dataset |
68,019 | Efficient Algorithm Linear Temporal Logic to Deterministic Rabin Automata | <p>I am trying to construct an equivalent Deterministic Rabin Automata (DRA) given a Linear Temporal Logic (LTL) Formula. One (expensive) way to do this would be to construct an equivalent Non-deterministic Buchi Automata and then determinize it using Safra's construction. </p>

<p>I am interested to know wheth... | formal languages formal methods buchi automata | 1 | Efficient Algorithm Linear Temporal Logic to Deterministic Rabin Automata -- (formal languages formal methods buchi automata)
<p>I am trying to construct an equivalent Deterministic Rabin Automata (DRA) given a Linear Temporal Logic (LTL) Formula. One (expensive) way to do this would be to construct an equivalent Non-d... | habedi/stack-exchange-dataset |
68,022 | Given a vertex, find a path between it and each other vertex that minimizes the maximum weight in the path | <p>I'm revising for an upcoming exam and was wondering if someone could help me with a practice problem:</p>

<blockquote>
 <p>We model a set of cities and highways as an undirected weighted graph <span class="math-container">$G = (V,E,l)$</span>, where the vertices <span class="math-container">$V$</span> ... | algorithms graphs graph traversal | 1 | Given a vertex, find a path between it and each other vertex that minimizes the maximum weight in the path -- (algorithms graphs graph traversal)
<p>I'm revising for an upcoming exam and was wondering if someone could help me with a practice problem:</p>

<blockquote>
 <p>We model a set of cities and highw... | habedi/stack-exchange-dataset |
68,023 | Pumping lemma for $\{110^n10^{n-m}1^m: 1\le m<n\}$ | <p>How can I prove that the language $L=\{110^n 10^{n-m} 1^m \mid 1 \le m < n \}$ is not regular using pumping lemma?</p>

<p>I chose the word $w = 110^{2p} 10^{2p-q} 1^q$ to prove the non-regularity. 
Then I started partitioning the word to $xyz$ with $|y| \ge 1$, $|xy| \le p$ and for each $i\ge 0$, $xy... | formal languages regular languages pumping lemma | 1 | Pumping lemma for $\{110^n10^{n-m}1^m: 1\le m<n\}$ -- (formal languages regular languages pumping lemma)
<p>How can I prove that the language $L=\{110^n 10^{n-m} 1^m \mid 1 \le m < n \}$ is not regular using pumping lemma?</p>

<p>I chose the word $w = 110^{2p} 10^{2p-q} 1^q$ to prove the non-regularity. &#x... | habedi/stack-exchange-dataset |
68,024 | Propositional logic and connectives(translating to english) | <p>I want to know some stuff about translating compound statements to english:</p>

<p>For the propositions below:</p>

<p>p: You have the flu.
q: You miss the final examination.
r: You pass the course.</p>

<p>I want to know how to translate the following compound proposition to english... | logic propositional logic | 1 | Propositional logic and connectives(translating to english) -- (logic propositional logic)
<p>I want to know some stuff about translating compound statements to english:</p>

<p>For the propositions below:</p>

<p>p: You have the flu.
q: You miss the final examination.
r: You pass the course.</p... | habedi/stack-exchange-dataset |
68,028 | Getting the idea behind pumping length correct | <p>I am unsure whether I got the notion behind the pumping length correctly. I know its definition, and just want to make sure that I understood everything correctly.</p>

<p>Suppose we have an automata that accepts $0^{*}1^{*}$. The longest word accepted is $01$ without an iteration, whose length is $2$. So $n... | finite automata pumping lemma | 1 | Getting the idea behind pumping length correct -- (finite automata pumping lemma)
<p>I am unsure whether I got the notion behind the pumping length correctly. I know its definition, and just want to make sure that I understood everything correctly.</p>

<p>Suppose we have an automata that accepts $0^{*}1^{*}$. ... | habedi/stack-exchange-dataset |
68,043 | How can Turing machines loop forever given that the input is finite? | <p>How Turing machine can loop forever when input length is always finite? 
I think this is a basic doubt but unable to understand how TM go into infinite loop? I think it can make transition forever on empty string. What are the other cases? Can it make without any empty alphabet ?</p>
 | turing machines | 1 | How can Turing machines loop forever given that the input is finite? -- (turing machines)
<p>How Turing machine can loop forever when input length is always finite? 
I think this is a basic doubt but unable to understand how TM go into infinite loop? I think it can make transition forever on empty string. What are ... | habedi/stack-exchange-dataset |
68,047 | What is a 'subrecursive algorithm'? | <p>I am reading <a href="https://global.oup.com/academic/product/exploring-robotic-minds-9780190281069?cc=dk&lang=en&" rel="nofollow noreferrer">Exploring Robotic Minds</a> by Prof. Jun Tani, and came across the term <code>subrecursive</code>. Original context:</p>

<blockquote>
 <p>Another possibi... | algorithms terminology recursion | 1 | What is a 'subrecursive algorithm'? -- (algorithms terminology recursion)
<p>I am reading <a href="https://global.oup.com/academic/product/exploring-robotic-minds-9780190281069?cc=dk&lang=en&" rel="nofollow noreferrer">Exploring Robotic Minds</a> by Prof. Jun Tani, and came across the term <code>subrecursive</c... | habedi/stack-exchange-dataset |
68,052 | Does it make sense to have both the concept of 'null' and 'Maybe'? | <p>While creating a client for <a href="https://api.stackexchange.com/">a web API</a> in C#, I ran into a problem regarding <code>null</code> as a value where it would represent two different things:</p>

<ul>
<li><em>nothing</em>, e.g. a <code>foo</code> may or may not have a <code>bar</code></li>
<li>... | programming languages language design | 1 | Does it make sense to have both the concept of 'null' and 'Maybe'? -- (programming languages language design)
<p>While creating a client for <a href="https://api.stackexchange.com/">a web API</a> in C#, I ran into a problem regarding <code>null</code> as a value where it would represent two different things:</p>
&#... | habedi/stack-exchange-dataset |
68,053 | Time complexity of addition | <p>Wikipedia lists the time complexity of addition as $n$, where $n$ is the number of bits. </p>

<p>Is this a rigid theoretical lower bound? Or is this just the complexity of the current fastest known algorithm. I want to know, because the complexity of addition, underscores all other arithmetic operations and... | algorithms algorithm analysis arithmetic | 1 | Time complexity of addition -- (algorithms algorithm analysis arithmetic)
<p>Wikipedia lists the time complexity of addition as $n$, where $n$ is the number of bits. </p>

<p>Is this a rigid theoretical lower bound? Or is this just the complexity of the current fastest known algorithm. I want to know, because t... | habedi/stack-exchange-dataset |
68,061 | Contained optimal combination of inputs | <p>I have 100 football (soccer) players, each with an "expected score" (higher is better) and price (e.g. 4300 dollars). I want to <strong>select the optimal combination of players</strong> with the <strong>highest combined score</strong> (i.e. a fantasy football formation) <strong>within a $50,000 budget</strong>, whe... | algorithms combinatorics knapsack problems permutations | 1 | Contained optimal combination of inputs -- (algorithms combinatorics knapsack problems permutations)
<p>I have 100 football (soccer) players, each with an "expected score" (higher is better) and price (e.g. 4300 dollars). I want to <strong>select the optimal combination of players</strong> with the <strong>highest comb... | habedi/stack-exchange-dataset |
68,070 | Given a string, is it possible to determine which hashing algorithm has produced it, if any? | <p>Given a string, is it possible to determine which hashing algorithm has produced it, if any? </p>

<p>For example, the MD5 hash of "string" is b45cffe084dd3d20d928bee85e7b0f21.</p>

<p>Is it possible to determine whether the above hash is:</p>

<p>1) Indeed a genuine hash in some hashing algo... | algorithms cryptography hash hashing encryption | 1 | Given a string, is it possible to determine which hashing algorithm has produced it, if any? -- (algorithms cryptography hash hashing encryption)
<p>Given a string, is it possible to determine which hashing algorithm has produced it, if any? </p>

<p>For example, the MD5 hash of "string" is b45cffe084dd3d20d928... | habedi/stack-exchange-dataset |
68,079 | Measuring availability from CAP theorem | <p>I wonder how to check availability property from CAP theorem.
Consistency check is conceptually easy: if at least once somehow same query at the same time returns different results, then the system may be considered inconsistent (or under some circumstances eventually consistent).</p>

<p>But what about ... | database theory databases | 1 | Measuring availability from CAP theorem -- (database theory databases)
<p>I wonder how to check availability property from CAP theorem.
Consistency check is conceptually easy: if at least once somehow same query at the same time returns different results, then the system may be considered inconsistent (or under som... | habedi/stack-exchange-dataset |
68,080 | What is the difference between strong normalization and weak normalization in the context of rewrite systems? | <p>In the context of <a href="https://www.wikiwand.com/en/Normalization_property_(abstract_rewriting)" rel="nofollow noreferrer">rewriting systems</a>, how does strong normalization differ from weak normalization?</p>
 | logic lambda calculus | 1 | What is the difference between strong normalization and weak normalization in the context of rewrite systems? -- (logic lambda calculus)
<p>In the context of <a href="https://www.wikiwand.com/en/Normalization_property_(abstract_rewriting)" rel="nofollow noreferrer">rewriting systems</a>, how does strong normalization d... | habedi/stack-exchange-dataset |
68,092 | Find a recurrence relation for merging of sublists of an array | <p>There are $\log n$ sublists each of size $\frac{n}{\log n}$. Write a recurrence relation for merging these lists into an $n$ element list. </p>

<p><strong>My Approach</strong>
Let $m = \log n$. Then,
$T(m) = 2T(m/2) + O(n)$, where $O(n)$ is for merge algorithm. </p>

<p>We get $T(m) = 2T(m/2... | algorithms sorting recurrence relation arrays divide and conquer | 1 | Find a recurrence relation for merging of sublists of an array -- (algorithms sorting recurrence relation arrays divide and conquer)
<p>There are $\log n$ sublists each of size $\frac{n}{\log n}$. Write a recurrence relation for merging these lists into an $n$ element list. </p>

<p><strong>My Approach</strong>... | habedi/stack-exchange-dataset |
68,094 | Why is the word "calculus" used to describe systems of logic and computation? | <p>Why is the word "calculus" used in this context?</p>

<p>The reason I ask is because these usages of "calculus" seem unrelated to the far more popular use of "calculus" in "differential calculus" and "integral calculus" to which something like λ-calculus seems only very distantly related. This word choice se... | terminology lambda calculus history | 1 | Why is the word "calculus" used to describe systems of logic and computation? -- (terminology lambda calculus history)
<p>Why is the word "calculus" used in this context?</p>

<p>The reason I ask is because these usages of "calculus" seem unrelated to the far more popular use of "calculus" in "differential calc... | habedi/stack-exchange-dataset |
68,098 | Closest arithmetic progression to an array | <p>Given an array of $N$ integers, having the option to increase or decrease its elements, the problem is to find the closest integer arithmetic progression. That corresponds to the smallest difference between the elements of the array and the elements of progression. Thus one needs to minimize the sum of absolute diff... | algorithms dynamic programming arithmetic linear programming | 1 | Closest arithmetic progression to an array -- (algorithms dynamic programming arithmetic linear programming)
<p>Given an array of $N$ integers, having the option to increase or decrease its elements, the problem is to find the closest integer arithmetic progression. That corresponds to the smallest difference between t... | habedi/stack-exchange-dataset |
68,109 | NFA that doesn't accept a language | <p>Suppose I want to draw a NFA that doesn't accept a language containing $aba$. Would this work:</p>

<p><a href="https://i.stack.imgur.com/706Uz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/706Uz.png" alt="enter image description here"></a></p>
 | automata | 1 | NFA that doesn't accept a language -- (automata)
<p>Suppose I want to draw a NFA that doesn't accept a language containing $aba$. Would this work:</p>

<p><a href="https://i.stack.imgur.com/706Uz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/706Uz.png" alt="enter image description here"></a... | habedi/stack-exchange-dataset |
68,113 | Time Complexity of Sort-Merge Join | <p>According to this <a href="https://de.wikipedia.org/wiki/Joinalgorithmen#Bewertung_3" rel="nofollow noreferrer">German Wikipedia article</a>, the time required to merge relations $R$ and $S$ is $\in \mathcal{O}(|R| + |S|)$ if both relations are already sorted. 
[<strong><em>Note</strong>: You don't really need t... | time complexity database theory databases | 1 | Time Complexity of Sort-Merge Join -- (time complexity database theory databases)
<p>According to this <a href="https://de.wikipedia.org/wiki/Joinalgorithmen#Bewertung_3" rel="nofollow noreferrer">German Wikipedia article</a>, the time required to merge relations $R$ and $S$ is $\in \mathcal{O}(|R| + |S|)$ if both rela... | habedi/stack-exchange-dataset |
68,125 | Finding k'th smallest element from a given sequence only with O(k) memory O(n) time | <p>Suppose that we read a sequence of $n$ numbers, one by one. How to find $k$'th smallest element just with using $O(k)$ cell memory and in linear time ($O(n)$). I think we should save first $k$ terms of sequence and when get the $k+1$'th term, delete a term which we sure that it cannot be the $k$'th smallest element ... | data structures search algorithms quicksort | 1 | Finding k'th smallest element from a given sequence only with O(k) memory O(n) time -- (data structures search algorithms quicksort)
<p>Suppose that we read a sequence of $n$ numbers, one by one. How to find $k$'th smallest element just with using $O(k)$ cell memory and in linear time ($O(n)$). I think we should save f... | habedi/stack-exchange-dataset |
68,134 | Why use maximum likelihood for word prediction? | <p>According to <a href="https://www.tensorflow.org/tutorials/word2vec/" rel="nofollow noreferrer">https://www.tensorflow.org/tutorials/word2vec/</a>, the standard approach for predicting the next word in a word sequence is maximum likelihood. The predicted next word is the word that maximizes</p>

<p>$$P(w_t|h... | natural language processing | 1 | Why use maximum likelihood for word prediction? -- (natural language processing)
<p>According to <a href="https://www.tensorflow.org/tutorials/word2vec/" rel="nofollow noreferrer">https://www.tensorflow.org/tutorials/word2vec/</a>, the standard approach for predicting the next word in a word sequence is maximum likelih... | habedi/stack-exchange-dataset |
68,139 | Reduction from Maximum Independent Set to Independent Set Decision Problem | <p>I was hoping someone would be able to help me with this question.</p>

<p>The Maximum Independent Set search problem is, given an undirected graph G, to output an independent set in G of maximum size.</p>

<p>Give a polynomial time algorithm for the Maximum Independent Set search problem which can us... | reductions | 1 | Reduction from Maximum Independent Set to Independent Set Decision Problem -- (reductions)
<p>I was hoping someone would be able to help me with this question.</p>

<p>The Maximum Independent Set search problem is, given an undirected graph G, to output an independent set in G of maximum size.</p>

<p>G... | habedi/stack-exchange-dataset |
68,156 | Reduction from Vertex Cover | <blockquote>
 <p>The city council would like to place trash bins around the city and has a list of suitable spots (street crossroads, supermarkets etc.) but the number of these spots is greater than the number of available bins. The council's goal is to place the limited number of bins so that the distance from ea... | complexity theory reductions np hard decision problem | 1 | Reduction from Vertex Cover -- (complexity theory reductions np hard decision problem)
<blockquote>
 <p>The city council would like to place trash bins around the city and has a list of suitable spots (street crossroads, supermarkets etc.) but the number of these spots is greater than the number of available bins.... | habedi/stack-exchange-dataset |
68,163 | Why are directed graphs important? | <p>We have been reading about algorithms for MST, strong-connectivity, routing, etc. in directed graphs.</p>

<p>Also recently people have been doing research for dynamic and fault tolerant algorithms for directed graphs.</p>

<p>But I was wondering if there are any practical applications where the unde... | graphs fault tolerance | 1 | Why are directed graphs important? -- (graphs fault tolerance)
<p>We have been reading about algorithms for MST, strong-connectivity, routing, etc. in directed graphs.</p>

<p>Also recently people have been doing research for dynamic and fault tolerant algorithms for directed graphs.</p>

<p>But I was w... | habedi/stack-exchange-dataset |
68,164 | Median-of-medians in O(log n) memory | <p>Is there a way to use <a href="https://en.wikipedia.org/wiki/Median_of_medians" rel="nofollow noreferrer">median-of-medians</a> to find a median in,
<br>
simultaneously, O(log n) memory and O(n) comparisons?</p>

<p>The user orlp on this site <a href="https://cs.stackexchange.com/a/68132/12859"... | asymptotics space complexity comparison | 1 | Median-of-medians in O(log n) memory -- (asymptotics space complexity comparison)
<p>Is there a way to use <a href="https://en.wikipedia.org/wiki/Median_of_medians" rel="nofollow noreferrer">median-of-medians</a> to find a median in,
<br>
simultaneously, O(log n) memory and O(n) comparisons?</p>

... | habedi/stack-exchange-dataset |
68,168 | in refutation (resolution) can we use a clause that have been resolved | <p>In resolution if we have a set S composed of three clause C1, C2 and C3 and we want to proof that C4 is derivable from S using refutation:</p>

<p>suppose we've resolved C1 and C2 to C5, can we resolve C1 with C5 or C3 or C4 or C2 cause even it has been resolved?</p>

<p>and if we want to conceive an... | logic proof techniques first order logic | 1 | in refutation (resolution) can we use a clause that have been resolved -- (logic proof techniques first order logic)
<p>In resolution if we have a set S composed of three clause C1, C2 and C3 and we want to proof that C4 is derivable from S using refutation:</p>

<p>suppose we've resolved C1 and C2 to C5, can w... | habedi/stack-exchange-dataset |
68,171 | Why $e(C_i) = D_i$ is correct assumption? (FLP Impossibility 1985 - Lemma 3) | <p>Please bear with my unhelpful typesetting.</p>

<p>My question is regarding well known FLP paper 
<a href="https://groups.csail.mit.edu/tds/papers/Lynch/jacm85.pdf" rel="nofollow noreferrer">Impossibility of Distributed Consensus with One Faulty Process</a> by Fischer, Lynch and Patterson</p>

<p... | distributed systems concurrency synchronization mutual exclusion consensus | 1 | Why $e(C_i) = D_i$ is correct assumption? (FLP Impossibility 1985 - Lemma 3) -- (distributed systems concurrency synchronization mutual exclusion consensus)
<p>Please bear with my unhelpful typesetting.</p>

<p>My question is regarding well known FLP paper 
<a href="https://groups.csail.mit.edu/tds/papers/L... | habedi/stack-exchange-dataset |
68,179 | Combining merge sort and insertion sort | <p>A cache-aware sorting algorithm sorts an array of size $ 2^{k} $ with each key of size 4 bytes. The size of the cache memory is 128 bytes and algorithm is the combinations of merge sort and insertion sort to exploit the locality of reference for the cache memory (i.e. will use insertion sort when problem size equal... | algorithms time complexity | 1 | Combining merge sort and insertion sort -- (algorithms time complexity)
<p>A cache-aware sorting algorithm sorts an array of size $ 2^{k} $ with each key of size 4 bytes. The size of the cache memory is 128 bytes and algorithm is the combinations of merge sort and insertion sort to exploit the locality of reference fo... | habedi/stack-exchange-dataset |
68,184 | Dijkstra's Algorithm | <p>I have recently implemented Dijkstra's Algorithm to the shortest path between all pairs of nodes in the graph. I have implemented this code in Java. As instructed I am using a linked list to represent the adjacency matrix. As instructed, I am running my algorithm for a complete graph. The running time for a 1000 nod... | algorithms graphs | 1 | Dijkstra's Algorithm -- (algorithms graphs)
<p>I have recently implemented Dijkstra's Algorithm to the shortest path between all pairs of nodes in the graph. I have implemented this code in Java. As instructed I am using a linked list to represent the adjacency matrix. As instructed, I am running my algorithm for a com... | habedi/stack-exchange-dataset |
68,187 | Hash functions producing uniform outputs | <p>I've seen this question in a past exam paper, and I know that the answer given is <strong>(b)</strong>, but I'm not sure why.</p>

<blockquote>
 <p>Which one of the following hash functions on integers will distribute keys
 most uniformly over 10 buckets numbered 0 to 9 for i ranging from 0 to
... | data structures hash hash tables | 1 | Hash functions producing uniform outputs -- (data structures hash hash tables)
<p>I've seen this question in a past exam paper, and I know that the answer given is <strong>(b)</strong>, but I'm not sure why.</p>

<blockquote>
 <p>Which one of the following hash functions on integers will distribute keys&#x... | habedi/stack-exchange-dataset |
68,188 | Counting substrings with a given number of different characters in O(N) | <p>Given a string $S$ of length $n$, and a number $k$, count the number of substrings (regardless of their length) that contain exactly $k$ different characters.</p>

<p>The obvious solution takes $O(n^2)$ time (fix substring start point, and move its end point while keeping track of the set of seen characters)... | algorithms strings counting | 1 | Counting substrings with a given number of different characters in O(N) -- (algorithms strings counting)
<p>Given a string $S$ of length $n$, and a number $k$, count the number of substrings (regardless of their length) that contain exactly $k$ different characters.</p>

<p>The obvious solution takes $O(n^2)$ t... | habedi/stack-exchange-dataset |
68,190 | Running time of algorithms that sometimes loop forever | <p>Consider the following algorithm that computes the sum of two integers (toy example):</p>

<pre><code>INPUT: Integers (a,b)

 1. Toss a coin c
 2. If c = 0, then loop forever
 3. If c = 1, then compute and output a+b
</code></pre>

<p>What is the running time of this algorithm? Th... | algorithms complexity theory | 1 | Running time of algorithms that sometimes loop forever -- (algorithms complexity theory)
<p>Consider the following algorithm that computes the sum of two integers (toy example):</p>

<pre><code>INPUT: Integers (a,b)

 1. Toss a coin c
 2. If c = 0, then loop forever
 3. If c = 1, then compute an... | habedi/stack-exchange-dataset |
68,203 | Is this language in $PSPACE^{L'}$? | <p>Let's assume we have an arbitrary language $L'$ and let's define the language $L = \{1^n | \text{The number of strings in } L' \text{ of length } n \text{ is odd }\}$.</p>

<p>Is $L\in PSPACE^{L'}$?</p>

<p>I tried saying that I can define a determinstic machine that holds a counter and that goes ove... | complexity theory turing machines oracle machines | 1 | Is this language in $PSPACE^{L'}$? -- (complexity theory turing machines oracle machines)
<p>Let's assume we have an arbitrary language $L'$ and let's define the language $L = \{1^n | \text{The number of strings in } L' \text{ of length } n \text{ is odd }\}$.</p>

<p>Is $L\in PSPACE^{L'}$?</p>

<p>I tr... | habedi/stack-exchange-dataset |
68,211 | Is there an isomorphism between (subset of) category theory and relational algebra? | <p>It comes from big data perspective. Basically, many frameworks (like Apache Spark) "compensate" lack of relational operations by providing Functor/Monad-like interfaces and there is a similar movement towards cats-to-SQL conversions (Slick in Scala). For instance, we need natural join (assuming no repetitions on ind... | relational algebra category theory curry howard | 1 | Is there an isomorphism between (subset of) category theory and relational algebra? -- (relational algebra category theory curry howard)
<p>It comes from big data perspective. Basically, many frameworks (like Apache Spark) "compensate" lack of relational operations by providing Functor/Monad-like interfaces and there i... | habedi/stack-exchange-dataset |
68,214 | Finding the spots furthest away from bad data | <p>The real-world problem I'm trying to solve is to create an algorithm which finds the ideal channels where I can transmit radio traffic, inside a radio frequency band that could contain various disturbances. These <em>n</em> ideal channels are those who are furthest away from any of the disturbances, but also the fur... | algorithms data structures sorting search algorithms | 1 | Finding the spots furthest away from bad data -- (algorithms data structures sorting search algorithms)
<p>The real-world problem I'm trying to solve is to create an algorithm which finds the ideal channels where I can transmit radio traffic, inside a radio frequency band that could contain various disturbances. These ... | habedi/stack-exchange-dataset |
68,219 | Sum of two elements in set evenly divisible by k | <p>I have gone through this particular problem in hackerrank. </p>

<blockquote>
 <p>You are given an array of $n$ integers, $a_0, a_1, a_2 , \ldots, a_n$, and a positive integer $k$. Find and print the number of pairs $(i, j)$ such that $i < j$ and $a_i + a_j$ is evenly divisible by $k$.</p>
</bloc... | algorithms arrays modular arithmetic | 1 | Sum of two elements in set evenly divisible by k -- (algorithms arrays modular arithmetic)
<p>I have gone through this particular problem in hackerrank. </p>

<blockquote>
 <p>You are given an array of $n$ integers, $a_0, a_1, a_2 , \ldots, a_n$, and a positive integer $k$. Find and print the number of pai... | habedi/stack-exchange-dataset |
68,225 | Properties of a term rewrite rule | <p>While doing some bibliography on term-rewriting, I often found these two properties to define a term rewrite rule (see for example <a href="https://pdfs.semanticscholar.org/a19e/9d5f7411b6904c27e6ea7e9fb8177b7cc61f.pdf" rel="nofollow noreferrer">here</a> and <a href="https://www-users.cs.york.ac.uk/det/Papers/tgr_su... | term rewriting | 1 | Properties of a term rewrite rule -- (term rewriting)
<p>While doing some bibliography on term-rewriting, I often found these two properties to define a term rewrite rule (see for example <a href="https://pdfs.semanticscholar.org/a19e/9d5f7411b6904c27e6ea7e9fb8177b7cc61f.pdf" rel="nofollow noreferrer">here</a> and <a h... | habedi/stack-exchange-dataset |
68,231 | What's really meant by context-free in the term context-free grammar? | <p>I have been studying compilers for a while, and I have been searching what's meant by "context" in grammar and what it means for grammar to be "context-free", but with no result.</p>

<p>So can anyone help with this ?</p>
 | terminology context free formal grammars | 1 | What's really meant by context-free in the term context-free grammar? -- (terminology context free formal grammars)
<p>I have been studying compilers for a while, and I have been searching what's meant by "context" in grammar and what it means for grammar to be "context-free", but with no result.</p>

<p>So can... | habedi/stack-exchange-dataset |
68,236 | Help with recursive algorithm analysis | <p>Given this algorithm:</p>

<pre><code>int foo(int num) {
 if (num == 0){
 return 0;
 } else {
 return 1 + foo(num/10);
 }
}
</code></pre>

<p>Me and my friend are debating how you should treat "N" as the size of the input.</p>

<p>If I'm cons... | algorithm analysis recursion | 1 | Help with recursive algorithm analysis -- (algorithm analysis recursion)
<p>Given this algorithm:</p>

<pre><code>int foo(int num) {
 if (num == 0){
 return 0;
 } else {
 return 1 + foo(num/10);
 }
}
</code></pre>

<p>Me and my friend are debating how y... | habedi/stack-exchange-dataset |
68,252 | Arithmetic coding and "the optimal compression ratio" | <p>Trying to learn more about compression techniques and found something in the <a href="https://en.wikipedia.org/wiki/Arithmetic_coding#Huffman_coding" rel="nofollow noreferrer">wikipedia article on arithmetic coding</a> that I'm not sure I fully grok. In describing how Huffman Coding can sometimes be inefficient, the... | information theory data compression huffman coding | 1 | Arithmetic coding and "the optimal compression ratio" -- (information theory data compression huffman coding)
<p>Trying to learn more about compression techniques and found something in the <a href="https://en.wikipedia.org/wiki/Arithmetic_coding#Huffman_coding" rel="nofollow noreferrer">wikipedia article on arithmetic... | habedi/stack-exchange-dataset |
68,259 | Comparing floating-point numbers as integers | <p>In the article <a href="http://floating-point-gui.de/errors/comparison/" rel="nofollow noreferrer">http://floating-point-gui.de/errors/comparison/</a>, a method for comparing floating-point numbers is suggested:</p>
<blockquote>
<p>There is an alternative to heaping conceptual complexity onto such an apparen... | floating point | 1 | Comparing floating-point numbers as integers -- (floating point)
<p>In the article <a href="http://floating-point-gui.de/errors/comparison/" rel="nofollow noreferrer">http://floating-point-gui.de/errors/comparison/</a>, a method for comparing floating-point numbers is suggested:</p>
<blockquote>
<p>There is an ... | habedi/stack-exchange-dataset |
68,271 | Complexity of k-way merge with log n arrays of size n / log n | <p>I'm designing an in-place sorting algorithm to sort a collection of size $n$. Near the end of the sorting, it may end up with with $\log{n}$ sorted sub-sequences of size $\frac{n}{\log{n}}$. At this point, I use a very simple $k$-way merge algorithm that merges the sub-sequences pairwise until everything has been me... | algorithm analysis asymptotics sorting | 1 | Complexity of k-way merge with log n arrays of size n / log n -- (algorithm analysis asymptotics sorting)
<p>I'm designing an in-place sorting algorithm to sort a collection of size $n$. Near the end of the sorting, it may end up with with $\log{n}$ sorted sub-sequences of size $\frac{n}{\log{n}}$. At this point, I use... | habedi/stack-exchange-dataset |
68,279 | Efficient way to find the i-th size in a BST | <p>Given the following definition of binary search tree:</p>

<p>$$\text{size}(t)=\cases{0\qquad\qquad\qquad\qquad\qquad\qquad t=\text{ null}\\
1+\text{size(t.left)+size(t.right)}\qquad\text{otherwise}}$$</p>

<p>for each vertex in the tree t.size contain the size of it's subtree</p>

<block... | algorithms data structures runtime analysis | 1 | Efficient way to find the i-th size in a BST -- (algorithms data structures runtime analysis)
<p>Given the following definition of binary search tree:</p>

<p>$$\text{size}(t)=\cases{0\qquad\qquad\qquad\qquad\qquad\qquad t=\text{ null}\\
1+\text{size(t.left)+size(t.right)}\qquad\text{otherwise}}$$</p>
&... | habedi/stack-exchange-dataset |
68,282 | How does the double rotation in AVL tree work? | <p>I am trying to find out from <a href="https://www.cs.usfca.edu/~galles/visualization/AVLtree.html" rel="nofollow noreferrer">this visualization</a> how does the AVL trees work. But I am not able to find out how is the algorithm choosing which vertex is the right one to use as "partial root". </p>

<p>The sim... | graphs search algorithms binary trees balanced search trees | 1 | How does the double rotation in AVL tree work? -- (graphs search algorithms binary trees balanced search trees)
<p>I am trying to find out from <a href="https://www.cs.usfca.edu/~galles/visualization/AVLtree.html" rel="nofollow noreferrer">this visualization</a> how does the AVL trees work. But I am not able to find ou... | habedi/stack-exchange-dataset |
68,283 | A term for two algorithms which give same results but differ in complexity | <p>Is there a technical term for a pair $(u,v)$ of algorithms, such that $u$ and $v$ have an identical output for each input (I include the option if not halting as a possible output), but they have different complexity (either time or space) as a function of their input?</p>

<p>An example of such a pair is (b... | algorithms complexity theory terminology | 1 | A term for two algorithms which give same results but differ in complexity -- (algorithms complexity theory terminology)
<p>Is there a technical term for a pair $(u,v)$ of algorithms, such that $u$ and $v$ have an identical output for each input (I include the option if not halting as a possible output), but they have ... | habedi/stack-exchange-dataset |
68,288 | Finding strings that are matched by a given regular expression | <p>I'm trying to be ahead of the game by studying some Theory of Computation concepts before class starts at the end of this month. There's this question I came across that I don't understand below.</p>

<pre><code>Let L be the language defined by the regular expression:
(c U ab U b)*bb(c U ab)

(U... | regular expressions | 1 | Finding strings that are matched by a given regular expression -- (regular expressions)
<p>I'm trying to be ahead of the game by studying some Theory of Computation concepts before class starts at the end of this month. There's this question I came across that I don't understand below.</p>

<pre><code>Let L be... | habedi/stack-exchange-dataset |
68,307 | Query all bounding boxes which contain a point | <p>I'm looking for the most efficient spatial-indexing data-structure for storing and querying bounding boxes which contain individual points. The points represent 2D coordinates on a grid, while the bounding boxes represent regions of the grid. The bounding boxes may vary greatly in size, and multiple bounding boxes m... | algorithms data structures space partitioning | 1 | Query all bounding boxes which contain a point -- (algorithms data structures space partitioning)
<p>I'm looking for the most efficient spatial-indexing data-structure for storing and querying bounding boxes which contain individual points. The points represent 2D coordinates on a grid, while the bounding boxes represe... | habedi/stack-exchange-dataset |
68,311 | Is there any graph problem that, when restricted to trees, has $\Omega(n^2)$ time complexity? | <p>Trees are pretty linear in nature, since the number of edges is always one less than the number of vertices. Furthermore, the absence of cycles can sometimes drastically reduce the computational complexity of otherwise pretty hard problems. For example, the longest path problem is NP-hard for general graphs, but is ... | complexity theory graphs time complexity trees | 1 | Is there any graph problem that, when restricted to trees, has $\Omega(n^2)$ time complexity? -- (complexity theory graphs time complexity trees)
<p>Trees are pretty linear in nature, since the number of edges is always one less than the number of vertices. Furthermore, the absence of cycles can sometimes drastically r... | habedi/stack-exchange-dataset |
68,314 | Supervised learning with no prior information | <p>I am now reading two modern books on machine learning theory. Both of them emphasize that, in order to succeed in supervised learning, one must choose a good hypothesis class. "Good" means that it is sufficiently simple (formally, has a low VC dimension) and that it contains the true hypothesis or sufficiently close... | machine learning learning theory | 1 | Supervised learning with no prior information -- (machine learning learning theory)
<p>I am now reading two modern books on machine learning theory. Both of them emphasize that, in order to succeed in supervised learning, one must choose a good hypothesis class. "Good" means that it is sufficiently simple (formally, ha... | habedi/stack-exchange-dataset |
68,325 | No subset of RE captures the set of TMs halting on themselves as input | <p>For a property $P$ of languages, which we identify with the set of languages satisfying it, let $L_P = \{ \langle M \rangle \mid L(M) \in P \}$ be the set of descriptions of Turing machines whose languages satisfy $P$.</p>

<blockquote>
 <p>How can we prove that there's no property $\displaystyle P\subs... | computability turing machines | 1 | No subset of RE captures the set of TMs halting on themselves as input -- (computability turing machines)
<p>For a property $P$ of languages, which we identify with the set of languages satisfying it, let $L_P = \{ \langle M \rangle \mid L(M) \in P \}$ be the set of descriptions of Turing machines whose languages satis... | habedi/stack-exchange-dataset |
68,332 | Connected components and graph edition | <p>There are known algorithms to find the connected components of a given graph. Those I know are easily extensible to support addition of nodes and edges to the graph and then find the resulting components more quickly than by recomputing from scratch.</p>

<p>What I'm looking for is an algorithm with an asso... | graphs | 1 | Connected components and graph edition -- (graphs)
<p>There are known algorithms to find the connected components of a given graph. Those I know are easily extensible to support addition of nodes and edges to the graph and then find the resulting components more quickly than by recomputing from scratch.</p>

<... | habedi/stack-exchange-dataset |
68,345 | How to efficiently code Dynamic Time Warping algorithm with a locality constrain? | <p>For given two lists $[s_1, s_2, ... s_n]$ and $[t_1, t_2, ..., t_m]$</p>

<p>I need to implement <a href="https://en.wikipedia.org/wiki/Dynamic_time_warping" rel="nofollow noreferrer">DTW</a> algorithm with one extra constraint:</p>

<p>If $s_i$ is matched with $t_j$ then the next element $s_{i+1}$ h... | algorithms dynamic programming subsequences time series analysis | 1 | How to efficiently code Dynamic Time Warping algorithm with a locality constrain? -- (algorithms dynamic programming subsequences time series analysis)
<p>For given two lists $[s_1, s_2, ... s_n]$ and $[t_1, t_2, ..., t_m]$</p>

<p>I need to implement <a href="https://en.wikipedia.org/wiki/Dynamic_time_warping"... | habedi/stack-exchange-dataset |
68,346 | Does every data type just boil down to nodes with pointers? | <p>An array or vector is just a sequence of values. They can surely be implemented with a linked list. This is just a bunch of nodes with pointers to the next node.</p>

<p>Stacks and queues are two abstract data types commonly taught in Intro CS courses. Somewhere in the class, students often have to impleme... | algorithms data structures abstract data types | 1 | Does every data type just boil down to nodes with pointers? -- (algorithms data structures abstract data types)
<p>An array or vector is just a sequence of values. They can surely be implemented with a linked list. This is just a bunch of nodes with pointers to the next node.</p>

<p>Stacks and queues are two ... | habedi/stack-exchange-dataset |
68,358 | Operator-precedence grammar`s symmetrical rule | <p>I have a basic question, but I cannot find an answer anywhere on the Web. I have the following grammar rules:</p>

<ol>
<li><code>S -> if C ;</code></li>
<li><code>C -> O < O</code></li>
<li><code>O -> O + i</code></li>
<li><code>O -> i</code></li>
</ol>

<p>The par... | formal grammars | 1 | Operator-precedence grammar`s symmetrical rule -- (formal grammars)
<p>I have a basic question, but I cannot find an answer anywhere on the Web. I have the following grammar rules:</p>

<ol>
<li><code>S -> if C ;</code></li>
<li><code>C -> O < O</code></li>
<li><code>O -> O + i</code></l... | habedi/stack-exchange-dataset |
68,363 | Randomly partition an rectangle into N smaller rectangles | <p>I'm looking for an algorithm that can partition a rectangle into N smaller rectangles, at random. N will be small (on the order of 5-10 in most cases). It need not be uniformly at random, but at the very least, I'd like to avoid algorithms which completely exclude interesting classes of partitions.</p>

<p>O... | space partitioning | 1 | Randomly partition an rectangle into N smaller rectangles -- (space partitioning)
<p>I'm looking for an algorithm that can partition a rectangle into N smaller rectangles, at random. N will be small (on the order of 5-10 in most cases). It need not be uniformly at random, but at the very least, I'd like to avoid algori... | habedi/stack-exchange-dataset |
68,364 | How on-chip multithreading prevents cache misses from stalling a processor pipeline? | <p>On-chip multithreading is considered a powerful performance enhancer technique that enables a processor to handle multiple threads at the same time. If I got the idea right, multithreading avoids pipeline stalls by processing instructions coming from different threads - since no data dependencies exist between diffe... | computer architecture parallel computing | 1 | How on-chip multithreading prevents cache misses from stalling a processor pipeline? -- (computer architecture parallel computing)
<p>On-chip multithreading is considered a powerful performance enhancer technique that enables a processor to handle multiple threads at the same time. If I got the idea right, multithreadi... | habedi/stack-exchange-dataset |
68,366 | What happens when sink transition is enabled | <p>Well I guess it is only a matter of definition but I've failed to find certain answer to the following question:</p>

<p>In a Petri net if transition has k inputs and zero outputs what is considered to happen when transition fires? Do we have just k - 1 token left and then just transition is not enabled? </... | petri nets | 1 | What happens when sink transition is enabled -- (petri nets)
<p>Well I guess it is only a matter of definition but I've failed to find certain answer to the following question:</p>

<p>In a Petri net if transition has k inputs and zero outputs what is considered to happen when transition fires? Do we have just ... | habedi/stack-exchange-dataset |
68,387 | Conflicting definitions of quasipolynomial time | <p>The textbook The Nature of Computation uses the following definition of quasipolynomial time: </p>

<blockquote>
 <p>A quasipolynomial is a function of the form $f(n) = 2^{\Theta(\log^k n)}$ for some constant $k > 0$, where $\log^k n$ denotes $(\log n)^k$. Let us define <strong>QuasiP</strong> as th... | terminology time complexity asymptotics landau notation | 1 | Conflicting definitions of quasipolynomial time -- (terminology time complexity asymptotics landau notation)
<p>The textbook The Nature of Computation uses the following definition of quasipolynomial time: </p>

<blockquote>
 <p>A quasipolynomial is a function of the form $f(n) = 2^{\Theta(\log^k n)}$ for... | habedi/stack-exchange-dataset |
68,398 | Semantic natural language processing - from texts to logical expressions? Universal knowledge base? | <p>My question is - <strong>is there a semantic natural language processing that tries to understand the meaning of the texts and that tries to derive the consequences of the understood meaning? Is there a universal knowledge base that can be used for the "grounding" of the texts?</strong></p>

<p>I have heard ... | logic artificial intelligence semantics natural language processing | 1 | Semantic natural language processing - from texts to logical expressions? Universal knowledge base? -- (logic artificial intelligence semantics natural language processing)
<p>My question is - <strong>is there a semantic natural language processing that tries to understand the meaning of the texts and that tries to der... | habedi/stack-exchange-dataset |
68,408 | ground terms in logic and $\lambda$-calculus? | <p>What are the differences of ground terms in first-order logic and higher-order logic?</p>

<p>I found on the Wikipedia: "In mathematical logic, a ground term of a formal system is a term that does not contain any free variables."</p>

<p>That mentioned "free variable" is the same thing with free vari... | logic lambda calculus | 1 | ground terms in logic and $\lambda$-calculus? -- (logic lambda calculus)
<p>What are the differences of ground terms in first-order logic and higher-order logic?</p>

<p>I found on the Wikipedia: "In mathematical logic, a ground term of a formal system is a term that does not contain any free variables."</p>&#x... | habedi/stack-exchange-dataset |
68,411 | The stability of log(1+x) | <p>I am trying to understand why the formula</p>

<p>$$ \frac{\log(1+x)}{(1+x)-1} \times x,$$</p>

<p>which simply reduces down to $\log(1+x)$, is considered as more stable to compute than $\log(1+x)$. In my head it doesn't make sense to me as my brain automatically simplifies it to $\log(1+x)$, which ... | algorithms numerical algorithms numerical analysis error estimation | 1 | The stability of log(1+x) -- (algorithms numerical algorithms numerical analysis error estimation)
<p>I am trying to understand why the formula</p>

<p>$$ \frac{\log(1+x)}{(1+x)-1} \times x,$$</p>

<p>which simply reduces down to $\log(1+x)$, is considered as more stable to compute than $\log(1+x)$. In... | habedi/stack-exchange-dataset |
68,422 | Using two hash functions for increased password security? | <p>Forgive me for my brief knowledge on hash functions as I am not from a computer science background, however I am researching password security for my thesis and have been looking into hashing functions for password security. I understand that a password goes through a hashing function and is stored in a separate dat... | security hashing | 1 | Using two hash functions for increased password security? -- (security hashing)
<p>Forgive me for my brief knowledge on hash functions as I am not from a computer science background, however I am researching password security for my thesis and have been looking into hashing functions for password security. I understand... | habedi/stack-exchange-dataset |
68,423 | Context-freeness of $\{a^nb^mc^k \mid n \leq m \leq k\}$ and its complement | <p>Was analysing old exam, still, even in home condition can answer this:</p>
<blockquote>
<p>Determine which of the following languages over the alphabet <span class="math-container">$\{a,b,c\}$</span> are context-free. Prove the claim.</p>
<p>(a) <span class="math-container">$L_1 = \{a^nb^mc^k \mid n \leq... | context free pumping lemma | 1 | Context-freeness of $\{a^nb^mc^k \mid n \leq m \leq k\}$ and its complement -- (context free pumping lemma)
<p>Was analysing old exam, still, even in home condition can answer this:</p>
<blockquote>
<p>Determine which of the following languages over the alphabet <span class="math-container">$\{a,b,c\}$</span> a... | habedi/stack-exchange-dataset |
68,427 | Closure of regular languages to shuffle using closure operations | <p>Given a language:
$L = \{\; a_1b_1a_2b_2a_3b_3\dots a_nb_n \mid \forall i: a_i,b_i \in \Sigma, a_1\dots a_n \in L_1\ , b_1\dots b_n \in L_2 \;\}$</p>

<p>Also $L_1, L_2$ are regular languages.</p>

<p>Using closure only (homomorphism) prove that L is also regular language.</p>

<hr>
... | regular languages closure properties | 1 | Closure of regular languages to shuffle using closure operations -- (regular languages closure properties)
<p>Given a language:
$L = \{\; a_1b_1a_2b_2a_3b_3\dots a_nb_n \mid \forall i: a_i,b_i \in \Sigma, a_1\dots a_n \in L_1\ , b_1\dots b_n \in L_2 \;\}$</p>

<p>Also $L_1, L_2$ are regular languages.</p>... | habedi/stack-exchange-dataset |
68,430 | how to identify patterns in program execution flows? | <p>Consider a library, that is used by different programs. Under certain (unknown) circumstances, an error can occur. I want to feed execution traces of faulty programs to some kind of an algorithm / framework so it learns about the "pattern" which led to the error. It should then, when fed a live trace, detect when th... | algorithms machine learning pattern recognition | 1 | how to identify patterns in program execution flows? -- (algorithms machine learning pattern recognition)
<p>Consider a library, that is used by different programs. Under certain (unknown) circumstances, an error can occur. I want to feed execution traces of faulty programs to some kind of an algorithm / framework so i... | habedi/stack-exchange-dataset |
68,437 | Are finite-domain binary constraint satisfaction problems solvable in polynomial time? | <blockquote>
 <p>Suppose a CSP has $n$ variables with finite domains of maximal size $d$. Furthermore, all constraints on the variables are binary. Can such a CSP be solved in polynomial time in $n$ and $d$?</p>
</blockquote>

<p>This was an exam question on last year’s AI exam, but I’m not sure how to... | complexity theory polynomial time constraint satisfaction | 1 | Are finite-domain binary constraint satisfaction problems solvable in polynomial time? -- (complexity theory polynomial time constraint satisfaction)
<blockquote>
 <p>Suppose a CSP has $n$ variables with finite domains of maximal size $d$. Furthermore, all constraints on the variables are binary. Can such a CSP be... | habedi/stack-exchange-dataset |
68,450 | Is there a correspondence between the syntaxes and the type systems of programming languages? | <p>I was reading the first chapter of Robert Harper's <em>Practical Foundations for Programming Languages</em> in which it introduced <strong>abstract binding tree</strong>s, aka <em>abt</em>. It seems pretty like typed lambda calculus.</p>

<ol>
<li>There are ground sorts, which are similar to ground types... | lambda calculus type theory syntax syntax trees | 1 | Is there a correspondence between the syntaxes and the type systems of programming languages? -- (lambda calculus type theory syntax syntax trees)
<p>I was reading the first chapter of Robert Harper's <em>Practical Foundations for Programming Languages</em> in which it introduced <strong>abstract binding tree</strong>s... | habedi/stack-exchange-dataset |
68,462 | How to determine enumerability after applying Rice's theorem? | <p>To my knowledge, lots of languages can be classified as undecidable after applying Rice's theorem, for example {"M" | L(M) is regular}.</p>

<p>But what I am not sure is, how to determine if a language is enumerable after applying Rice's theorem? I reckon we can examine that whether the M halt on some specif... | computability rice theorem | 1 | How to determine enumerability after applying Rice's theorem? -- (computability rice theorem)
<p>To my knowledge, lots of languages can be classified as undecidable after applying Rice's theorem, for example {"M" | L(M) is regular}.</p>

<p>But what I am not sure is, how to determine if a language is enumerable... | habedi/stack-exchange-dataset |
68,471 | NFA automata with ϵ moves proof | <p>How can I prove that for every NFA with $\epsilon$ moves if $q_0 \in F$ then $\epsilon \in L(A)$? I can't think of any technique since it seems so trivial.</p>
 | automata finite automata proof techniques | 1 | NFA automata with ϵ moves proof -- (automata finite automata proof techniques)
<p>How can I prove that for every NFA with $\epsilon$ moves if $q_0 \in F$ then $\epsilon \in L(A)$? I can't think of any technique since it seems so trivial.</p>
 | habedi/stack-exchange-dataset |
68,484 | Why proving programs correctness doesn't have the same importance as algorithms analysis or the theory of computation in practice? | <p>What are the major causes that makes "Proving Programs correct", not a widely attractive subject? though from it's name, and from what we know from other disciplines (like mathematics) it looks like it should be on the top of the "must know list". And by the way I'm talking about "the real world", in practice.</p>&#... | proof techniques correctness proof | 1 | Why proving programs correctness doesn't have the same importance as algorithms analysis or the theory of computation in practice? -- (proof techniques correctness proof)
<p>What are the major causes that makes "Proving Programs correct", not a widely attractive subject? though from it's name, and from what we know fro... | habedi/stack-exchange-dataset |
68,493 | Why can level-triggered interrupts be shared but not edge-triggered interrupts? | <blockquote>
 <p>A key difference between the edge-triggered and level-triggered interrupts is interrupt sharing. <strong>Level-triggered interrupts can be shared. Edge-triggered interrupts cannot be shared</strong>.</p>
</blockquote>

<p>I read the line above in an IBM document. Need help to understan... | computer architecture operating systems cpu | 1 | Why can level-triggered interrupts be shared but not edge-triggered interrupts? -- (computer architecture operating systems cpu)
<blockquote>
 <p>A key difference between the edge-triggered and level-triggered interrupts is interrupt sharing. <strong>Level-triggered interrupts can be shared. Edge-triggered interru... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.