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 |
|---|---|---|---|---|---|---|
14,932 | Is the time reversal symmetry of non-deterministic computations important? | <p>A deterministic computation can only be run backward in time, if all transitions are one-to-one. This restriction is absent for non-deterministic computations. Hence it seems to me that non-deterministic computations be can run both forward and backward in time. But because the output becomes the input for the rever... | complexity theory | 1 | Is the time reversal symmetry of non-deterministic computations important? -- (complexity theory)
<p>A deterministic computation can only be run backward in time, if all transitions are one-to-one. This restriction is absent for non-deterministic computations. Hence it seems to me that non-deterministic computations be... | habedi/stack-exchange-dataset |
14,935 | Constructing a PDA for the language $\{a^m b^n : m < 2n < 3m \}$ | <p>I'm having a lot of trouble constructing a PDA for the language: \begin{equation*}
\{a^m b^n : m < 2n < 3m \}
\end{equation*}</p>

<p>I know if I push a symbol for each $a$ I see, then pop 2 symbols for each $b$ I see, then I should run out to satisfy the $m < 2n$ part of the inequality. But... | formal languages automata pushdown automata | 1 | Constructing a PDA for the language $\{a^m b^n : m < 2n < 3m \}$ -- (formal languages automata pushdown automata)
<p>I'm having a lot of trouble constructing a PDA for the language: \begin{equation*}
\{a^m b^n : m < 2n < 3m \}
\end{equation*}</p>

<p>I know if I push a symbol for each $a$ I see, t... | habedi/stack-exchange-dataset |
14,945 | How can you bound the error of an approximation without knowing the optimal solution? | <p>I been looking at this <a href="http://www.math.uwaterloo.ca/tsp/world/countries.html">site</a> and it says that people found solutions for TSP tours that are just 0.031% higher than the optimal tour is. Without finding the optimal tour how does they know what length it is supposed to be?</p>
 | complexity theory approximation | 1 | How can you bound the error of an approximation without knowing the optimal solution? -- (complexity theory approximation)
<p>I been looking at this <a href="http://www.math.uwaterloo.ca/tsp/world/countries.html">site</a> and it says that people found solutions for TSP tours that are just 0.031% higher than the optimal... | habedi/stack-exchange-dataset |
14,954 | Division by a constant | <p>After skimming <a href="http://www.lirmm.fr/~imbert/pdfs/constmult_arith18.pdf">Multiplication by a Constant is Sublinear (PDF)</a>, (<a href="http://ge.tt/6343C5u/v/0">slides (PDF)</a>, <a href="http://ge.tt/6343C5u/v/1">slides with notes (PDF)</a>) I was wondering if this could be extended to division by a constan... | algorithms reference request integers | 1 | Division by a constant -- (algorithms reference request integers)
<p>After skimming <a href="http://www.lirmm.fr/~imbert/pdfs/constmult_arith18.pdf">Multiplication by a Constant is Sublinear (PDF)</a>, (<a href="http://ge.tt/6343C5u/v/0">slides (PDF)</a>, <a href="http://ge.tt/6343C5u/v/1">slides with notes (PDF)</a>) ... | habedi/stack-exchange-dataset |
14,960 | Notation for average case complexity of an algorithm | <p>I'm just wondering what the correct notation is when referring to an average case complexity of an algorithm that was calculated by doing empirical analysis.</p>

<p>For example, I have tested my algorithm and fitted the results to the curve $f(n)=2.65\times 10^{-15}\cdot(2.17^{n})$ and in my report right no... | asymptotics notation | 1 | Notation for average case complexity of an algorithm -- (asymptotics notation)
<p>I'm just wondering what the correct notation is when referring to an average case complexity of an algorithm that was calculated by doing empirical analysis.</p>

<p>For example, I have tested my algorithm and fitted the results t... | habedi/stack-exchange-dataset |
14,981 | Finding number of numbers dividing n^m exactly p times | <p>Suppose I am given a number $n$ (less than $10^8$) and $m$ (less than $10^7$) and $p$ (less than $10^4$), I have to write a program to find number of numbers that divide $n^m$ exactly $p$ times.</p>

