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 |
|---|---|---|---|---|---|---|
37,879 | What is the implication of NP-completeness if P=NP? | <p>If a certain problem $X$ is NP-complete and $P\neq NP$, then $X$ is not polynomial. But we still don't know that $P\neq NP$, so in theory $X$ may be polynomial. Does the fact that $X$ is NP-complete say anything about it being more difficult than other polynomial problems? In particular:</p>

<ol>
<li>Do... | complexity theory time complexity np complete | 1 | What is the implication of NP-completeness if P=NP? -- (complexity theory time complexity np complete)
<p>If a certain problem $X$ is NP-complete and $P\neq NP$, then $X$ is not polynomial. But we still don't know that $P\neq NP$, so in theory $X$ may be polynomial. Does the fact that $X$ is NP-complete say anything ab... | habedi/stack-exchange-dataset |
37,888 | Variants of the 3-SUM problem | <p>The <a href="https://en.wikipedia.org/wiki/3SUM" rel="noreferrer">3SUM problem</a> has two variants. In one variant, there is a single array $S$ of integers, and we have to find three different elements $a,b,c \in S$ such that $a+b+c=0$. In another variant, there are are three arrays $X,Y,Z$, and we have to find a n... | algorithms reductions discrete mathematics | 1 | Variants of the 3-SUM problem -- (algorithms reductions discrete mathematics)
<p>The <a href="https://en.wikipedia.org/wiki/3SUM" rel="noreferrer">3SUM problem</a> has two variants. In one variant, there is a single array $S$ of integers, and we have to find three different elements $a,b,c \in S$ such that $a+b+c=0$. I... | habedi/stack-exchange-dataset |
37,894 | An example of a non-regular grammar for a regular language? | <p>I understand that a regular language can be specified by either regular or non-regular grammars. What is an example of a non-regular grammar for a regular language?</p>
 | formal languages regular languages formal grammars | 1 | An example of a non-regular grammar for a regular language? -- (formal languages regular languages formal grammars)
<p>I understand that a regular language can be specified by either regular or non-regular grammars. What is an example of a non-regular grammar for a regular language?</p>
 | habedi/stack-exchange-dataset |
37,907 | Fine-Grain parallel algorithm for LU-decomposition | <p>How would you understand this pseudocode of parallel algorithm for LU-decomposition ? I'm confused mostly with the</p>
<pre><code>min(i; j) - 1,
</code></pre>
<p>because I have no idea, what the author wanted to say by it. I know that it means " choose the lesser number of 'i' and 'j' and then subst... | algorithms parallel computing matrices decomposition | 1 | Fine-Grain parallel algorithm for LU-decomposition -- (algorithms parallel computing matrices decomposition)
<p>How would you understand this pseudocode of parallel algorithm for LU-decomposition ? I'm confused mostly with the</p>
<pre><code>min(i; j) - 1,
</code></pre>
<p>because I have no idea, what the a... | habedi/stack-exchange-dataset |
37,908 | Pumping Lemma confusion | <p>I have the following language...</p>

<p>$$A=\{a^ib^i | i>0\}\cup\{a^jb^k|j>2, k>3\}$$</p>

<p>Now, pumping lemma states that a regular language can be written in the form $x=pq^ir$. What confuses me is how to split the language into three parts, this is my attempt:</p>

<p>$p=a^j$</... | formal languages regular languages pumping lemma | 1 | Pumping Lemma confusion -- (formal languages regular languages pumping lemma)
<p>I have the following language...</p>

<p>$$A=\{a^ib^i | i>0\}\cup\{a^jb^k|j>2, k>3\}$$</p>

<p>Now, pumping lemma states that a regular language can be written in the form $x=pq^ir$. What confuses me is how to spli... | habedi/stack-exchange-dataset |
37,914 | How to efficiently use an AVL tree to store partial sums? | <p>Let $a_{1} , ... , a_{m} $ be real numbers $\geq 1$, where $m$ is at least 1. I am supposed to store them in an augmented AVL structure with the following operations:</p>

<p>-PartialSum (i): Return the $i_{th}$ partial sum.</p>

<p>-Change (i, y): Change the $a_{i}$ element for y.</p>

<p>I ... | algorithms data structures search trees | 1 | How to efficiently use an AVL tree to store partial sums? -- (algorithms data structures search trees)
<p>Let $a_{1} , ... , a_{m} $ be real numbers $\geq 1$, where $m$ is at least 1. I am supposed to store them in an augmented AVL structure with the following operations:</p>

<p>-PartialSum (i): Return the $i_... | habedi/stack-exchange-dataset |
37,916 | Shortest path where weights are computationally expensive to calculate | <p>Suppose we have a function, CalculateEdgeWeight, which is computationally expensive. We want to find the shortest path between two nodes $s$ and $t$ in a simple edge-weighted digraph $G= (V,E)$ where weights of $ij \in E$ are calculated with CalculateEdgeWeight($ij$). </p>

<p>Is there a shortest path algori... | shortest path | 1 | Shortest path where weights are computationally expensive to calculate -- (shortest path)
<p>Suppose we have a function, CalculateEdgeWeight, which is computationally expensive. We want to find the shortest path between two nodes $s$ and $t$ in a simple edge-weighted digraph $G= (V,E)$ where weights of $ij \in E$ are c... | habedi/stack-exchange-dataset |
37,922 | Algorithm analysis in the presence of undefined functions | <p>I wonder how we can perform algorithm analysis when in an algorithm we have calls of functions whose definition we do not know, e.g. functions delivered by external libraries.</p>
 | algorithm analysis | 1 | Algorithm analysis in the presence of undefined functions -- (algorithm analysis)
<p>I wonder how we can perform algorithm analysis when in an algorithm we have calls of functions whose definition we do not know, e.g. functions delivered by external libraries.</p>
 | habedi/stack-exchange-dataset |
37,940 | Heuristic for weighted maximum independent set in graph with ~$2 \times 10^5$ nodes and $|E| \propto |V|$ | <p>I want to find a near-optimal solution for a maximum weight independent set.
i.e given a graph $G = (V,E)$ I want to find a set $S = \{v_1,v_2,\dots,v_n\}$ of nodes in $V$ such that the sum of their weights is maximum (The weights are positive), under the constraint that every pair is not connected by an edge, &... | graphs search algorithms heuristics | 1 | Heuristic for weighted maximum independent set in graph with ~$2 \times 10^5$ nodes and $|E| \propto |V|$ -- (graphs search algorithms heuristics)
<p>I want to find a near-optimal solution for a maximum weight independent set.
i.e given a graph $G = (V,E)$ I want to find a set $S = \{v_1,v_2,\dots,v_n\}$ of nodes i... | habedi/stack-exchange-dataset |
37,949 | Minimal DFA that accepts binary strings whose decimal equivalent is divisible by 32 | <p>I thought the answer would be 32 for remainder $0,1,2,\dots, 31$. But answer given as $6$.
and explanation is given as if the number is $2^n$ then number of states required would be $n+1$.</p>
 | automata finite automata | 1 | Minimal DFA that accepts binary strings whose decimal equivalent is divisible by 32 -- (automata finite automata)
<p>I thought the answer would be 32 for remainder $0,1,2,\dots, 31$. But answer given as $6$.
and explanation is given as if the number is $2^n$ then number of states required would be $n+1$.</p>&#... | habedi/stack-exchange-dataset |
37,952 | Hash function floating point inputs for genetic algorithm | <p>I am implementing a genetic algorithm to use as an optimisation algorithm to evolve robots. The robots have certain parameters (represented as floats) which can lie anywhere within a certain range defined for each parameter. My goal is to optimise these parameters to produce the fittest robot.</p>

<p>There ... | hash | 1 | Hash function floating point inputs for genetic algorithm -- (hash)
<p>I am implementing a genetic algorithm to use as an optimisation algorithm to evolve robots. The robots have certain parameters (represented as floats) which can lie anywhere within a certain range defined for each parameter. My goal is to optimise t... | habedi/stack-exchange-dataset |
37,955 | Artificial intelligence - bridge and torch problem | <p>I am doing a artificial intelligence course as part of my computer science degree. </p>

<p>I am stuck on a question about searching. The question is a version of the <a href="http://en.wikipedia.org/wiki/Bridge_and_torch_problem" rel="nofollow">Bridge and torch problem</a>. </p>

<p>Five people need... | complexity theory combinatorics artificial intelligence search problem | 1 | Artificial intelligence - bridge and torch problem -- (complexity theory combinatorics artificial intelligence search problem)
<p>I am doing a artificial intelligence course as part of my computer science degree. </p>

<p>I am stuck on a question about searching. The question is a version of the <a href="http:/... | habedi/stack-exchange-dataset |
37,956 | Why is the optimal cut-off for switching from Quicksort to Insertion sort machine dependent? | <p>I fail to understand why cut off value would be system dependent, and not a constant.</p>

<p><a href="http://algs4.cs.princeton.edu/23quicksort/">From Princeton University website</a> </p>

