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 |
|---|---|---|---|---|---|---|
51,469 | Are there any problems that require exponential time in quantum computing? | <p>Given the fact that the qbits have superpositions, and have more representational power compared to circuits, are there any problems that require at least exponential time to guarantee a solution with a quantum computer?</p>

<p>I've checked the <a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo">Com... | complexity theory quantum computing | 1 | Are there any problems that require exponential time in quantum computing? -- (complexity theory quantum computing)
<p>Given the fact that the qbits have superpositions, and have more representational power compared to circuits, are there any problems that require at least exponential time to guarantee a solution with ... | habedi/stack-exchange-dataset |
51,477 | Why is this NPDA? | <p><a href="https://i.stack.imgur.com/cgk0r.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cgk0r.jpg" alt="enter image description here"></a></p>

<p>I am studying PDA at the moment, and I came up with this question.</p>

<p>The figure above tells me that although both PDA accept the... | automata pushdown automata | 1 | Why is this NPDA? -- (automata pushdown automata)
<p><a href="https://i.stack.imgur.com/cgk0r.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cgk0r.jpg" alt="enter image description here"></a></p>

<p>I am studying PDA at the moment, and I came up with this question.</p>

<p>The figur... | habedi/stack-exchange-dataset |
51,487 | What is the point of delimiters and whitespace handling | <p>I see that language specifies reserved words, delimiters and whitespaces in the lexer section. Are delimiters just like reserved identifiers in the punctuation space or they have additioinal function regarding skipping the whitespace? </p>

<p>Namely, spec says</p>

<blockquote>
 <p>Each lexical... | programming languages parsers language design lexical analysis | 1 | What is the point of delimiters and whitespace handling -- (programming languages parsers language design lexical analysis)
<p>I see that language specifies reserved words, delimiters and whitespaces in the lexer section. Are delimiters just like reserved identifiers in the punctuation space or they have additioinal fu... | habedi/stack-exchange-dataset |
51,495 | PTAS definition vs. FPTAS | <p>From what I read in the <code>preliminary version of a chapter of the book “Lectures on Scheduling”
edited by R.H. M¨ohring, C.N. Potts, A.S. Schulz, G.J. Woeginger, L.A. Wolsey, to appear around 2011 A.D.</code></p>

<p>This is the <em>PTAS</em> Definition:</p>

<blockquote>
 <p>A polynomia... | algorithms complexity theory terminology complexity classes approximation | 1 | PTAS definition vs. FPTAS -- (algorithms complexity theory terminology complexity classes approximation)
<p>From what I read in the <code>preliminary version of a chapter of the book “Lectures on Scheduling”
edited by R.H. M¨ohring, C.N. Potts, A.S. Schulz, G.J. Woeginger, L.A. Wolsey, to appear around 2011 A.D.</c... | habedi/stack-exchange-dataset |
51,500 | Find value of b | <p>The following system of restrictions is given:</p>

<p>$$y_1+ 2 y_2 \leq 4 \\ 2y_1+y_2 \leq 2 \\ y_1+b y_2 \leq 3 \\ y_1, y_2 \geq 0$$</p>

<p>For which values of b is there a degenarate basic feasible solution? </p>

<p>Can we make a drawing to see when we will have a degenarate basic feasib... | linear programming | 1 | Find value of b -- (linear programming)
<p>The following system of restrictions is given:</p>

<p>$$y_1+ 2 y_2 \leq 4 \\ 2y_1+y_2 \leq 2 \\ y_1+b y_2 \leq 3 \\ y_1, y_2 \geq 0$$</p>

<p>For which values of b is there a degenarate basic feasible solution? </p>

<p>Can we make a drawing to see whe... | habedi/stack-exchange-dataset |
51,509 | Is there a zero-knowledge protocol for bit vector agreement? | <p>Suppose Alice knows a secret vector of $N$ bits, say $A=\langle a_1, a_2, \ldots, a_N\rangle$ and Bob similarly knows $B=\langle b_1, b_2, \ldots, b_N\rangle$. Is there a protocol that allows them to determine the number of bits that their vectors have in common, without revealing any additional information about w... | cryptography protocols | 1 | Is there a zero-knowledge protocol for bit vector agreement? -- (cryptography protocols)
<p>Suppose Alice knows a secret vector of $N$ bits, say $A=\langle a_1, a_2, \ldots, a_N\rangle$ and Bob similarly knows $B=\langle b_1, b_2, \ldots, b_N\rangle$. Is there a protocol that allows them to determine the number of bit... | habedi/stack-exchange-dataset |
51,523 | Efficient algorithm to compute the minimum of multiple piecewise linear functions | <p>Let $f_i(x)$ be a continuous, convex, piecewise-linear function for $i=1,\ldots,n$. Define 
$$g(x) = \min_{1\leq i\leq n} f_i(x).$$ 
Clearly, $g(x)$ is also a piecewise linear function. What would be a good approach to compute all the pieces? In other words, it's clear that $g(x)$ can be represented as
$... | algorithms computational geometry efficiency numerical algorithms | 1 | Efficient algorithm to compute the minimum of multiple piecewise linear functions -- (algorithms computational geometry efficiency numerical algorithms)
<p>Let $f_i(x)$ be a continuous, convex, piecewise-linear function for $i=1,\ldots,n$. Define 
$$g(x) = \min_{1\leq i\leq n} f_i(x).$$ 
Clearly, $g(x)$ is also... | habedi/stack-exchange-dataset |
51,532 | What is the Haskell-style type signature called (i.e., who is it named after)? | <p>A type signature in Haskell is written in the following format:</p>

<pre><code>functionName :: arg1Type -> arg2Type -> returnType
</code></pre>

<p>There's a (hyphenated, after a person or persons) name for this style of type signature (which predates Haskell), but it's escaping me and I c... | reference request programming languages type theory notation | 1 | What is the Haskell-style type signature called (i.e., who is it named after)? -- (reference request programming languages type theory notation)
<p>A type signature in Haskell is written in the following format:</p>

<pre><code>functionName :: arg1Type -> arg2Type -> returnType
</code></pre>

... | habedi/stack-exchange-dataset |
51,538 | Showing a problem is NP complete? Reducing CLIQUE to KITE. | <p>I've got an exam next week all about this sort of thing. Ie: Find polynomial certifier for a problem, give a polynomial reduction, prove problem X reduces to Y and etc. </p>

<p>The problem is, there doesn't seem to be anyone available in my department to help me until after the test. I really struggle to un... | complexity theory np complete reductions clique | 1 | Showing a problem is NP complete? Reducing CLIQUE to KITE. -- (complexity theory np complete reductions clique)
<p>I've got an exam next week all about this sort of thing. Ie: Find polynomial certifier for a problem, give a polynomial reduction, prove problem X reduces to Y and etc. </p>

<p>The problem is, the... | habedi/stack-exchange-dataset |
51,540 | Reccurrence equation and finding suitable algorithm | <p>I'm given the following recurrence equation:</p>

<p>$$\begin{align*}
 T(1) &= 0\\
 T(n) &= T(n/2) + 1 && \text{when $n > 1$ is even}\\
 T(n) &= T((n+1)/2) + 1 && \text{when $n > 1$ is odd.}
\end{align*}$$</p>

<p>The problems I have are the... | algorithm analysis recurrence relation | 1 | Reccurrence equation and finding suitable algorithm -- (algorithm analysis recurrence relation)
<p>I'm given the following recurrence equation:</p>

<p>$$\begin{align*}
 T(1) &= 0\\
 T(n) &= T(n/2) + 1 && \text{when $n > 1$ is even}\\
 T(n) &= T((n+1)/2) + 1 &&am... | habedi/stack-exchange-dataset |
51,542 | Why not to take the unary representation of numbers in numeric algorithms? | <p>A pseudo-polynomial time algorithm is an algorithm that has polynomial running time on input value (magnitude) but exponential running time on input size(number of bits).</p>

<p>For example testing whether a number $n$ is prime or not, requires a loop through numbers from 2 to $n-1$ and check if $n$ <em>mod... | complexity theory algorithm analysis time complexity polynomial time pseudo polynomial | 1 | Why not to take the unary representation of numbers in numeric algorithms? -- (complexity theory algorithm analysis time complexity polynomial time pseudo polynomial)
<p>A pseudo-polynomial time algorithm is an algorithm that has polynomial running time on input value (magnitude) but exponential running time on input s... | habedi/stack-exchange-dataset |
51,550 | Data structure for set of intervals - query for all intervals contains given point | <p>We're given a set of $n$ intervals $[a_i, b_i]$, $i=1...n$. 
I am looking for a data structure which makes it possible to query for all intervals that contain the point $x$. </p>