<p>Mathematically, I have to find number of distinct $x$ such that
$$ n^m \equiv 0 \mod x^p \qquad\text{a... | algorithms number theory arithmetic mathematical programming | 1 | Finding number of numbers dividing n^m exactly p times -- (algorithms number theory arithmetic mathematical programming)
<p>Suppose I am given a number $n$ (less than $10^8$) and $m$ (less than $10^7$) and $p$ (less than $10^4$), I have to write a program to find number of numbers that divide $n^m$ exactly $p$ times.</... | habedi/stack-exchange-dataset |
14,983 | How to prove the structured program theorem? | <p><a href="http://en.wikipedia.org/wiki/Structured_program_theorem" rel="noreferrer">Wikipedia</a>:</p>
<blockquote>
<p>The structured program theorem [...] states that [...] any algorithm
can be expressed using only three control structures. They are</p>
<ul>
<li>Executing one subprogram, and then... | computability programming languages computation models | 1 | How to prove the structured program theorem? -- (computability programming languages computation models)
<p><a href="http://en.wikipedia.org/wiki/Structured_program_theorem" rel="noreferrer">Wikipedia</a>:</p>
<blockquote>
<p>The structured program theorem [...] states that [...] any algorithm
can be expres... | habedi/stack-exchange-dataset |
14,984 | Borrowing bioinformatic methods in other fields | <p>Have the bioinformatic methods like sequence analysis, genome annotation, comparative genomics (and many others), been applied to solve problems outside the field of bioinformatics?</p>
 | bioinformatics | 1 | Borrowing bioinformatic methods in other fields -- (bioinformatics)
<p>Have the bioinformatic methods like sequence analysis, genome annotation, comparative genomics (and many others), been applied to solve problems outside the field of bioinformatics?</p>
 | habedi/stack-exchange-dataset |
14,986 | What's the correct definition of the $\Upsilon$ category of schedules? | <p>I'm reading <a href="http://www.pps.univ-paris-diderot.fr/~mellies/mpri/mpri-ens/articles/harmer-hyland-mellies-categorical-combinatorics.pdf" rel="nofollow">this</a> article about game semantics and I'm a bit puzzled with the definition given for $\Upsilon$ in section $3.3$. There are some points that are either un... | combinatorics category theory game semantics | 1 | What's the correct definition of the $\Upsilon$ category of schedules? -- (combinatorics category theory game semantics)
<p>I'm reading <a href="http://www.pps.univ-paris-diderot.fr/~mellies/mpri/mpri-ens/articles/harmer-hyland-mellies-categorical-combinatorics.pdf" rel="nofollow">this</a> article about game semantics ... | habedi/stack-exchange-dataset |
14,989 | Recurrence Equation Question | <p>I have some difficulty trying to tell which equation to use when I'm given an explanation on how an algorithm operates. Especially divide and conquer.</p>

<p>Normally I see these kind of equations:</p>

<pre><code>C(n) = aC(n/a) + b where a and b are constants
</code></pre>

<p>Other tim... | algorithms recurrence relation | 1 | Recurrence Equation Question -- (algorithms recurrence relation)
<p>I have some difficulty trying to tell which equation to use when I'm given an explanation on how an algorithm operates. Especially divide and conquer.</p>

<p>Normally I see these kind of equations:</p>

<pre><code>C(n) = aC(n/a) + b wh... | habedi/stack-exchange-dataset |
14,991 | A* to find the longest path in a directed cyclic graph | <p>I have written an A* algorithm to find the shortest path through a directed cyclic graph. I am trying to modify it to find the longest path through the same graph.</p>

<p>My attempt was to write it so that all I change is [1] the weights per edge (making them negative instead of positive) and [2] the heuri... | graphs shortest path weighted graphs | 1 | A* to find the longest path in a directed cyclic graph -- (graphs shortest path weighted graphs)
<p>I have written an A* algorithm to find the shortest path through a directed cyclic graph. I am trying to modify it to find the longest path through the same graph.</p>

<p>My attempt was to write it so that all ... | habedi/stack-exchange-dataset |
14,994 | why does ${a^nb^n}$ fit the pumping lemma for context-free languages? | <p>I am writing somthing about Ppumping Lemma. I know that the language $L = \{ a^nb^n| n ≥ 0 \}$ is context-free. But I don't understand how this language satisfies the conditions of pumping lemma (for context-free languages) ?</p>

<p>if we pick the string $s = a^pb^p, |s| > p , |vxy| < p \land |vy| >... | context free pumping lemma | 1 | why does ${a^nb^n}$ fit the pumping lemma for context-free languages? -- (context free pumping lemma)
<p>I am writing somthing about Ppumping Lemma. I know that the language $L = \{ a^nb^n| n ≥ 0 \}$ is context-free. But I don't understand how this language satisfies the conditions of pumping lemma (for context-free la... | habedi/stack-exchange-dataset |
15,001 | Distribution algorithm according to weighted parameters (with a min-max constraint) | <p>I'm trying to solve the following problem related to distribution-</p>

<p>I have a list L of items (I1, I2,....In) sorted in order of importance, I1 being the most important. Each item has multiple tags assigned to it and the combination of these tags can be different on each item, so I1 may have tags T1 an... | algorithms distributed systems | 1 | Distribution algorithm according to weighted parameters (with a min-max constraint) -- (algorithms distributed systems)
<p>I'm trying to solve the following problem related to distribution-</p>

<p>I have a list L of items (I1, I2,....In) sorted in order of importance, I1 being the most important. Each item has... | habedi/stack-exchange-dataset |
15,012 | SVM optimization objective: why are we maximizing $\frac{1}{\|w\|}$? | <p>I'm learning about Support Vector Machines(SVM).
I understood that their objective is to maximize the margin between the decision line and the closest point to it.
For simplicity, let's assume we have a linear SVM and linearly separable data X.
We would like to find the maximum distance D and vector W, s... | machine learning | 1 | SVM optimization objective: why are we maximizing $\frac{1}{\|w\|}$? -- (machine learning)
<p>I'm learning about Support Vector Machines(SVM).
I understood that their objective is to maximize the margin between the decision line and the closest point to it.
For simplicity, let's assume we have a linear SVM and ... | habedi/stack-exchange-dataset |
15,014 | How to prove that context sensitive languages are closed under intersection and complement? | <p>This is a question from the exam of our "Automata and Formal Languages" course. There is a question where asked to prove or disprove that any "relative complement" operation between two context sensitive languages will also produce a context sensitive language. </p>

<p>From the context sensitive closure pro... | formal languages closure properties context sensitive | 1 | How to prove that context sensitive languages are closed under intersection and complement? -- (formal languages closure properties context sensitive)
<p>This is a question from the exam of our "Automata and Formal Languages" course. There is a question where asked to prove or disprove that any "relative complement" op... | habedi/stack-exchange-dataset |
15,015 | Reduction examples from the strongly NPC problem 3-PARTITION | <p>3-PARTITION is <a href="http://en.wikipedia.org/wiki/Strongly_NP-complete">strongly NP-complete</a>, i.e. it remains NP-complete even if the input is given in unary.</p>

<p>I'm searching two or three examples of (possibly well-known) <em>non-numeric problems</em> that have been proved to be NP-complete usin... | reference request np complete | 1 | Reduction examples from the strongly NPC problem 3-PARTITION -- (reference request np complete)
<p>3-PARTITION is <a href="http://en.wikipedia.org/wiki/Strongly_NP-complete">strongly NP-complete</a>, i.e. it remains NP-complete even if the input is given in unary.</p>

<p>I'm searching two or three examples of ... | habedi/stack-exchange-dataset |
15,017 | Are algorithms (and efficiency in general) getting less important? | <p>Since buying computation power is much affordable than in the past, are the knowledge of algorithms and being efficient getting less important? It's clear that you would want to avoid an infinite loop, so, not everything goes. But if you have better hardware, could you have somehow worse software?</p>
 | efficiency | 1 | Are algorithms (and efficiency in general) getting less important? -- (efficiency)
<p>Since buying computation power is much affordable than in the past, are the knowledge of algorithms and being efficient getting less important? It's clear that you would want to avoid an infinite loop, so, not everything goes. But if ... | habedi/stack-exchange-dataset |
15,024 | Is the per-vertex error over a PageRank iteration monotonically decreasing? | <p>It seems to me that taken over the entire graph, the norm of the error vector must be monotonically decreasing, otherwise we couldn't guarantee that PageRank would ever converge.</p>

<p>However, is the same true on a per-vertex basis? I.e., from iteration t to iteration t+1, is the squared error of a vertex... | graphs algorithm analysis error estimation | 1 | Is the per-vertex error over a PageRank iteration monotonically decreasing? -- (graphs algorithm analysis error estimation)
<p>It seems to me that taken over the entire graph, the norm of the error vector must be monotonically decreasing, otherwise we couldn't guarantee that PageRank would ever converge.</p>

<... | habedi/stack-exchange-dataset |
16,037 | How are the web based compilers designed? | <p>Is it possible to design a compiler that can safely compile and run untrusted code?</p>

<p>As a practical example, I want to know how the online compilers are designed/programmed?(Like the one on codepad.org) Are they similar to our traditional day-to-day compiler. How they are hosted on servers?</p>
 | compilers | 1 | How are the web based compilers designed? -- (compilers)
<p>Is it possible to design a compiler that can safely compile and run untrusted code?</p>

<p>As a practical example, I want to know how the online compilers are designed/programmed?(Like the one on codepad.org) Are they similar to our traditional day-to... | habedi/stack-exchange-dataset |
16,044 | Kripke automaton and observations | <p>This is a question concerning Kripke automaton. My answers seem a little short and I was wondering if I was missing something?
Transition table of a Kripke automaton: </p>

<p><img src="https://i.stack.imgur.com/FefEb.png" alt="enter image description here"></p>

<p>A -> red light is on</p>
&... | automata | 1 | Kripke automaton and observations -- (automata)
<p>This is a question concerning Kripke automaton. My answers seem a little short and I was wondering if I was missing something?
Transition table of a Kripke automaton: </p>

<p><img src="https://i.stack.imgur.com/FefEb.png" alt="enter image description here"... | habedi/stack-exchange-dataset |
16,048 | Is $\{s_0 w s_1 : s_0s_1\in L_1, w\in L_2 \}$ context free if $L_1$ and $L_2$ are? | <p>In class, it was alluded to that a language: \begin{equation*}
\{s_0 w s_1 : s_0s_1\in L_1, w\in L_2 \}
\end{equation*} would be context free, if $L_1$ and $L_2$ are context free.</p>

<p>Intuitively, that doesn't make sense to me. I tried doing my own research and attempted a proof using the pumping... | formal languages context free closure properties | 1 | Is $\{s_0 w s_1 : s_0s_1\in L_1, w\in L_2 \}$ context free if $L_1$ and $L_2$ are? -- (formal languages context free closure properties)
<p>In class, it was alluded to that a language: \begin{equation*}
\{s_0 w s_1 : s_0s_1\in L_1, w\in L_2 \}
\end{equation*} would be context free, if $L_1$ and $L_2$ are contex... | habedi/stack-exchange-dataset |
16,051 | What do I need to know about algorithms? | <p>Drawing from <a href="https://cs.stackexchange.com/questions/15017/are-algorithms-and-efficiency-in-general-getting-less-important">Are algorithms (and efficiency in general) getting less important?</a>, I get that algorithms are more important than ever, but I need to know anything about them other than their compl... | algorithms efficiency | 1 | What do I need to know about algorithms? -- (algorithms efficiency)
<p>Drawing from <a href="https://cs.stackexchange.com/questions/15017/are-algorithms-and-efficiency-in-general-getting-less-important">Are algorithms (and efficiency in general) getting less important?</a>, I get that algorithms are more important than... | habedi/stack-exchange-dataset |
16,057 | How to analyze/test a binary search algorithm? | <p>I was asked to "Compute the average runtime for a binary search, ordered array, and the key is in the array." I'm not quite sure how to approach this problem. Isn't the runtime of binary search O(log n)? And the average would be something like n + n/2 + n/4... etc?</p>

<p>I'm then asked to "Implement a prog... | algorithm analysis runtime analysis binary search | 1 | How to analyze/test a binary search algorithm? -- (algorithm analysis runtime analysis binary search)
<p>I was asked to "Compute the average runtime for a binary search, ordered array, and the key is in the array." I'm not quite sure how to approach this problem. Isn't the runtime of binary search O(log n)? And the ave... | habedi/stack-exchange-dataset |
16,065 | How does an admissible heuristic ensure an optimal solution? | <p>When using A* (or any other best path finding algorithm), we say that the heuristic used should be <strong>admissible</strong>, that is, it should never overestimate the actual solution path's length (or moves).</p>

<p>How does an admissible heuristic ensure an optimal solution? I am preferably looking for ... | algorithms artificial intelligence search algorithms heuristics | 1 | How does an admissible heuristic ensure an optimal solution? -- (algorithms artificial intelligence search algorithms heuristics)
<p>When using A* (or any other best path finding algorithm), we say that the heuristic used should be <strong>admissible</strong>, that is, it should never overestimate the actual solution p... | habedi/stack-exchange-dataset |
16,074 | Deciding the class of certain languages | <p>I am preparing for my exam in Formal languages and Automata theory and I'm looking at some old exam questions right now. I need help with the following question: </p>

<blockquote>
 <p>For each of the following languages answer whether it is regular, context-free but not regular, or not context-free. A ... | formal languages context free automata | 1 | Deciding the class of certain languages -- (formal languages context free automata)
<p>I am preparing for my exam in Formal languages and Automata theory and I'm looking at some old exam questions right now. I need help with the following question: </p>

<blockquote>
 <p>For each of the following languages... | habedi/stack-exchange-dataset |
16,082 | Proof that there is unambigous grammar for every regular language | <p>How can I prove, or where can I find proof that for every regular language there is unambigous grammar?</p>
 | proof techniques ambiguity | 1 | Proof that there is unambigous grammar for every regular language -- (proof techniques ambiguity)
<p>How can I prove, or where can I find proof that for every regular language there is unambigous grammar?</p>
 | habedi/stack-exchange-dataset |
16,086 | experimental analysis of running times in extendable table | <p>I was given the following homework question:</p>

<blockquote>
 <p>Implement an extendable table using arrays that can increase in size
 as elements are added. Perform an experimental analysis of each of the
 running times for performing a sequence of n add methods, assuming the
 array si... | algorithm analysis runtime analysis arrays | 1 | experimental analysis of running times in extendable table -- (algorithm analysis runtime analysis arrays)
<p>I was given the following homework question:</p>

<blockquote>
 <p>Implement an extendable table using arrays that can increase in size
 as elements are added. Perform an experimental analysis... | habedi/stack-exchange-dataset |
16,088 | Poly-time reduction from ILP to SAT? | <p>So, as is known, ILP's 0-1 decision problem is NP-complete. Showing it's in NP is easy, and the original reduction was from SAT; since then, many other NP-Complete problems have been shown to have ILP formulations (which function as reductions from those problems to ILP), because ILP is very usefully general.</p>&#x... | np complete reductions satisfiability integer programming | 1 | Poly-time reduction from ILP to SAT? -- (np complete reductions satisfiability integer programming)
<p>So, as is known, ILP's 0-1 decision problem is NP-complete. Showing it's in NP is easy, and the original reduction was from SAT; since then, many other NP-Complete problems have been shown to have ILP formulations (wh... | habedi/stack-exchange-dataset |
16,092 | What is the definition of Computer Science, and what is the Science within Computer Science? | <p>I am pursuing a BS in Computer Science, but I am at an early point of it, and I am pretty sure I will be happy with my choice given that it seems like an academically and career flexible education to pursue.</p>

<p>Having said that, there seems to be a variety of definitions about what Computer Science real... | terminology history | 1 | What is the definition of Computer Science, and what is the Science within Computer Science? -- (terminology history)
<p>I am pursuing a BS in Computer Science, but I am at an early point of it, and I am pretty sure I will be happy with my choice given that it seems like an academically and career flexible education to... | habedi/stack-exchange-dataset |
16,109 | Where in the Chomsky Hierarchy are Regular Expressions as a language? | <p>I'm referring to regular expressions as language: \begin{equation*}
 \Sigma = \{ ``a", ``b", ``(", ``)", ``*", ... \}
\end{equation*} and \begin{equation*}
 L = \Sigma^* \text{, which form a legal regular expression}
\end{equation*} I am not referring to their computational power. I did some research... | formal languages reference request regular languages | 1 | Where in the Chomsky Hierarchy are Regular Expressions as a language? -- (formal languages reference request regular languages)
<p>I'm referring to regular expressions as language: \begin{equation*}
 \Sigma = \{ ``a", ``b", ``(", ``)", ``*", ... \}
\end{equation*} and \begin{equation*}
 L = \Sigma^* \text{,... | habedi/stack-exchange-dataset |
16,111 | Points-in-a-plane from HackerRank | <p>I've been struggling with this problem for days now, making no progress:</p>
<blockquote>
<p>There are N points on an XY plane. In one turn, you can select a set of collinear points on the plane and remove them. Your goal is to remove all the points in the least number of turns. Given the coordinates of the ... | algorithms graphs | 1 | Points-in-a-plane from HackerRank -- (algorithms graphs)
<p>I've been struggling with this problem for days now, making no progress:</p>
<blockquote>
<p>There are N points on an XY plane. In one turn, you can select a set of collinear points on the plane and remove them. Your goal is to remove all the points in... | habedi/stack-exchange-dataset |
16,114 | Is this pumping lemma proof correct? | <p>$$ L = \{a^ib^jc^k \mid i,j,k > 0 \text{ and } i+k>j\} $$</p>

<p>I say it's not regular. Proof by pumping lemma:
Find a string $xy^iz$ that is not in $L$ (respecting the constraints).
Let $w=x^py^pz^p$.</p>

<p>Let $i=2$.
$x^p(y^py^p)z^p$ is not in $L$. </p>

<p>Thus $L$ is... | regular languages pumping lemma | 1 | Is this pumping lemma proof correct? -- (regular languages pumping lemma)
<p>$$ L = \{a^ib^jc^k \mid i,j,k > 0 \text{ and } i+k>j\} $$</p>

<p>I say it's not regular. Proof by pumping lemma:
Find a string $xy^iz$ that is not in $L$ (respecting the constraints).
Let $w=x^py^pz^p$.</p>

<p>L... | habedi/stack-exchange-dataset |
16,122 | Removing constant symbols from language to prove irregularity | <p>I'm confused about a solution I saw about the following language not being regular:\begin{equation*}
 L=\{0^n ~1 ~2^n : n >0\}
\end{equation*} The example solution said that $L$ was "the same as":\begin{equation*}
 L'=\{0^n1^n : n > 0 \}
\end{equation*} so it wasn't regular. I understand why $... | regular languages | 1 | Removing constant symbols from language to prove irregularity -- (regular languages)
<p>I'm confused about a solution I saw about the following language not being regular:\begin{equation*}
 L=\{0^n ~1 ~2^n : n >0\}
\end{equation*} The example solution said that $L$ was "the same as":\begin{equation*}
 L... | habedi/stack-exchange-dataset |
16,131 | How many virtual machines run inside MS Windows? | <p>In my Computer Systems (first year) module as part of my EE degree I'm studying virtual machines, memory management, hardware abstraction etc. I have come across the information that the OS creates and uses a few virtual machines to provide hardware and I/O abstraction.</p>

<p>I assume that there are multip... | operating systems | 1 | How many virtual machines run inside MS Windows? -- (operating systems)
<p>In my Computer Systems (first year) module as part of my EE degree I'm studying virtual machines, memory management, hardware abstraction etc. I have come across the information that the OS creates and uses a few virtual machines to provide hard... | habedi/stack-exchange-dataset |
16,133 | sock matching algorithm | <p>There are $n$ pairs of socks, all different. They all went out of the dryer, so there are now $2n$ socks scattered around. Given two socks, the only operation I can do is to decide whether they are identical (- belong to the same pair) or different (- belong to different pairs). What is the best way to sort the sock... | algorithms time complexity sorting | 1 | sock matching algorithm -- (algorithms time complexity sorting)
<p>There are $n$ pairs of socks, all different. They all went out of the dryer, so there are now $2n$ socks scattered around. Given two socks, the only operation I can do is to decide whether they are identical (- belong to the same pair) or different (- b... | habedi/stack-exchange-dataset |
16,134 | Tree flattening with layout guarantees | <p>I want to flatten a binary tree into a linear array, and I wonder if there are specific algorithms to improve locality in the linearized representation (for instance, ensuring that all data from the left child of the root node appears before the data from the right child is an easy optimization.) What is the recomme... | binary trees performance | 1 | Tree flattening with layout guarantees -- (binary trees performance)
<p>I want to flatten a binary tree into a linear array, and I wonder if there are specific algorithms to improve locality in the linearized representation (for instance, ensuring that all data from the left child of the root node appears before the da... | habedi/stack-exchange-dataset |
16,159 | Converting a 2-SAT formula into an implication graph | <p>Both <a href="http://en.wikipedia.org/wiki/2-satisfiability" rel="nofollow" title="this text appears when you mouse over">wikipedia</a> and my lecturer explained how the 2 satisfiability problem work. However, I am finding it really hard understanding how this formula:</p>

<pre><code>xvy≡ ¬x-->y ≡ ¬y --&... | complexity theory satisfiability | 1 | Converting a 2-SAT formula into an implication graph -- (complexity theory satisfiability)
<p>Both <a href="http://en.wikipedia.org/wiki/2-satisfiability" rel="nofollow" title="this text appears when you mouse over">wikipedia</a> and my lecturer explained how the 2 satisfiability problem work. However, I am finding it ... | habedi/stack-exchange-dataset |
16,160 | How to purge a linked list in $\mathcal{O}(n\log n)$ time? | <p>I was wondering how to remove duplicate values from a linked list in $\mathcal{O}(n\lg n)$ time. I have an idea that by using merge sort when we want to compare elements for choosing the small one, if they are equal advance on pointer and just consider one element. Any alternatives?</p>
 | sorting linked lists | 1 | How to purge a linked list in $\mathcal{O}(n\log n)$ time? -- (sorting linked lists)
<p>I was wondering how to remove duplicate values from a linked list in $\mathcal{O}(n\lg n)$ time. I have an idea that by using merge sort when we want to compare elements for choosing the small one, if they are equal advance on point... | habedi/stack-exchange-dataset |
16,201 | Double, down facing arrow in operational semantics | <p>What is the meaning of the double, down facing arrow $\Downarrow$ in the context of operational semantics? Here's the example formula that uses it:</p>

<p>$$\frac{s_0 \vdash M_1 \Downarrow P_1, s_1 \; ... \; s_{n-1} \vdash M_n \Downarrow P_n, s_n}{s_0 \vdash M \Downarrow P, s_n}$$</p>

<p>It would b... | terminology semantics operational semantics | 1 | Double, down facing arrow in operational semantics -- (terminology semantics operational semantics)
<p>What is the meaning of the double, down facing arrow $\Downarrow$ in the context of operational semantics? Here's the example formula that uses it:</p>

<p>$$\frac{s_0 \vdash M_1 \Downarrow P_1, s_1 \; ... \; ... | habedi/stack-exchange-dataset |
16,204 | What happens when an alphabet is not listed in a Turing Machine? | <p>I was given a quick lesson on Turing Machines which I found interesting. However, I came up with a problem which made me think a bit on a problem and since it's not an actual class, the answer was not given. First, let me give you some background info on a Turing Machine:</p>

<pre><code>A Turing machine is ... | turing machines | 1 | What happens when an alphabet is not listed in a Turing Machine? -- (turing machines)
<p>I was given a quick lesson on Turing Machines which I found interesting. However, I came up with a problem which made me think a bit on a problem and since it's not an actual class, the answer was not given. First, let me give you ... | habedi/stack-exchange-dataset |
16,210 | Is $\log{n}$ bounded from above by $n^{o(1)}$? | <p>Let $O(n)$ be "Big-O" of $n$ and $o(n)$ be "Small-O" of $n$.</p>

<p>It is a well-known fact that $O(n \log{n}) \subset O(n^{1 + \epsilon})$ for any $\epsilon > 0$. Can we omit the $\epsilon$, and just type $O(n \log{n}) \subset O(n^{1 + o(1)})$?</p>
 | asymptotics landau notation | 1 | Is $\log{n}$ bounded from above by $n^{o(1)}$? -- (asymptotics landau notation)
<p>Let $O(n)$ be "Big-O" of $n$ and $o(n)$ be "Small-O" of $n$.</p>

<p>It is a well-known fact that $O(n \log{n}) \subset O(n^{1 + \epsilon})$ for any $\epsilon > 0$. Can we omit the $\epsilon$, and just type $O(n \log{n}) \subs... | habedi/stack-exchange-dataset |
16,221 | Algorithm to write a dictionary using thousands of words to find all anagrams for a given string with O(1) complexity | <p>Problem Statement:
Suppose we have a thousands of words and we need to maintain these words in a data structure in such a way that we should be able to find all anagrams for a given string.
I tried to achieve this with O(1) complexity.</p>

<p>I am looking for a algorithm to implement above scenario.... | algorithms complexity theory time complexity strings | 1 | Algorithm to write a dictionary using thousands of words to find all anagrams for a given string with O(1) complexity -- (algorithms complexity theory time complexity strings)
<p>Problem Statement:
Suppose we have a thousands of words and we need to maintain these words in a data structure in such a way that we sho... | habedi/stack-exchange-dataset |
16,226 | What is the fastest algorithm for multiplication of two n-digit numbers? | <p>I want to know which algorithm is fastest for multiplication of two n-digit numbers?
Space complexity can be relaxed here! </p>
 | algorithms mathematical programming | 1 | What is the fastest algorithm for multiplication of two n-digit numbers? -- (algorithms mathematical programming)
<p>I want to know which algorithm is fastest for multiplication of two n-digit numbers?
Space complexity can be relaxed here! </p>
 | habedi/stack-exchange-dataset |
16,239 | Selection of K elements of given ranks | <p>Given a procedure/function </p>

<p>$Select(S,r)$ - which selects element of rank r from set S
which uses at most $|S|. constant$ comparisons</p>

<p>We design another function $Multiselect(S,R)$
with $R =\{r_1<r_2<...<r_k\}$<br>
returns $X =\{x_1<x_2<...<x_k\}$ such th... | complexity theory algorithm analysis | 1 | Selection of K elements of given ranks -- (complexity theory algorithm analysis)
<p>Given a procedure/function </p>

<p>$Select(S,r)$ - which selects element of rank r from set S
which uses at most $|S|. constant$ comparisons</p>

<p>We design another function $Multiselect(S,R)$
with $R =\{r_1&l... | habedi/stack-exchange-dataset |
16,240 | Snowball Question FFT | <p><a href="http://courses.csail.mit.edu/6.046/spring04/handouts/prac-quiz2-sol.pdf" rel="nofollow">http://courses.csail.mit.edu/6.046/spring04/handouts/prac-quiz2-sol.pdf</a></p>

<p>I'm confused as to the solution for the snowball question. To start with, I have two specific questions:</p>

<p>(1) Eac... | algorithms fourier transform polynomials | 1 | Snowball Question FFT -- (algorithms fourier transform polynomials)
<p><a href="http://courses.csail.mit.edu/6.046/spring04/handouts/prac-quiz2-sol.pdf" rel="nofollow">http://courses.csail.mit.edu/6.046/spring04/handouts/prac-quiz2-sol.pdf</a></p>

<p>I'm confused as to the solution for the snowball question. T... | habedi/stack-exchange-dataset |
16,245 | Any path detecting between A to B | <p>In my world there are nodes and lines, I want to see if there is any path between node A, and node B, that do not cross any line(including the lines of the path itself) and do not go thru the same node twice. What would be the efficiency of such algorithm and where can I find more information about it.</p>

... | search algorithms | 1 | Any path detecting between A to B -- (search algorithms)
<p>In my world there are nodes and lines, I want to see if there is any path between node A, and node B, that do not cross any line(including the lines of the path itself) and do not go thru the same node twice. What would be the efficiency of such algorithm and ... | habedi/stack-exchange-dataset |
16,248 | Compile a programming language with itself | <p>I'm a computer science student. I want to create my own programming language (A basic language with few instructions).</p>

<p>I know how to do a syntactic analyser, I already did it in Perl. In an article, I read something about the compiler, a compiler is done in itself.</p>

<p>For example the C c... | programming languages compilers | 1 | Compile a programming language with itself -- (programming languages compilers)
<p>I'm a computer science student. I want to create my own programming language (A basic language with few instructions).</p>

<p>I know how to do a syntactic analyser, I already did it in Perl. In an article, I read something about... | habedi/stack-exchange-dataset |
16,253 | Suffix trees - "smaller half trick" | <p>I have been reading a paper <a href="http://academic.research.microsoft.com/Paper/298449" rel="nofollow">Finding Maximal Pairs with Bounded Gap</a>:</p>

<p>An in there, there is a sentence (page 6 second paragraph):</p>

<blockquote>
 <p>The “smaller-half trick” is used in several methods for f... | data structures strings suffix trees | 1 | Suffix trees - "smaller half trick" -- (data structures strings suffix trees)
<p>I have been reading a paper <a href="http://academic.research.microsoft.com/Paper/298449" rel="nofollow">Finding Maximal Pairs with Bounded Gap</a>:</p>

<p>An in there, there is a sentence (page 6 second paragraph):</p>

<... | habedi/stack-exchange-dataset |
16,255 | Proving $f = \Omega (h)$ | <p>I need to prove that $n^4+2n = \Omega (n^2)$</p>

<p>Which means I need to point two constants $c_1,c_2$ that from $n_0$:
$$ c_1 \leq \frac{\log(n^4+2n)}{\log(n^2)} \leq c_2$$</p>

<p>Now I know that:
$\lim_{n \to \infty } \frac{\log(n^4+2n)}{\log(n^2)} = 2$ so I can choose $c_1 = 0.5$ and $c... | complexity theory time complexity | 1 | Proving $f = \Omega (h)$ -- (complexity theory time complexity)
<p>I need to prove that $n^4+2n = \Omega (n^2)$</p>

<p>Which means I need to point two constants $c_1,c_2$ that from $n_0$:
$$ c_1 \leq \frac{\log(n^4+2n)}{\log(n^2)} \leq c_2$$</p>

<p>Now I know that:
$\lim_{n \to \infty } \frac{... | habedi/stack-exchange-dataset |
16,260 | exact matching between two strings - linear edit distance? | <p>This is the problem, given a string with characters from: <code>a-z</code>, <code>.</code>, <code>*</code>, and another string with characters from <code>a-z</code>. where <code>*</code> can delete the character before it, otherwise <code>*</code> is skipped and <code>.</code> can match any single character. the que... | algorithms dynamic programming regular expressions strings | 1 | exact matching between two strings - linear edit distance? -- (algorithms dynamic programming regular expressions strings)
<p>This is the problem, given a string with characters from: <code>a-z</code>, <code>.</code>, <code>*</code>, and another string with characters from <code>a-z</code>. where <code>*</code> can del... | habedi/stack-exchange-dataset |
16,266 | Show how to do FFT by hand | <p>Say you have two polynomials: $3 + x$ and $2x^2 + 2$.</p>

<p>I'm trying to understand how FFT helps us multiply these two polynomials. However, I can't find any worked out examples. Can someone show me how FFT algorithm would multiply these two polynomials. (Note: there is nothing special about these polyno... | algorithms fourier transform divide and conquer | 1 | Show how to do FFT by hand -- (algorithms fourier transform divide and conquer)
<p>Say you have two polynomials: $3 + x$ and $2x^2 + 2$.</p>

<p>I'm trying to understand how FFT helps us multiply these two polynomials. However, I can't find any worked out examples. Can someone show me how FFT algorithm would mu... | habedi/stack-exchange-dataset |
16,269 | Shortest non intersecting path for a graph embedded in a euclidean plane (2D) | <p>What algorithm would you use to find the shortest path of a graph, which is embedded in an euclidean plane, such that the path should not contain any self-intersections (in the embedding)?</p>

<p>For example, in the graph below, you want to go from $(0,0) \rightarrow (-3,2)$. Normally, an algorithm like Dij... | algorithms graphs shortest path graph traversal weighted graphs | 1 | Shortest non intersecting path for a graph embedded in a euclidean plane (2D) -- (algorithms graphs shortest path graph traversal weighted graphs)
<p>What algorithm would you use to find the shortest path of a graph, which is embedded in an euclidean plane, such that the path should not contain any self-intersections (... | habedi/stack-exchange-dataset |
16,271 | What would be a not arithmetically definable language that is not Turing reducible to another given not arithmetically definable language? | <p>I have this question I'm struggling with. </p>

<p>Let $A=\{<i,n>|\;n \in \phi ^{(i)}\}$. In other words, $A$ is the language defined by the set of all pairs $<i,n>$ such that $n$ is $\leq_m$ to the $i$th Turing jump.
A is definitely not an arithmetically definable language, and you can prove... | complexity theory computability reductions arithmetic | 1 | What would be a not arithmetically definable language that is not Turing reducible to another given not arithmetically definable language? -- (complexity theory computability reductions arithmetic)
<p>I have this question I'm struggling with. </p>

<p>Let $A=\{<i,n>|\;n \in \phi ^{(i)}\}$. In other words,... | habedi/stack-exchange-dataset |
16,279 | Sort edges in euclidean graph | <p>Given a euclidean graph <span class="math-container">$G$</span> and a node <span class="math-container">$p$</span> with edges to all the other nodes, is there a more efficient solution than <span class="math-container">$O(NLog(N))$</span> to output all the edges to <span class="math-container">$p$</span> in sorted o... | graphs computational geometry | 1 | Sort edges in euclidean graph -- (graphs computational geometry)
<p>Given a euclidean graph <span class="math-container">$G$</span> and a node <span class="math-container">$p$</span> with edges to all the other nodes, is there a more efficient solution than <span class="math-container">$O(NLog(N))$</span> to output all... | habedi/stack-exchange-dataset |
16,308 | Approaches to Solve PDA | <p>There is a saying by Computer Science Professor's everywhere :</p>

<pre><code>PDA Checks the intelligence of Students, as certainly there is no approach except power and imagination
of mind to solve problems and design PDA...
</code></pre>

<p>While thinking today i thought How can we design... | automata pushdown automata | 1 | Approaches to Solve PDA -- (automata pushdown automata)
<p>There is a saying by Computer Science Professor's everywhere :</p>

<pre><code>PDA Checks the intelligence of Students, as certainly there is no approach except power and imagination
of mind to solve problems and design PDA...
</code></pre>
... | habedi/stack-exchange-dataset |
16,311 | Drawing an implication graph for 2-SAT clauses | <p>I am trying to convert the following 2-sat clauses to implications and then draw the implication graph.</p>

<p>The clauses are: <code>{¬xvy}, {¬yvz}, {¬zvw} ,{¬wvu},{¬uv¬x},{xvw},{¬wvx}</code></p>

<p>I converted the boolean literals into implications so I could construct the implication graph:</p>&... | complexity theory logic satisfiability | 1 | Drawing an implication graph for 2-SAT clauses -- (complexity theory logic satisfiability)
<p>I am trying to convert the following 2-sat clauses to implications and then draw the implication graph.</p>

<p>The clauses are: <code>{¬xvy}, {¬yvz}, {¬zvw} ,{¬wvu},{¬uv¬x},{xvw},{¬wvx}</code></p>

<p>I conver... | habedi/stack-exchange-dataset |
16,321 | Proving Equivalence of 1-dimensional Cellular Automaton and Turing Machines | <p>I'm considering an automaton $A$ over a alphabet $\Sigma$, with a set of states $Q$, such that $\Sigma \subset Q$, which includes special "accept" and "blank" states not in $\Sigma$. It also has an infinite list of cells, which begins with the input string, the rest being blank. It has a transition function $\delta:... | turing machines cellular automata | 1 | Proving Equivalence of 1-dimensional Cellular Automaton and Turing Machines -- (turing machines cellular automata)
<p>I'm considering an automaton $A$ over a alphabet $\Sigma$, with a set of states $Q$, such that $\Sigma \subset Q$, which includes special "accept" and "blank" states not in $\Sigma$. It also has an infi... | habedi/stack-exchange-dataset |
16,324 | Courcelle's Theorem: Looking for papers | <p>I am looking for an easy and introductory paper on the proof of <a href="http://en.wikipedia.org/wiki/Courcelle%27s_theorem">Courcelle's Theorem</a>. I am also interested in its connection to <a href="http://en.wikipedia.org/wiki/Parameterized_complexity">parameterized complexity</a> regarding the <a href="http://en... | complexity theory graphs reference request discrete mathematics parameterized complexity | 1 | Courcelle's Theorem: Looking for papers -- (complexity theory graphs reference request discrete mathematics parameterized complexity)
<p>I am looking for an easy and introductory paper on the proof of <a href="http://en.wikipedia.org/wiki/Courcelle%27s_theorem">Courcelle's Theorem</a>. I am also interested in its conne... | habedi/stack-exchange-dataset |
16,325 | Direct reduction from Near-Clique to Clique | <p>An undirected graph is a Near-Clique if adding one more edge would make it a clique. Formally, a graph $G=(V,E)$ contains a near-clique of size $k$ if there exists $S\subseteq V$ and $u,v\in S$ where $|S|=k$, $(u,v)\notin E$, and $S$ forms a clique in $(V,E\cup\{(u,v)\})$. How can I show a direct reduction... | complexity theory graphs reductions np | 1 | Direct reduction from Near-Clique to Clique -- (complexity theory graphs reductions np)
<p>An undirected graph is a Near-Clique if adding one more edge would make it a clique. Formally, a graph $G=(V,E)$ contains a near-clique of size $k$ if there exists $S\subseteq V$ and $u,v\in S$ where $|S|=k$, $(u,v)\notin E$... | habedi/stack-exchange-dataset |
16,331 | Concorde time efficiency | <p>What is the efficiency of <a href="http://www.math.uwaterloo.ca/tsp/concorde.html" rel="nofollow">Concorde</a> TSP solver program. And is it have any weaknesses? I build my own exact solver and I want to compare it to Concorde. What would be the best way to do this?</p>
 | traveling salesman | 1 | Concorde time efficiency -- (traveling salesman)
<p>What is the efficiency of <a href="http://www.math.uwaterloo.ca/tsp/concorde.html" rel="nofollow">Concorde</a> TSP solver program. And is it have any weaknesses? I build my own exact solver and I want to compare it to Concorde. What would be the best way to do this?</... | habedi/stack-exchange-dataset |
16,334 | Concatenation of the intersection of two languages | <p>I'm enrolled to a Formal Language And Automata course, and we have to prove this equation on sets of strings:
$$(L_1\cap L_2)\cdot L_3 ≠ (L_1\cdot L_3) \cap (L_2\cdot L_3)$$</p>

<p>I've tried a lot of sets for e.g.
$L1 = \{a,b,c,d\}$,
$L2 = \{a,f,g\}$,
$L3 = \{s,d,h\}$.
but always the LH... | formal languages sets | 1 | Concatenation of the intersection of two languages -- (formal languages sets)
<p>I'm enrolled to a Formal Language And Automata course, and we have to prove this equation on sets of strings:
$$(L_1\cap L_2)\cdot L_3 ≠ (L_1\cdot L_3) \cap (L_2\cdot L_3)$$</p>

<p>I've tried a lot of sets for e.g.
$L1 = \... | habedi/stack-exchange-dataset |
16,346 | How to discuss coefficients in big-O notation | <p>What notation is used to discuss the coefficients of functions in big-O notation?</p>

<p>I have two functions:</p>

<ul>
<li>$f(x) = 7x^2 + 4x +2$</li>
<li>$g(x) = 3x^2 + 5x +4$</li>
</ul>

<p>Obviously, both functions are $O(x^2)$, indeed $\Theta(x^2)$, but that doesn't allow a ... | terminology asymptotics landau notation | 1 | How to discuss coefficients in big-O notation -- (terminology asymptotics landau notation)
<p>What notation is used to discuss the coefficients of functions in big-O notation?</p>

<p>I have two functions:</p>

<ul>
<li>$f(x) = 7x^2 + 4x +2$</li>
<li>$g(x) = 3x^2 + 5x +4$</li>
</ul>

... | habedi/stack-exchange-dataset |
16,357 | Undecidability of the PCP problem with bounded width | <p>Given two ordered sets of words $a_1, a_2, ..., a_k$, $b_1, b_2, ..., b_k$ taking values in some discrete alphabet $A$, a solution to the PCP problem is a sequence $i_1, ..., i_n$ taking values in $1, 2,..., k$ such that $a_{i_1}|a_{i_2}|...|a_{i_n}=b_{i_1}|b_{i_2}|...|b_{i_n}$ where $|$ means concatenation. $k$ can... | computability reference request undecidability decision problem | 1 | Undecidability of the PCP problem with bounded width -- (computability reference request undecidability decision problem)
<p>Given two ordered sets of words $a_1, a_2, ..., a_k$, $b_1, b_2, ..., b_k$ taking values in some discrete alphabet $A$, a solution to the PCP problem is a sequence $i_1, ..., i_n$ taking values i... | habedi/stack-exchange-dataset |
16,371 | Does coNP-completeness imply NP-hardness? | <p>Does coNP-completeness imply NP-hardness? In particular, I have a problem that I have shown to be coNP-complete. Can I claim that it is NP-hard? I realize that I can claim coNP-hardness, but I am not sure if that terminology is standard.</p>

<p>I am comfortable with the claim that if an NP-complete problem ... | complexity theory np hard | 1 | Does coNP-completeness imply NP-hardness? -- (complexity theory np hard)
<p>Does coNP-completeness imply NP-hardness? In particular, I have a problem that I have shown to be coNP-complete. Can I claim that it is NP-hard? I realize that I can claim coNP-hardness, but I am not sure if that terminology is standard.</p>&#x... | habedi/stack-exchange-dataset |
16,373 | NP-hardness and FPTAS | <p>I have a problem in understanding how to prove the following question.</p>

<p>Let $Q = \langle\max,f,L\rangle$ be an NPO-Problem, where $f$ only supports integers. 
Define $$L_Q^* =\{(x_0,1^k) : \exists x . L(x_0,x) \land f(x_0,x) \geq k\}.$$
The instance of $x_0$ is binary coded, while the numerica... | complexity theory np hard approximation parameterized complexity | 1 | NP-hardness and FPTAS -- (complexity theory np hard approximation parameterized complexity)
<p>I have a problem in understanding how to prove the following question.</p>

<p>Let $Q = \langle\max,f,L\rangle$ be an NPO-Problem, where $f$ only supports integers. 
Define $$L_Q^* =\{(x_0,1^k) : \exists x . L(x_0... | habedi/stack-exchange-dataset |
16,377 | Algorithm playing modification of "Hey, That's My Fish!" game | <p>Ok, I must admit this a task from my studies but I'm stuck.</p>

<p>Rules of the game are on <a href="https://en.wikipedia.org/wiki/Hey!_That%27s_My_Fish!" rel="nofollow">Wikipedia.</a> However, we have a modified version: on input we have a board with x fields, there are y penguins on some fields, there may... | algorithms board games | 1 | Algorithm playing modification of "Hey, That's My Fish!" game -- (algorithms board games)
<p>Ok, I must admit this a task from my studies but I'm stuck.</p>

<p>Rules of the game are on <a href="https://en.wikipedia.org/wiki/Hey!_That%27s_My_Fish!" rel="nofollow">Wikipedia.</a> However, we have a modified versi... | habedi/stack-exchange-dataset |
16,399 | Solve parity game in polynomial time? | <p>Is it possible to solve a <a href="https://en.wikipedia.org/wiki/Parity_game" rel="nofollow noreferrer">parity game</a> in polynomial time? If yes, how? If no, why not?</p>
 | algorithms complexity theory graphs polynomial time game theory | 1 | Solve parity game in polynomial time? -- (algorithms complexity theory graphs polynomial time game theory)
<p>Is it possible to solve a <a href="https://en.wikipedia.org/wiki/Parity_game" rel="nofollow noreferrer">parity game</a> in polynomial time? If yes, how? If no, why not?</p>
 | habedi/stack-exchange-dataset |
16,400 | Maximum number of inversions that can be removed by swapping two elements? | <p>I have come across a question that is a bit hard to understand due to its wording, I may havecome up with a possible solution, but I don't know if it's correct. Can you please help me? Thanks in advance!</p>

<p><strong>Question</strong></p>

<p>Suppose we exchange elements $a[i]$ and $a[j]$, where $... | sorting arrays | 1 | Maximum number of inversions that can be removed by swapping two elements? -- (sorting arrays)
<p>I have come across a question that is a bit hard to understand due to its wording, I may havecome up with a possible solution, but I don't know if it's correct. Can you please help me? Thanks in advance!</p>

<p><s... | habedi/stack-exchange-dataset |
16,402 | difference between propagation speed and bandwidth in digital communication | <p>I want to know difference between propagation speed and bandwidth in digital communication.I know bandwidth is no of bits in one second and propagation speed of signal is distance traveled by signal is one second.Is there any relation between them or they are totally different.Can anyone tell me exact definition to ... | computer networks | 1 | difference between propagation speed and bandwidth in digital communication -- (computer networks)
<p>I want to know difference between propagation speed and bandwidth in digital communication.I know bandwidth is no of bits in one second and propagation speed of signal is distance traveled by signal is one second.Is th... | habedi/stack-exchange-dataset |
16,406 | Is there a name for this infinite language? | <p>Is there a name for this infinite language?</p>

<p>$$L = \{ 0(,1)^*(,2)^*(,3)^*....(,n)^* \;\mid n \geq 1\}$$</p>

<p>A string $w \in L$ is simply an ordered list of increasing integers in which every integer $\geq 1$ can be repeated 0 or more times, for example "0", "0,1", "0,1,2,2", "0,1,2,3", "0... | terminology | 1 | Is there a name for this infinite language? -- (terminology)
<p>Is there a name for this infinite language?</p>

<p>$$L = \{ 0(,1)^*(,2)^*(,3)^*....(,n)^* \;\mid n \geq 1\}$$</p>

<p>A string $w \in L$ is simply an ordered list of increasing integers in which every integer $\geq 1$ can be repeated 0 or... | habedi/stack-exchange-dataset |
16,411 | $k$-way merge but without an absolute order | <p>I have $k$ lists that I would like to combine to a single list. Each list's elements are unique and are sorted in a particular order, but there is no notion of an absolute order, and different items across lists can only be compared if they are equal. To give a specific example (here I use $<$ to indicate the sor... | algorithms | 1 | $k$-way merge but without an absolute order -- (algorithms)
<p>I have $k$ lists that I would like to combine to a single list. Each list's elements are unique and are sorted in a particular order, but there is no notion of an absolute order, and different items across lists can only be compared if they are equal. To gi... | habedi/stack-exchange-dataset |
16,415 | What does this context-free grammar generate? | <p>The grammar is</p>

<p>$$ S\to aSb\ |\ bSa\ |\ SS\ |\ \epsilon. $$</p>

<p>I think this generates the set of strings with equal numbers of $a$'s and $b$'s based on examples I've done. Is this correct?</p>
 | context free | 1 | What does this context-free grammar generate? -- (context free)
<p>The grammar is</p>

<p>$$ S\to aSb\ |\ bSa\ |\ SS\ |\ \epsilon. $$</p>

<p>I think this generates the set of strings with equal numbers of $a$'s and $b$'s based on examples I've done. Is this correct?</p>
 | habedi/stack-exchange-dataset |
16,417 | How to analyze the lower bound of the horse racing problem using adversary argument? | <p>Consider the following problem:</p>

<blockquote>
 <p>Give an algorithm to find the $1^{st}, 2^{nd}, 3^{th}$ fastest horses from 25 horses. In each round, at most 5 horses can race and you can get the exact position of these horses. Analyze the lower bound of this problem using <em>adversary argument</e... | algorithms algorithm analysis lower bounds | 1 | How to analyze the lower bound of the horse racing problem using adversary argument? -- (algorithms algorithm analysis lower bounds)
<p>Consider the following problem:</p>

<blockquote>
 <p>Give an algorithm to find the $1^{st}, 2^{nd}, 3^{th}$ fastest horses from 25 horses. In each round, at most 5 horses... | habedi/stack-exchange-dataset |
16,418 | Efficient way to find intersections | <p>I have an Euclidean graph: each vertex is a point on the 2D plane, so the weight of each edge is the Euclidean distance between the vertices.</p>

<p>I am randomly creating a path thru all the vertices and I want to know if there is any efficient way to find all the intersections on my path.</p>
 | algorithms graphs graph traversal weighted graphs | 1 | Efficient way to find intersections -- (algorithms graphs graph traversal weighted graphs)
<p>I have an Euclidean graph: each vertex is a point on the 2D plane, so the weight of each edge is the Euclidean distance between the vertices.</p>

<p>I am randomly creating a path thru all the vertices and I want to kn... | habedi/stack-exchange-dataset |
16,421 | A technical clarification on subgraph isomorhism | <p>Let $G$ be a graph on $|\mathcal{V}(G)|$ vertices. If $H$ is another graph that contains a clique of size $|\mathcal{V}(G)|$, then does it mean $G$ is subgraph isomorphic to $H$? Does this mean that all graphs with vertices less than $|\mathcal{V}(G)|$ are subgraph isomorphic to $H$?</p>

<p>If the above is ... | graphs | 1 | A technical clarification on subgraph isomorhism -- (graphs)
<p>Let $G$ be a graph on $|\mathcal{V}(G)|$ vertices. If $H$ is another graph that contains a clique of size $|\mathcal{V}(G)|$, then does it mean $G$ is subgraph isomorphic to $H$? Does this mean that all graphs with vertices less than $|\mathcal{V}(G)|$ are... | habedi/stack-exchange-dataset |
16,433 | Unranking paths in a graph/lattice | <blockquote>
 <p>A ranking algorithm determines the position (or rank) of a combinatorial object among all the objects (with respect to a given order); an unranking algorithm finds the object having a specified rank. Thus, ranking and unranking can be considered as inverse operations.</p>
</blockquote>
&#x... | graphs combinatorics lattices | 1 | Unranking paths in a graph/lattice -- (graphs combinatorics lattices)
<blockquote>
 <p>A ranking algorithm determines the position (or rank) of a combinatorial object among all the objects (with respect to a given order); an unranking algorithm finds the object having a specified rank. Thus, ranking and unranking ... | habedi/stack-exchange-dataset |
16,443 | Which grammar is this? | <p>Having the grammar <code>G = (V,P,S)</code> with variable <code>V = {S,A}</code> over the alphabet <code>{a,b}</code> with the rules:</p>
<blockquote>
<p>S->aA</p>
<p>A->Sbb|b</p>
</blockquote>
<p>How can i recognize which kind of grammar is this? I think that's not "regular expression... | regular languages context free regular expressions | 1 | Which grammar is this? -- (regular languages context free regular expressions)
<p>Having the grammar <code>G = (V,P,S)</code> with variable <code>V = {S,A}</code> over the alphabet <code>{a,b}</code> with the rules:</p>
<blockquote>
<p>S->aA</p>
<p>A->Sbb|b</p>
</blockquote>
<p>How can i recog... | habedi/stack-exchange-dataset |
16,454 | Confused about beta-reduction/shifting in untyped $\lambda$-calculus with de Bruijn terms | <p>In <em>Types and Programming Languages</em>, the family of sets of terms with de Bruijn indices in the untyped $\lambda$-calculus is defined in this way:</p>

<p>Let $T$ be the smallest family of sets $\{T_0, T_1, T_2, ...\}$ such that</p>

<ol>
<li>$k \in T_n$ whenever $0 \le k \lt n$;</li>
... | lambda calculus | 1 | Confused about beta-reduction/shifting in untyped $\lambda$-calculus with de Bruijn terms -- (lambda calculus)
<p>In <em>Types and Programming Languages</em>, the family of sets of terms with de Bruijn indices in the untyped $\lambda$-calculus is defined in this way:</p>

<p>Let $T$ be the smallest family of se... | habedi/stack-exchange-dataset |
16,456 | Which priority queue implementations are stable? | <p>I can't answer this question. It seems simple but I really don't know how to approach it.
Here it is:</p>
<blockquote>
<p>A priority queue is said to be stable if deletions of items with equal priority value occur in the order in which they were inserted. Which of the following priority queue structures ... | data structures priority queues | 1 | Which priority queue implementations are stable? -- (data structures priority queues)
<p>I can't answer this question. It seems simple but I really don't know how to approach it.
Here it is:</p>
<blockquote>
<p>A priority queue is said to be stable if deletions of items with equal priority value occur in th... | habedi/stack-exchange-dataset |
16,459 | Algorithm to determine if recursion was breadth first or depth first | <p>Given a tree $T$ and a sequence of nodes $S$, with the only constraint on $S$ being that it's done through some type of recursion - that is, a node can only appear in $S$ if all of its ancestors have already appeared, what's a good algorithm to determine if $S$ is a breadth first visit, a depth first visit, or neith... | algorithms trees recursion discrete mathematics | 1 | Algorithm to determine if recursion was breadth first or depth first -- (algorithms trees recursion discrete mathematics)
<p>Given a tree $T$ and a sequence of nodes $S$, with the only constraint on $S$ being that it's done through some type of recursion - that is, a node can only appear in $S$ if all of its ancestors ... | habedi/stack-exchange-dataset |
16,461 | Memory complexity? | <p>I am unclear about finding the memory complexity of an algorithm.</p>

<p>Some places refer memory complexity as what container would be carrying for instance:</p>

<pre><code>for i = 1 to n-1
 if d[i] == d[i + 1]
 d[i] = (d[i] + 5) mod 13
</code></pre>

<p>Is consid... | complexity theory algorithm analysis asymptotics space complexity | 1 | Memory complexity? -- (complexity theory algorithm analysis asymptotics space complexity)
<p>I am unclear about finding the memory complexity of an algorithm.</p>

<p>Some places refer memory complexity as what container would be carrying for instance:</p>

<pre><code>for i = 1 to n-1
 if d[i] =... | habedi/stack-exchange-dataset |
16,466 | Computability vs Complexity? | <p>In Theoretical Computer Science, which one is more important? Computability of a problem or Complexity of a problem?</p>
 | algorithms complexity theory computability | 1 | Computability vs Complexity? -- (algorithms complexity theory computability)
<p>In Theoretical Computer Science, which one is more important? Computability of a problem or Complexity of a problem?</p>
 | habedi/stack-exchange-dataset |
16,467 | How to reverse a subarray of an array | <p>How to reverse the order of elements in an array between indices <span class="math-container">$i$</span> and <span class="math-container">$j$</span>.</p>
<p>Ex: For the array <code>[A,B,C,D,E,F]</code>, calling the function <code>reverse(array, 1,4)</code> will modify the array to be <code>[A,E,D,C,B,F]</code>.<... | algorithms arrays | 1 | How to reverse a subarray of an array -- (algorithms arrays)
<p>How to reverse the order of elements in an array between indices <span class="math-container">$i$</span> and <span class="math-container">$j$</span>.</p>
<p>Ex: For the array <code>[A,B,C,D,E,F]</code>, calling the function <code>reverse(array, 1,4)</c... | habedi/stack-exchange-dataset |
16,469 | Known bounds on space complexity of multiplication decision problem | <p>Given three numbers $m$, $n$ and $p$ in interleaved binary encoding<sup>1</sup>, it's obviously possible to check in $O(1)$ space whether $m+n=p$. It's less obvious<sup>2</sup> that it isn't possible to check in $O(1)$ space whether $m\cdot n=p$. I wonder whether one can prove that it isn't possible to check in $O(... | space complexity binary arithmetic | 1 | Known bounds on space complexity of multiplication decision problem -- (space complexity binary arithmetic)
<p>Given three numbers $m$, $n$ and $p$ in interleaved binary encoding<sup>1</sup>, it's obviously possible to check in $O(1)$ space whether $m+n=p$. It's less obvious<sup>2</sup> that it isn't possible to check... | habedi/stack-exchange-dataset |
16,477 | Why is Iterative-deepening A* optimal, even without monotonicity? | <p>Why is it that Iterative-deepening A* is optimal, even without monotonicity? How can I be sure that the first goal reached is the optimal one?</p>
 | search algorithms search trees | 1 | Why is Iterative-deepening A* optimal, even without monotonicity? -- (search algorithms search trees)
<p>Why is it that Iterative-deepening A* is optimal, even without monotonicity? How can I be sure that the first goal reached is the optimal one?</p>
 | habedi/stack-exchange-dataset |
16,483 | Complexity of deciding the satisfiability of a quasi-monotone CNF formula | <p>A <em>quasi-monotone CNF formula</em> is a formula where each variable appears at most once as a positive literal (and any number of times as a negative literal). </p>

<p>What is the complexity of deciding its satisfiability?</p>
 | complexity theory np complete satisfiability decision problem | 1 | Complexity of deciding the satisfiability of a quasi-monotone CNF formula -- (complexity theory np complete satisfiability decision problem)
<p>A <em>quasi-monotone CNF formula</em> is a formula where each variable appears at most once as a positive literal (and any number of times as a negative literal). </p>

... | habedi/stack-exchange-dataset |
16,496 | Does a language stay regular if you re-encode the input? | <p>$\tau$ be a transformation that, applied to a word of $\Sigma_a^\star$, replaces each character with a word from a possibly different $\Sigma_b^\star$ and concatenates the resulting words. For instance, given a $\tau$ with the following translation table:</p>

<pre><code>A -> AA
B -> AB
C ->... | regular languages | 1 | Does a language stay regular if you re-encode the input? -- (regular languages)
<p>$\tau$ be a transformation that, applied to a word of $\Sigma_a^\star$, replaces each character with a word from a possibly different $\Sigma_b^\star$ and concatenates the resulting words. For instance, given a $\tau$ with the following ... | habedi/stack-exchange-dataset |
16,503 | OOP: exampe and references on constructor anomalies | <p>I have read the following artice that defines the term "constructor anomaly":</p>

<p>Cohen, Tal, and Joseph Gil. "Better Construction with Factories." journal of object technology 6.6 (2007): 103-123.
<a href="http://www.jot.fm/issues/issue_2007_07/article3/" rel="nofollow">http://www.jot.fm/issues/issu... | reference request programming languages object oriented | 1 | OOP: exampe and references on constructor anomalies -- (reference request programming languages object oriented)
<p>I have read the following artice that defines the term "constructor anomaly":</p>

<p>Cohen, Tal, and Joseph Gil. "Better Construction with Factories." journal of object technology 6.6 (2007): 103... | habedi/stack-exchange-dataset |
16,512 | Metrics and algorithms for complexity of a graph | <p>I am interested in what sort of metrics are there that try to give a measure of how complex a given graph is, what are the corresponding algorithms, and what is their time complexity. A short description or list of relevant paper would be great.</p>

<p>It might help to say that I have two graphs and I want ... | graphs regular languages time complexity | 1 | Metrics and algorithms for complexity of a graph -- (graphs regular languages time complexity)
<p>I am interested in what sort of metrics are there that try to give a measure of how complex a given graph is, what are the corresponding algorithms, and what is their time complexity. A short description or list of relevan... | habedi/stack-exchange-dataset |
16,513 | Computing with the Monster | <p>The <a href="http://en.wikipedia.org/wiki/Monster_group" rel="nofollow">Monster</a> <strong>M</strong> is the largest of the finite sporadic groups that arises in the <a href="http://en.wikipedia.org/wiki/Classification_of_finite_simple_groups" rel="nofollow">classification of finite, simple groups</a> in mathematic... | algorithms data structures | 1 | Computing with the Monster -- (algorithms data structures)
<p>The <a href="http://en.wikipedia.org/wiki/Monster_group" rel="nofollow">Monster</a> <strong>M</strong> is the largest of the finite sporadic groups that arises in the <a href="http://en.wikipedia.org/wiki/Classification_of_finite_simple_groups" rel="nofollow... | habedi/stack-exchange-dataset |
16,515 | Reachable state space of an 8-puzzle | <p>I've just began studying Artificial Intelligence and am wondering why the reachable state space of an 8-puzzle is $9!/2$. I see that the number of permutations of the tiles is $9!$ but it is not immediately obvious why half the possible states of the puzzle are unreachable at any given state. Can anyone elaborate?</... | artificial intelligence | 1 | Reachable state space of an 8-puzzle -- (artificial intelligence)
<p>I've just began studying Artificial Intelligence and am wondering why the reachable state space of an 8-puzzle is $9!/2$. I see that the number of permutations of the tiles is $9!$ but it is not immediately obvious why half the possible states of the ... | habedi/stack-exchange-dataset |
16,520 | How is the implementation of pipes in a OS | <p>I understand that a pipe is a form of IPC where a process creates a link to communicate with some other process (a child maybe), taking each one a end of the pipe. File descriptors are created for read and write and they can use it in half-duplex or full-duplex. My question is if the implementation of this schema is... | operating systems | 1 | How is the implementation of pipes in a OS -- (operating systems)
<p>I understand that a pipe is a form of IPC where a process creates a link to communicate with some other process (a child maybe), taking each one a end of the pipe. File descriptors are created for read and write and they can use it in half-duplex or f... | habedi/stack-exchange-dataset |
16,529 | Generalized operators for programming languages | <p>After asking this question <a href="https://stackoverflow.com/questions/19649183/are-there-generalized-mathematical-operators-in-cs">on stackoverflow</a>, it has changed slightly. Is there a way to represent a grammar as a basis for a vector space and represent a program as an object that lives in that vector space... | formal grammars linear algebra category theory | 1 | Generalized operators for programming languages -- (formal grammars linear algebra category theory)
<p>After asking this question <a href="https://stackoverflow.com/questions/19649183/are-there-generalized-mathematical-operators-in-cs">on stackoverflow</a>, it has changed slightly. Is there a way to represent a gramma... | habedi/stack-exchange-dataset |
16,533 | guillotine cuts versus general cuts | <p>Cutting problems are problems where a certain large object should be cut to several small objects. For example, imagine you have a factory that works with large sheets of raw glass, of width $W$ and length $L$. There are several buyers, each of which wants an unbounded number of small glass sheets. Buyer $i$ wants s... | reference request computational geometry lower bounds packing | 1 | guillotine cuts versus general cuts -- (reference request computational geometry lower bounds packing)
<p>Cutting problems are problems where a certain large object should be cut to several small objects. For example, imagine you have a factory that works with large sheets of raw glass, of width $W$ and length $L$. The... | habedi/stack-exchange-dataset |
16,539 | clarification in tf-idf formula | <p>According to the wiki-article, <a href="http://en.wikipedia.org/wiki/Tf%E2%80%93idf" rel="nofollow">http://en.wikipedia.org/wiki/Tf%E2%80%93idf</a> the term frequency of term $t$ in document $d$ is given as follows:
$$
tf(t,d) = 0.5 + \frac{0.5 \times f(t,d)}{\max{\{f(w,d): w~\epsilon~d\}}}
$$</p>
&#... | search algorithms | 1 | clarification in tf-idf formula -- (search algorithms)
<p>According to the wiki-article, <a href="http://en.wikipedia.org/wiki/Tf%E2%80%93idf" rel="nofollow">http://en.wikipedia.org/wiki/Tf%E2%80%93idf</a> the term frequency of term $t$ in document $d$ is given as follows:
$$
tf(t,d) = 0.5 + \frac{0.5 \times f(... | habedi/stack-exchange-dataset |
16,545 | What is the difference between a Neural Network, a Deep Learning System and a Deep Belief Network? | <p>What is the difference between a Neural Network, a Deep Learning System and a Deep Belief Network?</p>

<p>As I recall your basic neural network is a 3 layers kinda thing,
and I have had Deep Belief Systems described as being neural networks stacked on top of each other.</p>

<p>I've not til rece... | machine learning neural networks boltzmann machine | 1 | What is the difference between a Neural Network, a Deep Learning System and a Deep Belief Network? -- (machine learning neural networks boltzmann machine)
<p>What is the difference between a Neural Network, a Deep Learning System and a Deep Belief Network?</p>

<p>As I recall your basic neural network is a 3 la... | habedi/stack-exchange-dataset |
16,546 | Randomizd String Searching | <p>I need to detect whether a binary pattern P of length m occurs in a binary text T of length n where m

<p>I want to state an algorithm that runs in time O(n) where we assume that arithmetic operations on O(log2n) bit numbers can be executed in constant time. The algorithm should accept with probability 1 whe... | searching | 1 | Randomizd String Searching -- (searching)
<p>I need to detect whether a binary pattern P of length m occurs in a binary text T of length n where m

<p>I want to state an algorithm that runs in time O(n) where we assume that arithmetic operations on O(log2n) bit numbers can be executed in constant time. The algo... | habedi/stack-exchange-dataset |
16,547 | Is there an adjustment for Adler32 algorithm so it works well on short messages? | <p>The Adler32 algorithm has a shortcoming <a href="http://en.wikipedia.org/wiki/Adler-32" rel="nofollow">as noted on Wikipedia</a>:</p>

<blockquote>
 <p>Jonathan Stone discovered in 2001 that Adler-32 has a weakness for very short messages. He wrote "Briefly, the problem is that, for very short packets, ... | algorithms hash | 1 | Is there an adjustment for Adler32 algorithm so it works well on short messages? -- (algorithms hash)
<p>The Adler32 algorithm has a shortcoming <a href="http://en.wikipedia.org/wiki/Adler-32" rel="nofollow">as noted on Wikipedia</a>:</p>

<blockquote>
 <p>Jonathan Stone discovered in 2001 that Adler-32 ha... | habedi/stack-exchange-dataset |
16,555 | Sum number of times statement is executed in triple nested loop | <p>I have this code fragment:</p>

<pre><code>for( i=0; i<n; i++ )
 for( j=0; j<i; j++ )
 for( k=0; k<j; k++ )
 S;
</code></pre>

<p>I need to find the number of times that S is executed in that code block. I <a href="http://www.wolframalpha.com/input/?i=sum... | runtime analysis loops | 1 | Sum number of times statement is executed in triple nested loop -- (runtime analysis loops)
<p>I have this code fragment:</p>

<pre><code>for( i=0; i<n; i++ )
 for( j=0; j<i; j++ )
 for( k=0; k<j; k++ )
 S;
</code></pre>

<p>I need to find the number of time... | habedi/stack-exchange-dataset |
16,562 | Term for array of identical type and different types | <p>What is proper terminology to distinguish between an array (ordered list) data structure in which each element is of identical type/class, and an array in which each element can be different?</p>
 | terminology arrays | 1 | Term for array of identical type and different types -- (terminology arrays)
<p>What is proper terminology to distinguish between an array (ordered list) data structure in which each element is of identical type/class, and an array in which each element can be different?</p>
 | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.