<blockquote>
 <p>Cutoff to insertion sort. As with mergesort, it pays to switch to
 insertion sort f... | algorithms sorting efficiency quicksort | 1 | Why is the optimal cut-off for switching from Quicksort to Insertion sort machine dependent? -- (algorithms sorting efficiency quicksort)
<p>I fail to understand why cut off value would be system dependent, and not a constant.</p>

<p><a href="http://algs4.cs.princeton.edu/23quicksort/">From Princeton Universit... | habedi/stack-exchange-dataset |
37,957 | Prove that a language is not regular with process of elimination | <p>When deterministic automaton, I need to prove that you can't implement the language in it, because the language is not regular.</p>

<p>Easiest way to prove that a language is regular, is just by making an automaton for it. But if the automaton is not regular, you can't just say that it's not regular because... | regular languages automata | 1 | Prove that a language is not regular with process of elimination -- (regular languages automata)
<p>When deterministic automaton, I need to prove that you can't implement the language in it, because the language is not regular.</p>

<p>Easiest way to prove that a language is regular, is just by making an automa... | habedi/stack-exchange-dataset |
37,975 | How to calculate probability of packet loss and drop rate? | <p>In a queuing system (M/M/1) with a finite packet capacity $z$, how do you determine the probability of packet loss if we assume that packets are dropped when the system is full? Packets arrive with a rate $\lambda$ and are served at rate $\mu$ (using the Poisson distribution).</p>

<p><strong>My attempt at a... | probability theory computer networks priority queues | 1 | How to calculate probability of packet loss and drop rate? -- (probability theory computer networks priority queues)
<p>In a queuing system (M/M/1) with a finite packet capacity $z$, how do you determine the probability of packet loss if we assume that packets are dropped when the system is full? Packets arrive with a ... | habedi/stack-exchange-dataset |
37,983 | What is considered arithmetic when dealing with bits? | <p>In a recent homework question we were asked to implement a program that would use only bitwise operations. From our notes, this includes & | ^ ~ >> << and >>>. We are not allowed to use arithmetic operations, or loops. </p>

<p>Since immediately addition can be defined with the above accepted opera... | terminology arithmetic | 1 | What is considered arithmetic when dealing with bits? -- (terminology arithmetic)
<p>In a recent homework question we were asked to implement a program that would use only bitwise operations. From our notes, this includes & | ^ ~ >> << and >>>. We are not allowed to use arithmetic operations, or loops. </p>&#... | habedi/stack-exchange-dataset |
37,995 | What is the advantage of Day-Stout-Warren algorithm for balancing BST? | <p>While reading about <a href="http://en.wikipedia.org/wiki/Day%E2%80%93Stout%E2%80%93Warren_algorithm" rel="nofollow">Day–Stout–Warren algorithm for balancing BST</a> which takes any BST and transforms it into a balanced BST in <code>O(n)</code> time.</p>

<p>In my opinion I can achieve absolutely the same wi... | algorithms data structures optimization binary trees search trees | 1 | What is the advantage of Day-Stout-Warren algorithm for balancing BST? -- (algorithms data structures optimization binary trees search trees)
<p>While reading about <a href="http://en.wikipedia.org/wiki/Day%E2%80%93Stout%E2%80%93Warren_algorithm" rel="nofollow">Day–Stout–Warren algorithm for balancing BST</a> which tak... | habedi/stack-exchange-dataset |
38,003 | Understanding Gustafson's Law | <p><a href="http://en.wikipedia.org/wiki/Gustafson's_law#Derivation_of_Gustafson.27s_law" rel="nofollow">Wikipedia</a> says about Gustafsons's law that:</p>

<blockquote>
 <p>It may even be the case that $\alpha$ diminishes as $P$ (together with the problem size) increases. </p>
</blockquote>
&... | parallel computing | 1 | Understanding Gustafson's Law -- (parallel computing)
<p><a href="http://en.wikipedia.org/wiki/Gustafson's_law#Derivation_of_Gustafson.27s_law" rel="nofollow">Wikipedia</a> says about Gustafsons's law that:</p>