<p>My proposition is using two-dimensional interval (sometimes name is segment) tree. Each query will take $O(\log^2 n + k... | data structures intervals | 1 | Data structure for set of intervals - query for all intervals contains given point -- (data structures intervals)
<p>We're given a set of $n$ intervals $[a_i, b_i]$, $i=1...n$. 
I am looking for a data structure which makes it possible to query for all intervals that contain the point $x$. </p>

<p>My prop... | habedi/stack-exchange-dataset |
51,575 | Check if given vertices form a connected subtree in a graph | <p><strong>The approach described in this question is wrong. It'll find false positives for disconnected components with multiple vertices. See D.W.'s answer for a reliable alternative.</strong></p>

<p>This might be a simple question, but I can't seem to find a clear cut algorithm for this. I'm given a set of ... | graphs connected subtree | 1 | Check if given vertices form a connected subtree in a graph -- (graphs connected subtree)
<p><strong>The approach described in this question is wrong. It'll find false positives for disconnected components with multiple vertices. See D.W.'s answer for a reliable alternative.</strong></p>

<p>This might be a sim... | habedi/stack-exchange-dataset |
51,576 | What is the 1's and 2's complement of 0.01101? | <p>What is the 1's and 2's complement of 0.01101?
I'm unable to find any details on this from google.</p>

<p>Basically how do we represent the floating points in 1's and 2's complement forms?</p>

<p>Even wikipedia only says that 1's complement is the inverted bits of binary representation. The exa... | floating point number formats | 1 | What is the 1's and 2's complement of 0.01101? -- (floating point number formats)
<p>What is the 1's and 2's complement of 0.01101?
I'm unable to find any details on this from google.</p>

<p>Basically how do we represent the floating points in 1's and 2's complement forms?</p>

<p>Even wikipedia on... | habedi/stack-exchange-dataset |
51,580 | Complexity of solving LP with a non-linear growth in variables/constraints | <p>It has been shown that any Linear Program (LP) can be solved in a polynomial number of steps. An example of such algorithm is <a href="https://en.wikipedia.org/wiki/Linear_programming#Ellipsoid_algorithm.2C_following_Khachiyan" rel="nofollow noreferrer" title="meow">the ellipsoid method</a>.</p>

<blockquote... | time complexity optimization np hard linear programming game theory | 1 | Complexity of solving LP with a non-linear growth in variables/constraints -- (time complexity optimization np hard linear programming game theory)
<p>It has been shown that any Linear Program (LP) can be solved in a polynomial number of steps. An example of such algorithm is <a href="https://en.wikipedia.org/wiki/Line... | habedi/stack-exchange-dataset |
51,584 | Equivalence of Turing Machines | <p>Consider the following two arguments </p>

<blockquote>
 <p>"<em>For every non deterministic TM M1 there exists an <strong>equivalent</strong>
 deterministic machine M2 recognizing the same language.</em>"<br>
 "<strong><em>Equivalence</strong> of two Turing Machines is undecidable</em>"</p>&#... | turing machines | 1 | Equivalence of Turing Machines -- (turing machines)
<p>Consider the following two arguments </p>

<blockquote>
 <p>"<em>For every non deterministic TM M1 there exists an <strong>equivalent</strong>
 deterministic machine M2 recognizing the same language.</em>"<br>
 "<strong><em>Equivalence</stron... | habedi/stack-exchange-dataset |
51,586 | What does the term "Finite" stands for in Finite State Machines? | <p>Do we consider Pushdown Automata, Turing Machines in Finite State Machines?<br>
If we don't, then what does the term "Finite" stands for in Finite state machines, as PDAs & TMs are also defined to have Finite Number of States?</p>
 | terminology automata finite automata | 1 | What does the term "Finite" stands for in Finite State Machines? -- (terminology automata finite automata)
<p>Do we consider Pushdown Automata, Turing Machines in Finite State Machines?<br>
If we don't, then what does the term "Finite" stands for in Finite state machines, as PDAs & TMs are also defined to have ... | habedi/stack-exchange-dataset |
51,590 | Is it possible to use a copy-on-write strategy to modify a B+ tree? | <p>Alright, I'm not sure if this is more of a stack overflow question, but I'm going to try here because you folks seem more suited.</p>

<p>CouchDB makes an interesting claim about using an "append only" B+ tree to index its documents. Specifically...</p>

<blockquote>
 <p>"In a B-tree, data is ke... | algorithms trees search trees | 1 | Is it possible to use a copy-on-write strategy to modify a B+ tree? -- (algorithms trees search trees)
<p>Alright, I'm not sure if this is more of a stack overflow question, but I'm going to try here because you folks seem more suited.</p>

<p>CouchDB makes an interesting claim about using an "append only" B+ t... | habedi/stack-exchange-dataset |
51,597 | Show this language is non-regular using pumping lemma: B = {ww | w ∈ {a,b,c,...,z)*} | <p>The question I'm working from is:</p>

<p>Prove whether or not a finite automation exists that recognises the following language:</p>

<p>B = {ww | w ∈ {a,b,c,...,z)*}</p>

<p><strong><em>EDIT</em></strong></p>

<p>So I believe this is a non-regular language. My understanding of pumpi... | finite automata regular expressions pumping lemma | 1 | Show this language is non-regular using pumping lemma: B = {ww | w ∈ {a,b,c,...,z)*} -- (finite automata regular expressions pumping lemma)
<p>The question I'm working from is:</p>

<p>Prove whether or not a finite automation exists that recognises the following language:</p>

<p>B = {ww | w ∈ {a,b,c,..... | habedi/stack-exchange-dataset |
51,599 | Why is c) a combinational circuit, but d) not? | <p>I am doing practice after just learning what combinational circuits are, yet I am unsure of why (c) is combinational, but (d) is not. Can someone please explain to me why this is? The Solution mentions that for (d) node n6 connects to the output terminals of both I3 and I4, but how is this different from the circui... | computer architecture logic circuits digital circuits | 1 | Why is c) a combinational circuit, but d) not? -- (computer architecture logic circuits digital circuits)
<p>I am doing practice after just learning what combinational circuits are, yet I am unsure of why (c) is combinational, but (d) is not. Can someone please explain to me why this is? The Solution mentions that for... | habedi/stack-exchange-dataset |
51,612 | Is the language $L=\{a^nb^n\} \cup \{aa*\}$ DCFL? | <p>Is the language $L=\{a^nb^n\} \cup \{aa*\}$ DCFL OR CFL?
The author says $L$ is CFL, but I am able to generate a Deterministic PDA for the corresponding language. I am naive in this subject and hence I am not sure whether its DCFL or CFL.</p>

<p>Can you provide an explanation that shows $L$ is either DC... | formal grammars parsers | 1 | Is the language $L=\{a^nb^n\} \cup \{aa*\}$ DCFL? -- (formal grammars parsers)
<p>Is the language $L=\{a^nb^n\} \cup \{aa*\}$ DCFL OR CFL?
The author says $L$ is CFL, but I am able to generate a Deterministic PDA for the corresponding language. I am naive in this subject and hence I am not sure whether its DCFL or ... | habedi/stack-exchange-dataset |
51,616 | Data structure to store sphere points (latitude,longitude) and retrieve all points within a distance | <p>I have a set of thousands~millions of points on a sphere's surface, each with latitude, longitude.<br>
I want to quickly get all points within a distance <code>d</code> of a particular sphere point <code>latC, lonC</code>.</p>

<ul>
<li>The points are mostly concentrated at places where humans go oft... | data structures sets | 1 | Data structure to store sphere points (latitude,longitude) and retrieve all points within a distance -- (data structures sets)
<p>I have a set of thousands~millions of points on a sphere's surface, each with latitude, longitude.<br>
I want to quickly get all points within a distance <code>d</code> of a particular s... | habedi/stack-exchange-dataset |
51,631 | Distribute numbers 1,N on a grid as evenly as possible | <p>I'm working on a complex engineering problem that I've essentially reduced to this problem:</p>

<p>I have a set of natural numbers $1,N$ and a grid (square or hexagonal) of exactly $N$ cells. I have to map each number to each cell so that the distribution (in a geometric sense) is <em>as flat as possible</e... | algorithms optimization sorting | 1 | Distribute numbers 1,N on a grid as evenly as possible -- (algorithms optimization sorting)
<p>I'm working on a complex engineering problem that I've essentially reduced to this problem:</p>

<p>I have a set of natural numbers $1,N$ and a grid (square or hexagonal) of exactly $N$ cells. I have to map each numbe... | habedi/stack-exchange-dataset |
51,632 | Classifier optimization | <p>Suppose we have a set E of entities. Each entity is described by a set P of binary properties (i.e. each element e of E has a defined true/false value for each element p of P).</p>

<p>|P| >> |E|</p>

<p>We now want to select a subset of fixed size (e.g., 10) of P that will enable us distinguish the ... | optimization | 1 | Classifier optimization -- (optimization)
<p>Suppose we have a set E of entities. Each entity is described by a set P of binary properties (i.e. each element e of E has a defined true/false value for each element p of P).</p>

<p>|P| >> |E|</p>

<p>We now want to select a subset of fixed size (e.g., 10)... | habedi/stack-exchange-dataset |
51,645 | Formulating a constraint to exclude a single point from the feasible region of an IP? | <p>Consider a basic integer program such as:</p>

<p>$$\begin{align} 
\min_x & \quad c^Tx \\
\text{s.t.} & \quad Ax \leq b \\
&\quad x_i \in \{-100,\ldots,100\}
\end{align}
$$</p>

