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 |
|---|---|---|---|---|---|---|
49,948 | Class of the language only containing the empty string? | <p>$L = \left \{ \epsilon \right \}$<br>
Clearly this language is finite so this must be a regular language.<br>
Now since every regular language is Context Sensitive, $L$ is a CSL.<br>
We can define the grammar for $L$ as :<br>
$S\rightarrow \epsilon$<br>
Now since $L$ is a CSL, this grammar must ... | formal languages regular languages context sensitive | 1 | Class of the language only containing the empty string? -- (formal languages regular languages context sensitive)
<p>$L = \left \{ \epsilon \right \}$<br>
Clearly this language is finite so this must be a regular language.<br>
Now since every regular language is Context Sensitive, $L$ is a CSL.<br>
We can ... | habedi/stack-exchange-dataset |
49,949 | Difference between Bayesian Networks and Dynamic Bayesian Networks | <p>I'm studying Bayesian networks and want to clarify a couple of things with people who are more knowledgable in the area than me.</p>

<p>As far as I understand it, a Bayesian network (BN) is a directed acyclic graph (DAG) that encodes conditional dependencies between random variables. The graph is drawn in s... | machine learning bayesian statistics graphical models | 1 | Difference between Bayesian Networks and Dynamic Bayesian Networks -- (machine learning bayesian statistics graphical models)
<p>I'm studying Bayesian networks and want to clarify a couple of things with people who are more knowledgable in the area than me.</p>

<p>As far as I understand it, a Bayesian network ... | habedi/stack-exchange-dataset |
49,956 | If two languages together cover all words and one is regular, is the other one as well? | <p>If $L_1$$\subseteq$ $\Sigma^*$, $L_2$$\subseteq$ $\Sigma^*$ , $L_1$ is regular and $L_1$$\cup$ $L_2$ = $\Sigma^*$ then is $L_2$ necessarily regular?</p>

<p>I think that the answer is yes, but I'm not sure on my proof.</p>

<p>The reason that I think that $L_2$ is regular is because surely $L_2$ just... | formal languages regular languages closure properties | 1 | If two languages together cover all words and one is regular, is the other one as well? -- (formal languages regular languages closure properties)
<p>If $L_1$$\subseteq$ $\Sigma^*$, $L_2$$\subseteq$ $\Sigma^*$ , $L_1$ is regular and $L_1$$\cup$ $L_2$ = $\Sigma^*$ then is $L_2$ necessarily regular?</p>

<p>I thi... | habedi/stack-exchange-dataset |
49,963 | Another version of the online set cover problem? | <p><a href="http://research.microsoft.com/en-us/um/people/nikdev/OnlineAlgoCourse/ClassNotes/Feb_27.pdf" rel="nofollow">Here</a> is a note about online set cover problem: 
we are initially given the $m$ sets, but we do not know which elements they contain. At any time $t$, we get a new element $e_t$ and learn which... | algorithms set cover | 1 | Another version of the online set cover problem? -- (algorithms set cover)
<p><a href="http://research.microsoft.com/en-us/um/people/nikdev/OnlineAlgoCourse/ClassNotes/Feb_27.pdf" rel="nofollow">Here</a> is a note about online set cover problem: 
we are initially given the $m$ sets, but we do not know which element... | habedi/stack-exchange-dataset |
49,987 | Branchless function equivalent | <p>Does every pure function have a branchless equivalent?</p>

<p>By <em>pure</em> function I understand a function that uses only its input values and no global state to produce the output.</p>

<p>By <em>branchless</em> function I understand a function that does not use if/else during its execution. A... | algorithms algorithm analysis equality | 1 | Branchless function equivalent -- (algorithms algorithm analysis equality)
<p>Does every pure function have a branchless equivalent?</p>

<p>By <em>pure</em> function I understand a function that uses only its input values and no global state to produce the output.</p>

<p>By <em>branchless</em> functio... | habedi/stack-exchange-dataset |
49,998 | How do incompressible strings and random strings share the same properties? | <p>I came across the following theorem in <a href="http://www.cin.ufpe.br/~jjss/Introcuction%20to%20Theory%20of%20computation%20by%20Micheal%20Sipser%20Ist%20Ed..pdf" rel="nofollow">Sipser's</a> about incompressible strings.</p>

<blockquote>
 <p>Let $\;f$ be some computable function which holds for almost... | computability data compression randomness | 1 | How do incompressible strings and random strings share the same properties? -- (computability data compression randomness)
<p>I came across the following theorem in <a href="http://www.cin.ufpe.br/~jjss/Introcuction%20to%20Theory%20of%20computation%20by%20Micheal%20Sipser%20Ist%20Ed..pdf" rel="nofollow">Sipser's</a> ab... | habedi/stack-exchange-dataset |
50,001 | Modeling $(x > 0 \wedge y > 0) \Leftrightarrow z > 0$ in a linear program: impossible? | <p>In <a href="https://cs.stackexchange.com/questions/12102/express-boolean-logic-operations-in-zero-one-integer-linear-programming-ilp">this question</a>, we see how to model boolean logic in $0 - 1$ ILPs. Moving to a relaxation, modelling $(x > 0 \vee y > 0) \Leftrightarrow z > 0$ with $x,y,z \in [0,1]$ with... | linear programming quadratic programming | 1 | Modeling $(x > 0 \wedge y > 0) \Leftrightarrow z > 0$ in a linear program: impossible? -- (linear programming quadratic programming)
<p>In <a href="https://cs.stackexchange.com/questions/12102/express-boolean-logic-operations-in-zero-one-integer-linear-programming-ilp">this question</a>, we see how to model boolean log... | habedi/stack-exchange-dataset |
50,011 | Converting a digital circuit to two layers of OR and AND gates | <p>The other day someone mentioned to me that you could take an arbitrary digital circuit which mapped N input bits to M output bits, and replace it with a layer of OR gates and a layer of AND gates. I believe he said there would be 2^N ANDs and ORs each. I haven't been able to find any more information about this th... | boolean algebra digital circuits | 1 | Converting a digital circuit to two layers of OR and AND gates -- (boolean algebra digital circuits)
<p>The other day someone mentioned to me that you could take an arbitrary digital circuit which mapped N input bits to M output bits, and replace it with a layer of OR gates and a layer of AND gates. I believe he said ... | habedi/stack-exchange-dataset |
50,014 | Why is Savage's Vertex Cover algorithm a 2-approximation? | <p>Carla. D. Savage formulated the following approximation algorithm for the vertex cover problem.</p>
<blockquote>
<p>Given graph <span class="math-container">$G$</span>, start at arbitrary node and traverse <span class="math-container">$G$</span> depth-first</p>
<p>Obtain DFS tree <span class="math-contai... | algorithms graphs approximation matching | 1 | Why is Savage's Vertex Cover algorithm a 2-approximation? -- (algorithms graphs approximation matching)
<p>Carla. D. Savage formulated the following approximation algorithm for the vertex cover problem.</p>
<blockquote>
<p>Given graph <span class="math-container">$G$</span>, start at arbitrary node and traverse... | habedi/stack-exchange-dataset |
50,022 | Finding subset such that one sum is more than target and another sum is less | <p>Consider the following problem: Given positive integers $a_1,\ldots,a_n,b_1,\ldots,b_n,A,B$, does there exist a subset $S$ of $\{1,\ldots,n\}$ such that $\sum_{i\in S}a_i\geq A$ and $\sum_{i \in S}b_i\leq B$?</p>

<p>Is this problem NP-hard? I'm thinking there is possibly a reduction from the subset-sum prob... | complexity theory reductions np hard | 1 | Finding subset such that one sum is more than target and another sum is less -- (complexity theory reductions np hard)
<p>Consider the following problem: Given positive integers $a_1,\ldots,a_n,b_1,\ldots,b_n,A,B$, does there exist a subset $S$ of $\{1,\ldots,n\}$ such that $\sum_{i\in S}a_i\geq A$ and $\sum_{i \in S}b... | habedi/stack-exchange-dataset |
50,023 | Finding an automaton with a given number of states | <blockquote>
 <p>Define an NFA with 4 states that is equivalant to the following Regular Expression. $(01 + 011 + 0111)^*$.</p>
</blockquote>

<p>My main problem is that to check for a string of length 4 (<code>0111</code>) I need at least 5 states to begin with. So to my (novice) little brain the ques... | automata finite automata nondeterminism | 1 | Finding an automaton with a given number of states -- (automata finite automata nondeterminism)
<blockquote>
 <p>Define an NFA with 4 states that is equivalant to the following Regular Expression. $(01 + 011 + 0111)^*$.</p>
</blockquote>