<blockquote>
 <p>It may even be the case that $\alpha$ diminishes as $P$ (together with the... | habedi/stack-exchange-dataset |
38,007 | Can a propositional threshold connective be expressed by standard connectives? | <p>We are given a finite set of propositional atoms $\{x_1, \dots, x_n\}$ and an integer $k$.
Can we capture through a propositional formula $\varphi$ (built from the standard connectives $\neg, \wedge, \vee$ only) the set of all models having at most $k$ atoms valued at $1$, such that the size of $\varphi$ is poly... | logic propositional logic | 1 | Can a propositional threshold connective be expressed by standard connectives? -- (logic propositional logic)
<p>We are given a finite set of propositional atoms $\{x_1, \dots, x_n\}$ and an integer $k$.
Can we capture through a propositional formula $\varphi$ (built from the standard connectives $\neg, \wedge, \ve... | habedi/stack-exchange-dataset |
38,008 | If L1 ∪ L2 and L1 are regular, is L2 also regular? | <p>This is a problem in a theory of computation book that's stumping me:</p>

<blockquote>
 <p>Suppose that we know that $L_1 ∪ L_2$ and $L_1$ are regular. Can we conclude that $L_2$ is 
 regular? Explain.</p>
</blockquote>

<p>At first, I thought I could build the NFA that is the union of... | formal languages regular languages closure properties | 1 | If L1 ∪ L2 and L1 are regular, is L2 also regular? -- (formal languages regular languages closure properties)
<p>This is a problem in a theory of computation book that's stumping me:</p>

<blockquote>
 <p>Suppose that we know that $L_1 ∪ L_2$ and $L_1$ are regular. Can we conclude that $L_2$ is 
 regu... | habedi/stack-exchange-dataset |
38,010 | Versions of NP with different logical unifiers | <p>One formulation of NP is this: a language is in NP if it can be solved in polynomial time by an algorithm that has access to a special "Nondeterministic Bit" function, which branches the world into two alternate universes, writes a $1$ on the worktape in the first universe and a $0$ in the second, finishes the compu... | complexity theory np | 1 | Versions of NP with different logical unifiers -- (complexity theory np)
<p>One formulation of NP is this: a language is in NP if it can be solved in polynomial time by an algorithm that has access to a special "Nondeterministic Bit" function, which branches the world into two alternate universes, writes a $1$ on the w... | habedi/stack-exchange-dataset |
38,014 | Making a finite automata | <p>How can I make a finite automaton which does not end in string ab.</p>

<p>With the alphabet a,b</p>

<p>I made 3 states. For the first one it is accepting states and thus accept the empty string.</p>

<p>So here is a table I made. State 1 is initial state</p>

<pre><code> inpu... | automata finite automata | 1 | Making a finite automata -- (automata finite automata)
<p>How can I make a finite automaton which does not end in string ab.</p>

<p>With the alphabet a,b</p>

<p>I made 3 states. For the first one it is accepting states and thus accept the empty string.</p>

<p>So here is a table I made. State ... | habedi/stack-exchange-dataset |
38,015 | Modeling concurrent algorithms | <p>I'm working on a class library (C++) that can be thought of as a producer/consumer queue of producer/consumer queues. There are many queues of data, and the goal is to assign worker threads to process these queues, as needed, using coroutines. At any rate, the details aren't necessarily important to the question, bu... | concurrency synchronization temporal logic | 1 | Modeling concurrent algorithms -- (concurrency synchronization temporal logic)
<p>I'm working on a class library (C++) that can be thought of as a producer/consumer queue of producer/consumer queues. There are many queues of data, and the goal is to assign worker threads to process these queues, as needed, using corout... | habedi/stack-exchange-dataset |
38,019 | Integer Programming - packing wolves and sheep | <p>I'm new to linear/integer programming and I'm trying to solve a little problem I made up. I want to "pack" animals into a minimum number of bins where some of the animals cannot co-exist (wolves and sheep). Here is a picture of my little flow network that's guiding me.
<img src="https://i.stack.imgur.com/7VAR2.j... | optimization integer programming | 1 | Integer Programming - packing wolves and sheep -- (optimization integer programming)
<p>I'm new to linear/integer programming and I'm trying to solve a little problem I made up. I want to "pack" animals into a minimum number of bins where some of the animals cannot co-exist (wolves and sheep). Here is a picture of my l... | habedi/stack-exchange-dataset |
38,020 | Merging Sorted lists using Heap Data Structure | <p>Suppose there are $\lceil\log n\rceil$ sorted lists of $\lceil\frac{n}{\log n}\rceil$ elements each. The time complexity of producing a sorted list of all these elements is: (Hint: Use a heap data structure)</p>

<ol>
<li><p>$O(n \log \log n)$</p></li>
<li><p>$θ(n \log n)$</p></li>
<li><p>$Ω(n \... | algorithms heaps | 1 | Merging Sorted lists using Heap Data Structure -- (algorithms heaps)
<p>Suppose there are $\lceil\log n\rceil$ sorted lists of $\lceil\frac{n}{\log n}\rceil$ elements each. The time complexity of producing a sorted list of all these elements is: (Hint: Use a heap data structure)</p>

<ol>
<li><p>$O(n \log ... | habedi/stack-exchange-dataset |
38,021 | Big O notation comparison with constant time | <p>So, I'm new to this whole asymptomatic notation with respect to algorithms. So say you have a $f(n) = 1/n$ and $g(n) = 1$, would it be OK to say that $f(n)$ is not equal or is not an element of $O(g(n)) $?
 I say this because I'm actually drawing an analogy with another example. Say in my second example $f(n)... | algorithms algorithm analysis asymptotics | 1 | Big O notation comparison with constant time -- (algorithms algorithm analysis asymptotics)
<p>So, I'm new to this whole asymptomatic notation with respect to algorithms. So say you have a $f(n) = 1/n$ and $g(n) = 1$, would it be OK to say that $f(n)$ is not equal or is not an element of $O(g(n)) $?
 I say this b... | habedi/stack-exchange-dataset |
38,025 | Combinational Logic - Need help with proof by rewrite | <p>In my Computer Logic class we were assigned the following problem: </p>

<blockquote>
 <p>Complete a <strong>truth table</strong> that has $3$ inputs $(A, B,C)$ and one output
 $(F)$. $F$ is asserted whenever $B$ or $C$ are asserted, but
 deasserted if both $B$ and $C$ are asserted. ... | logic | 1 | Combinational Logic - Need help with proof by rewrite -- (logic)
<p>In my Computer Logic class we were assigned the following problem: </p>

<blockquote>
 <p>Complete a <strong>truth table</strong> that has $3$ inputs $(A, B,C)$ and one output
 $(F)$. $F$ is asserted whenever $B$ or $C$ are a... | habedi/stack-exchange-dataset |
38,030 | Generate Regular Grammar for a Language with Modular Condition | <p>This is a homework problem. I've wrestled with it for quite awhile and can't come up with a valid solution. The problem is:</p>

<p>Find a regular grammar that generates each of the following languages:
$$L = \{ w \in {a,b}^* \mid \text{na}(w) – \text{nb}(w) = 1 \mod 3 \} , $$</p>

<p>where $\t... | formal languages regular languages formal grammars | 1 | Generate Regular Grammar for a Language with Modular Condition -- (formal languages regular languages formal grammars)
<p>This is a homework problem. I've wrestled with it for quite awhile and can't come up with a valid solution. The problem is:</p>

<p>Find a regular grammar that generates each of the follow... | habedi/stack-exchange-dataset |
38,039 | Can number of states in DFA be greater than $2^n$ when language-equivalent NFA has $n$ states? | <p>As title says, can the number of states in DFA be greater than $2^n$ when language-equivalent NFA has $n$ states - that is if the NFA recognizes the same language as the DFA and has $n$ states, can DFA have more than $2^n$ states?</p>

<p>I think it is, and this is trivially. However Wikipedia seeems to writ... | complexity theory finite automata | 1 | Can number of states in DFA be greater than $2^n$ when language-equivalent NFA has $n$ states? -- (complexity theory finite automata)
<p>As title says, can the number of states in DFA be greater than $2^n$ when language-equivalent NFA has $n$ states - that is if the NFA recognizes the same language as the DFA and has $... | habedi/stack-exchange-dataset |
38,043 | How to pick a good structural induction hypothesis | <p>(Full disclosure: homework question)</p>

<p>Let $M = (Q, \Sigma, q_0, A, \delta)$ be a finite automaton. The extended transition function $\delta^*$ is defined as follows:</p>

<ol>
<li><p>$\forall q \in Q$</p>

<p>$\delta^*(q, \Lambda) = q$</p></li>
<li><p>$\forall q \in Q, y \in \S... | finite automata proof techniques induction | 1 | How to pick a good structural induction hypothesis -- (finite automata proof techniques induction)
<p>(Full disclosure: homework question)</p>

<p>Let $M = (Q, \Sigma, q_0, A, \delta)$ be a finite automaton. The extended transition function $\delta^*$ is defined as follows:</p>

<ol>
<li><p>$\forall... | habedi/stack-exchange-dataset |
38,045 | Algorithm: ordering non-overlapping intervals | <p>Assume we have a (multi)set of nontrivial intervals $\mathcal{I} = \{I_1,...,I_n\}$ and for any two $I_i, I_j \in \mathcal{I}$, we have that $I_i \cap I_j$ is trivial (that is: contains at most one point), or one of them contains the other. Just to clarify, an example would be $\mathcal{I} = \{[0,10], [2,6],[6,8], [... | algorithms data structures trees intervals ordering | 1 | Algorithm: ordering non-overlapping intervals -- (algorithms data structures trees intervals ordering)
<p>Assume we have a (multi)set of nontrivial intervals $\mathcal{I} = \{I_1,...,I_n\}$ and for any two $I_i, I_j \in \mathcal{I}$, we have that $I_i \cap I_j$ is trivial (that is: contains at most one point), or one o... | habedi/stack-exchange-dataset |
38,049 | Why are reversible gates not used? | <p>I was reading the book "The singularity is near" written by Kurzweil and he mentioned the reversible gates like for example the <a href="http://en.wikipedia.org/wiki/Fredkin_gate">Fredkin gate</a>. The advantage using such gates is that we could get rid of the thermal waste related to computation where bits just dis... | computer architecture | 1 | Why are reversible gates not used? -- (computer architecture)
<p>I was reading the book "The singularity is near" written by Kurzweil and he mentioned the reversible gates like for example the <a href="http://en.wikipedia.org/wiki/Fredkin_gate">Fredkin gate</a>. The advantage using such gates is that we could get rid o... | habedi/stack-exchange-dataset |
38,058 | Arbitrary Programs that Halt | <p>I've been learning about Theory of Computation lately, and i'm trying to link general programming with the Theory of Computation. I thought of considering any arbitrary program that halts, as an algorithm for solving some specific computational problem in the sense of Theory of Computation. </p>

<p>For s... | computability turing machines | 1 | Arbitrary Programs that Halt -- (computability turing machines)
<p>I've been learning about Theory of Computation lately, and i'm trying to link general programming with the Theory of Computation. I thought of considering any arbitrary program that halts, as an algorithm for solving some specific computational problem... | habedi/stack-exchange-dataset |
38,067 | Integer Programming Traveling Salesman - Checking if Tour is Complete | <p>I'm reading a Wikipedia article on the Traveling Salesman problem as an Integer Programming formulation (<a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem" rel="nofollow">http://en.wikipedia.org/wiki/Travelling_salesman_problem</a>). The authors have all their constraints and I don't understand the f... | traveling salesman integer programming | 1 | Integer Programming Traveling Salesman - Checking if Tour is Complete -- (traveling salesman integer programming)
<p>I'm reading a Wikipedia article on the Traveling Salesman problem as an Integer Programming formulation (<a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem" rel="nofollow">http://en.wikipe... | habedi/stack-exchange-dataset |
38,069 | Turing Machines: Arbitrary alphabet equivalence with binary alphabet | <p>Think of an $n$-ary alphabet as $\{0, 1, ..., n-1, n\}$. For example, a binary alphabet is $\{0, 1\}$.</p>

<blockquote>
 <p>Do <strong>Turing Machines</strong> with binary alphabets decide the same set of languages as Turing Machines with $3$+ symbol alphabets? </p>
</blockquote>

<p>I am u... | turing machines | 1 | Turing Machines: Arbitrary alphabet equivalence with binary alphabet -- (turing machines)
<p>Think of an $n$-ary alphabet as $\{0, 1, ..., n-1, n\}$. For example, a binary alphabet is $\{0, 1\}$.</p>

<blockquote>
 <p>Do <strong>Turing Machines</strong> with binary alphabets decide the same set of language... | habedi/stack-exchange-dataset |
38,081 | Proof via induction for small-step semantics | <p>I'm doing a course in Computer Programming Languages and I'm trying to prove the following (roughly following Pierce's Types and Programming Languages book):</p>

<p>if $t \rightarrow^* t'$ then $if\; t\; then \; t2 \; else \; t3 \rightarrow^* if\; t'\; then \; t2 \; else \; t3$</p>

<p>I'm a little ... | programming languages proof techniques semantics operational semantics | 1 | Proof via induction for small-step semantics -- (programming languages proof techniques semantics operational semantics)
<p>I'm doing a course in Computer Programming Languages and I'm trying to prove the following (roughly following Pierce's Types and Programming Languages book):</p>

<p>if $t \rightarrow^* t'... | habedi/stack-exchange-dataset |
38,085 | Let A,B be languages. If A is decidable and B undecidable, then A reducible to B | <p>So I'm learning for an upcoming exam and there's a specific problem which I can't show:</p>

<blockquote>
 <p>Let A be decidable and B undecidable, then $A \le B$</p>
</blockquote>

<p>Can someone give me a hint how to solve that? Furthermore, does that mean, that every decidable language is... | computability reductions undecidability | 1 | Let A,B be languages. If A is decidable and B undecidable, then A reducible to B -- (computability reductions undecidability)
<p>So I'm learning for an upcoming exam and there's a specific problem which I can't show:</p>

<blockquote>
 <p>Let A be decidable and B undecidable, then $A \le B$</p>
</block... | habedi/stack-exchange-dataset |
38,094 | Fast solution for a combinatorial maximizaton problem | <p>You are given a natural number n (n<20). We construct the set S from all binary numbers with n bits. We call two numbers "compatible" if they don't have any common substring of length n-1 (consisted of not necessarily consecutive bits). Now we have to find the maximum number from the numbers in S so that every pa... | algorithms optimization combinatorics | 1 | Fast solution for a combinatorial maximizaton problem -- (algorithms optimization combinatorics)
<p>You are given a natural number n (n<20). We construct the set S from all binary numbers with n bits. We call two numbers "compatible" if they don't have any common substring of length n-1 (consisted of not necessarily... | habedi/stack-exchange-dataset |
38,095 | What happens when there is a branch mispredict and an interrupt occurs? | <p>There is a branch mispredict and while executing the false code, an interrupt occurs (for example a keyboard interrupt). The EPC (register that holds the return address) now holds the wrong return address (after the interrupt handler has finished, it would return in code that wasn't even meant to be executed). How d... | computer architecture | 1 | What happens when there is a branch mispredict and an interrupt occurs? -- (computer architecture)
<p>There is a branch mispredict and while executing the false code, an interrupt occurs (for example a keyboard interrupt). The EPC (register that holds the return address) now holds the wrong return address (after the in... | habedi/stack-exchange-dataset |
38,098 | Math in computer science is hard? | <p>I am in High School (P.R.) and I am a regular person in math. Should I try computer science?</p>
 | education | 1 | Math in computer science is hard? -- (education)
<p>I am in High School (P.R.) and I am a regular person in math. Should I try computer science?</p>
 | habedi/stack-exchange-dataset |
38,114 | Verifying a solution vs. finding one | <p>There is an algorithmic problem $A(n)$, where $n$ is the size of the problem. </p>

<p>It is known that, for every candidate solution S, the time it takes to verify whether it is a correct solution to $A(n)$ is $T(n)$.</p>

<ol>
<li><p>Does this imply a lower bound on the time it takes to find a ... | complexity theory runtime analysis | 1 | Verifying a solution vs. finding one -- (complexity theory runtime analysis)
<p>There is an algorithmic problem $A(n)$, where $n$ is the size of the problem. </p>

<p>It is known that, for every candidate solution S, the time it takes to verify whether it is a correct solution to $A(n)$ is $T(n)$.</p>

... | habedi/stack-exchange-dataset |
38,119 | Naive Bayes MapReduce | <p>I have the following question to answer in a MapReduce assignment sheet</p>
<blockquote>
<p>The <strong>Naive Bayes classifier</strong> is a widely-used tool for analyzing data. Consider a data set that has <span class="math-container">$n$</span> data items, each of which has the same <span class="math-conta... | probability theory database theory | 1 | Naive Bayes MapReduce -- (probability theory database theory)
<p>I have the following question to answer in a MapReduce assignment sheet</p>
<blockquote>
<p>The <strong>Naive Bayes classifier</strong> is a widely-used tool for analyzing data. Consider a data set that has <span class="math-container">$n$</span> ... | habedi/stack-exchange-dataset |
38,120 | How does a regular language satisfies the second condition of the pumping lemma | <p>I'm a little bit confused about the second condition of the pumping lemma which are:</p>
<blockquote>
<ol>
<li><span class="math-container">$|y|\geq1$</span></li>
<li><span class="math-container">$|xy|\leq p$</span></li>
<li><span class="math-container">$\forall i \geq 0 : x y^i z \in L$</span></... | formal languages regular languages pumping lemma | 1 | How does a regular language satisfies the second condition of the pumping lemma -- (formal languages regular languages pumping lemma)
<p>I'm a little bit confused about the second condition of the pumping lemma which are:</p>
<blockquote>
<ol>
<li><span class="math-container">$|y|\geq1$</span></li>
<li>... | habedi/stack-exchange-dataset |
38,121 | Average Time Complexity of Searching An Array | <p>Why is the average time complexity of searching an array $O(n)$? Is it because if the element does not exist, then $n$ searches must be done. If the element is at the end of the array then $n$ must also be done, so $\frac{2n}{2} = n$?</p>
 | algorithm analysis runtime analysis average case | 1 | Average Time Complexity of Searching An Array -- (algorithm analysis runtime analysis average case)
<p>Why is the average time complexity of searching an array $O(n)$? Is it because if the element does not exist, then $n$ searches must be done. If the element is at the end of the array then $n$ must also be done, so $\... | habedi/stack-exchange-dataset |
38,132 | I/O in Theory of Computation | <p>I posted a question "Arbitrary Programs that halt" some days ago and now i think my doubt is a lot more clear. </p>

<p>I concluded that in any arbitrary program that halts, control flow operations, calculation operations ( 2+3 , "1 && 0", etc ) and memory assignment ( x:= "Hello" ) can be easily ... | turing machines computation models | 1 | I/O in Theory of Computation -- (turing machines computation models)
<p>I posted a question "Arbitrary Programs that halt" some days ago and now i think my doubt is a lot more clear. </p>

<p>I concluded that in any arbitrary program that halts, control flow operations, calculation operations ( 2+3 , "1 &... | habedi/stack-exchange-dataset |
38,141 | Why system calls via interrupts are slow and thus we have SYSENTER/SYSEXIT instructions? | <p>As far as I understand we got SYSENTER/SYSEXIT instructions because system calls via interrupts were slow (right? I might be wrong though). Therefore my question is why system calls via interrupts are slow? And how do we optimize them via SYSENTER/SYSEXIT instructions? Thank you</p>
 | operating systems | 1 | Why system calls via interrupts are slow and thus we have SYSENTER/SYSEXIT instructions? -- (operating systems)
<p>As far as I understand we got SYSENTER/SYSEXIT instructions because system calls via interrupts were slow (right? I might be wrong though). Therefore my question is why system calls via interrupts are slow... | habedi/stack-exchange-dataset |
38,150 | FP^NP-complete problems | <p>Is there any other standard FP^NP-complete problem other than the Traveling Salesman Problem? For instance, in the canonical propositional logic?</p>
 | complexity theory complexity classes propositional logic | 1 | FP^NP-complete problems -- (complexity theory complexity classes propositional logic)
<p>Is there any other standard FP^NP-complete problem other than the Traveling Salesman Problem? For instance, in the canonical propositional logic?</p>
 | habedi/stack-exchange-dataset |
38,157 | Whats is the meaning of polynomial run-time in input size ? | <p>If an algorithm runs in exponential time with exponential input then we say it runs in polynomial time ?
Why ? 
Doesn't the algorithm run in exponential time anyway ? 
How the input size affects ? 
Thanks.</p>
 | complexity theory time complexity pseudo polynomial | 1 | Whats is the meaning of polynomial run-time in input size ? -- (complexity theory time complexity pseudo polynomial)
<p>If an algorithm runs in exponential time with exponential input then we say it runs in polynomial time ?
Why ? 
Doesn't the algorithm run in exponential time anyway ? 
How the input size a... | habedi/stack-exchange-dataset |
38,205 | When was the terminology *tracing collector* introduced to denote both mark-and-sweep and copy collectors | <p>Automatic storage reclamation, aka garbage collection, comes in two
main families, sometimes cooperating: the reference count collectors
and the tracing collectors. I may develop specifics of each family if
there is demand for it but my question is about tracing collectors.</p>

<p>Tracing collec... | terminology programming languages memory management garbage collection | 1 | When was the terminology *tracing collector* introduced to denote both mark-and-sweep and copy collectors -- (terminology programming languages memory management garbage collection)
<p>Automatic storage reclamation, aka garbage collection, comes in two
main families, sometimes cooperating: the reference count colle... | habedi/stack-exchange-dataset |
38,206 | What is a compact model? | <p>I am a domain scientist and I study biophysical systems. When I asked a colleague in CS for suggestions about how to design a multi-scale simulator, he mentioned the term "compact model".</p>

<p>Now, I can't find a very good definition of this term. I can find the book <a href="http://www.worldcat.org/title... | terminology | 1 | What is a compact model? -- (terminology)
<p>I am a domain scientist and I study biophysical systems. When I asked a colleague in CS for suggestions about how to design a multi-scale simulator, he mentioned the term "compact model".</p>

<p>Now, I can't find a very good definition of this term. I can find the b... | habedi/stack-exchange-dataset |
38,207 | Complexity of 4-coloring a map with constraints | <p>The well-known <a href="http://en.wikipedia.org/wiki/Four_color_theorem" rel="nofollow noreferrer">Four color theorem</a> states that every map which is divided into regions, can be colored using 4 colors such that no two adjacent regions have the same color.</p>
<p>In fact, <a href="http://people.math.gatech.ed... | complexity theory graphs colorings parameterized complexity planar graphs | 1 | Complexity of 4-coloring a map with constraints -- (complexity theory graphs colorings parameterized complexity planar graphs)
<p>The well-known <a href="http://en.wikipedia.org/wiki/Four_color_theorem" rel="nofollow noreferrer">Four color theorem</a> states that every map which is divided into regions, can be colored ... | habedi/stack-exchange-dataset |
38,213 | Omega-Language to Büchi automaton | <p>I'm currently preparing a presentation about LTL and a book says that the language $L = (a(a \cup b))^\omega$ cannot be described by any LTL (or FO) formula which is understandable but how does the corresponding Büchi automaton $\mathcal{A}$ look like with $L(\mathcal{A}) = L$?</p>
 | automata buchi automata | 1 | Omega-Language to Büchi automaton -- (automata buchi automata)
<p>I'm currently preparing a presentation about LTL and a book says that the language $L = (a(a \cup b))^\omega$ cannot be described by any LTL (or FO) formula which is understandable but how does the corresponding Büchi automaton $\mathcal{A}$ look like wi... | habedi/stack-exchange-dataset |
38,224 | Creating an K-nary tree that is balanced in both width and depth for N nodes. N known a priori | <p>Given N items you want to put into a tree, think very generally here like a phone tree, and your goal is to keep the tree from getting "too wide" and "too deep". How many children (K) do you put at each node?</p>

<p>I seem to recall hearing of some proof, many years ago, K was best when set to Euler's numbe... | data structures trees | 1 | Creating an K-nary tree that is balanced in both width and depth for N nodes. N known a priori -- (data structures trees)
<p>Given N items you want to put into a tree, think very generally here like a phone tree, and your goal is to keep the tree from getting "too wide" and "too deep". How many children (K) do you put ... | habedi/stack-exchange-dataset |
38,226 | What do CPUs do when a program aborts with an error? | <p>If a very severe interrupt occurs, say a divide by zero, this will quit the program. How is this done, is there a special instruction in the processor or is it a software routine? And after quitting the program, where will the CPU jump to?</p>
 | computer architecture operating systems | 1 | What do CPUs do when a program aborts with an error? -- (computer architecture operating systems)
<p>If a very severe interrupt occurs, say a divide by zero, this will quit the program. How is this done, is there a special instruction in the processor or is it a software routine? And after quitting the program, where w... | habedi/stack-exchange-dataset |
38,233 | generating recursive descent parser | <p>I have a grammar,</p>

<p>$L \to A \langle A \rangle^*$ </p>

<p>$A \to () \mid (L)$</p>

<p>but I am not sure how to generate parser for $\langle A \rangle$. I know in other case, for example, if $E \to T \langle^*T\rangle^*$ then I can create parser like </p>

<pre><code>proc E begi... | algorithms context free formal grammars parsers syntax | 1 | generating recursive descent parser -- (algorithms context free formal grammars parsers syntax)
<p>I have a grammar,</p>

<p>$L \to A \langle A \rangle^*$ </p>

<p>$A \to () \mid (L)$</p>

<p>but I am not sure how to generate parser for $\langle A \rangle$. I know in other case, for example, if ... | habedi/stack-exchange-dataset |
38,244 | How can Weighted MaxSAT be in $FP^{NP}$ when dealing with large weights? | <p>Weighted MaxSAT is in $\mathrm{FP^{NP}}$, see [1] Theorem 17.4, i.e. Weighted MaxSAT can be solved with at most a polynomial number of calls to a SAT oracle.</p>

<p>The proof in [1] makes use of binary search with a search space from weight $0$ to the sum of all weights. But I am struggling with the fact th... | complexity theory np hard | 1 | How can Weighted MaxSAT be in $FP^{NP}$ when dealing with large weights? -- (complexity theory np hard)
<p>Weighted MaxSAT is in $\mathrm{FP^{NP}}$, see [1] Theorem 17.4, i.e. Weighted MaxSAT can be solved with at most a polynomial number of calls to a SAT oracle.</p>

<p>The proof in [1] makes use of binary se... | habedi/stack-exchange-dataset |
38,248 | What do we know about NP ∩ co-NP and its relation to NPI? | <p>A TA dropped by today to inquire some things about NP and co-NP.
We arrived at a point where I was stumped, too: what does a Venn diagram of
P, NPI, NP, and co-NP look like assuming P ≠ NP (the other case is boring)?</p>

<p>There seem to be four basic options.</p>

<ol>
<li><p>NP ∩ co-NP... | complexity theory reference request complexity classes np | 1 | What do we know about NP ∩ co-NP and its relation to NPI? -- (complexity theory reference request complexity classes np)
<p>A TA dropped by today to inquire some things about NP and co-NP.
We arrived at a point where I was stumped, too: what does a Venn diagram of
P, NPI, NP, and co-NP look like assuming P ≠ NP... | habedi/stack-exchange-dataset |
38,254 | The XOR cut-set structure, and combinatorial designs | <p>Given a graph $G(V,E)$ and a subset of vertices $T \subseteq V$, define $\mathsf{cutset}(T)$ = the set of edges connecting a vertex at $T$ with a vertex at $V\setminus T$.</p>

<p>Our goal is to preprocess $G$ such that, given any set $T$, we can quickly return an edge in $\mathsf{cutset}(T)$, or reply that ... | data structures combinatorics | 1 | The XOR cut-set structure, and combinatorial designs -- (data structures combinatorics)
<p>Given a graph $G(V,E)$ and a subset of vertices $T \subseteq V$, define $\mathsf{cutset}(T)$ = the set of edges connecting a vertex at $T$ with a vertex at $V\setminus T$.</p>

<p>Our goal is to preprocess $G$ such that, ... | habedi/stack-exchange-dataset |
38,258 | Can there be two different left most derevations for a grammar? | <p>Suppose there is a CFG with the rules</p>

<pre><code>S--> Aa
A--> Bb
B--> A
B--> Epsilon
</code></pre>

<p>To my best understanding the left most derivation would go like this..</p>

<pre><code> S==> Aa ==> Bba ==> Aba ==> Bbba ==> bba
</code><... | context free formal grammars ambiguity | 1 | Can there be two different left most derevations for a grammar? -- (context free formal grammars ambiguity)
<p>Suppose there is a CFG with the rules</p>

<pre><code>S--> Aa
A--> Bb
B--> A
B--> Epsilon
</code></pre>

<p>To my best understanding the left most derivation would g... | habedi/stack-exchange-dataset |
38,278 | Removing arbitrary element from Max Heap | <p>Which of the following strategies is more feasible?</p>

<ul>
<li>Strategy 1: Remove the element from the array, compress the array and reheapify.</li>
<li>Strategy 2: Update the value of this node to the current maximum value in the heap + 1, then delete_max.</li>
</ul>
 | data structures heaps | 1 | Removing arbitrary element from Max Heap -- (data structures heaps)
<p>Which of the following strategies is more feasible?</p>

<ul>
<li>Strategy 1: Remove the element from the array, compress the array and reheapify.</li>
<li>Strategy 2: Update the value of this node to the current maximum value in the... | habedi/stack-exchange-dataset |
38,281 | Primitive recursive functions and unbounded quantifiers | <p>From what I know If the predicate $P(t,x_1,...,x_n)$ belongs to some PRC class $\zeta$ then so do the predicates</p>

<p>$(\forall t)_{\le y}$ $P(t,x_1,...,x_n)$</p>

<p>$(\exists t)_{\le y}$ $P(t,x_1,...,x_n)$</p>

<p>But what about the unbounded quantifier? what differ... | computability primitive recursion | 1 | Primitive recursive functions and unbounded quantifiers -- (computability primitive recursion)
<p>From what I know If the predicate $P(t,x_1,...,x_n)$ belongs to some PRC class $\zeta$ then so do the predicates</p>

<p>$(\forall t)_{\le y}$ $P(t,x_1,...,x_n)$</p>

<p>$(\exists t)_{\le y}$&nbs... | habedi/stack-exchange-dataset |
38,283 | Books on how to approach an IT research subject? | <p>Are there any recommended books or other sources about research in IT?</p>

<p>For example, I want to do some research on the subject 'Internet of things'. What would be the best way to approach this? What methods should I use?</p>
 | books research | 1 | Books on how to approach an IT research subject? -- (books research)
<p>Are there any recommended books or other sources about research in IT?</p>

<p>For example, I want to do some research on the subject 'Internet of things'. What would be the best way to approach this? What methods should I use?</p>
 | habedi/stack-exchange-dataset |
38,284 | Hates Pepole Nice Algorithm | <p>Some people in <code>n</code> groups, hates from each others. the hates relation are symmetric. (a hates b, b hates a, also). suppose we know list of all people that hates from others. (which one hates from which ones...). we want to divide these people into two groups such that no one in each group hates from other... | algorithms assignment problem algorithm design | 1 | Hates Pepole Nice Algorithm -- (algorithms assignment problem algorithm design)
<p>Some people in <code>n</code> groups, hates from each others. the hates relation are symmetric. (a hates b, b hates a, also). suppose we know list of all people that hates from others. (which one hates from which ones...). we want to div... | habedi/stack-exchange-dataset |
38,286 | Generalisation of pancake sorting with arbitrary flipped slices? | <p>In <a href="http://en.wikipedia.org/wiki/Pancake_sorting" rel="nofollow">pancake sort</a>, the primary operation is: flip all pancakes <strong>above</strong> a given position. What about flipping all pancakes <strong>between</strong> two given positions? Anybody knows if this has been studied?</p>

<p>To ill... | algorithms sorting | 1 | Generalisation of pancake sorting with arbitrary flipped slices? -- (algorithms sorting)
<p>In <a href="http://en.wikipedia.org/wiki/Pancake_sorting" rel="nofollow">pancake sort</a>, the primary operation is: flip all pancakes <strong>above</strong> a given position. What about flipping all pancakes <strong>between</st... | habedi/stack-exchange-dataset |
38,314 | Method for Creating Any Unambiguous Grammar? | <p>I'm in an undergraduate class where we're studying formal grammars right now. I asked my teacher if there was any known set of rules for creating context free grammars that</p>

<ol>
<li>Was guaranteed to produce an unambiguous grammar. </li>
<li>Allows for the creation of any possible unambiguous gr... | context free formal grammars ambiguity | 1 | Method for Creating Any Unambiguous Grammar? -- (context free formal grammars ambiguity)
<p>I'm in an undergraduate class where we're studying formal grammars right now. I asked my teacher if there was any known set of rules for creating context free grammars that</p>

<ol>
<li>Was guaranteed to produce an ... | habedi/stack-exchange-dataset |
38,316 | Entropy notation: What does this mean? | <p>If you look at page 13 of the lecture slides <a href="http://www.fi.muni.cz/~xbouda1/teaching/2010/IV111/lecture9.pdf" rel="nofollow">here</a> there is this line</p>

<p>$H(Y) = H((1-\pi)(1-\alpha), \alpha, \pi(1-\alpha))$</p>

<p>I don't really understand what the term on right hand side is. At firs... | information theory entropy | 1 | Entropy notation: What does this mean? -- (information theory entropy)
<p>If you look at page 13 of the lecture slides <a href="http://www.fi.muni.cz/~xbouda1/teaching/2010/IV111/lecture9.pdf" rel="nofollow">here</a> there is this line</p>

<p>$H(Y) = H((1-\pi)(1-\alpha), \alpha, \pi(1-\alpha))$</p>

<p... | habedi/stack-exchange-dataset |
38,323 | Combine abstract factory with decorator pattern | <p>I'm working on a simple project of software engineering that should combine two patterns. 
I choose Abstract Factory and Decorator patterns to modify (dynamically) objects created with the concrete Factory classes.
My question is: is delegating object decorations to those Factory classes a design error?</p>&... | software engineering object oriented design patterns | 1 | Combine abstract factory with decorator pattern -- (software engineering object oriented design patterns)
<p>I'm working on a simple project of software engineering that should combine two patterns. 
I choose Abstract Factory and Decorator patterns to modify (dynamically) objects created with the concrete Factory c... | habedi/stack-exchange-dataset |
38,327 | Is the number of inequivalent elementary cellular automata rules really 88? | <p>Everywhere from Wolfram's "New Kind of Science" (p. 57) to <a href="http://en.wikipedia.org/wiki/Elementary_cellular_automaton#Reflections_and_complements" rel="nofollow">Wikipedia</a> they say that, out of all possible 256 (=2^8) elementary cellular automata rules, 88 are inequivalent (as defined in the Wikipedia a... | automata combinatorics cellular automata | 1 | Is the number of inequivalent elementary cellular automata rules really 88? -- (automata combinatorics cellular automata)
<p>Everywhere from Wolfram's "New Kind of Science" (p. 57) to <a href="http://en.wikipedia.org/wiki/Elementary_cellular_automaton#Reflections_and_complements" rel="nofollow">Wikipedia</a> they say t... | habedi/stack-exchange-dataset |
38,330 | A partition algorithm | <p>I have encountered the following problem that I found very interesting to solve:</p>

<blockquote>
 <p>Given an array of positive integers $\{a_1, a_2, ..., a_n\}$ you are required
 to partition the array into $3$ blocks/partitions such that the maximum
 of sums of integers in each partition i... | algorithms arrays partition problem | 1 | A partition algorithm -- (algorithms arrays partition problem)
<p>I have encountered the following problem that I found very interesting to solve:</p>

<blockquote>
 <p>Given an array of positive integers $\{a_1, a_2, ..., a_n\}$ you are required
 to partition the array into $3$ blocks/partitions such... | habedi/stack-exchange-dataset |
38,336 | Unification --- removing equations and updating the solution | <p>This question is concerned with the first order unification. Suppose I have a set $D$ of equations and a solution to these equations. Let this solution be a set $S$ of substitutions. Now, suppose I remove some equations from $D$. Is there an algorithm that just uses these removed equations and quickly updates $D$, o... | algorithms logic unification | 1 | Unification --- removing equations and updating the solution -- (algorithms logic unification)
<p>This question is concerned with the first order unification. Suppose I have a set $D$ of equations and a solution to these equations. Let this solution be a set $S$ of substitutions. Now, suppose I remove some equations fr... | habedi/stack-exchange-dataset |
38,337 | Digital Image Processing | <p>I'm a Computer Science Graduate but I didn't study digital image processing during my college years. Now I'm thinking of learning it, but I'm little bit confused about where to start.</p>

<p>Is there any short series of undergrad-level lectures that I can follow, combined with any hands-on mini project (lik... | education image processing | 1 | Digital Image Processing -- (education image processing)
<p>I'm a Computer Science Graduate but I didn't study digital image processing during my college years. Now I'm thinking of learning it, but I'm little bit confused about where to start.</p>

<p>Is there any short series of undergrad-level lectures that I... | habedi/stack-exchange-dataset |
38,344 | True or False: If $A \subseteq \{0,1\}^* \Rightarrow A^*$ is semi-decidable | <p>Question: Is the following statement true or false?</p>

<p>If $A \subseteq \{0,1\}^* \Rightarrow A^*$ is semi-decidable</p>

<p>I thought that since every language is automatically of type 0, it follows that $A \in RE$, and since RE is closed under the Kleene star operator, it follows that $A^* \in ... | formal languages semi decidability | 1 | True or False: If $A \subseteq \{0,1\}^* \Rightarrow A^*$ is semi-decidable -- (formal languages semi decidability)
<p>Question: Is the following statement true or false?</p>

<p>If $A \subseteq \{0,1\}^* \Rightarrow A^*$ is semi-decidable</p>

<p>I thought that since every language is automatically of ... | habedi/stack-exchange-dataset |
38,357 | Is it really possible to prove lower bounds? | <p>Given any computational problem, is the task of finding lower bounds for such computation really possible? I suppose it boils down to how a single computational step is defined and what model we use for the proof, but given that, do we really prove a lower bound then in general? What I means is that can we prove som... | complexity theory time complexity proof techniques lower bounds | 1 | Is it really possible to prove lower bounds? -- (complexity theory time complexity proof techniques lower bounds)
<p>Given any computational problem, is the task of finding lower bounds for such computation really possible? I suppose it boils down to how a single computational step is defined and what model we use for ... | habedi/stack-exchange-dataset |
38,364 | What Programming Languages a Computer Science Engineer must learn | <p>During my college I studied C/C++, C#.Net and ASP.Net. Now one my friend suggested me to learn Python & MATLAB also. He wasn't much specific why to learn these languages, He said it would be helpful to get a job with these languages. I've also seen lots of good resume, mostly they have Python (Scripting Language... | programming languages | 1 | What Programming Languages a Computer Science Engineer must learn -- (programming languages)
<p>During my college I studied C/C++, C#.Net and ASP.Net. Now one my friend suggested me to learn Python & MATLAB also. He wasn't much specific why to learn these languages, He said it would be helpful to get a job with the... | habedi/stack-exchange-dataset |
38,375 | What is an edge hop? | <p>I've tried googling it, but found nothing. Here is the context it's in:</p>

<p>From <em>Bayesian Reasoning and Machine Learning</em>:</p>

<p>Adjacency matrices may seem wasteful since many of the entries are zero. However, they have a useful property that more than redeems them. For an N x N adjace... | graphs machine learning | 1 | What is an edge hop? -- (graphs machine learning)
<p>I've tried googling it, but found nothing. Here is the context it's in:</p>

<p>From <em>Bayesian Reasoning and Machine Learning</em>:</p>

<p>Adjacency matrices may seem wasteful since many of the entries are zero. However, they have a useful propert... | habedi/stack-exchange-dataset |
38,380 | Data Structure for Representing a Math Expression | <p>I'm looking to improve my object-oriented design skills and I came across a problem which asked to design classes to represent a mathematical expression such as (a + b) * ( c - d / e) in memory so that it could be evaluated (by adding an evaluate method if need be in the class some time later)</p>

<p>The si... | data structures binary trees stacks | 1 | Data Structure for Representing a Math Expression -- (data structures binary trees stacks)
<p>I'm looking to improve my object-oriented design skills and I came across a problem which asked to design classes to represent a mathematical expression such as (a + b) * ( c - d / e) in memory so that it could be evaluated (b... | habedi/stack-exchange-dataset |
38,382 | Differences in Postfix Syntax | <p>A question about postfix/RPN came up in my class due to the current ACSL competition. Is it a rule or convention that <strong>4 + (5 * 6)</strong> in infix is written <strong>4 5 6 * +</strong> in postfix, as opposed to <strong>5 6 * 4 +</strong> in postfix? When the second postfix example is translated into infix, ... | notation syntax | 1 | Differences in Postfix Syntax -- (notation syntax)
<p>A question about postfix/RPN came up in my class due to the current ACSL competition. Is it a rule or convention that <strong>4 + (5 * 6)</strong> in infix is written <strong>4 5 6 * +</strong> in postfix, as opposed to <strong>5 6 * 4 +</strong> in postfix? When th... | habedi/stack-exchange-dataset |
38,397 | Is it possible to make excluded search with for loop in Java? | <p>I am trying to calculate all pure strategy Nash equilibrium in a mxn game. It requires to check all pure strategy pairs (m.n pairs). Suppose player 1 has m strategies. Algorithm should start with the first pair (1,1) and compare (1,1) with (2,1),(3,1),...(m,1). </p>

<p>Same for all strategies, exp: (3,4) is... | search algorithms game theory java | 1 | Is it possible to make excluded search with for loop in Java? -- (search algorithms game theory java)
<p>I am trying to calculate all pure strategy Nash equilibrium in a mxn game. It requires to check all pure strategy pairs (m.n pairs). Suppose player 1 has m strategies. Algorithm should start with the first pair (1,1... | habedi/stack-exchange-dataset |
38,404 | What are the practical uses of ontologies? | <p>I have read many papers and books about <a href="http://en.wikipedia.org/wiki/Ontology_%28information_science%29" rel="nofollow">ontologies</a> and I am trying to figure out that how they are used in a real project?</p>

<p>For example how the ontology for a soccer player robot can be defined and used with a... | artificial intelligence applied theory knowledge representation ontologies robotics | 1 | What are the practical uses of ontologies? -- (artificial intelligence applied theory knowledge representation ontologies robotics)
<p>I have read many papers and books about <a href="http://en.wikipedia.org/wiki/Ontology_%28information_science%29" rel="nofollow">ontologies</a> and I am trying to figure out that how th... | habedi/stack-exchange-dataset |
38,410 | Stack memory questions | <p>Are data and return addresses both pushed on the same stack space?
If yes, couldn't this piece of code cause problems:</p>

<pre><code>CALL r1 //the PC is now the contents of register 1, return address is pushed on the stack. 
POP r2 //pop the top of the stack and put the data in register 2. 
... | computer architecture stacks | 1 | Stack memory questions -- (computer architecture stacks)
<p>Are data and return addresses both pushed on the same stack space?
If yes, couldn't this piece of code cause problems:</p>

<pre><code>CALL r1 //the PC is now the contents of register 1, return address is pushed on the stack. 
POP r2 //pop th... | habedi/stack-exchange-dataset |
38,419 | What do we call a function that outputs 0 on half and 1 on the other half of all inputs? | <p>I have a Boolean function that outputs a one on half of its inputs and outputs a zero on half of its inputs, the inputs are assumed to be coming from the uniform distribution. Another way of saying this is the output is one half the time and zero half the time, on average. What is the scientific notation for describ... | terminology mathematical foundations | 1 | What do we call a function that outputs 0 on half and 1 on the other half of all inputs? -- (terminology mathematical foundations)
<p>I have a Boolean function that outputs a one on half of its inputs and outputs a zero on half of its inputs, the inputs are assumed to be coming from the uniform distribution. Another wa... | habedi/stack-exchange-dataset |
38,426 | Is a k counter automata a special kind of PDA? | <p>I understand that a 1 counter automata is a special kind of PDA where the stack alphabet consists of one symbol (ignoring the fixed bottom symbol) but what about 2 counter automata? Is it a special kind of PDA where the stack alphabet consists of two symbols? Can we generalize like so: a k-counter automata is a PDA ... | automata pushdown automata computation models | 1 | Is a k counter automata a special kind of PDA? -- (automata pushdown automata computation models)
<p>I understand that a 1 counter automata is a special kind of PDA where the stack alphabet consists of one symbol (ignoring the fixed bottom symbol) but what about 2 counter automata? Is it a special kind of PDA where the... | habedi/stack-exchange-dataset |
38,429 | How to interpret the execution of distributed computation from time-space diagram? | <p>I'm following a course on Distributed Systems </p>

<p><a href="http://www.ict.kth.se/courses/ID2203/index.html" rel="nofollow">http://www.ict.kth.se/courses/ID2203/index.html</a> </p>

<p>and currently learning about asynchronous models. I can't seem to reconcile a given time-space diagram of an exe... | distributed systems | 1 | How to interpret the execution of distributed computation from time-space diagram? -- (distributed systems)
<p>I'm following a course on Distributed Systems </p>

<p><a href="http://www.ict.kth.se/courses/ID2203/index.html" rel="nofollow">http://www.ict.kth.se/courses/ID2203/index.html</a> </p>

<p>and ... | habedi/stack-exchange-dataset |
38,434 | What does does $O$ mean in this context? | <p>I understand big O notation in computational complexity theory, but I don't see how it applies in the equation below.</p>

<p>From <em>Pattern Recognition and Machine Learning:</em></p>

<blockquote>
 <p>If we weren't familiar with the rules of ordinary calculus, we could
 evaluate a conven... | asymptotics machine learning notation | 1 | What does does $O$ mean in this context? -- (asymptotics machine learning notation)
<p>I understand big O notation in computational complexity theory, but I don't see how it applies in the equation below.</p>

<p>From <em>Pattern Recognition and Machine Learning:</em></p>

<blockquote>
 <p>If we we... | habedi/stack-exchange-dataset |
38,451 | When is a regexp is not a Regular Expression? | <p>Since I'm studying for my formal languages college course, I stumbled upon these fascinating posts (<a href="http://neilk.net/blog/2000/06/01/abigails-regex-to-test-for-prime-numbers/" rel="nofollow noreferrer">One</a> <a href="http://blog.kenficara.com/2013/06/30/irregular-language-and-regular-expressions/" rel="no... | regular expressions | 1 | When is a regexp is not a Regular Expression? -- (regular expressions)
<p>Since I'm studying for my formal languages college course, I stumbled upon these fascinating posts (<a href="http://neilk.net/blog/2000/06/01/abigails-regex-to-test-for-prime-numbers/" rel="nofollow noreferrer">One</a> <a href="http://blog.kenfic... | habedi/stack-exchange-dataset |
38,453 | Erasing $\epsilon$ production from CFG | <p>I would like to delete the $\epsilon$-production from the context free grammar with the following rules P:</p>

<p>$$S \rightarrow ASB , BSA, \epsilon$$
$$A \rightarrow aS$$
$$B \rightarrow bB, b$$</p>

<p>Now we were only given this algorithm for that task:</p>

<ol>
<li>collect ... | context free formal grammars | 1 | Erasing $\epsilon$ production from CFG -- (context free formal grammars)
<p>I would like to delete the $\epsilon$-production from the context free grammar with the following rules P:</p>

<p>$$S \rightarrow ASB , BSA, \epsilon$$
$$A \rightarrow aS$$
$$B \rightarrow bB, b$$</p>

<p>Now we were on... | habedi/stack-exchange-dataset |
38,459 | Is this language regular or non-regular: {ww : w ∈ {a,b}* } | <p>This is a question from a text book that's giving me some trouble. The question is:</p>

<blockquote>
 <p>Determine whether or not this language is regular. Justify your answer.
 $$L = \{ww : w \in \{a,b\}^* \}$$</p>
</blockquote>

<p>I think this language is not regular because $w$ ca... | formal languages regular languages | 1 | Is this language regular or non-regular: {ww : w ∈ {a,b}* } -- (formal languages regular languages)
<p>This is a question from a text book that's giving me some trouble. The question is:</p>

<blockquote>
 <p>Determine whether or not this language is regular. Justify your answer.
 $$L = \{ww : w \in ... | habedi/stack-exchange-dataset |
38,467 | How to bridge theory and implementation for while loops? | <p>I'm working on my own little programming language for educational purposes, and I've run into a little bit of a problem. There are a few different solutions for it, but all of them seem inelegant - and from what I understand, unnecessary. But reading through the books I have and google searches, I can't find the ele... | programming languages loops language design | 1 | How to bridge theory and implementation for while loops? -- (programming languages loops language design)
<p>I'm working on my own little programming language for educational purposes, and I've run into a little bit of a problem. There are a few different solutions for it, but all of them seem inelegant - and from what... | habedi/stack-exchange-dataset |
38,469 | Can we separate P and E? | <p>Let $\mathsf E$ be deterministic exponential time with linear exponent. Do we know that the inclusion $\mathsf P\subseteq\mathsf E$ is strict? If so, what's the proof?</p>

<p>The time hierarchy immediately separates, for instance, $\mathsf E$ and $\mathsf{TIME}(2^{n\log n})$. Diagonalizing directly on $\... | complexity theory time complexity complexity classes | 1 | Can we separate P and E? -- (complexity theory time complexity complexity classes)
<p>Let $\mathsf E$ be deterministic exponential time with linear exponent. Do we know that the inclusion $\mathsf P\subseteq\mathsf E$ is strict? If so, what's the proof?</p>

<p>The time hierarchy immediately separates, for in... | habedi/stack-exchange-dataset |
38,471 | (Un)Decidability of disjoint decidable and undecidable sets | <p>I thought of this question today: given are a decidable set $A$ and undecidable set $B$ for which $A \cap B = \emptyset$. Is $A \cup B$ decidable or undecidable?</p>

<p>I am almost sure that it is undecidable but cannot come up with an argument/proof as to why, or even a counterexample.</p>
 | computability undecidability | 1 | (Un)Decidability of disjoint decidable and undecidable sets -- (computability undecidability)
<p>I thought of this question today: given are a decidable set $A$ and undecidable set $B$ for which $A \cap B = \emptyset$. Is $A \cup B$ decidable or undecidable?</p>

<p>I am almost sure that it is undecidable but c... | habedi/stack-exchange-dataset |
38,474 | Hardness of a constrained quadratic maximization | <p>Consider the following quadratic maximization:
\begin{align}
\max_{\mathbf{x} \in \mathcal{X}} &\quad\mathbf{x}^{T}\mathbf{A}\mathbf{x}
\end{align}
with
\begin{align}
\mathcal{X} = \lbrace
\mathbf{x} \in \mathbb{R}^{n} :~ \|\mathbf{x}\|_{2}=1, \|\mathbf{x}\|_{0}\le k
\rbrace,
... | complexity theory optimization np hard | 1 | Hardness of a constrained quadratic maximization -- (complexity theory optimization np hard)
<p>Consider the following quadratic maximization:
\begin{align}
\max_{\mathbf{x} \in \mathcal{X}} &\quad\mathbf{x}^{T}\mathbf{A}\mathbf{x}
\end{align}
with
\begin{align}
\mathcal{X} = \lbrace
\ma... | habedi/stack-exchange-dataset |
38,475 | Does the proof of undecidability of the Halting Problem cheat by reversing results? | <p>I have trouble understanding Turing's halting problem.</p>

<p>His proof assumes that there exists a magical machine $H$ which could determine whether a computer would halt or loop forever for a given input. Then we attach another machine that reverses the output and we have a contradiction and therefore $H$... | computability halting problem | 1 | Does the proof of undecidability of the Halting Problem cheat by reversing results? -- (computability halting problem)
<p>I have trouble understanding Turing's halting problem.</p>

<p>His proof assumes that there exists a magical machine $H$ which could determine whether a computer would halt or loop forever f... | habedi/stack-exchange-dataset |
38,482 | Subgraph isomorphism in planar graphs | <p>I'm a computer engineer trying to understand this <a href="https://www.ics.uci.edu/~eppstein/pubs/Epp-TR-94-25.pdf" rel="nofollow">Eppstein paper</a> for matching subgraphs in planar graphs.</p>

<p>I'm trying to find subgraph matches to map an application graph (the subgraph) to a network-on-chip (the large... | algorithms graphs graph isomorphism planar graphs | 1 | Subgraph isomorphism in planar graphs -- (algorithms graphs graph isomorphism planar graphs)
<p>I'm a computer engineer trying to understand this <a href="https://www.ics.uci.edu/~eppstein/pubs/Epp-TR-94-25.pdf" rel="nofollow">Eppstein paper</a> for matching subgraphs in planar graphs.</p>

<p>I'm trying to fin... | habedi/stack-exchange-dataset |
39,496 | Questions on Graph and Hamiltonian | <p>From <a href="https://books.google.com/books?id=8535vmYbLGYC&pg=PA400&lpg=PA400&dq=whether%20a%20graph%20is%20%20%22not%20Hamiltonian%22%20is%20an%20NP-complete%20problem&source=bl&ots=pi_z-iZrnP&sig=RYHYyl0woD6pQgGYSa7M_STxbpw&hl=en&sa=X&ei=RHbjVLyRFoH1Uu_5gZgN&ved=0CMgBEOgBM... | complexity theory graphs np complete np hard decision problem | 1 | Questions on Graph and Hamiltonian -- (complexity theory graphs np complete np hard decision problem)
<p>From <a href="https://books.google.com/books?id=8535vmYbLGYC&pg=PA400&lpg=PA400&dq=whether%20a%20graph%20is%20%20%22not%20Hamiltonian%22%20is%20an%20NP-complete%20problem&source=bl&ots=pi_z-iZrnP... | habedi/stack-exchange-dataset |
39,497 | Confusion about example in Raft consensus paper | <p>In part (c) of Figure 8 in this paper <a href="http://ramcloud.stanford.edu/raft.pdf" rel="nofollow">http://ramcloud.stanford.edu/raft.pdf</a>, I am confused how S1 knows that the current term is 4 when it restarts and is elected leader.</p>

<p>Here is the sequence as I currently understand it:</p>

... | distributed systems | 1 | Confusion about example in Raft consensus paper -- (distributed systems)
<p>In part (c) of Figure 8 in this paper <a href="http://ramcloud.stanford.edu/raft.pdf" rel="nofollow">http://ramcloud.stanford.edu/raft.pdf</a>, I am confused how S1 knows that the current term is 4 when it restarts and is elected leader.</p>&#x... | habedi/stack-exchange-dataset |
39,498 | Is log(n) in complexity class P? | <p>$\log(n)$ is not polynomial; is a problem solvable in $\mathcal{O}(\log n)$ time in P?</p>

<p>$n\times \log(n)$ is also not polynomial; is a problem solvable in $\mathcal{O}(n\times \log n)$ time in P?</p>

<p>If not, what complexity classes contain those problems? </p>

<p>The definitions ... | reference request asymptotics landau notation | 1 | Is log(n) in complexity class P? -- (reference request asymptotics landau notation)
<p>$\log(n)$ is not polynomial; is a problem solvable in $\mathcal{O}(\log n)$ time in P?</p>

<p>$n\times \log(n)$ is also not polynomial; is a problem solvable in $\mathcal{O}(n\times \log n)$ time in P?</p>

<p>If not... | habedi/stack-exchange-dataset |
39,507 | Brackets in distributive law? | <p>The (second) distributive law in boolean algebra is defined as</p>

<blockquote>
 <p>$A + (B C) = (A + B) (A + C)$</p>
</blockquote>

<p>But wouldn't it be correct to define it that way:</p>

<blockquote>
 <p>$(A + (B C)\, ) = (A + B) (A + C)$</p>
</blockquote>

<p>B... | boolean algebra | 1 | Brackets in distributive law? -- (boolean algebra)
<p>The (second) distributive law in boolean algebra is defined as</p>

<blockquote>
 <p>$A + (B C) = (A + B) (A + C)$</p>
</blockquote>

<p>But wouldn't it be correct to define it that way:</p>

<blockquote>
 <p>$(A + (B C)\, ) = (... | habedi/stack-exchange-dataset |
39,508 | How to design a Turing Enumerator which either ends with 011 or is of odd length? | <p>This question was asked by my professor in optional brain teaser section, I have tried to solve it for last 48 hours, I am not able to construct a deterministic Turing Machine, Can someone provide hint or something because this seems like impossible to me :( ..</p>
 | turing machines | 1 | How to design a Turing Enumerator which either ends with 011 or is of odd length? -- (turing machines)
<p>This question was asked by my professor in optional brain teaser section, I have tried to solve it for last 48 hours, I am not able to construct a deterministic Turing Machine, Can someone provide hint or something... | habedi/stack-exchange-dataset |
39,525 | What is the difference between assignment, valuation and name binding? | <p>I read that <a href="https://en.wikipedia.org/wiki/Name_binding" rel="nofollow noreferrer">Name binding assigns some value (data/code/expression) to an identifier</a>. <a href="https://en.wikipedia.org/wiki/Assignment_(computer_science)" rel="nofollow noreferrer">Assignment</a> and <a href="https://cs.stackexchange.... | terminology programming languages variable binding | 1 | What is the difference between assignment, valuation and name binding? -- (terminology programming languages variable binding)
<p>I read that <a href="https://en.wikipedia.org/wiki/Name_binding" rel="nofollow noreferrer">Name binding assigns some value (data/code/expression) to an identifier</a>. <a href="https://en.wi... | habedi/stack-exchange-dataset |
39,529 | Efficient way to calculate sum in sliding window? | <p>Assume you have a grid as below:</p>

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

<p>The square is the sliding window. I want to slide this window over all the possible position such that the window is contained in the grid (i.e the edges of the window s... | algorithms efficiency arrays | 1 | Efficient way to calculate sum in sliding window? -- (algorithms efficiency arrays)
<p>Assume you have a grid as below:</p>

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

<p>The square is the sliding window. I want to slide this window over all the possible 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.