<p>where $x \in \mathbb{Z}^n, A \in \mathbb{R}^{m \times n}$ and $b \in \mathbb{R^m}$.</p>&... | discrete mathematics integer programming | 1 | Formulating a constraint to exclude a single point from the feasible region of an IP? -- (discrete mathematics integer programming)
<p>Consider a basic integer program such as:</p>

<p>$$\begin{align} 
\min_x & \quad c^Tx \\
\text{s.t.} & \quad Ax \leq b \\
&\quad x_i \in \{-100,\ldots,1... | habedi/stack-exchange-dataset |
51,651 | Why $A \cap B = \widehat{\widehat{A}\cup \widehat{B}}$ does not holds for the class of Recursively Enumerable Languages? | <blockquote>
 <p>"<em>The class of Recursively Enumerable Languages is closed under Union,
 and Intersection but they are not closed under Complement.</em>"</p>
</blockquote>

<p>I know why they are not closed under Complement & why they are closed under Union & Intersection but for other ... | closure properties | 1 | Why $A \cap B = \widehat{\widehat{A}\cup \widehat{B}}$ does not holds for the class of Recursively Enumerable Languages? -- (closure properties)
<blockquote>
 <p>"<em>The class of Recursively Enumerable Languages is closed under Union,
 and Intersection but they are not closed under Complement.</em>"</p>
... | habedi/stack-exchange-dataset |
51,655 | Showing that $\mathscr{L}$ is not context-free-grammar language | <blockquote>
<p>Let <span class="math-container">$"t"$</span> and <span class="math-container">$"s"$</span> be a words we will say that two words are "completly different" if for all <span class="math-container">$1\leqslant i\leqslant |t|$</span> the <span class="math-container">$i$</span> letter in <span... | formal languages context free pumping lemma | 1 | Showing that $\mathscr{L}$ is not context-free-grammar language -- (formal languages context free pumping lemma)
<blockquote>
<p>Let <span class="math-container">$"t"$</span> and <span class="math-container">$"s"$</span> be a words we will say that two words are "completly different" if for all <span clas... | habedi/stack-exchange-dataset |
51,658 | How to convert PDA to CFG | <p>I learned how to convert <a href="https://en.wikipedia.org/wiki/Context-free_grammar" rel="nofollow noreferrer">context-free grammar</a> to <a href="https://en.wikipedia.org/wiki/Pushdown_automata" rel="nofollow noreferrer">pushdown automata</a> but how can I do the opposite? to convert PDA to CFG?</p>

<p>F... | context free formal grammars pushdown automata | 1 | How to convert PDA to CFG -- (context free formal grammars pushdown automata)
<p>I learned how to convert <a href="https://en.wikipedia.org/wiki/Context-free_grammar" rel="nofollow noreferrer">context-free grammar</a> to <a href="https://en.wikipedia.org/wiki/Pushdown_automata" rel="nofollow noreferrer">pushdown automa... | habedi/stack-exchange-dataset |
51,665 | what is the k-line-connected graph definition | <p>What is the definition for k-line-connectedness of the graph ? I am in doubt whether it differs from usual k-vertex (edge) connectedness. I've encountered it in the paper titled "Np-complete problems on a 3-connected cubic planar graph and their applications" where it comes without definition. Unfortunately for me I... | complexity theory graphs | 1 | what is the k-line-connected graph definition -- (complexity theory graphs)
<p>What is the definition for k-line-connectedness of the graph ? I am in doubt whether it differs from usual k-vertex (edge) connectedness. I've encountered it in the paper titled "Np-complete problems on a 3-connected cubic planar graph and t... | habedi/stack-exchange-dataset |
51,671 | Pumping Lemma for $L = \left \{ a^{c}\mid \text{c is a composite number} \right \}$ | <p>$L = \left \{ a^{c}\mid \text{c is a composite number} \right \}$<br>
I feel that this is not a context-free language as checking this constraint requires divisibility checking, but I am facing a hard time in proving that $L$ is not a Context Free Language using Pumping Lemma.<br>
Could please anybody please... | pumping lemma | 1 | Pumping Lemma for $L = \left \{ a^{c}\mid \text{c is a composite number} \right \}$ -- (pumping lemma)
<p>$L = \left \{ a^{c}\mid \text{c is a composite number} \right \}$<br>
I feel that this is not a context-free language as checking this constraint requires divisibility checking, but I am facing a hard time in p... | habedi/stack-exchange-dataset |
51,675 | This opertion gives overflow and carry? | <p>Take this example in 2's complement representation with 8 bits.</p>

<p>1111 1110 + 1111 1110 ( -2 + -2 = -4 )
Calculation:</p>

<pre><code> 1111 1110
 +1111 1110
 -----------
1|1111 1100 = -4 in 2's complement
</code></pre>

<p>This operation gives overflow and carry at ... | arithmetic | 1 | This opertion gives overflow and carry? -- (arithmetic)
<p>Take this example in 2's complement representation with 8 bits.</p>

<p>1111 1110 + 1111 1110 ( -2 + -2 = -4 )
Calculation:</p>

<pre><code> 1111 1110
 +1111 1110
 -----------
1|1111 1100 = -4 in 2's complement
</code></pre>... | habedi/stack-exchange-dataset |
51,684 | How does a computer solve matrices of higher order? | <p>To compute the determinant of a $n \times n$ matrix using the cofactor expansion requires roughly $n!$ operations ($n! = 1 \times 2 \times 3 \times \ldots \times n)$.
Consider a $25 \times 25$ matrix. This would require $25!$ operations or roughly operations. Suppose you have a super computer that can do $1$ tri... | algorithms | 1 | How does a computer solve matrices of higher order? -- (algorithms)
<p>To compute the determinant of a $n \times n$ matrix using the cofactor expansion requires roughly $n!$ operations ($n! = 1 \times 2 \times 3 \times \ldots \times n)$.
Consider a $25 \times 25$ matrix. This would require $25!$ operations or rough... | habedi/stack-exchange-dataset |
51,687 | Minimal class of grammar required to run program | <p>In computability we have the hierarchy of grammars "<a href="https://en.wikipedia.org/wiki/Chomsky_hierarchy" rel="nofollow">https://en.wikipedia.org/wiki/Chomsky_hierarchy</a>". In this hierarchy we have many classes of grammar. This hierarchy has Turing machines at the top, and weaker machines lower. Machines are ... | complexity theory computability turing machines formal grammars | 1 | Minimal class of grammar required to run program -- (complexity theory computability turing machines formal grammars)
<p>In computability we have the hierarchy of grammars "<a href="https://en.wikipedia.org/wiki/Chomsky_hierarchy" rel="nofollow">https://en.wikipedia.org/wiki/Chomsky_hierarchy</a>". In this hierarchy we... | habedi/stack-exchange-dataset |
51,693 | 2 SAT variants complexity class | <p><strong>Question:</strong>
Which of the following languages are in P? which in NP? other classes?</p>

<p>a. EXACTLY-2-CNF (every clause in the formula has 2 differenet literelas)- does there exist a satisfying assignment s.t. at most k variables are TRUE.</p>

<p>b. same language but this time i... | complexity theory complexity classes | 1 | 2 SAT variants complexity class -- (complexity theory complexity classes)
<p><strong>Question:</strong>
Which of the following languages are in P? which in NP? other classes?</p>

<p>a. EXACTLY-2-CNF (every clause in the formula has 2 differenet literelas)- does there exist a satisfying assignment s.t. at m... | habedi/stack-exchange-dataset |
51,696 | Synchronizing speech and text | <p>I have a text and a narration of the exact same text. What is the best way to synchronize them together? By synchronizing I mean, finding out for example the location of each word in the audio. For example if the sentence is "I took a cab" I want for markers on the accompanying audio which indicate start of each wor... | speech recognition | 1 | Synchronizing speech and text -- (speech recognition)
<p>I have a text and a narration of the exact same text. What is the best way to synchronize them together? By synchronizing I mean, finding out for example the location of each word in the audio. For example if the sentence is "I took a cab" I want for markers on t... | habedi/stack-exchange-dataset |
51,697 | Inverting radial distortion | <p>I'm trying to understand the math behind correcting a radial distortion (caused by a lens), but I'm failing to have it explained in simple terms.</p>

<p>I found several examples that proceed this way: a starting point $P = (x, y)$ is given and it is transformed to another point $P'=(x', y')$ with the follow... | discrete mathematics image processing computer vision | 1 | Inverting radial distortion -- (discrete mathematics image processing computer vision)
<p>I'm trying to understand the math behind correcting a radial distortion (caused by a lens), but I'm failing to have it explained in simple terms.</p>

<p>I found several examples that proceed this way: a starting point $P ... | habedi/stack-exchange-dataset |
51,709 | Explanation of the knowledge representation hypothesis (Brian Smith) | <p>In 1982 Brian Smith proposed his Knowledge Representation Hypothesis:</p>

<blockquote>
 <p>Any mechanically embodied intelligent process will be comprised of
 structural ingredients that </p>
 
 <ul>
 <li>we as external observers naturally take to represent a propositional account o... | artificial intelligence | 1 | Explanation of the knowledge representation hypothesis (Brian Smith) -- (artificial intelligence)
<p>In 1982 Brian Smith proposed his Knowledge Representation Hypothesis:</p>

<blockquote>
 <p>Any mechanically embodied intelligent process will be comprised of
 structural ingredients that </p>
 &#... | habedi/stack-exchange-dataset |
51,716 | What are GPU arrays? | <p>I came across the Python library libgpuarray and was reading about it but could not really understand what a GPU array is and why do we need it? What is the difference between a normal array and GPU array? </p>

<p>Please excuse the noobness of the question. </p>
 | arrays | 1 | What are GPU arrays? -- (arrays)
<p>I came across the Python library libgpuarray and was reading about it but could not really understand what a GPU array is and why do we need it? What is the difference between a normal array and GPU array? </p>

<p>Please excuse the noobness of the question. </p>
 | habedi/stack-exchange-dataset |
51,719 | Given a λ-term, can I decide which machine model I need to express it? | <p>I am having a hard time figuring out the specific relationship, of various things in computability. So we have a hierarchy of machines, with a (real life) upper bound of Turing machines, moving on down to things like deterministic finite automata. We also have a hierarchy of grammars that the machines can implement.... | computability turing machines lambda calculus turing completeness | 1 | Given a λ-term, can I decide which machine model I need to express it? -- (computability turing machines lambda calculus turing completeness)
<p>I am having a hard time figuring out the specific relationship, of various things in computability. So we have a hierarchy of machines, with a (real life) upper bound of Turin... | habedi/stack-exchange-dataset |
51,723 | Maximum bipartite matching with extra reward for covering certain sets | <p>Consider the following variation of Bipartite Maximum Matching. As usual, we have a bipartite graph $G$. In addition, there is an additional collection of sets $S_1,S_2,\dots,S_k$, with each set $S_{i}$ being defined as a collection of nodes from the right side of the graph $G$ as well as a weight.</p>

... | algorithms graphs bipartite matching computational complexity | 1 | Maximum bipartite matching with extra reward for covering certain sets -- (algorithms graphs bipartite matching computational complexity)
<p>Consider the following variation of Bipartite Maximum Matching. As usual, we have a bipartite graph $G$. In addition, there is an additional collection of sets $S_1,S_2,\dots,S... | habedi/stack-exchange-dataset |
51,725 | Prove an arithmetic property of a partial recursive function | <p>I have this program written in haskell :
<a href="https://i.stack.imgur.com/6WXa5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6WXa5.png" alt="enter image description here"></a></p>

<p>I have to prove that:
 $(\forall a \in \mathbb{N})[!D_V [h](a) \Rightarrow log_2 (D_V[h](a... | programming languages denotational semantics | 1 | Prove an arithmetic property of a partial recursive function -- (programming languages denotational semantics)
<p>I have this program written in haskell :
<a href="https://i.stack.imgur.com/6WXa5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6WXa5.png" alt="enter image description here"></a></p... | habedi/stack-exchange-dataset |
51,726 | What's the time complexity of Monte Carlo Tree Search? | <p>I'm trying to find the time complexity of Monte Carlo Tree Search (MCTS). Googling doesn't help, so I'm trying to see how far I get calculating it myself.</p>
<p>It does four steps for <code>n</code> iterations, or before the time runs out. So we'll have</p>
<blockquote>
<p>O(n*(selection+expansion+simul... | algorithm analysis time complexity | 1 | What's the time complexity of Monte Carlo Tree Search? -- (algorithm analysis time complexity)
<p>I'm trying to find the time complexity of Monte Carlo Tree Search (MCTS). Googling doesn't help, so I'm trying to see how far I get calculating it myself.</p>
<p>It does four steps for <code>n</code> iterations, or bef... | habedi/stack-exchange-dataset |
51,733 | Trouble understanding how to create a grammar parse tree | <p>I'm starting an online Computer Science class called Advanced Programming Languages, and the book asks me to create a parse tree and generate a grammar from it. Here are the exact instructions:</p>

<blockquote>
 <p>To verify that a string of characters belongs to a language defined by a grammar, we mu... | context free formal grammars parsers | 1 | Trouble understanding how to create a grammar parse tree -- (context free formal grammars parsers)
<p>I'm starting an online Computer Science class called Advanced Programming Languages, and the book asks me to create a parse tree and generate a grammar from it. Here are the exact instructions:</p>

<blockquot... | habedi/stack-exchange-dataset |
51,738 | Algorithm to find the shortest walk with k leaf nodes on a tree | <p>Let's say I have a general tree. What algorithm can I use to find a shortest walk that starts at the root, passes through exactly $k$ different leaves, and ends at the root? Passing through a node/edge more than once is allowed.</p>

<p>For example, consider this graph:</p>

<p><img src="https://i.i... | graphs trees shortest path | 1 | Algorithm to find the shortest walk with k leaf nodes on a tree -- (graphs trees shortest path)
<p>Let's say I have a general tree. What algorithm can I use to find a shortest walk that starts at the root, passes through exactly $k$ different leaves, and ends at the root? Passing through a node/edge more than once is ... | habedi/stack-exchange-dataset |
51,746 | How to choose the number of HOG pyramid layers? | <p>Reading <a href="https://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf">Histograms of Oriented Gradients for Human Detection</a>, I cannot see any discussion of how many layers there should be in the HOG pyramid. <a href="http://docs.opencv.org/2.4/modules/gpu/doc/object_detection.html#gpu-hogdescriptor-dete... | computer vision | 1 | How to choose the number of HOG pyramid layers? -- (computer vision)
<p>Reading <a href="https://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf">Histograms of Oriented Gradients for Human Detection</a>, I cannot see any discussion of how many layers there should be in the HOG pyramid. <a href="http://docs.opencv... | habedi/stack-exchange-dataset |
51,757 | What would we call this datastructure? | <p>Suppose we have a datastructure that is a list containing elements that are either a leaf or another layer of the datastructure (recursively defined). What would we call this? It isn't a tree, since it has variable number of leaves and branches on each node. It isn't a forest, since it doesn't consist of a list of t... | terminology data structures | 1 | What would we call this datastructure? -- (terminology data structures)
<p>Suppose we have a datastructure that is a list containing elements that are either a leaf or another layer of the datastructure (recursively defined). What would we call this? It isn't a tree, since it has variable number of leaves and branches ... | habedi/stack-exchange-dataset |
51,758 | Why is Hamming Weight (in the CRC context) independent from the data? | <p>I'm designing a communication protocol for 24 to 52 bits (typically 32 bits) data including the CRC-8 for error detection. I'm trying to select the best polynomial for this kind of application.</p>

<p>In the paper <a href="http://users.ece.cmu.edu/~koopman/roses/dsn04/koopman04_crc_poly_embedded.pdf" rel="n... | coding theory error correcting codes | 1 | Why is Hamming Weight (in the CRC context) independent from the data? -- (coding theory error correcting codes)
<p>I'm designing a communication protocol for 24 to 52 bits (typically 32 bits) data including the CRC-8 for error detection. I'm trying to select the best polynomial for this kind of application.</p>
&#x... | habedi/stack-exchange-dataset |
51,763 | Does the conservative two phase locking protocol produce cascadeless schedules? | <p>Let us consider the following schedule : </p>

<p>\begin{array}{lcr}
\mbox{$T_1$} & \mbox{$T_2$}\\
\\
\mbox{lock-exclusive(a)} \\
\mbox{lock-exclusive(b)} \\
\mbox{read(a)} \\
\mbox{a=a+50} \\
\mbox{write(a)} \\
\mbox{unlock(a)} \\
\mbox{} & \mbox{lock-exclusive(... | concurrency database theory | 1 | Does the conservative two phase locking protocol produce cascadeless schedules? -- (concurrency database theory)
<p>Let us consider the following schedule : </p>

<p>\begin{array}{lcr}
\mbox{$T_1$} & \mbox{$T_2$}\\
\\
\mbox{lock-exclusive(a)} \\
\mbox{lock-exclusive(b)} \\
\mbox{read(a... | habedi/stack-exchange-dataset |
51,770 | Why are computable functions also called recursive functions? | <p>In computability theory, computable functions are also called recursive functions. At least at first sight, they do not have anything in common with what you call "recursive" in day-to-day programming (i.e., functions that call themselfes).</p>

<p>What is the actual meaning of recursive in the context of co... | computability terminology history | 1 | Why are computable functions also called recursive functions? -- (computability terminology history)
<p>In computability theory, computable functions are also called recursive functions. At least at first sight, they do not have anything in common with what you call "recursive" in day-to-day programming (i.e., function... | habedi/stack-exchange-dataset |
51,772 | Know when we have a cache default and if it loads | <p>I have an exercise about cache memory, first the cache is empty :<br>
I have a cache memory with 16 lines and each lines have 16 octet, the address is 16 bits</p>

<p>So I know that the INDEX will be composed of 4 bits and the offset will be composed of 4 bits too 
So i will have this :</p>

... | cpu cache | 1 | Know when we have a cache default and if it loads -- (cpu cache)
<p>I have an exercise about cache memory, first the cache is empty :<br>
I have a cache memory with 16 lines and each lines have 16 octet, the address is 16 bits</p>

<p>So I know that the INDEX will be composed of 4 bits and the offset will b... | habedi/stack-exchange-dataset |
51,775 | An obvious approach to explaining NP != coNP, how far has it been pushed? | <p>A recent <a href="https://cs.stackexchange.com/questions/51730/an-obvious-approach-to-np-conp-is-there-a-counterexample">question</a> made me think about an obvious approach for circumventing the "algorithm is allowed to do anything" problem, when proving lower bounds. Instead of starting with a simple looking NP-co... | complexity theory np co np | 1 | An obvious approach to explaining NP != coNP, how far has it been pushed? -- (complexity theory np co np)
<p>A recent <a href="https://cs.stackexchange.com/questions/51730/an-obvious-approach-to-np-conp-is-there-a-counterexample">question</a> made me think about an obvious approach for circumventing the "algorithm is a... | habedi/stack-exchange-dataset |
51,789 | Algorithm to convert decimal number to binary | <p>I am reading <a href="http://tibasicdev.wikidot.com/binandhex" rel="nofollow">this material</a> to understand the basics of number system.
I am stuck at a point in that material where it writes the algorithm to convert a decimal number to binary number.
The heading of that part where I am stuck is <code>Deci... | algorithms number formats base conversion | 1 | Algorithm to convert decimal number to binary -- (algorithms number formats base conversion)
<p>I am reading <a href="http://tibasicdev.wikidot.com/binandhex" rel="nofollow">this material</a> to understand the basics of number system.
I am stuck at a point in that material where it writes the algorithm to convert a... | habedi/stack-exchange-dataset |
51,798 | What is the XNOR of 3 or more inputs? | <p>We know that for 3 variables (A=0,B=1,C=1), f$_1$ = (A XNOR B XNOR C) = 1, since the input has even number of 1's.</p>

<p>But if we were to do this step by step, f$_2$ = (A XNOR (B XNOR C)) = (A XNOR (1 XNOR 1))</p>

<p>Now, 1 XNOR 1 = 1. So, f$_2$ = (A XNOR 1) = 0 XNOR 1 = 0.</p>

<p>Why is... | arithmetic boolean algebra | 1 | What is the XNOR of 3 or more inputs? -- (arithmetic boolean algebra)
<p>We know that for 3 variables (A=0,B=1,C=1), f$_1$ = (A XNOR B XNOR C) = 1, since the input has even number of 1's.</p>

<p>But if we were to do this step by step, f$_2$ = (A XNOR (B XNOR C)) = (A XNOR (1 XNOR 1))</p>

<p>Now, 1 XNO... | habedi/stack-exchange-dataset |
51,799 | How does the Weibull distribution work as fault model in wireless sensor networks? | <p>I am a little bit confused with the concept of using the Weibull distribution or other distribution for fault model. As I understand, in simulation this distribution is often used for modelling a fault in components.</p>

<p>On the other hand when designing systems we often assume some components might becom... | computer networks randomness modelling fault tolerance | 1 | How does the Weibull distribution work as fault model in wireless sensor networks? -- (computer networks randomness modelling fault tolerance)
<p>I am a little bit confused with the concept of using the Weibull distribution or other distribution for fault model. As I understand, in simulation this distribution is often... | habedi/stack-exchange-dataset |
51,803 | Which sorting has a complexity of $n \log n$ if you compare two elements? | <p>I want to ask just a quick question. If I have an array, which sorting method will have a complexity of $n \log n$ if I compare two objects in that array? I can't decide between <code>divide-and-conquer</code>or <code>insertion-sort</code>. And how would the iterative solution look like in pseudocode?</p>
 | algorithms sorting | 1 | Which sorting has a complexity of $n \log n$ if you compare two elements? -- (algorithms sorting)
<p>I want to ask just a quick question. If I have an array, which sorting method will have a complexity of $n \log n$ if I compare two objects in that array? I can't decide between <code>divide-and-conquer</code>or <code>i... | habedi/stack-exchange-dataset |
51,813 | Remove contiguous subsequence so the remaining numbers will created a sorted sequence | <blockquote>
 <p>You are given $N$ numbers. Remove contiguous subsequence of those numbers, so the remaining numbers will create a sorted sequence. For example, if the sequence is $5$, $7$, $8$, $2$, $1$, $9$ then we have to remove subsequence $2$, $1$. I am only interested in the minimal amount of numbers removed... | algorithms optimization dynamic programming subsequences | 1 | Remove contiguous subsequence so the remaining numbers will created a sorted sequence -- (algorithms optimization dynamic programming subsequences)
<blockquote>
 <p>You are given $N$ numbers. Remove contiguous subsequence of those numbers, so the remaining numbers will create a sorted sequence. For example, if the... | habedi/stack-exchange-dataset |
51,818 | Methods for proving upper bound on a-approximiation algorithms? | <p>I'm dealing with some simple randomized and on-line algorithms, both kind produce some lower/upper bound on quality of the output instance. </p>

<p>For example, there's a simple randomized algorithm for the <em>MAX-E3SAT</em> problem, where there are $m$ clauses each consisting of three distinct 3 variables... | approximation randomized algorithms online algorithms | 1 | Methods for proving upper bound on a-approximiation algorithms? -- (approximation randomized algorithms online algorithms)
<p>I'm dealing with some simple randomized and on-line algorithms, both kind produce some lower/upper bound on quality of the output instance. </p>

<p>For example, there's a simple randomi... | habedi/stack-exchange-dataset |
51,833 | What is the difference between $\log^2(n)$, $\log(n)^2$, $(\log n)^2$, $\log (n^2)$ and $\log \log n$? | <p>In research articles (e.g. <a href="http://ttic.uchicago.edu/~cjulia/papers/crossing-STOC.pdf" rel="noreferrer">this one's abstract</a>), I often see the complexity of an algorithm expressed using a somewhat ambiguous notation:</p>

<ul>
<li><p>$\log^2(n) = ?$</p></li>
<li><p>$\log(n)^2 = ?$</p></li>... | notation mathematical foundations | 1 | What is the difference between $\log^2(n)$, $\log(n)^2$, $(\log n)^2$, $\log (n^2)$ and $\log \log n$? -- (notation mathematical foundations)
<p>In research articles (e.g. <a href="http://ttic.uchicago.edu/~cjulia/papers/crossing-STOC.pdf" rel="noreferrer">this one's abstract</a>), I often see the complexity of an algo... | habedi/stack-exchange-dataset |
51,838 | primitive recursion on untyped lambda calculus | <p>Does a definition of primitive recursion exist for the untyped lambda calculus? Does the definition of primitive recursion require typing for natural numbers?</p>

<p>The only definitions I can find are for the typed lambda calculus: <a href="http://www.math.nagoya-u.ac.jp/~garrigue/lecture/2013_tenbo/recfun... | lambda calculus primitive recursion | 1 | primitive recursion on untyped lambda calculus -- (lambda calculus primitive recursion)
<p>Does a definition of primitive recursion exist for the untyped lambda calculus? Does the definition of primitive recursion require typing for natural numbers?</p>

<p>The only definitions I can find are for the typed lamb... | habedi/stack-exchange-dataset |
51,842 | Expected number of common edges for a given tree with any other tree | <p>So I am working on a problem where I have a set of (labeled) nodes and I have a tree structure (rooted) over that set of nodes. The goal for me is to automatically generate that tree structure. To find the performance of my algorithm, I am trying to use the score as the fraction of edges that I have common in the ge... | algorithms graphs machine learning trees data mining | 1 | Expected number of common edges for a given tree with any other tree -- (algorithms graphs machine learning trees data mining)
<p>So I am working on a problem where I have a set of (labeled) nodes and I have a tree structure (rooted) over that set of nodes. The goal for me is to automatically generate that tree structu... | habedi/stack-exchange-dataset |
51,847 | What is the difference between Abstract Data Types and objects? | <p>An <a href="https://softwareengineering.stackexchange.com/a/38675/34181">answer on Programmers.SE</a> characterizes an essay by Cook (<a href="http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf" rel="nofollow noreferrer">Objects are not ADTs</a>) as saying</p>

<blockquote>
 <ul>
 <li><p>Objects... | programming languages object oriented abstract data types | 1 | What is the difference between Abstract Data Types and objects? -- (programming languages object oriented abstract data types)
<p>An <a href="https://softwareengineering.stackexchange.com/a/38675/34181">answer on Programmers.SE</a> characterizes an essay by Cook (<a href="http://www.cs.utexas.edu/~wcook/Drafts/2009/ess... | habedi/stack-exchange-dataset |
51,858 | Recurrence relations when function call is made inside loop | <pre><code>int fun (int n)
{
 int x=1, k;
 if (n==1) return x;
 for (k=1; k<n; ++k)
 x = x + fun(k) * fun(n – k);
 return x;
}
</code></pre>

<blockquote>
 <p>What is the value of fun(5)?</p>
</blockquote>

<p>I find it difficult to realize a recurrenc... | algorithms algorithm analysis recurrence relation recursion loops | 1 | Recurrence relations when function call is made inside loop -- (algorithms algorithm analysis recurrence relation recursion loops)
<pre><code>int fun (int n)
{
 int x=1, k;
 if (n==1) return x;
 for (k=1; k<n; ++k)
 x = x + fun(k) * fun(n – k);
 return x;
}
</code></pre>
&... | habedi/stack-exchange-dataset |
51,861 | Simple Bayesian classification with Laplace smoothing question | <p>I'm having a hard time getting my head around smoothing, so I've got a very simple question about Laplace/Add-one smoothing based on a toy problem I've been working with.</p>

<p>The problem is a simple Bayesian classifier for periods ending sentences vs. periods not ending sentences, based on the word immed... | machine learning classification bayesian statistics | 1 | Simple Bayesian classification with Laplace smoothing question -- (machine learning classification bayesian statistics)
<p>I'm having a hard time getting my head around smoothing, so I've got a very simple question about Laplace/Add-one smoothing based on a toy problem I've been working with.</p>

<p>The proble... | habedi/stack-exchange-dataset |
51,878 | Should Kolmogorov complexity include all resources or just program size? | <p>I've been thinking about pi and Kolmogorov complexity (Kc). </p>

<p>As the digits of pi are randomly distributed (and infinite) , they can't be compressed with a typical compression program. Through the prism of Kc, it would seem that a generating program (e.g. Gauss-Legendre algorithm) is much smaller th... | randomness kolmogorov complexity | 1 | Should Kolmogorov complexity include all resources or just program size? -- (randomness kolmogorov complexity)
<p>I've been thinking about pi and Kolmogorov complexity (Kc). </p>

<p>As the digits of pi are randomly distributed (and infinite) , they can't be compressed with a typical compression program. Thro... | habedi/stack-exchange-dataset |
51,883 | Segmenting a human body point cloud into limbs | <p>I have a human body point cloud taken through a Kinect (v1). Now, I want to segment the point cloud into different parts, namely hands, lower arms, upper arms, torso, upper legs, lower legs, feet and head. </p>

<p>Here's the method I'm currently using:</p>

<ul>
<li>I get the approximate skeleto... | algorithms computer vision graphics | 1 | Segmenting a human body point cloud into limbs -- (algorithms computer vision graphics)
<p>I have a human body point cloud taken through a Kinect (v1). Now, I want to segment the point cloud into different parts, namely hands, lower arms, upper arms, torso, upper legs, lower legs, feet and head. </p>

<p>Here's... | habedi/stack-exchange-dataset |
51,887 | What restrictions apply to query and target vector encoding on fast-forward neural networks? | <p>I'm currently studying fast-forward multi-layer neural networks with back propagation, in the book I see that all query and target vectors are binary-encoded, this makes me believe that this is the only allowed encoding, yet all other neurons in the hidden layers and output layer can take on any real value between 0... | machine learning neural networks | 1 | What restrictions apply to query and target vector encoding on fast-forward neural networks? -- (machine learning neural networks)
<p>I'm currently studying fast-forward multi-layer neural networks with back propagation, in the book I see that all query and target vectors are binary-encoded, this makes me believe that ... | habedi/stack-exchange-dataset |
51,895 | Isn't polynomial identity testing over arithmetic *expressions* trivial? | <p>Polynomial identity testing is the standard example of a problem known to be in <strong>co-RP</strong> but not known to be in <strong>P</strong>. Over arithmetic <em>circuits</em>, it does indeed seem hard, since the degree of the polynomial can be made exponentially large by repeated squaring. <a href="https://cs.s... | randomized algorithms polynomial time circuits | 1 | Isn't polynomial identity testing over arithmetic *expressions* trivial? -- (randomized algorithms polynomial time circuits)
<p>Polynomial identity testing is the standard example of a problem known to be in <strong>co-RP</strong> but not known to be in <strong>P</strong>. Over arithmetic <em>circuits</em>, it does ind... | habedi/stack-exchange-dataset |
51,900 | Is there a name/algorithm for this problem related to set cover and CSP? | <p>Our college would like to determine if a transcript contains classes that satisfy every general education requirement. What makes this nontrivial is that while a single class may in theory satisfy multiple graduation requirements (e.g., writing, quantitative literacy, and art), each class may only count for up to tw... | algorithms graphs bipartite matching | 1 | Is there a name/algorithm for this problem related to set cover and CSP? -- (algorithms graphs bipartite matching)
<p>Our college would like to determine if a transcript contains classes that satisfy every general education requirement. What makes this nontrivial is that while a single class may in theory satisfy multi... | habedi/stack-exchange-dataset |
51,901 | Maximize ratio of sums | <p>I have a $2 \times n$ matrix of positive integers, where the elements are denoted by $a_{ij}$ for all $i$ in the set $\{1,2\}$ and for all $j$ in the set $\{1,\ldots,n\}$.</p>

<p>I would like to select a subset $S$ of the columns that maximizes the ratio $$\left(\sum_{j\in S}a_{1j}\right) / \left(\sum_{j\in... | reference request optimization search problem | 1 | Maximize ratio of sums -- (reference request optimization search problem)
<p>I have a $2 \times n$ matrix of positive integers, where the elements are denoted by $a_{ij}$ for all $i$ in the set $\{1,2\}$ and for all $j$ in the set $\{1,\ldots,n\}$.</p>

<p>I would like to select a subset $S$ of the columns that... | habedi/stack-exchange-dataset |
51,905 | How to solve for p in Akra-Bazzi method for analyzing time complexity? | <p>Every single online resource I've looked up on <a href="https://en.wikipedia.org/wiki/Akra%E2%80%93Bazzi_method#The_formula" rel="nofollow">Akra-Bazzi method</a> appears to skip over the same step: They say you have to solve for $p$ without explaining how. If you look up the various PDFs and webpages online, they al... | algorithms time complexity asymptotics | 1 | How to solve for p in Akra-Bazzi method for analyzing time complexity? -- (algorithms time complexity asymptotics)
<p>Every single online resource I've looked up on <a href="https://en.wikipedia.org/wiki/Akra%E2%80%93Bazzi_method#The_formula" rel="nofollow">Akra-Bazzi method</a> appears to skip over the same step: They... | habedi/stack-exchange-dataset |
51,911 | Difference between heuristic-based searching and optimal path searching | <p>I'm currently studying for an AI computer-science course.
One thing is difficult for me to grasp and somewhat vaguely explained in my course-material:</p>

<p>I understand that with search-methods like e.g. beam search, hill-climbing... you can search based on a certain knowledge about the problem which ... | search algorithms artificial intelligence search trees heuristics | 1 | Difference between heuristic-based searching and optimal path searching -- (search algorithms artificial intelligence search trees heuristics)
<p>I'm currently studying for an AI computer-science course.
One thing is difficult for me to grasp and somewhat vaguely explained in my course-material:</p>

<p>I u... | habedi/stack-exchange-dataset |
51,918 | How do I find my wife in a supermarket? | <p>If two people are lost in a maze, is there an algorithm that they can both use to find each other <em>without</em> having previously agreed what algorithm they will be using?</p>

<p>I think there are some characteristics that this algorithm will have:</p>

<ul>
<li>Each person must be able to de... | algorithms search algorithms agent based computing | 1 | How do I find my wife in a supermarket? -- (algorithms search algorithms agent based computing)
<p>If two people are lost in a maze, is there an algorithm that they can both use to find each other <em>without</em> having previously agreed what algorithm they will be using?</p>

<p>I think there are some charact... | habedi/stack-exchange-dataset |
51,921 | Different characterization of $\Delta_2^P$ | <p>$\Delta_2^P =P^{NP}$, is the set of all languages decidable by a polynomial Turing machine with access to a SAT oracle. I came across a definition of $\Delta_2^P$ as the set of all languages $L$ such that there exists $L_1\in NP, L_2\in coNP$ where $L=L_1\cap L_2$. </p>

<p>I'm trying to prove that a languag... | complexity theory | 1 | Different characterization of $\Delta_2^P$ -- (complexity theory)
<p>$\Delta_2^P =P^{NP}$, is the set of all languages decidable by a polynomial Turing machine with access to a SAT oracle. I came across a definition of $\Delta_2^P$ as the set of all languages $L$ such that there exists $L_1\in NP, L_2\in coNP$ where $L... | habedi/stack-exchange-dataset |
51,933 | String Comparison vs. Hashing | <p>I recently learned about the <a href="https://en.wikipedia.org/wiki/Rolling_hash" rel="nofollow">rolling hash</a> data structure, and basically one of its prime uses to searching for a substring within a string. Here are some advantages that I noticed:</p>

<ul>
<li>Comparing two strings can be expensive... | programming languages runtime analysis | 1 | String Comparison vs. Hashing -- (programming languages runtime analysis)
<p>I recently learned about the <a href="https://en.wikipedia.org/wiki/Rolling_hash" rel="nofollow">rolling hash</a> data structure, and basically one of its prime uses to searching for a substring within a string. Here are some advantages that I... | habedi/stack-exchange-dataset |
51,938 | Sum to a certain value of a group of integers | <p>Take a group filled with an arbitrary number of random integers. Is there any way of finding out whether it is possible for the sum of the integers can equal a certain number, with the condition that any of the integers can (but do not have to) be multiplied by 0 or -1?</p>

<p>The only possible solution I c... | algorithms integers | 1 | Sum to a certain value of a group of integers -- (algorithms integers)
<p>Take a group filled with an arbitrary number of random integers. Is there any way of finding out whether it is possible for the sum of the integers can equal a certain number, with the condition that any of the integers can (but do not have to) b... | habedi/stack-exchange-dataset |
51,942 | Is there a name for algorithms which detect nearly-similar structures? | <p>I'm interested in how you might detect similarities in tree structures. For example, in these three JSON documents;</p>

<pre><code>(a) { name="foo", length=23 }
(b) { name="boo", length=99, redundant=true }
(c) { quux="baz", a=44, b=66, c=99 }
</code></pre>

<p>it's obvious to the ... | algorithms heuristics | 1 | Is there a name for algorithms which detect nearly-similar structures? -- (algorithms heuristics)
<p>I'm interested in how you might detect similarities in tree structures. For example, in these three JSON documents;</p>

<pre><code>(a) { name="foo", length=23 }
(b) { name="boo", length=99, redundant=tr... | habedi/stack-exchange-dataset |
51,950 | Flaw with Cross Entropy Error in Neural Networks | <p>I've recently been working on creating a neural network to classify handwritten digits. I implemented 1-of-N encoding such that there are the same number of output nodes as possible digits (The expected output is 0 for all digits' nodes except for the digit that was inputted, which would be 1).</p>

<p>Becau... | artificial intelligence neural networks | 1 | Flaw with Cross Entropy Error in Neural Networks -- (artificial intelligence neural networks)
<p>I've recently been working on creating a neural network to classify handwritten digits. I implemented 1-of-N encoding such that there are the same number of output nodes as possible digits (The expected output is 0 for all ... | habedi/stack-exchange-dataset |
51,951 | Why can't we round results of linear programming to get integer programming? | <ul>
<li><p>If linear programming suggests that we need $2.5$ trucks to deliver goods, why can't we round up and say $3$ trucks are needed?</p></li>
<li><p>If linear programming suggests we can afford only $3.7$ workers, then why can't we just round down to $3$ workers?</p></li>
</ul>

<p>When can w... | optimization linear programming integer programming rounding | 1 | Why can't we round results of linear programming to get integer programming? -- (optimization linear programming integer programming rounding)
<ul>
<li><p>If linear programming suggests that we need $2.5$ trucks to deliver goods, why can't we round up and say $3$ trucks are needed?</p></li>
<li><p>If linear pro... | habedi/stack-exchange-dataset |
51,952 | What was the first programming language with loop break? | <p>While tracing the history of the BREAK and CONTINUE statements found in popular languages, I ran into a dead end right around ALGOL.</p>

<p><strong>Algol _?</strong> -> CPL -> BCPL -> C -> C++ -> Java -> JavaScript</p>

<p>What was the first programming language to introduce the feature of being abl... | programming languages history | 1 | What was the first programming language with loop break? -- (programming languages history)
<p>While tracing the history of the BREAK and CONTINUE statements found in popular languages, I ran into a dead end right around ALGOL.</p>

<p><strong>Algol _?</strong> -> CPL -> BCPL -> C -> C++ -> Java -> JavaScript</... | habedi/stack-exchange-dataset |
51,954 | Logic formula for exactly n unique objects (no more, no less) | <p>I have a question in Logic:</p>

<p>If I am asked to construct a formula, using the '=' predicate, that shows that there are exactly n objects, I need to show that there are no n+1 objects, right?</p>

<p>For example, to show that there are exactly 3 objects, I will show that there are no 4 objects.<... | logic sets first order logic finite sets | 1 | Logic formula for exactly n unique objects (no more, no less) -- (logic sets first order logic finite sets)
<p>I have a question in Logic:</p>

<p>If I am asked to construct a formula, using the '=' predicate, that shows that there are exactly n objects, I need to show that there are no n+1 objects, right?</p>&... | habedi/stack-exchange-dataset |
51,972 | Why don't nodes carry as many pointers as possible in a skip list? | <p>From this main picture explaining <a href="https://en.wikipedia.org/wiki/Skip_list" rel="nofollow noreferrer">how skip lists work from Wikipedia</a>, we see that some nodes carry different amounts of pointers to other parts of the list:</p>

<p><a href="https://i.stack.imgur.com/LMfwW.png" rel="nofollow nore... | data structures linked lists | 1 | Why don't nodes carry as many pointers as possible in a skip list? -- (data structures linked lists)
<p>From this main picture explaining <a href="https://en.wikipedia.org/wiki/Skip_list" rel="nofollow noreferrer">how skip lists work from Wikipedia</a>, we see that some nodes carry different amounts of pointers to othe... | habedi/stack-exchange-dataset |
51,983 | Computing a partial density matrix from an amplitude vector | <p>Suppose you're given the list of $2^{2n}$ complex coefficients defining the state of a $2n$ qubit register. You want to compute the $2^n \times 2^n$ density matrix of the first $n$ qubits.</p>

<p>Is it possible to compute the result in $O(4^n)$ time? That would be optimal, since the output has size $\Theta(... | algorithms quantum computing | 1 | Computing a partial density matrix from an amplitude vector -- (algorithms quantum computing)
<p>Suppose you're given the list of $2^{2n}$ complex coefficients defining the state of a $2n$ qubit register. You want to compute the $2^n \times 2^n$ density matrix of the first $n$ qubits.</p>

<p>Is it possible to ... | habedi/stack-exchange-dataset |
51,985 | The language of all base-10 integers that are multiples of 9 | <p>If I want to represent all the base 10 integers that are multiples of 9 as a language how do I do so?</p>

<p>Alphabets are finite sets.</p>
 | formal languages regular languages | 1 | The language of all base-10 integers that are multiples of 9 -- (formal languages regular languages)
<p>If I want to represent all the base 10 integers that are multiples of 9 as a language how do I do so?</p>

<p>Alphabets are finite sets.</p>
 | habedi/stack-exchange-dataset |
51,986 | Does a DFA accept an empty string if $q_0$ is the accept state? | <p>Suppose $q_0$ is the start state, does this mean that if it's the accept state, then the machine must accept the empty string since it cannot have a transition with the empty string?</p>
 | formal languages regular languages automata dfa | 1 | Does a DFA accept an empty string if $q_0$ is the accept state? -- (formal languages regular languages automata dfa)
<p>Suppose $q_0$ is the start state, does this mean that if it's the accept state, then the machine must accept the empty string since it cannot have a transition with the empty string?</p>
 | habedi/stack-exchange-dataset |
51,989 | What is the running time of this recursive algorithm? | <p>I made the following (ungolfed) Haskell program for the <a href="https://codegolf.stackexchange.com/questions/69271/fractal-smoke-sequence/69595#69595">code golf</a> challenge of computing the first $n$ values of <a href="https://oeis.org/A229037" rel="nofollow noreferrer">A229037</a>.</p>

<p>This is my pro... | algorithm analysis runtime analysis recurrence relation recursion | 1 | What is the running time of this recursive algorithm? -- (algorithm analysis runtime analysis recurrence relation recursion)
<p>I made the following (ungolfed) Haskell program for the <a href="https://codegolf.stackexchange.com/questions/69271/fractal-smoke-sequence/69595#69595">code golf</a> challenge of computing the... | habedi/stack-exchange-dataset |
51,991 | How to find the shortest path from some vertex in set $S$ to set $S'$ | <p>If i have a graph $G=(V,E)$, a subset of vertices $S \subset V$ and a second set of vertices $S' \subset (V\setminus S)$, what is the best way to find the shortest path connecting the two sets? That is, we are looking for a shortest path among all $S$-$S'$ paths. We can also assume all edge weights are positive.</p>... | algorithms graphs optimization shortest path | 1 | How to find the shortest path from some vertex in set $S$ to set $S'$ -- (algorithms graphs optimization shortest path)
<p>If i have a graph $G=(V,E)$, a subset of vertices $S \subset V$ and a second set of vertices $S' \subset (V\setminus S)$, what is the best way to find the shortest path connecting the two sets? Tha... | habedi/stack-exchange-dataset |
51,996 | Which formula corresponds to this K-Map? | <p>I have a K-Map and I need to figure out which expression isn't equivalent to the provided K-Map. </p>

<p>$f(w,x,y,z) = \sum(3,7,9,11,13,15) + \Phi(4,5,6)$
<a href="https://i.stack.imgur.com/XRjDQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XRjDQ.png" alt="Here is the K-Map"></a></... | logic boolean algebra propositional logic karnaugh map | 1 | Which formula corresponds to this K-Map? -- (logic boolean algebra propositional logic karnaugh map)
<p>I have a K-Map and I need to figure out which expression isn't equivalent to the provided K-Map. </p>

<p>$f(w,x,y,z) = \sum(3,7,9,11,13,15) + \Phi(4,5,6)$
<a href="https://i.stack.imgur.com/XRjDQ.png" re... | habedi/stack-exchange-dataset |
51,999 | Difference between virtual memory and job pool | <p>Both virtual memory and job pools store the processes temporarily on disk and bring them to memory at some later stage, so what is the actual difference in between them?</p>

<p>What I guess is that when a process is just created, it first goes to the job pool and then it is sent to the ready queue. Virtual ... | operating systems virtual memory | 1 | Difference between virtual memory and job pool -- (operating systems virtual memory)
<p>Both virtual memory and job pools store the processes temporarily on disk and bring them to memory at some later stage, so what is the actual difference in between them?</p>

<p>What I guess is that when a process is just cr... | habedi/stack-exchange-dataset |
52,008 | Is the maximum matching problem trivial when the graph is complete? | <p>I have a quick question.</p>

<p>The maximum matching problem is an easy problem but not a trivial one. I was wondering that if the bipartite graph was complete, is it a trivial problem?</p>

<p>I think we can just select an arbitrary edge $\{u,v\}$ and remove the vertices $u$ and $v$ from the graph ... | matching | 1 | Is the maximum matching problem trivial when the graph is complete? -- (matching)
<p>I have a quick question.</p>

<p>The maximum matching problem is an easy problem but not a trivial one. I was wondering that if the bipartite graph was complete, is it a trivial problem?</p>

<p>I think we can just sele... | habedi/stack-exchange-dataset |
52,009 | Is matrix "adjoint-squaring" faster than general matrix multiplication? | <p>The <a href="https://en.wikipedia.org/wiki/Coppersmith%E2%80%93Winograd_algorithm" rel="nofollow">best known algorithm(s)</a> for matrix multiplication of $n$-dimensional matrices take $O(n^{2.37})$ time. However, that's for matrices with totally independent contents. When the two matrices are related to each other ... | complexity theory time complexity matrices multiplication | 1 | Is matrix "adjoint-squaring" faster than general matrix multiplication? -- (complexity theory time complexity matrices multiplication)
<p>The <a href="https://en.wikipedia.org/wiki/Coppersmith%E2%80%93Winograd_algorithm" rel="nofollow">best known algorithm(s)</a> for matrix multiplication of $n$-dimensional matrices ta... | habedi/stack-exchange-dataset |
52,017 | Algorithmic Composition: generative vs transformative algorith | <p>What's the difference between <strong>generative</strong> and <strong>transformative</strong> algorithms in relation to algorithmic composition of music?</p>

<p>As I understand the basic idea of the algorithms themselves, generative uses past candidate values (output becomes input) as progenitors (parents) ... | algorithms terminology | 1 | Algorithmic Composition: generative vs transformative algorith -- (algorithms terminology)
<p>What's the difference between <strong>generative</strong> and <strong>transformative</strong> algorithms in relation to algorithmic composition of music?</p>

<p>As I understand the basic idea of the algorithms themsel... | habedi/stack-exchange-dataset |
52,031 | Random sampling of tuples | <p>When I talked with students about pseudo-random number generation, I mentioned that you should not blindly use subsequent outputs of a pseudo-random number generator (PRNG) to form tuples as they may not be uniformly random then; a famous example is <a href="https://en.wikipedia.org/wiki/RANDU" rel="nofollow">RANDU<... | reference request randomness sampling pseudo random generators | 1 | Random sampling of tuples -- (reference request randomness sampling pseudo random generators)
<p>When I talked with students about pseudo-random number generation, I mentioned that you should not blindly use subsequent outputs of a pseudo-random number generator (PRNG) to form tuples as they may not be uniformly random... | habedi/stack-exchange-dataset |
52,037 | Proving that the reversal of a language reversal is that language | <p>I am trying to prove that with language L, (L^R) ^R =L
So that the reversal of the reversal of the language is the original language L.</p>

<p>I have proved that before with a <strong>string not language</strong> (let's call it a string 's').</p>

<pre><code>(s^R)^R = s.
Proof by induction o... | strings induction | 1 | Proving that the reversal of a language reversal is that language -- (strings induction)
<p>I am trying to prove that with language L, (L^R) ^R =L
So that the reversal of the reversal of the language is the original language L.</p>

<p>I have proved that before with a <strong>string not language</strong> (l... | habedi/stack-exchange-dataset |
52,038 | How can I sum pixel values over a rotated rectangle? | <p>I have an optimization problem in which I need to sum pixel values in an image over a rectangular region. This is a core component of the optimization so it will be done often and the naive solution is not fast enough. </p>

<p>The region can be rotated arbitrarily so that I can't use an <a href="https://en.... | computational geometry computer vision | 1 | How can I sum pixel values over a rotated rectangle? -- (computational geometry computer vision)
<p>I have an optimization problem in which I need to sum pixel values in an image over a rectangular region. This is a core component of the optimization so it will be done often and the naive solution is not fast enough. <... | habedi/stack-exchange-dataset |
52,053 | Does Heapsort work in time o(n log n) in the best case? | <p>Is it possible for Heapsort to work in time $o(n\log n)$ on certain inputs?</p>

<p>For example in case of Insertion sort it is possible, however when it comes to Quickssort it is not possible. What about Heapsort? I tried to find an input array such that Heapsort will be working in $o(n\log n)$.</p>
&#... | algorithms runtime analysis sorting lower bounds heap sort | 1 | Does Heapsort work in time o(n log n) in the best case? -- (algorithms runtime analysis sorting lower bounds heap sort)
<p>Is it possible for Heapsort to work in time $o(n\log n)$ on certain inputs?</p>

<p>For example in case of Insertion sort it is possible, however when it comes to Quickssort it is not possi... | habedi/stack-exchange-dataset |
52,056 | programs compatible with different processors | <p>Ok, I've been told for years that during the old days, a program written on a certain machine would run only on that machine but now, programs run on multiple types of computers. </p>

<p>What does this really mean? I mean, does it mean that programs were written for certain instruction sets of the processor... | computer architecture software engineering | 1 | programs compatible with different processors -- (computer architecture software engineering)
<p>Ok, I've been told for years that during the old days, a program written on a certain machine would run only on that machine but now, programs run on multiple types of computers. </p>

<p>What does this really mean?... | habedi/stack-exchange-dataset |
52,065 | two languages reducible to each other can belong to RE and recursive? | <p>If two languages L1 and L2 both are reducible to each other in polynomial time then which of the following is false?</p>

<p><strong>A</strong> L1 is decidable and L2 is undecidable.</p>

<p><strong>B</strong> L1 is recursive and l2 is RE</p>

<p><strong>C</strong> both</p>

<p><st... | computability undecidability | 1 | two languages reducible to each other can belong to RE and recursive? -- (computability undecidability)
<p>If two languages L1 and L2 both are reducible to each other in polynomial time then which of the following is false?</p>

<p><strong>A</strong> L1 is decidable and L2 is undecidable.</p>

<p><stro... | habedi/stack-exchange-dataset |
52,071 | How to optimize a function by maximizing 1 variable and minimizing another? | <p><strong>Problem</strong></p>

<p>I want to implement an optimization algorithm for my file transfer program.</p>

<p>The program buffers data in a local file before uploading to central server periodically and it compresses the files before transferring.</p>

<p>I would want the program to in... | optimization machine learning gradient descent | 1 | How to optimize a function by maximizing 1 variable and minimizing another? -- (optimization machine learning gradient descent)
<p><strong>Problem</strong></p>

<p>I want to implement an optimization algorithm for my file transfer program.</p>

<p>The program buffers data in a local file before uploadin... | habedi/stack-exchange-dataset |
52,072 | Importance of a person to another person in social network | <p>In social network (an unweighted indirect network), is there some measure of importance of a person <code>A</code> on another person <code>B</code>, denote as <code>I(A,B)</code>, so that (approximately):</p>

<ol>
<li>The smaller the shortest distance between <code>A, B</code> in the the network, the hi... | graphs social networks | 1 | Importance of a person to another person in social network -- (graphs social networks)
<p>In social network (an unweighted indirect network), is there some measure of importance of a person <code>A</code> on another person <code>B</code>, denote as <code>I(A,B)</code>, so that (approximately):</p>

<ol>
<li... | habedi/stack-exchange-dataset |
52,077 | Maximal difference of height between two leaves in an AVL tree | <p>What is the maximal difference between heights of leaves in an AVL tree? I am interested only in the asymptotic difference. </p>

<p>I am not sure about my answer - I think that it is $O(\log n)$, given the fact that at every level we may have difference equal one. </p>

<p>Am I right?</p>
 | binary trees balanced search trees | 1 | Maximal difference of height between two leaves in an AVL tree -- (binary trees balanced search trees)
<p>What is the maximal difference between heights of leaves in an AVL tree? I am interested only in the asymptotic difference. </p>

<p>I am not sure about my answer - I think that it is $O(\log n)$, given th... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.