<p>My main problem is that to check for a string of length 4 (<c... | habedi/stack-exchange-dataset |
50,026 | weighted subset exchange question | <p>Assume there is a set {1,...,n} of person. For each person i, a set $A_i$ of items are available for exchange. A is the set of all items. The value of item j to person i is $v_{ij}$ and assume all values are positive integers. The question is, does there exist a pair of person who can both make profit by exchanging ... | complexity theory np complete | 1 | weighted subset exchange question -- (complexity theory np complete)
<p>Assume there is a set {1,...,n} of person. For each person i, a set $A_i$ of items are available for exchange. A is the set of all items. The value of item j to person i is $v_{ij}$ and assume all values are positive integers. The question is, does... | habedi/stack-exchange-dataset |
50,035 | Why doesn't the Needleman-Wunsch algorithm find solutions that begin with a gap? | <p>I have implemented in C++ the Needleman-Wunsch algorithm for pairwise sequence alignment using the following scores: +1 for match (regardless of base), -1 gap penalty and -1 for a mismatch. Given two sequences of length $m$ and $n$ the algorithm then generates the $mn$ search space row by row as per the algorithm's ... | dynamic programming backtracking bioinformatics | 1 | Why doesn't the Needleman-Wunsch algorithm find solutions that begin with a gap? -- (dynamic programming backtracking bioinformatics)
<p>I have implemented in C++ the Needleman-Wunsch algorithm for pairwise sequence alignment using the following scores: +1 for match (regardless of base), -1 gap penalty and -1 for a mis... | habedi/stack-exchange-dataset |
50,038 | Why does if A is a spanning tree which doesn't have $e_1$ then $A\bigcup\{e_1\}$ has a unique cycle? | <p>I am studying the algorithm of Sollin and we recently studied a lemma:</p>
<p>Let be G a graph which values are diffferent on the edges.</p>
<ul>
<li>We sort the edges <span class="math-container">$e_1,e_2,...e_m$</span> such as <span class="math-container">$v(e_i)<v(e_j)$</span></li>
<li>Every t... | proof techniques trees spanning trees | 1 | Why does if A is a spanning tree which doesn't have $e_1$ then $A\bigcup\{e_1\}$ has a unique cycle? -- (proof techniques trees spanning trees)
<p>I am studying the algorithm of Sollin and we recently studied a lemma:</p>
<p>Let be G a graph which values are diffferent on the edges.</p>
<ul>
<li>We sort the... | habedi/stack-exchange-dataset |
50,052 | Is there a known maximum for how much a string of 0's and 1's can be compressed? | <p>A long time ago I read a newspaper article where a professor of some sort said that in the future we will be able to compress data to just two bits (or something like that).</p>

<p>This is of course not correct (and it could be that my memory of what he exactly stated is not correct). Understandably it woul... | data compression | 1 | Is there a known maximum for how much a string of 0's and 1's can be compressed? -- (data compression)
<p>A long time ago I read a newspaper article where a professor of some sort said that in the future we will be able to compress data to just two bits (or something like that).</p>

<p>This is of course not co... | habedi/stack-exchange-dataset |
50,053 | How do POMDPs and Dynamic Influence Diagrams differ? | <p>To give some perspective, first consider the following diagram comparing Markov Chains, HMMs, MDPs, and POMDPs (I'm not sure who to credit for it).</p>

<pre>

 Fully observable Partially observable
 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _&... | probability theory decision problem hidden markov models | 1 | How do POMDPs and Dynamic Influence Diagrams differ? -- (probability theory decision problem hidden markov models)
<p>To give some perspective, first consider the following diagram comparing Markov Chains, HMMs, MDPs, and POMDPs (I'm not sure who to credit for it).</p>

<pre>

 Fully ... | habedi/stack-exchange-dataset |
50,059 | Why is the Mersenne Twister regarded as good? | <p>The Mersenne Twister is widely regarded as good. Heck, <a href="https://github.com/python/cpython/blob/master/Lib/random.py#L33">the CPython source</a> says that it "is one of the most extensively tested generators in existence." But what does this mean? When asked to list properties of this generator, most of what ... | algorithms randomness sampling pseudo random generators | 1 | Why is the Mersenne Twister regarded as good? -- (algorithms randomness sampling pseudo random generators)
<p>The Mersenne Twister is widely regarded as good. Heck, <a href="https://github.com/python/cpython/blob/master/Lib/random.py#L33">the CPython source</a> says that it "is one of the most extensively tested genera... | habedi/stack-exchange-dataset |
50,086 | What is the file system of ram? | <p>As much I know about a memory and storing data there would always be a managing type feature in every memory which manages all the data and its location. So, what is the <strong>file system of a RAM</strong>. I also like to know the format or type (mp3, pdf, png, txt, jpg or binary) of data stored in.</p>
 | memory management filesystems | 1 | What is the file system of ram? -- (memory management filesystems)
<p>As much I know about a memory and storing data there would always be a managing type feature in every memory which manages all the data and its location. So, what is the <strong>file system of a RAM</strong>. I also like to know the format or type (m... | habedi/stack-exchange-dataset |
50,089 | How ram is divided | <p>when I write a program, in a Von Neumann architecture, how the ram will be divided to receive data and instructions? For example if I have 1 MB of ram, the addresses from 0 to 499.999 for data and from 500.000 to 999.999 for instructions? Or I could find instructions mixed with data? Is divided the entire memory for... | memory management | 1 | How ram is divided -- (memory management)
<p>when I write a program, in a Von Neumann architecture, how the ram will be divided to receive data and instructions? For example if I have 1 MB of ram, the addresses from 0 to 499.999 for data and from 500.000 to 999.999 for instructions? Or I could find instructions mixed w... | habedi/stack-exchange-dataset |
50,090 | Why is data fragmentation not possible on main memory (RAM)? | <p>I am wondering why data fragmentation is a problem on main memory.</p>

<p>On a software level, virtual addresses are used anyway. So why can one address space not be split up into multiple segments, like a hard disk might do? I don't see how the performance would be affected, as the time needed to access me... | memory hardware virtual memory memory allocation | 1 | Why is data fragmentation not possible on main memory (RAM)? -- (memory hardware virtual memory memory allocation)
<p>I am wondering why data fragmentation is a problem on main memory.</p>

<p>On a software level, virtual addresses are used anyway. So why can one address space not be split up into multiple segm... | habedi/stack-exchange-dataset |
50,099 | Finding a lower bound for the amount of comparisons for sorting $k$ subarrays with $\frac n k$ elements | <blockquote>
 <p>Let the input be an array of $n$ elements, with $k$ sets $S_1,...,S_k$ such that each set has $\frac n k$ elements. The elements in each $S_i$ are larger than the elements in $S_{i-1}$.</p>
 
 <ol>
 <li><p>Find an algorithm that sorts the input in $O(n\log (\frac n k ))$ runtime.</p... | algorithms algorithm analysis data structures asymptotics sorting | 1 | Finding a lower bound for the amount of comparisons for sorting $k$ subarrays with $\frac n k$ elements -- (algorithms algorithm analysis data structures asymptotics sorting)
<blockquote>
 <p>Let the input be an array of $n$ elements, with $k$ sets $S_1,...,S_k$ such that each set has $\frac n k$ elements. The ele... | habedi/stack-exchange-dataset |
50,108 | How did MacLisp's garbage collector "run in the register set"? | <p><a href="http://www.paulgraham.com/thist.html" rel="nofollow">Olin Shivers, ‘History of T’</a>:</p>

<blockquote>
 <p>Maclisp on the [PDP]-10 had used a mark&sweep GC (one version of which famously "ran in the register set," though that is another story)</p>
</blockquote>

<p>This implie... | programming languages memory management garbage collection lisp | 1 | How did MacLisp's garbage collector "run in the register set"? -- (programming languages memory management garbage collection lisp)
<p><a href="http://www.paulgraham.com/thist.html" rel="nofollow">Olin Shivers, ‘History of T’</a>:</p>

<blockquote>
 <p>Maclisp on the [PDP]-10 had used a mark&sweep GC (... | habedi/stack-exchange-dataset |
50,112 | How to draw a DFA for given language? | <p>Give a finite state diagram for a DFA that accepts any word in the language $L = \{w \mid w \in \{a, b\}^* \text{ and }w \text{ alternates } a\text{'s and }b\text{’s and has an even number of }b\text{’s}\}$.</p>

<p>My attempt: I am having problem on how to deal with the even part of b.</p>
 | automata finite automata dfa | 1 | How to draw a DFA for given language? -- (automata finite automata dfa)
<p>Give a finite state diagram for a DFA that accepts any word in the language $L = \{w \mid w \in \{a, b\}^* \text{ and }w \text{ alternates } a\text{'s and }b\text{’s and has an even number of }b\text{’s}\}$.</p>

<p>My attempt: I am havi... | habedi/stack-exchange-dataset |
50,114 | Given computable function, what are conditions for computability of inverse function? | <p>If $f:\mathbb{N}\rightarrow\mathbb{N}$ is computable and has an inverse, under what conditions is $f^{-1}$ also computable? I couldn't find that in a textbook, and googling gets some vague suggestions about bijective, but I couldn't find a clearly stated theorem to that effect. Offhand, bijective seems sufficient bu... | computability | 1 | Given computable function, what are conditions for computability of inverse function? -- (computability)
<p>If $f:\mathbb{N}\rightarrow\mathbb{N}$ is computable and has an inverse, under what conditions is $f^{-1}$ also computable? I couldn't find that in a textbook, and googling gets some vague suggestions about bijec... | habedi/stack-exchange-dataset |
50,123 | NP complete language having no Polytime decidable superset | <p>Is there an NP complete language having no polytime decidable superset (apart from the set of all strings)?</p>
 | complexity theory np complete | 1 | NP complete language having no Polytime decidable superset -- (complexity theory np complete)
<p>Is there an NP complete language having no polytime decidable superset (apart from the set of all strings)?</p>
 | habedi/stack-exchange-dataset |
50,127 | Why Bloom filter needs $\frac{m}{n}\ln{2}$ hash functions? | <p>I show from <a href="https://en.wikipedia.org/wiki/Bloom_filter#Optimal_number_of_hash_functions" rel="nofollow">Wikipedia</a> that the optimal number of hash functions is:</p>

<blockquote>
 <p>$k =\frac{m}{n}\ln{2}$.</p>
</blockquote>

<p>However it's not obvious for me why, even after rea... | bloom filters hashing | 1 | Why Bloom filter needs $\frac{m}{n}\ln{2}$ hash functions? -- (bloom filters hashing)
<p>I show from <a href="https://en.wikipedia.org/wiki/Bloom_filter#Optimal_number_of_hash_functions" rel="nofollow">Wikipedia</a> that the optimal number of hash functions is:</p>

<blockquote>
 <p>$k =\frac{m}{n}\ln{2}$.... | habedi/stack-exchange-dataset |
50,132 | How to prove a L=L(G) without knowing the L? | <p>How does one prove L(G)=L if the language is not given and only the grammar G is given? If there is no pattern to be seen in the grammar that would create the strings w of a language L, how would you go about doing this?</p>
 | formal languages context free | 1 | How to prove a L=L(G) without knowing the L? -- (formal languages context free)
<p>How does one prove L(G)=L if the language is not given and only the grammar G is given? If there is no pattern to be seen in the grammar that would create the strings w of a language L, how would you go about doing this?</p>
 | habedi/stack-exchange-dataset |
50,142 | Languages that are not subset, but are union | <p>Are there examples of regular languages $L_1$ and $L_2$, where $L_1$ and $L_2$ is not a subset of each other but that $(L_1 \cup L_2)^* = L_1^* \cup L_2^*$ ?</p>
 | formal languages regular languages proof techniques | 1 | Languages that are not subset, but are union -- (formal languages regular languages proof techniques)
<p>Are there examples of regular languages $L_1$ and $L_2$, where $L_1$ and $L_2$ is not a subset of each other but that $(L_1 \cup L_2)^* = L_1^* \cup L_2^*$ ?</p>
 | habedi/stack-exchange-dataset |
50,151 | Using natural deduction, show that: ∀x.(P (x) → Q(x)), ∃x.P (x) ⊢N ∃x.Q(x) | <ol>
<li><p>How I would show: <strong>∀x.(P (x) → Q(x)), ∃x.P (x) ⊢N ∃x.Q(x)</strong> using Natural Deduction? </p></li>
<li><p>Would I not need to know what P(x) and Q(x) are to prove soundness and completeness? </p></li>
</ol>
 | logic | 1 | Using natural deduction, show that: ∀x.(P (x) → Q(x)), ∃x.P (x) ⊢N ∃x.Q(x) -- (logic)
<ol>
<li><p>How I would show: <strong>∀x.(P (x) → Q(x)), ∃x.P (x) ⊢N ∃x.Q(x)</strong> using Natural Deduction? </p></li>
<li><p>Would I not need to know what P(x) and Q(x) are to prove soundness and completeness? </p></li>
... | habedi/stack-exchange-dataset |
50,154 | Why do puzzles like Masyu lie in NP? | <p><a href="https://i.stack.imgur.com/OkUnI.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OkUnI.gif" alt="This is a Masyu puzzle with its solution on the right"></a></p>

<p>The puzzle is made up of (n x n) squares so when taking the problem the input size would be n.</p>

<p>Rules ... | complexity theory np complete proof techniques np | 1 | Why do puzzles like Masyu lie in NP? -- (complexity theory np complete proof techniques np)
<p><a href="https://i.stack.imgur.com/OkUnI.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OkUnI.gif" alt="This is a Masyu puzzle with its solution on the right"></a></p>

<p>The puzzle is made up of ... | habedi/stack-exchange-dataset |
50,185 | How does Hassin's algorithm for the Restricted Shortest Path work? | <p>I'm studying the <a href="http://www.diku.dk/OLD/undervisning/2005v/404/approx_path.pdf" rel="nofollow">Approximation For Restricted Shortest Path Problem</a> paper and don't understand what he is doing. In particular, I wonder why it is important that one computes upper and lower bounds $UB$ and $LB$ on $OPT$, so t... | graphs dynamic programming shortest path approximation | 1 | How does Hassin's algorithm for the Restricted Shortest Path work? -- (graphs dynamic programming shortest path approximation)
<p>I'm studying the <a href="http://www.diku.dk/OLD/undervisning/2005v/404/approx_path.pdf" rel="nofollow">Approximation For Restricted Shortest Path Problem</a> paper and don't understand what... | habedi/stack-exchange-dataset |
50,186 | Matrix Max in less than O(n) | <p>I am attempting to find the maximum value in a matrix (or 2d array) and want to find it in less than O(n) time. The easiest way, which results in O(n) run time, is an element wise search. If a better run time is possible, I would also like to find any values over a specific threshold in less than O(n) time. Is any o... | algorithms runtime analysis arrays | 1 | Matrix Max in less than O(n) -- (algorithms runtime analysis arrays)
<p>I am attempting to find the maximum value in a matrix (or 2d array) and want to find it in less than O(n) time. The easiest way, which results in O(n) run time, is an element wise search. If a better run time is possible, I would also like to find ... | habedi/stack-exchange-dataset |
50,195 | Hardness of approximation: what decision problem is hard exactly? | <p>Just a question for personal comprehension. Consider the following statement:</p>

<blockquote>
 <p>It is NP-hard to approximate Set-Cover within a $(1 - \epsilon) \log n$ factor for any $0 < \epsilon < 1$.</p>
</blockquote>

<p>Now, NP-hardness refers to decision problems.So what is ... | complexity theory np hard approximation | 1 | Hardness of approximation: what decision problem is hard exactly? -- (complexity theory np hard approximation)
<p>Just a question for personal comprehension. Consider the following statement:</p>

<blockquote>
 <p>It is NP-hard to approximate Set-Cover within a $(1 - \epsilon) \log n$ factor for any $0 &l... | habedi/stack-exchange-dataset |
50,198 | What are the vertical and horizontal focal lengths? | <p>In this paper,</p>

<p><a href="http://www.vision.caltech.edu/malaa/publications/aly08realtime.pdf" rel="nofollow">http://www.vision.caltech.edu/malaa/publications/aly08realtime.pdf</a></p>

<p>the author mentioned "the vertical and horizontal focal lengths" but didn't have any clear definition.</p>&... | computer vision | 1 | What are the vertical and horizontal focal lengths? -- (computer vision)
<p>In this paper,</p>

<p><a href="http://www.vision.caltech.edu/malaa/publications/aly08realtime.pdf" rel="nofollow">http://www.vision.caltech.edu/malaa/publications/aly08realtime.pdf</a></p>

<p>the author mentioned "the vertical... | habedi/stack-exchange-dataset |
50,209 | What does it mean for a problem to be both NP hard and coNP hard | <p>I have a faint notion of what NP hard is (that a problem is legit difficult 3 SAT for example). </p>

<p>I have forgotten what coNP hard, and Wikipedia tells me that the complement of coNP hard is NP hard...not really helping there</p>

<p>Can someone please clarify for me on an intuitive level what ... | complexity theory intuition | 1 | What does it mean for a problem to be both NP hard and coNP hard -- (complexity theory intuition)
<p>I have a faint notion of what NP hard is (that a problem is legit difficult 3 SAT for example). </p>

<p>I have forgotten what coNP hard, and Wikipedia tells me that the complement of coNP hard is NP hard...not ... | habedi/stack-exchange-dataset |
50,215 | What is the sqrt(n)-approximation algorithm for set packing problem | <p>The set packing problem is :
Given a universe $U$ and a family $S$ of subsets of $U$, a packing is a subfamily $C\subseteq S$ of sets such that all sets in $C$ are pairwise disjoint, and the size of the packing is $|C|$. The goal is to find the $C$ where $|C|$ is maximum.</p>

<p>According to <a href="ht... | approximation packing | 1 | What is the sqrt(n)-approximation algorithm for set packing problem -- (approximation packing)
<p>The set packing problem is :
Given a universe $U$ and a family $S$ of subsets of $U$, a packing is a subfamily $C\subseteq S$ of sets such that all sets in $C$ are pairwise disjoint, and the size of the packing is $|C|... | habedi/stack-exchange-dataset |
50,219 | Meaning of $\stackrel{*}{\rightarrow}$ production rule? | <p>I've seen the production rule $\stackrel{*}{\rightarrow}$ in some papers concerning regular languages.</p>

<p>What's the meaning of $\stackrel{*}{\rightarrow}$ production rule?</p>
 | formal languages regular languages notation | 1 | Meaning of $\stackrel{*}{\rightarrow}$ production rule? -- (formal languages regular languages notation)
<p>I've seen the production rule $\stackrel{*}{\rightarrow}$ in some papers concerning regular languages.</p>

<p>What's the meaning of $\stackrel{*}{\rightarrow}$ production rule?</p>
 | habedi/stack-exchange-dataset |
50,230 | Polygon casting - Removing from mold by rotation | <p>The following question appears in Section 4.9 of "Computational Geometry: Algorithms and Applications" By Mark de Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf:</p>

<blockquote>
 <p>Show that the problem of finding a center of rotation that allows us
 to remove <span class="math-c... | algorithms reductions computational geometry | 1 | Polygon casting - Removing from mold by rotation -- (algorithms reductions computational geometry)
<p>The following question appears in Section 4.9 of "Computational Geometry: Algorithms and Applications" By Mark de Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf:</p>

<blockquote>
 <p>Show ... | habedi/stack-exchange-dataset |
50,246 | Upper bound of algorithm with flooring | <p>Would much appreciate someone explaining how they managed to get to the upper bound of this algorithm.
$$T(n) = 2T(\lfloor \sqrt n\rfloor) + ln (n)$$
$$T(1) = 0$$
Solution is given as:
$$T(n) = O(logn*log(log(n)))$$</p>
 | algorithms algorithm analysis recursion | 1 | Upper bound of algorithm with flooring -- (algorithms algorithm analysis recursion)
<p>Would much appreciate someone explaining how they managed to get to the upper bound of this algorithm.
$$T(n) = 2T(\lfloor \sqrt n\rfloor) + ln (n)$$
$$T(1) = 0$$
Solution is given as:
$$T(n) = O(logn*log(log(n)))$$</... | habedi/stack-exchange-dataset |
50,249 | Termination of Moore's algorithm to minimize deterministic automata | <p>I use Moore's algorithm to minimize DFA as concluded below.</p>

<ol>
<li>We start with the complete graph with vertices <code>Q</code> and edges <code>E = { {p, q} | p = q ∈ Q }</code></li>
<li>We mark all edges <code>{p, q} ∈ E</code> with <code>p ∈ F</code> and <code>q ∈ F</code></li>
<li>As l... | algorithms automata | 1 | Termination of Moore's algorithm to minimize deterministic automata -- (algorithms automata)
<p>I use Moore's algorithm to minimize DFA as concluded below.</p>

<ol>
<li>We start with the complete graph with vertices <code>Q</code> and edges <code>E = { {p, q} | p = q ∈ Q }</code></li>
<li>We mark all e... | habedi/stack-exchange-dataset |
50,255 | Nullable nonterminals and recursion | <p>I have two questions regarding nullable nonterminals in a grammar. Often a simple algorithm is described to find nullable nonterminals:</p>

<blockquote>
 <ol>
 <li>Basis: if $A \rightarrow \epsilon$ is a production, $A$ is nullable.</li>
 <li>Induction: if $A \rightarrow X_1X_2\ldots X_n$ is ... | context free formal grammars | 1 | Nullable nonterminals and recursion -- (context free formal grammars)
<p>I have two questions regarding nullable nonterminals in a grammar. Often a simple algorithm is described to find nullable nonterminals:</p>

<blockquote>
 <ol>
 <li>Basis: if $A \rightarrow \epsilon$ is a production, $A$ is nulla... | habedi/stack-exchange-dataset |
50,261 | How to write Context-free Grammar for this language? | <p>I am trying to teach myself how to write Context-free Grammar for different languages. I have an example language I am trying to work out and this is the answer I came up with, does it make sense?</p>

<p>the language is (i used an image because i don't know how to write out the powers on a mac):</p>
&#x... | formal languages context free formal grammars | 1 | How to write Context-free Grammar for this language? -- (formal languages context free formal grammars)
<p>I am trying to teach myself how to write Context-free Grammar for different languages. I have an example language I am trying to work out and this is the answer I came up with, does it make sense?</p>

<p>... | habedi/stack-exchange-dataset |
50,263 | Comparing asymptotic notations | <p>I have a problem P that is said to be O(n^7) in the worst case.
I'm asked to agree or not if it is solvable in O(n^9) time. And also I'm asked to agree or not if P cannot be solved faster than Ω(n^7) in the worst case.</p>

<p>My answer for the first question is that if P is bounded by O(n^7) it is also ... | asymptotics landau notation | 1 | Comparing asymptotic notations -- (asymptotics landau notation)
<p>I have a problem P that is said to be O(n^7) in the worst case.
I'm asked to agree or not if it is solvable in O(n^9) time. And also I'm asked to agree or not if P cannot be solved faster than Ω(n^7) in the worst case.</p>

<p>My answer for ... | habedi/stack-exchange-dataset |
50,265 | Correctness of the greedy algorithm | <p>I am trying to solve the following problem:
Given a matrix which consists of only 0's and 1's. Considering the matrix as a metal sheet, we need to "cut-out" square blocks of sizes 2x2 consisting of only 0's from it. A 1 in the sheet (represented by the matrix) indicates that we cannot cut the region out from the... | algorithms correctness proof greedy algorithms | 1 | Correctness of the greedy algorithm -- (algorithms correctness proof greedy algorithms)
<p>I am trying to solve the following problem:
Given a matrix which consists of only 0's and 1's. Considering the matrix as a metal sheet, we need to "cut-out" square blocks of sizes 2x2 consisting of only 0's from it. A 1 in th... | habedi/stack-exchange-dataset |
50,267 | Counterexample to this modified Dijkstra's | <p>In class, we were given the following problem:</p>

<blockquote>
 <p>We are given a directed graph G = (V, E) on which each edge (u, v) ∈ E has an associated
 value r(u, v) which is a real number in the range 0 ≤ r(u, v) ≤ 1 that represents the reliability
 of a communication channel from vert... | graphs greedy algorithms | 1 | Counterexample to this modified Dijkstra's -- (graphs greedy algorithms)
<p>In class, we were given the following problem:</p>

<blockquote>
 <p>We are given a directed graph G = (V, E) on which each edge (u, v) ∈ E has an associated
 value r(u, v) which is a real number in the range 0 ≤ r(u, v) ≤ 1 t... | habedi/stack-exchange-dataset |
50,276 | What does it mean when a time complexity has another time complexity within it? | <p>Sometimes, when reading about algorithms or other theoretical topics, I see time complexities that include other time complexities within the expression.</p>

<p>For instance, "the best fixed-parameter tractable algorithm for the vertex cover problem has a time complexity of $O(1.2738^{k} \cdot n^{O(1)})$."<... | algorithms complexity theory time complexity | 1 | What does it mean when a time complexity has another time complexity within it? -- (algorithms complexity theory time complexity)
<p>Sometimes, when reading about algorithms or other theoretical topics, I see time complexities that include other time complexities within the expression.</p>

<p>For instance, "th... | habedi/stack-exchange-dataset |
50,308 | If $L_1L_2$ is regular language then $L_2L_1$ is regular to? | <p>We have two languages: $L_1,L_2$. We know that $L_1L_2$ is regular language, so my question is if $L_2L_1$ is regular to?</p>

<p>I try to find a way to prove it...</p>

<p>I can't assume of course that $L_1,L_2$ are regular...<br>
So I look for a way to prove it. </p>

<p>I'd like to g... | formal languages regular languages closure properties | 1 | If $L_1L_2$ is regular language then $L_2L_1$ is regular to? -- (formal languages regular languages closure properties)
<p>We have two languages: $L_1,L_2$. We know that $L_1L_2$ is regular language, so my question is if $L_2L_1$ is regular to?</p>

<p>I try to find a way to prove it...</p>

<p>I can't ... | habedi/stack-exchange-dataset |
50,326 | What is the average-case complexity of trial division? | <p>The trial division algorithm for checking if a number $N$ is prime works by trying to divide $N$ by all integers in the range 2, 3, ..., $\lfloor \sqrt{n} \rfloor$. If any of them cleanly divide $N$, then we say that $N$ is composite; otherwise we say that $N$ is prime.</p>

<p>In the worst case, this requir... | algorithm analysis runtime analysis average case primes | 1 | What is the average-case complexity of trial division? -- (algorithm analysis runtime analysis average case primes)
<p>The trial division algorithm for checking if a number $N$ is prime works by trying to divide $N$ by all integers in the range 2, 3, ..., $\lfloor \sqrt{n} \rfloor$. If any of them cleanly divide $N$, t... | habedi/stack-exchange-dataset |
50,333 | Algorithm for finding fixed cycles in bipartite graphs in sublinear time | <p>Does there exist an algorithm that will compute in sublinear time whether a bipartite graph contains a cycle of fixed length? For example given a $K_{3,3}$ graph finding if it contains a cycle $C_4$.</p>

<p>I considered the answer to be no. As a DFS could be used and then compare to see if after a certain t... | algorithms graphs search algorithms | 1 | Algorithm for finding fixed cycles in bipartite graphs in sublinear time -- (algorithms graphs search algorithms)
<p>Does there exist an algorithm that will compute in sublinear time whether a bipartite graph contains a cycle of fixed length? For example given a $K_{3,3}$ graph finding if it contains a cycle $C_4$.</p>... | habedi/stack-exchange-dataset |
50,342 | Why is factoring large integers considered difficult? | <p>I read somewhere that the most efficient algorithm found can compute the factors in $O(\exp((64/9 \cdot b)^{1/3} \cdot (\log b)^{2/3})$ time, but the code I wrote is $O(n)$ or possibly $O(n \log n)$ depending on how fast division and modulus are. I'm pretty sure I've misunderstood something somewhere, but I'm not su... | complexity theory time complexity factoring primes | 1 | Why is factoring large integers considered difficult? -- (complexity theory time complexity factoring primes)
<p>I read somewhere that the most efficient algorithm found can compute the factors in $O(\exp((64/9 \cdot b)^{1/3} \cdot (\log b)^{2/3})$ time, but the code I wrote is $O(n)$ or possibly $O(n \log n)$ dependin... | habedi/stack-exchange-dataset |
50,350 | Is O(ln n) "exponentially faster" than O(n)? | <p>I improved the complexity of an alogrithm from $O(n)$ to $O(\ln(n))$. Is it legitimate to call this an "exponential speedup" in a scientific publication? Usually I think going from NP to P when I hear the phrase "exponential speedup". I'd like to avoid overselling my work.</p>
 | algorithm analysis terminology asymptotics | 1 | Is O(ln n) "exponentially faster" than O(n)? -- (algorithm analysis terminology asymptotics)
<p>I improved the complexity of an alogrithm from $O(n)$ to $O(\ln(n))$. Is it legitimate to call this an "exponential speedup" in a scientific publication? Usually I think going from NP to P when I hear the phrase "exponential... | habedi/stack-exchange-dataset |
50,351 | How to prove that $L_1=1^*\cup \{0^i 1^{j^2}|i\ge 0,j\ge 0\} $ is irregular? | <p>We know that $L=\{0^i 1^{j^2}|i> 0,j\ge 0\} $ is irregular (by the Pumping Lemma), we have to use it to prove two things: </p>

<ol>
<li>$L_1=1^*\cup \{0^i 1^{j^2}|i\ge 0,j\ge 0\} $ is irregular.</li>
<li>$L_1$ is making all the three conditions (I don't know the exactly word at English for this.... | regular languages pumping lemma | 1 | How to prove that $L_1=1^*\cup \{0^i 1^{j^2}|i\ge 0,j\ge 0\} $ is irregular? -- (regular languages pumping lemma)
<p>We know that $L=\{0^i 1^{j^2}|i> 0,j\ge 0\} $ is irregular (by the Pumping Lemma), we have to use it to prove two things: </p>

<ol>
<li>$L_1=1^*\cup \{0^i 1^{j^2}|i\ge 0,j\ge 0\} $ is ir... | habedi/stack-exchange-dataset |
50,354 | What is discrete mathematics and why am I learning about it? | <p>I started computer science in university. And we started learning about Discrete and it's mathematics which is completely based on logic, which I understand. however, how is predicates, sets, proofs are related to computers ? I want to know the reason for learning these stuff? </p>
 | mathematical foundations | 1 | What is discrete mathematics and why am I learning about it? -- (mathematical foundations)
<p>I started computer science in university. And we started learning about Discrete and it's mathematics which is completely based on logic, which I understand. however, how is predicates, sets, proofs are related to computers ? ... | habedi/stack-exchange-dataset |
50,360 | Hash table versus binary search lookup for unchanging data | <p>Let's say I have some static, unchanging data (no adds, modifies or deletes) which is looked up by a string value, and that I'm looking to minimize size in memory while also trying to minimize lookup time.</p>

<p>It seems to me that keeping the strings sorted in a list and then doing a binary search is alwa... | data structures efficiency | 1 | Hash table versus binary search lookup for unchanging data -- (data structures efficiency)
<p>Let's say I have some static, unchanging data (no adds, modifies or deletes) which is looked up by a string value, and that I'm looking to minimize size in memory while also trying to minimize lookup time.</p>

<p>It s... | habedi/stack-exchange-dataset |
50,362 | How to prove P$\neq$NP? | <p>I am aware that this seems a very stupid (or too obvious to state) question. However, I am confused at some point.</p>

<p>We can show that <strong>P $=$ NP</strong> if and only if we can design an algorithm that solves any given instance of problem in <strong>NP</strong> in polynomial time.</p>

<p>... | complexity theory p vs np | 1 | How to prove P$\neq$NP? -- (complexity theory p vs np)
<p>I am aware that this seems a very stupid (or too obvious to state) question. However, I am confused at some point.</p>

<p>We can show that <strong>P $=$ NP</strong> if and only if we can design an algorithm that solves any given instance of problem in <... | habedi/stack-exchange-dataset |
50,374 | Proving specific prefixes of regular languages are regular | <p>There are particular problems in Kozen that I'm unable to solve, and they seem to be similar to each other. It is showing that sets:</p>

<p>$$ \{x \mid \exists y: |y| = 2^{|x|} \text{ and } xy \in A \}$$
$$ \{x \mid \exists y: |y| = |x|^2 \text{ and } xy \in A \} $$</p>

<p>are regular for a re... | formal languages regular languages closure properties | 1 | Proving specific prefixes of regular languages are regular -- (formal languages regular languages closure properties)
<p>There are particular problems in Kozen that I'm unable to solve, and they seem to be similar to each other. It is showing that sets:</p>

<p>$$ \{x \mid \exists y: |y| = 2^{|x|} \text{ and } ... | habedi/stack-exchange-dataset |
50,375 | Definition of complexity classes? | <p>My book uses this definition for the Polynomial complexity class ($L$ is a language over $\{0,1\}$):</p>

<p>$$\mathrm{P} = \left\{L\subseteq\{0,1\}^*\;\middle|\; \begin{array}{l} \text{there exists an algorithm $A$ that decides $L$} \\ \text{in polynomial time}\end{array}\right\}\,.$$</p>

<p>But by... | complexity theory formal languages time complexity complexity classes | 1 | Definition of complexity classes? -- (complexity theory formal languages time complexity complexity classes)
<p>My book uses this definition for the Polynomial complexity class ($L$ is a language over $\{0,1\}$):</p>

<p>$$\mathrm{P} = \left\{L\subseteq\{0,1\}^*\;\middle|\; \begin{array}{l} \text{there exists a... | habedi/stack-exchange-dataset |
50,378 | How to check if my language is context-free can't seem to solve it using pumping lemma | <p>I have a language and I am trying to see if it's context-free or not, by trying to use a pumping-lemma but I can't figure it out, been reading a lot of other posts but still struggling to apply it to my example</p>

<p>this is the language (sorry for using an image, i know how to write number exponents but i... | formal languages context free formal grammars pumping lemma | 1 | How to check if my language is context-free can't seem to solve it using pumping lemma -- (formal languages context free formal grammars pumping lemma)
<p>I have a language and I am trying to see if it's context-free or not, by trying to use a pumping-lemma but I can't figure it out, been reading a lot of other posts b... | habedi/stack-exchange-dataset |
50,393 | k-tape turing machine | <p>I want to create multi-tape Turing machine that recognize language {ww, $w \in {a,b}$}. With condition that max. steps is less or equal than $\frac{3}{2}\left | x \right | + 2$. Where x is word from language. I have an idea to create x-tapes to solve this problem, but can be the number of tapes not known before rea... | turing machines regular languages | 1 | k-tape turing machine -- (turing machines regular languages)
<p>I want to create multi-tape Turing machine that recognize language {ww, $w \in {a,b}$}. With condition that max. steps is less or equal than $\frac{3}{2}\left | x \right | + 2$. Where x is word from language. I have an idea to create x-tapes to solve this... | habedi/stack-exchange-dataset |
50,400 | How can you check if a 2SAT problem has a bad loop | <p>im trying to figure out why this is true</p>

<p><strong>The clauses {a,b}, {b,~c}, {c,~a} constitute a 2SAT problem with an implication graph without bad loops.</strong></p>

<p>Can someone show me how to illustrate this and indicate how i can find wether any 2SAT problem has a bad loop or not, Than... | complexity theory logic satisfiability | 1 | How can you check if a 2SAT problem has a bad loop -- (complexity theory logic satisfiability)
<p>im trying to figure out why this is true</p>

<p><strong>The clauses {a,b}, {b,~c}, {c,~a} constitute a 2SAT problem with an implication graph without bad loops.</strong></p>

<p>Can someone show me how to ... | habedi/stack-exchange-dataset |
50,406 | Why is this language not context free? | <p>I been watching tutorials about how to check if a language is not context-free and in 1 video there was a language: L = {a^n b^n c^n | n ≥ 0} and they used a pumping lemma to prove that it's not context-free, I am only a beginner at CFG however I thought a language is Context-free if you are able to create a CFG for... | formal languages context free formal grammars pumping lemma | 1 | Why is this language not context free? -- (formal languages context free formal grammars pumping lemma)
<p>I been watching tutorials about how to check if a language is not context-free and in 1 video there was a language: L = {a^n b^n c^n | n ≥ 0} and they used a pumping lemma to prove that it's not context-free, I am... | habedi/stack-exchange-dataset |
50,410 | Perfect matching in a graph and complete matching in bipartite graph | <p>When I <a href="https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=complete%20matching" rel="noreferrer">google for complete matching</a>, first link points to <a href="http://mathworld.wolfram.com/PerfectMatching.html" rel="noreferrer">perfect matching on wolfram</a>.</p>
... | graphs matching bipartite matching | 1 | Perfect matching in a graph and complete matching in bipartite graph -- (graphs matching bipartite matching)
<p>When I <a href="https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=complete%20matching" rel="noreferrer">google for complete matching</a>, first link points to <a href=... | habedi/stack-exchange-dataset |
50,419 | Algorithm that deside if there are two words $x$ and $y$ in the same length such that $x\in L(A_1)$ and $y\in L(A_2)$ | <p>Let $A_1=(Q,\Sigma,q_0,F_1,\delta _1)$ and $A_2=(P,\Sigma ,p_0,F_2,\delta _2)$ a finite non determinustic automaons. </p>

<blockquote>
 <p>Describe algorithm that deside if there are two words $x$ and $y$ in the same length such that $x\in L(A_1)$ and $y\in L(A_2)$</p>
</blockquote>

<p>Hin... | regular languages automata finite automata | 1 | Algorithm that deside if there are two words $x$ and $y$ in the same length such that $x\in L(A_1)$ and $y\in L(A_2)$ -- (regular languages automata finite automata)
<p>Let $A_1=(Q,\Sigma,q_0,F_1,\delta _1)$ and $A_2=(P,\Sigma ,p_0,F_2,\delta _2)$ a finite non determinustic automaons. </p>

<blockquote>
 <... | habedi/stack-exchange-dataset |
50,425 | Why is $\{1^n \mid n > 1\}$ regular? | <p>Given the definition of a regular language is one that can be expressed with finite memory, how is $\{1^n \mid n \geq 1\}$ regular? The $n$ is unbounded. I know a DFA can be drawn, which means the language is regular. But I thought another condition is that $n$ must be bounded, so it's as if the 2 tests contradict ... | formal languages regular languages automata | 1 | Why is $\{1^n \mid n > 1\}$ regular? -- (formal languages regular languages automata)
<p>Given the definition of a regular language is one that can be expressed with finite memory, how is $\{1^n \mid n \geq 1\}$ regular? The $n$ is unbounded. I know a DFA can be drawn, which means the language is regular. But I though... | habedi/stack-exchange-dataset |
50,441 | Show that the following construction is not a correct proof for Context Free Grammars | <blockquote>
<p>Give a counterexample to show that the following constructions are not correct proofs for the star operation:</p>
<p>Given a CFG <span class="math-container">$G = (V,Σ,R,S)$</span>, add the new rule i) <span class="math-container">$ S → SS$</span> or ii) <span class="math-container">$S → SS|ε$<... | formal languages context free formal grammars | 1 | Show that the following construction is not a correct proof for Context Free Grammars -- (formal languages context free formal grammars)
<blockquote>
<p>Give a counterexample to show that the following constructions are not correct proofs for the star operation:</p>
<p>Given a CFG <span class="math-container">$... | habedi/stack-exchange-dataset |
50,456 | Figuring out the language of a non-linear CFG | <p>I have the CFG G with the following production rules: 
$$
S \to aSaS \mid b
$$
Is it possible to find $L(G)$? I have no idea how describe it by any pattern. I use <a href="http://mdaines.github.io/grammophone" rel="nofollow">grammophone</a> to check example words, but it's not very helpful tho.</p>&#... | formal languages context free formal grammars | 1 | Figuring out the language of a non-linear CFG -- (formal languages context free formal grammars)
<p>I have the CFG G with the following production rules: 
$$
S \to aSaS \mid b
$$
Is it possible to find $L(G)$? I have no idea how describe it by any pattern. I use <a href="http://mdaines.github.io/grammop... | habedi/stack-exchange-dataset |
50,478 | Number of solutions to linear system of equations over GF(2) | <p>Linear systems of equations over the reals have either 0, 1 or infinitely many solutions. However, when applied to finite fields (specifically GF(2)), infinitely many is not an option.</p>

<p>Is there a fast general method to calculate the <em>number</em> of distinct solutions to a linear system of equation... | algorithms linear algebra boolean algebra | 1 | Number of solutions to linear system of equations over GF(2) -- (algorithms linear algebra boolean algebra)
<p>Linear systems of equations over the reals have either 0, 1 or infinitely many solutions. However, when applied to finite fields (specifically GF(2)), infinitely many is not an option.</p>

<p>Is there... | habedi/stack-exchange-dataset |
50,483 | How do set partitions get mapped by restricted growth functions | <p>I am reading Skiena but do not have a formal background in Computer Science. On page 457 he discusses generating set partitions via restricted growth functions. Here's specifically what he says:</p>

<blockquote>
 <blockquote>
 <p>Set partitions can be generated using techniques akin to integer p... | algorithms sets | 1 | How do set partitions get mapped by restricted growth functions -- (algorithms sets)
<p>I am reading Skiena but do not have a formal background in Computer Science. On page 457 he discusses generating set partitions via restricted growth functions. Here's specifically what he says:</p>

<blockquote>
 <bloc... | habedi/stack-exchange-dataset |
50,484 | Which is faster operations on register operands or immediate operands? | <p>I am reading the book Computer Organization and Design. It compares instructions on memory and instructions on registers but doesn't say anything about the speed of instructions when the source operand(s) is/are constants. In that case which will be faster register operands or immediate(constant) operands ?</p>
 | computer architecture | 1 | Which is faster operations on register operands or immediate operands? -- (computer architecture)
<p>I am reading the book Computer Organization and Design. It compares instructions on memory and instructions on registers but doesn't say anything about the speed of instructions when the source operand(s) is/are constan... | habedi/stack-exchange-dataset |
50,494 | Can one increment an $n$ bit integer using fewer than $2 - 2^{1-n}$ bit inspections on average? | <p>Given an $n$-bit integer, I am interested in performing an increment operation using as few bit reads as possible. The standard binary code (standard binary representation of numbers), requires $n$ bit reads and writes in the worst case, though only $2 - 2^{1-n}$ bit reads on average (i.e $2$ bit reads on average as... | lower bounds integers | 1 | Can one increment an $n$ bit integer using fewer than $2 - 2^{1-n}$ bit inspections on average? -- (lower bounds integers)
<p>Given an $n$-bit integer, I am interested in performing an increment operation using as few bit reads as possible. The standard binary code (standard binary representation of numbers), requires ... | habedi/stack-exchange-dataset |
50,504 | Issues in RSA setup | <p>Suppose we have public key: $$n= 1015, e= 3$$ and private key: $$d= 635, p= 35, q= 29, \phi(n)= 952$$
For $m = 100$, we have $$c = m^e ~mod~n = 100^3 mod~1015 = 225.$$
To decipher this, let us take $$c^d~mod~n$$ which is $$225^{635}~mod~1015$$ which equals $$680$$ But $680 \neq 100$ so this means that RS... | cryptography encryption modular arithmetic | 1 | Issues in RSA setup -- (cryptography encryption modular arithmetic)
<p>Suppose we have public key: $$n= 1015, e= 3$$ and private key: $$d= 635, p= 35, q= 29, \phi(n)= 952$$
For $m = 100$, we have $$c = m^e ~mod~n = 100^3 mod~1015 = 225.$$
To decipher this, let us take $$c^d~mod~n$$ which is $$225^{635}~mod~... | habedi/stack-exchange-dataset |
50,505 | How do I verify that a DFA is equivalent to a NFA? | <p>I'm learning how to convert NFAs to DFAs and I want to make sure I'm doing it right. Obviously, going back in the other direction isn't a thing. Does anyone know of an algorithm to check that a DFA is equivalent to a NFA?</p>
 | automata finite automata proof techniques nondeterminism | 1 | How do I verify that a DFA is equivalent to a NFA? -- (automata finite automata proof techniques nondeterminism)
<p>I'm learning how to convert NFAs to DFAs and I want to make sure I'm doing it right. Obviously, going back in the other direction isn't a thing. Does anyone know of an algorithm to check that a DFA is equ... | habedi/stack-exchange-dataset |
50,514 | Relation between hardware and software | <p>I'm very interested in computing and programming. I have done a lot of programming with different languages although I have a question nobody was able to answer until now. </p>

<p>I question myself how is software related to hardware. to be more specific what are the basic mechanisme which make it possible ... | computer architecture | 1 | Relation between hardware and software -- (computer architecture)
<p>I'm very interested in computing and programming. I have done a lot of programming with different languages although I have a question nobody was able to answer until now. </p>

<p>I question myself how is software related to hardware. to be m... | habedi/stack-exchange-dataset |
50,517 | Variation to edit distance depending on position still a metric? | <p>The <a href="https://en.wikipedia.org/wiki/Edit_distance#Properties" rel="nofollow">edit distance between two strings</a> $d(w_1, w_2)$ sums up the cost of edit operations that transform one string into the other. If done right, the edit distance is a metric.</p>

<p>In particular, the cost of an edit opera... | strings string metrics edit distance | 1 | Variation to edit distance depending on position still a metric? -- (strings string metrics edit distance)
<p>The <a href="https://en.wikipedia.org/wiki/Edit_distance#Properties" rel="nofollow">edit distance between two strings</a> $d(w_1, w_2)$ sums up the cost of edit operations that transform one string into the ot... | habedi/stack-exchange-dataset |
50,528 | Check whether loop invariants are correct? | <p>I'm trying to prove some code is correct, using Hoare logic. How do I check whether my loop invariants are correct?</p>

<p>I'm asked to prove (using Hoare Logic) that the following program is valid:</p>

<pre><code>x=1; 
i=N;
while (i!=0){ 
 i--;
 x*=A;
}
</code></pre>... | correctness proof loop invariants hoare logic software verification | 1 | Check whether loop invariants are correct? -- (correctness proof loop invariants hoare logic software verification)
<p>I'm trying to prove some code is correct, using Hoare logic. How do I check whether my loop invariants are correct?</p>

<p>I'm asked to prove (using Hoare Logic) that the following program is... | habedi/stack-exchange-dataset |
50,540 | How does one find a non-quadratic residue modulo $p$? | <p>I was wondering how one can find a non-quadratic residue modulo $p$ and what the runtime of this algorithm would be.</p>

<p>I thought that one can use the Legendre Symbol </p>

<p>$$ \left( \frac{a}{p} \right) = a^{ \frac{(p-1)}{2} } \pmod p $$ </p>

<p>if the Legendre Symbol returns -1 then... | algorithms algorithm analysis number theory | 1 | How does one find a non-quadratic residue modulo $p$? -- (algorithms algorithm analysis number theory)
<p>I was wondering how one can find a non-quadratic residue modulo $p$ and what the runtime of this algorithm would be.</p>

<p>I thought that one can use the Legendre Symbol </p>

<p>$$ \left( \frac{a... | habedi/stack-exchange-dataset |
50,541 | Big-O proof for a recurrence relation? | <p>This question is fairly specific in the manner of steps taken to solve the problem.</p>

<p>Given 
$T(n)=2T(2n/3)+O(n)$ prove that $T(n)=O(n^2)$.</p>

<p>So the steps were as follows. We want to prove that $T(n) \le cn^2$.</p>

<p>$$\begin{align*}
T(n)&=2T(2n/3)+O(n) \\
&... | asymptotics recurrence relation | 1 | Big-O proof for a recurrence relation? -- (asymptotics recurrence relation)
<p>This question is fairly specific in the manner of steps taken to solve the problem.</p>

<p>Given 
$T(n)=2T(2n/3)+O(n)$ prove that $T(n)=O(n^2)$.</p>

<p>So the steps were as follows. We want to prove that $T(n) \le cn^2$... | habedi/stack-exchange-dataset |
50,545 | Regular Expression representing the following language | <p>I am having trouble understanding how to write a regular expression for the set of words that contain at least two <em>b</em>'s and at least two <em>a</em>'s, where the alphabet is {a,b}.</p>

<p>I understand that set of words that contain at least two <em>b</em>'s is: <strong>[1]</strong> <code>(a+b)*b(a+b)... | finite automata regular expressions | 1 | Regular Expression representing the following language -- (finite automata regular expressions)
<p>I am having trouble understanding how to write a regular expression for the set of words that contain at least two <em>b</em>'s and at least two <em>a</em>'s, where the alphabet is {a,b}.</p>

<p>I understand that... | habedi/stack-exchange-dataset |
50,546 | NP-complete reduction for a k-dumbbell graph | <p>A k-dumbbell is a graph that consists of 2 cliques each of size k with one and only one edge between them. How do I show that finding if a graph is a k-dumbbell is NP-complete?</p>

<p>Proof it is in NP: Given the cliques of size k, I can verify if it they are the cliques of size k.</p>

<p>Proof of ... | np complete reductions np hard clique | 1 | NP-complete reduction for a k-dumbbell graph -- (np complete reductions np hard clique)
<p>A k-dumbbell is a graph that consists of 2 cliques each of size k with one and only one edge between them. How do I show that finding if a graph is a k-dumbbell is NP-complete?</p>

<p>Proof it is in NP: Given the cliques... | habedi/stack-exchange-dataset |
50,549 | Shortest path problem where edge weight depends on path taken | <p>I am attempting to find the most efficient route to get from a source to a destination in a bus network. Each stop is a vertex in a graph, and each edge between vertices represents a route between stops.</p>

<p>The weights of the edges represents how long it takes to complete a particular journey between st... | algorithms graphs shortest path routing | 1 | Shortest path problem where edge weight depends on path taken -- (algorithms graphs shortest path routing)
<p>I am attempting to find the most efficient route to get from a source to a destination in a bus network. Each stop is a vertex in a graph, and each edge between vertices represents a route between stops.</p>&#x... | habedi/stack-exchange-dataset |
50,557 | Why do we need to run the bellman-ford algorithm for n-1 times? | <p>I'm a little confused about the concept of the Bellman-Ford(BF) algorithm to compute the shortest path in a general graph with negative weights knowing that there are no negative cycles present. I understand why Dikjstra doesn't work for a graph with negative weights. So in the Bellman-Ford algorithm we decide to up... | algorithms shortest path graph algorithms | 1 | Why do we need to run the bellman-ford algorithm for n-1 times? -- (algorithms shortest path graph algorithms)
<p>I'm a little confused about the concept of the Bellman-Ford(BF) algorithm to compute the shortest path in a general graph with negative weights knowing that there are no negative cycles present. I understan... | habedi/stack-exchange-dataset |
50,581 | How can the class of tail recursive functions be compared to the classes of PR and R? | <p>How can the class of <a href="https://en.wikipedia.org/wiki/Tail_call" rel="nofollow noreferrer">tail recursive functions (TR)</a> be compared to the classes of <a href="https://en.wikipedia.org/wiki/Primitive_recursive_function" rel="nofollow noreferrer">primitive recursive functions (PR)</a> and recursive function... | computability recursion primitive recursion tail recursion | 1 | How can the class of tail recursive functions be compared to the classes of PR and R? -- (computability recursion primitive recursion tail recursion)
<p>How can the class of <a href="https://en.wikipedia.org/wiki/Tail_call" rel="nofollow noreferrer">tail recursive functions (TR)</a> be compared to the classes of <a hre... | habedi/stack-exchange-dataset |
50,598 | Is the language $a^i b^j c^k$ with $i+j > k$ context-free? | <p>I am learning about Context Free Grammars and currently stuck on the following question.</p>

<blockquote>
 <p>Is the following language context-free? If not, then how can we prove it using Pumping Lemma?</p>
 
 <p>$\qquad L = \{a^i b^j c^k \mid i,j,k \geq 0 \land i+j > k\}$.</p>
</bloc... | formal languages context free formal grammars | 1 | Is the language $a^i b^j c^k$ with $i+j > k$ context-free? -- (formal languages context free formal grammars)
<p>I am learning about Context Free Grammars and currently stuck on the following question.</p>

<blockquote>
 <p>Is the following language context-free? If not, then how can we prove it using Pump... | habedi/stack-exchange-dataset |
50,607 | Run-time analysis of distributed network decomposition algorithm | <p>I'm trying to understand the run-time analysis in the article [1].</p>

<p>The authors define the following notation: $g(n) = \hat O(f(n))$ if $g(n) = O(f(n)^{O(1)})$. In the run-time analysis of their algorithm, they find that
$$T(l) \leq \hat O(p\log n)10^{\log_{p/2} l} \equiv f(l,p)$$
where $n$ is... | algorithms algorithm analysis runtime analysis | 1 | Run-time analysis of distributed network decomposition algorithm -- (algorithms algorithm analysis runtime analysis)
<p>I'm trying to understand the run-time analysis in the article [1].</p>

<p>The authors define the following notation: $g(n) = \hat O(f(n))$ if $g(n) = O(f(n)^{O(1)})$. In the run-time analysis... | habedi/stack-exchange-dataset |
50,608 | Why does the concatenation of the empty set with any language give the empty set? | <p>Why does the concatenation of $\emptyset$ with any language give $\emptyset$. I would like to know the intuitive explanation for it.</p>
 | formal languages closure properties | 1 | Why does the concatenation of the empty set with any language give the empty set? -- (formal languages closure properties)
<p>Why does the concatenation of $\emptyset$ with any language give $\emptyset$. I would like to know the intuitive explanation for it.</p>
 | habedi/stack-exchange-dataset |
50,611 | There is any notation for a language that is empty infinite? | <p>Assume that $L$ is a language, is there any established notation that means that $L$ is infinite or empty?</p>
 | formal languages notation | 1 | There is any notation for a language that is empty infinite? -- (formal languages notation)
<p>Assume that $L$ is a language, is there any established notation that means that $L$ is infinite or empty?</p>
 | habedi/stack-exchange-dataset |
50,625 | What is the difference between ∀ and Π in the Calculus of Constructions? | <p>As I've learned, the Calculus of Constructions has only two binders - $\lambda$ and $\Pi$. Morte, for example, has $\forall$ as a mere alias of $\Pi$. Yet, on the paper <a href="http://homepage.cs.uiowa.edu/~astump/papers/fu-stump-rta-tlca-14.pdf">Self Types for Dependently Typed Lambda Encodings</a>, there are type... | type theory dependent types calculus of constructions | 1 | What is the difference between ∀ and Π in the Calculus of Constructions? -- (type theory dependent types calculus of constructions)
<p>As I've learned, the Calculus of Constructions has only two binders - $\lambda$ and $\Pi$. Morte, for example, has $\forall$ as a mere alias of $\Pi$. Yet, on the paper <a href="http://... | habedi/stack-exchange-dataset |
50,634 | Why it is nearly impossible to have an approximation algorithm for Maximum Clique problem? | <p>I read a theorem which states that:
If there exists a polynomial time approximation algorithm for solving the Maximum Clique problem (or the Maximum Independent Set problem) for any constant performance ratio r, then NP = P.</p>

<p>But I never understood the reasoning behind this!!</p>
 | complexity theory np complete approximation | 1 | Why it is nearly impossible to have an approximation algorithm for Maximum Clique problem? -- (complexity theory np complete approximation)
<p>I read a theorem which states that:
If there exists a polynomial time approximation algorithm for solving the Maximum Clique problem (or the Maximum Independent Set problem)... | habedi/stack-exchange-dataset |
50,641 | Computer science asymptotic terminology | <p>I have been hearing the phrases quasipolynomial, superpolynomial and subexponential.</p>

<p>I think know what quasipolynomial and subexponential is. I believe these are functions respectively of form $n^{\log^c n}$ and $n^{n^{1/c}}$ for some $c>1$.</p>

<p>What does superpolynomial mean?</p>
 | asymptotics | 1 | Computer science asymptotic terminology -- (asymptotics)
<p>I have been hearing the phrases quasipolynomial, superpolynomial and subexponential.</p>

<p>I think know what quasipolynomial and subexponential is. I believe these are functions respectively of form $n^{\log^c n}$ and $n^{n^{1/c}}$ for some $c>1$.... | habedi/stack-exchange-dataset |
50,651 | What's non-algorithm-specific | <p>I am reading the paper "<a href="http://robotics.stanford.edu/~shoham/www%20papers/CP04randomsat.pdf" rel="nofollow">Understanding Random SAT beyond the Clauses-to-Variables Ratio</a>" and at beginning of the page 2 say </p>

<blockquote>
 <p>the hardest region corresponds exactly to a phase transition ... | satisfiability | 1 | What's non-algorithm-specific -- (satisfiability)
<p>I am reading the paper "<a href="http://robotics.stanford.edu/~shoham/www%20papers/CP04randomsat.pdf" rel="nofollow">Understanding Random SAT beyond the Clauses-to-Variables Ratio</a>" and at beginning of the page 2 say </p>

<blockquote>
 <p>the hardest... | habedi/stack-exchange-dataset |
50,653 | How come Google search never gets slower? Doesn't it have to go through the ever increasing amount of data on the internet and then rank? | <p>I heard Google creates indexes of pages. Even then, the number of indexes goes with time. Why wouldn't this slow down the search?</p>
 | search | 1 | How come Google search never gets slower? Doesn't it have to go through the ever increasing amount of data on the internet and then rank? -- (search)
<p>I heard Google creates indexes of pages. Even then, the number of indexes goes with time. Why wouldn't this slow down the search?</p>
 | habedi/stack-exchange-dataset |
50,656 | Pseudo-random sequence prediction | <blockquote>
<p>Disclaimer: I am a biologist, so sorry for (perhaps) basic question phrased in such crude terms.</p>
<p>I am not sure if I should ask this question here or on DS/SC, but CS
is the largest of three, so here goes. (After I posted, it occurred to me that Cross-Validated might be the better plac... | machine learning probability theory | 1 | Pseudo-random sequence prediction -- (machine learning probability theory)
<blockquote>
<p>Disclaimer: I am a biologist, so sorry for (perhaps) basic question phrased in such crude terms.</p>
<p>I am not sure if I should ask this question here or on DS/SC, but CS
is the largest of three, so here goes. (Afte... | habedi/stack-exchange-dataset |
50,671 | Does having one large L1 cache instead of L1 and L2 cache makes computation faster? | <p>Does having one larger L1 cache instead of L1 and L2 cache makes computation faster? Also will this make the CPU more expensive to make?</p>
 | computer architecture efficiency cpu cache cpu | 1 | Does having one large L1 cache instead of L1 and L2 cache makes computation faster? -- (computer architecture efficiency cpu cache cpu)
<p>Does having one larger L1 cache instead of L1 and L2 cache makes computation faster? Also will this make the CPU more expensive to make?</p>
 | habedi/stack-exchange-dataset |
50,679 | Need help understanding textbook solution | <p>I am studying for my final exam in coding-theory class, and as <a href="http://rads.stackoverflow.com/amzn/click/1852336226" rel="nofollow">textbook</a> provides poorly written solution to the exercise question, I decided to ask the question here, hoping for more clarification.</p>

<p><strong>Question:</str... | coding theory | 1 | Need help understanding textbook solution -- (coding theory)
<p>I am studying for my final exam in coding-theory class, and as <a href="http://rads.stackoverflow.com/amzn/click/1852336226" rel="nofollow">textbook</a> provides poorly written solution to the exercise question, I decided to ask the question here, hoping f... | habedi/stack-exchange-dataset |
50,686 | Combinations of elements with mutual relationships | <p>I need to create the combination of 3 elements from a array of given <em>n</em> elements, however every of those 3 el. has to be in "relationship" with each other. Here is an example I can describe my issue better on:</p>

<p>We've got elements 1, 2, 3, 4, 5 & 6. We know following relationships:</p>
... | combinatorics relational algebra | 1 | Combinations of elements with mutual relationships -- (combinatorics relational algebra)
<p>I need to create the combination of 3 elements from a array of given <em>n</em> elements, however every of those 3 el. has to be in "relationship" with each other. Here is an example I can describe my issue better on:</p>
&#... | habedi/stack-exchange-dataset |
50,689 | Is {wxw^r} a regular language? | <p>Is $\{ WxW^{\mathrm{R}} \mid W,x\in\{0,1\}^+\}$ a regular language? If so, why?</p>

<p>The notation $W^{\mathrm{R}}$ means the reverse string of $W$?</p>

<p>If we consider <a href="https://stackoverflow.com/questions/14521300/why-l-wxwr-w-x-belongs-to-a-b-is-a-regular-language">the best answer... | formal languages regular languages finite automata | 1 | Is {wxw^r} a regular language? -- (formal languages regular languages finite automata)
<p>Is $\{ WxW^{\mathrm{R}} \mid W,x\in\{0,1\}^+\}$ a regular language? If so, why?</p>

<p>The notation $W^{\mathrm{R}}$ means the reverse string of $W$?</p>

<p>If we consider <a href="https://stackoverflow.com/... | habedi/stack-exchange-dataset |
50,691 | When is the output of shortest path $\subset$ MST? | <p>I was wondering if the output of an algorithm like Dijkstra was always contained in the minimal spanning tree, however, a counter example to this claim are cyclic graphs like:</p>

<p><a href="https://i.stack.imgur.com/73O5p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/73O5p.png" alt="e... | graphs shortest path minimum spanning tree | 1 | When is the output of shortest path $\subset$ MST? -- (graphs shortest path minimum spanning tree)
<p>I was wondering if the output of an algorithm like Dijkstra was always contained in the minimal spanning tree, however, a counter example to this claim are cyclic graphs like:</p>

<p><a href="https://i.stack.i... | habedi/stack-exchange-dataset |
50,697 | Two red children in a red-black tree | <p>My data structures exam contains the following question:</p>
<blockquote>
<p>Which of the statements below about red-black trees is true? (select one or more)</p>
<ol>
<li>Every path from the root to a leaf has the same amount of red links.</li>
<li>A node never has two red links to his childs.</... | data structures trees search trees | 1 | Two red children in a red-black tree -- (data structures trees search trees)
<p>My data structures exam contains the following question:</p>
<blockquote>
<p>Which of the statements below about red-black trees is true? (select one or more)</p>
<ol>
<li>Every path from the root to a leaf has the same amou... | habedi/stack-exchange-dataset |
50,706 | $O(\frac{\log n}{\log \log n})$ algorithm for the prefix parity problem | <p>The prefix parity problem can be defined as follows. You are given a string $S$ of length $n$ and initially every character is $0$. Then you want to build a data structure that can support updates such as follows. </p>

<ol>
<li>For a given $i$ change $S[i]$ to either $0$ or $1$</li>
<li>for a given ... | algorithms algorithm analysis search algorithms lower bounds | 1 | $O(\frac{\log n}{\log \log n})$ algorithm for the prefix parity problem -- (algorithms algorithm analysis search algorithms lower bounds)
<p>The prefix parity problem can be defined as follows. You are given a string $S$ of length $n$ and initially every character is $0$. Then you want to build a data structure that ca... | habedi/stack-exchange-dataset |
50,707 | What is a homogenous half-space? | <p>I can't think of any definition for half-space that would involve some sort of quantity not being homogenous.</p>
<p>This term is used in the paper <a href="http://www.cc.gatech.edu/%7Evempala/papers/robust.ps" rel="nofollow noreferrer">Robust Concepts and Random Projection</a> in the following paragraphs:</p>&#... | machine learning perceptron | 1 | What is a homogenous half-space? -- (machine learning perceptron)
<p>I can't think of any definition for half-space that would involve some sort of quantity not being homogenous.</p>
<p>This term is used in the paper <a href="http://www.cc.gatech.edu/%7Evempala/papers/robust.ps" rel="nofollow noreferrer">Robust Con... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.