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 |
|---|---|---|---|---|---|---|
28,766 | What is the term for this set | <p>I have a set of related data/objects for which, when undergoing some algorithm, there should be only one valid match. Is there a unique term for this type of set?</p>

<p>A common practical use case would be a list displayed for user selection, or a list of keys that should have a single corresponding entry ... | terminology sets | 1 | What is the term for this set -- (terminology sets)
<p>I have a set of related data/objects for which, when undergoing some algorithm, there should be only one valid match. Is there a unique term for this type of set?</p>

<p>A common practical use case would be a list displayed for user selection, or a list of... | habedi/stack-exchange-dataset |
28,780 | Are neural networks dynamical systems? | <p><a href="http://en.wikipedia.org/wiki/Dynamical_system" rel="nofollow">Dynamical systems</a> are those whose evolution can be described by a rule, evolves with time and is deterministic. In this context can I say that Neural networks have a rule of evolution which is the activation function $f(\text{sum of product o... | terminology artificial intelligence neural networks | 1 | Are neural networks dynamical systems? -- (terminology artificial intelligence neural networks)
<p><a href="http://en.wikipedia.org/wiki/Dynamical_system" rel="nofollow">Dynamical systems</a> are those whose evolution can be described by a rule, evolves with time and is deterministic. In this context can I say that Neu... | habedi/stack-exchange-dataset |
28,782 | Variable Length Encoding of Integers Using a Modulus Algorithm | <p>Continuing on the theme from my last question <a href="https://cs.stackexchange.com/questions/28719/variable-length-encoding-of-integers">Variable Length Encoding of Integers</a>, I have come up with a simple encoding scheme, but for which an efficient algorithm eludes me.</p>

<p>The constraints are simple ... | algorithms encoding scheme | 1 | Variable Length Encoding of Integers Using a Modulus Algorithm -- (algorithms encoding scheme)
<p>Continuing on the theme from my last question <a href="https://cs.stackexchange.com/questions/28719/variable-length-encoding-of-integers">Variable Length Encoding of Integers</a>, I have come up with a simple encoding sche... | habedi/stack-exchange-dataset |
28,783 | How to decode multiple-digit gamma codes and get the gap sequence? | <p>How to decode gamma code ($\gamma$ code): </p>

<pre><code>1110001110101011111101101111011
</code></pre>

<p>and get the gap sequence?</p>

<p>Detailed information about Gamma codes ($\gamma$ codes) with a brief example of decoding can be found <a href="http://nlp.stanford.edu/IR-book/ht... | algorithms data compression coding theory information retrieval | 1 | How to decode multiple-digit gamma codes and get the gap sequence? -- (algorithms data compression coding theory information retrieval)
<p>How to decode gamma code ($\gamma$ code): </p>

<pre><code>1110001110101011111101101111011
</code></pre>

<p>and get the gap sequence?</p>

<p>Detailed ... | habedi/stack-exchange-dataset |
28,787 | Is Post's Correspondence Problem decidable with fixed word size? | <p>So, it's known that PCP is undecidable even when we fix the number of tiles to $n \geq 7$.</p>

<p>I'm wondering, can anything similar be said for when there is a fixed word length?</p>

<p>To be precise, here's the problem:</p>

<blockquote>
 <p>Given fixed $m$ and $n$, with $n \geq 7$,... | computability undecidability decision problem | 1 | Is Post's Correspondence Problem decidable with fixed word size? -- (computability undecidability decision problem)
<p>So, it's known that PCP is undecidable even when we fix the number of tiles to $n \geq 7$.</p>

<p>I'm wondering, can anything similar be said for when there is a fixed word length?</p>
&#x... | habedi/stack-exchange-dataset |
28,802 | How to prove that a predicate is prefix closed | <p>Suppose we have the predicate</p>

<p>$\qquad A.p.q ≡ (∀i \mid p≤i≤j<q : X.i≤X.j)$</p>

<p>which says that $X[p..q)$ is ascending.</p>

<p>Apparently, the predicate holds for empty segments, is prefix closed and is postfix closed.</p>

<p>I would like to prove that the predicate ab... | logic proof techniques first order logic | 1 | How to prove that a predicate is prefix closed -- (logic proof techniques first order logic)
<p>Suppose we have the predicate</p>

<p>$\qquad A.p.q ≡ (∀i \mid p≤i≤j<q : X.i≤X.j)$</p>

<p>which says that $X[p..q)$ is ascending.</p>

<p>Apparently, the predicate holds for empty segments, is pre... | habedi/stack-exchange-dataset |
28,817 | Why does reduction from vertex cover to subset sum use base-4? | <p>Why does reduction from vertex cover to subset sum use base-4? </p>

<p><a href="http://web.engr.illinois.edu/~jeffe/teaching/algorithms/notes/30-nphard.pdf" rel="nofollow">30.13 Subset Sum (from Vertex Cover)</a></p>
 | complexity theory reductions proof techniques | 1 | Why does reduction from vertex cover to subset sum use base-4? -- (complexity theory reductions proof techniques)
<p>Why does reduction from vertex cover to subset sum use base-4? </p>

<p><a href="http://web.engr.illinois.edu/~jeffe/teaching/algorithms/notes/30-nphard.pdf" rel="nofollow">30.13 Subset Sum (from... | habedi/stack-exchange-dataset |
28,821 | Choice of algorithm for hierarchical clustering for minimizing network communication costs | <p>Suppose I have a large distributed task running on a cluster system where part of the workload is compute bound and part depends on network performance. Data transfer is not completely homogeneous between processes - some communication pairs are more or less sensitive to bandwidth and latency than others.</p>
&... | algorithms graphs computer networks weighted graphs assignment problem | 1 | Choice of algorithm for hierarchical clustering for minimizing network communication costs -- (algorithms graphs computer networks weighted graphs assignment problem)
<p>Suppose I have a large distributed task running on a cluster system where part of the workload is compute bound and part depends on network performanc... | habedi/stack-exchange-dataset |
28,830 | Pick a subgraph that maximizes the total cost of min-spanning tree among all subgraphs of the same size | <p>There is a complete graph $G$ with $n$ vertices and each edge has a distinct weight.</p>

<p>Is there an efficient (not necessarily optimal) algorithm to select $k$ vertices from the graph $G$, such that the total cost of the min-spanning tree of the selected $k$ vertices will be highest?</p>

<p>In ... | algorithms graphs optimization | 1 | Pick a subgraph that maximizes the total cost of min-spanning tree among all subgraphs of the same size -- (algorithms graphs optimization)
<p>There is a complete graph $G$ with $n$ vertices and each edge has a distinct weight.</p>

<p>Is there an efficient (not necessarily optimal) algorithm to select $k$ vert... | habedi/stack-exchange-dataset |
28,832 | Infer number of comets, based upon observations of their periodic visits to Earth | <p>Can we algorithmically infer the number of comets that orbit the Earth, based upon periodic observations of them, if we cannot tell the comets apart? In more detail:</p>
<h3>The problem</h3>
<ul>
<li><p>There is an unknown, fixed number of comets, <code>numComets</code> that pass by
Earth and are vi... | algorithms | 1 | Infer number of comets, based upon observations of their periodic visits to Earth -- (algorithms)
<p>Can we algorithmically infer the number of comets that orbit the Earth, based upon periodic observations of them, if we cannot tell the comets apart? In more detail:</p>
<h3>The problem</h3>
<ul>
<li><p>The... | habedi/stack-exchange-dataset |
28,848 | Poly-time computability of inversion of poly-time real functions | <p>At pp. 7-8 of Ker-I Ko's Computational Complexity of Real Functions (1991), the following is stated for one dimensional cases:</p>

<blockquote>
 <p>Let $INV_1$ be the operator that maps a one-to-one function $f:[0,1]\rightarrow [0,1]$ to its inverse function $f^{-1}$. Then $INV_1(f)$ is polynomial-time... | complexity theory computable analysis | 1 | Poly-time computability of inversion of poly-time real functions -- (complexity theory computable analysis)
<p>At pp. 7-8 of Ker-I Ko's Computational Complexity of Real Functions (1991), the following is stated for one dimensional cases:</p>

<blockquote>
 <p>Let $INV_1$ be the operator that maps a one-to-... | habedi/stack-exchange-dataset |
28,849 | Is it possible to go from code to circuit? | <p>I am wondering if it is possible to have a program that interprets programming code and is capable of turning that code into an optimized circuit. Is this possible, and if so, does it exist?</p>
 | compilers interpreters | 1 | Is it possible to go from code to circuit? -- (compilers interpreters)
<p>I am wondering if it is possible to have a program that interprets programming code and is capable of turning that code into an optimized circuit. Is this possible, and if so, does it exist?</p>
 | habedi/stack-exchange-dataset |
28,858 | Expressive power of lexer + parser | <p>Most modern compilers split their syntax analysis into
a lexical phase that is followed by a parsing phase.
The lexical phase is given by a regular expression, while parsing
is guided by a context-free grammar. </p>

<p>What class of languages can be recognised this way? 
Context-free languag... | formal languages parsing | 1 | Expressive power of lexer + parser -- (formal languages parsing)
<p>Most modern compilers split their syntax analysis into
a lexical phase that is followed by a parsing phase.
The lexical phase is given by a regular expression, while parsing
is guided by a context-free grammar. </p>

<p>What class o... | habedi/stack-exchange-dataset |
28,873 | Can A still be a key if two tuples are the same | <p>I am studying database functional dependency. It says if A can functionally determine all other attributes, it is considered to be a key.<br></p>

<p>What if 2 tuples are exactly the same, can we still say A is a key? To me A cannot determine an unique tuple.</p>
 | terminology database theory | 1 | Can A still be a key if two tuples are the same -- (terminology database theory)
<p>I am studying database functional dependency. It says if A can functionally determine all other attributes, it is considered to be a key.<br></p>

<p>What if 2 tuples are exactly the same, can we still say A is a key? To me A ca... | habedi/stack-exchange-dataset |
28,886 | How to sort using $\texttt{SQRTSORT}$ as a subroutine which sorts $\sqrt{n}$ of consecutive elements? | <p>I am teaching myself algorithms with the <a href="http://web.engr.illinois.edu/~jeffe/teaching/algorithms/notes/all-notes.pdf" rel="nofollow">online lecture notes by Jeff Erickson</a> and fails to solve the following problem (Problem 21 of Lecture 1).</p>

<blockquote>
 <p>(a) Describe an algorithm that... | algorithms complexity theory algorithm analysis time complexity sorting | 1 | How to sort using $\texttt{SQRTSORT}$ as a subroutine which sorts $\sqrt{n}$ of consecutive elements? -- (algorithms complexity theory algorithm analysis time complexity sorting)
<p>I am teaching myself algorithms with the <a href="http://web.engr.illinois.edu/~jeffe/teaching/algorithms/notes/all-notes.pdf" rel="nofoll... | habedi/stack-exchange-dataset |
28,889 | Feasible solution existence | <p>I wonder what is the fastest way to check whether the intersection of a set of half-spaces is empty. </p>

<p>Right now I'm using a linear programming formulation (with <a href="http://www.gurobi.com/" rel="nofollow noreferrer">Gurobi</a> as solver) to check if there is any feasible solution to a linear prog... | algorithms computational geometry decision problem linear programming | 1 | Feasible solution existence -- (algorithms computational geometry decision problem linear programming)
<p>I wonder what is the fastest way to check whether the intersection of a set of half-spaces is empty. </p>

<p>Right now I'm using a linear programming formulation (with <a href="http://www.gurobi.com/" rel=... | habedi/stack-exchange-dataset |
28,890 | are there any decidable problems not verifiable in polynomial time? | <p>As I understand it NP requires a solution to be verifiable in polynomial time. Can you provide examples of solvable problems not verifiable in polynomial time ?</p>
 | complexity theory computability | 1 | are there any decidable problems not verifiable in polynomial time? -- (complexity theory computability)
<p>As I understand it NP requires a solution to be verifiable in polynomial time. Can you provide examples of solvable problems not verifiable in polynomial time ?</p>
 | habedi/stack-exchange-dataset |
28,894 | If x operations cost O(x) amortized then how much xy operations cost? | <p>True or False?</p>

<p>Say some data structure can perform $x$ operations in amortized $O(x)$ time.
Then for a big enough $y$ it can perform $xy$ operations in worst case $O(xy)$ time.</p>

<p>My attempt:</p>

<p>$x$ operations in $O(x)$ amortized means $O(1)$ expected time for $1$ operat... | algorithm analysis amortized analysis | 1 | If x operations cost O(x) amortized then how much xy operations cost? -- (algorithm analysis amortized analysis)
<p>True or False?</p>

<p>Say some data structure can perform $x$ operations in amortized $O(x)$ time.
Then for a big enough $y$ it can perform $xy$ operations in worst case $O(xy)$ time.</p>
... | habedi/stack-exchange-dataset |
28,897 | Bellman-Ford and zero-distance cycle | <p>Problem statement: Given a graph G(V,E) which is not acyclic and may have negative edge weights (and thus may possibly have negative-length cycles), how does one detect if the graph has a zero-length cycle, and no negative-length cycles?</p>

<p>Background information: The question came up when I tried to im... | algorithms graphs shortest path | 1 | Bellman-Ford and zero-distance cycle -- (algorithms graphs shortest path)
<p>Problem statement: Given a graph G(V,E) which is not acyclic and may have negative edge weights (and thus may possibly have negative-length cycles), how does one detect if the graph has a zero-length cycle, and no negative-length cycles?</p>&#... | habedi/stack-exchange-dataset |
28,910 | Finding an element in a sorted array with at most three queries to larger elements | <p>Given a sorted array <strong>A</strong>, we have to find the position of an element <strong><em>m</em></strong> in it. (It is also given that the element exists in the array.)</p>

<p>However there is a constraint. Like in a game you have <strong>3</strong> lives. If you probe any element <strong><em>x</em><... | algorithms search algorithms search problem algorithm design | 1 | Finding an element in a sorted array with at most three queries to larger elements -- (algorithms search algorithms search problem algorithm design)
<p>Given a sorted array <strong>A</strong>, we have to find the position of an element <strong><em>m</em></strong> in it. (It is also given that the element exists in the ... | habedi/stack-exchange-dataset |
28,915 | What is the maximum directly adddressable memory capacity? | <p>This is taken from <em>OPERATING SYSTEMS: INTERNALS AND DESIGN PRINCIPLES by WILLIAM STALLINGS</em></p>

<p>Consider a 32-bit microprocessor composed of 2 fields: the first byte contains the opcode and remainder an immediate operand or an operand address.
What is the maximum directly addressable memory c... | computer architecture operating systems memory hardware | 1 | What is the maximum directly adddressable memory capacity? -- (computer architecture operating systems memory hardware)
<p>This is taken from <em>OPERATING SYSTEMS: INTERNALS AND DESIGN PRINCIPLES by WILLIAM STALLINGS</em></p>

<p>Consider a 32-bit microprocessor composed of 2 fields: the first byte contains th... | habedi/stack-exchange-dataset |
28,919 | How can we design an efficient warehouse management program? | <p>Assume that we want to develop a warehouse management system, which picks up plastic boxes and stacks them on a pallet. A pallet has a maximum of 5 vertical box stacks and the maximum height of a box stack is 1400 mm. There are 3 box sizes with varying heights (other dimensions are the same). The heights of the boxe... | algorithms packing | 1 | How can we design an efficient warehouse management program? -- (algorithms packing)
<p>Assume that we want to develop a warehouse management system, which picks up plastic boxes and stacks them on a pallet. A pallet has a maximum of 5 vertical box stacks and the maximum height of a box stack is 1400 mm. There are 3 bo... | habedi/stack-exchange-dataset |
28,923 | Reduction to Maximum Independent Set | <p>Suppose you had a set $P$ of people. Every person $p_j \in P$ is familiar with atleast one other person $p_i$ (familiarity is symmetric). Is there a subset $S$ of people such that for $|S| \ge k$, no two people in $S$ know each other? Show that the problem is NP-Complete.</p>

<p>Clearly this resembles the M... | complexity theory np complete reductions np | 1 | Reduction to Maximum Independent Set -- (complexity theory np complete reductions np)
<p>Suppose you had a set $P$ of people. Every person $p_j \in P$ is familiar with atleast one other person $p_i$ (familiarity is symmetric). Is there a subset $S$ of people such that for $|S| \ge k$, no two people in $S$ know each oth... | habedi/stack-exchange-dataset |
28,926 | What could 'two characters are terminals' mean? | <p>In the context of this statement, what does 'a & b are terminals' mean?</p>

<blockquote>
 <p>Stacks and queues can be used for determining whether a particular
 input string is in the language or not. </p>
 
 <p>L = {a^nb^m | m,n >= 0, m >= n, and a & b are terminals}</p>
 &... | formal languages terminology | 1 | What could 'two characters are terminals' mean? -- (formal languages terminology)
<p>In the context of this statement, what does 'a & b are terminals' mean?</p>

<blockquote>
 <p>Stacks and queues can be used for determining whether a particular
 input string is in the language or not. </p>
 ... | habedi/stack-exchange-dataset |
28,944 | Semantic Code Comparison | <p>Consider two codes that do the same thing, in the same time and memory order, But they don't do it exactly the same way. Is there any Idea for a program to declare those codes as the same?</p>

<p>For Example:</p>

<p><strong>Change Vars 1</strong></p>

<pre><code>a = a + b;
b = a - b;&#x... | terminology semantics | 1 | Semantic Code Comparison -- (terminology semantics)
<p>Consider two codes that do the same thing, in the same time and memory order, But they don't do it exactly the same way. Is there any Idea for a program to declare those codes as the same?</p>

<p>For Example:</p>

<p><strong>Change Vars 1</strong><... | habedi/stack-exchange-dataset |
28,951 | Algorithm to partially sort list into equal-sized buckets | <p>Suppose I have a large list of numbers that I want to divide into equal-sized buckets so that every bucket contains only larger numbers than buckets to its left. Numbers within each bucket don't need to be sorted.</p>

<p>For example, for the input</p>

<pre><code>[64, 72, 57, 47, 5, 4, 64, 21, 64, 6... | algorithms sorting | 1 | Algorithm to partially sort list into equal-sized buckets -- (algorithms sorting)
<p>Suppose I have a large list of numbers that I want to divide into equal-sized buckets so that every bucket contains only larger numbers than buckets to its left. Numbers within each bucket don't need to be sorted.</p>

<p>For e... | habedi/stack-exchange-dataset |
28,962 | How, in hardware, MIPS can access a word in the middle of an address | <p>This is am example of a RAM address in the MIPS architecture (32 bits)</p>

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

<p>I can imagine the RAM as having 32 pins just to inform the RAM address I want to access, so I can access each of these words in the... | computer architecture memory management | 1 | How, in hardware, MIPS can access a word in the middle of an address -- (computer architecture memory management)
<p>This is am example of a RAM address in the MIPS architecture (32 bits)</p>

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

<p>I can imagine the... | habedi/stack-exchange-dataset |
28,963 | Halting problem without self-reference | <p>In the halting problem, we are interested if there is a Turing machine $T$ that can tell whether a given Turing machine $M$ halts or not on a given input $i$. Usually, the proof starts assuming such a $T$ exists. Then, we consider a case where we restrict $i$ to $M$ itself, and then derive a contradiction by using a... | computability undecidability halting problem | 1 | Halting problem without self-reference -- (computability undecidability halting problem)
<p>In the halting problem, we are interested if there is a Turing machine $T$ that can tell whether a given Turing machine $M$ halts or not on a given input $i$. Usually, the proof starts assuming such a $T$ exists. Then, we consid... | habedi/stack-exchange-dataset |
28,972 | Recursive equations vs. inference rules | <p>It seems to me that recursive equations can always be presented as inference rules. For the forward direction, an example is addition over Peono numerals (built from $O$ and $S(\_)$)</p>

<p>$$
\begin{align}
add(O, m) & = m \\
add(S(n), m) & = S(add(n, m))
\end{align}
$$</p>&#... | logic recursion | 1 | Recursive equations vs. inference rules -- (logic recursion)
<p>It seems to me that recursive equations can always be presented as inference rules. For the forward direction, an example is addition over Peono numerals (built from $O$ and $S(\_)$)</p>

<p>$$
\begin{align}
add(O, m) & = m \\
a... | habedi/stack-exchange-dataset |
28,980 | Interleaving algorithm for 2 stacks | <p>Suppose I have two stacks $<a_1,a_2,...a_m>$ and $<b_1, b_2,...b_n>$ and a third stack of size $m+n$.
I want to have the third stack in the following manner, $$<a_1,b_1,a_2,b_2,...a_n,b_n...a_m-1,a_m>$$ for $$m>n$$
This was easy to do if the two initial stacks were not size constrained. ... | algorithms data structures stacks | 1 | Interleaving algorithm for 2 stacks -- (algorithms data structures stacks)
<p>Suppose I have two stacks $<a_1,a_2,...a_m>$ and $<b_1, b_2,...b_n>$ and a third stack of size $m+n$.
I want to have the third stack in the following manner, $$<a_1,b_1,a_2,b_2,...a_n,b_n...a_m-1,a_m>$$ for $$m>n$$&#x... | habedi/stack-exchange-dataset |
28,991 | Satisfying all the conditions of case 3 of the Master Method except the regularity condition | <p>The regularity condition of case 3 of Master Method says that $af(n/b) < cf(n)$, for $c < 1$.</p>

<p>How to devise a recurrence relation that satisfies all other conditions of case 3 except the regularity condition?</p>
 | recurrence relation master theorem | 1 | Satisfying all the conditions of case 3 of the Master Method except the regularity condition -- (recurrence relation master theorem)
<p>The regularity condition of case 3 of Master Method says that $af(n/b) < cf(n)$, for $c < 1$.</p>

<p>How to devise a recurrence relation that satisfies all other condit... | habedi/stack-exchange-dataset |
28,993 | Error-correction code for transmission only with bit-flipping from 0 to 1 | <p>I am using a transmission system that uses a Bloom filter (this part is out of my control). I want to send a small amount of data (32 bits) using this system.</p>

<p>For each bit [0,31], I add its index to the Bloom filter if the corresponding bit is set. The Bloom filter is then transmitted without error a... | information theory coding theory error correcting codes | 1 | Error-correction code for transmission only with bit-flipping from 0 to 1 -- (information theory coding theory error correcting codes)
<p>I am using a transmission system that uses a Bloom filter (this part is out of my control). I want to send a small amount of data (32 bits) using this system.</p>

<p>For eac... | habedi/stack-exchange-dataset |
29,005 | Generating hard puzzles for a backtracking snake | <p>Let $M$ be a matrix of height $h$ and width $w$. Each entry of $M$ is an integer.</p>

<p>There is a snake that starts from the "left side" of $M$, and its goal is to reach the "right side" of $M$. To get from one side to the other, i.e. to move from column $c$ to column $c+1$, the snake must choose an integ... | artificial intelligence search problem backtracking | 1 | Generating hard puzzles for a backtracking snake -- (artificial intelligence search problem backtracking)
<p>Let $M$ be a matrix of height $h$ and width $w$. Each entry of $M$ is an integer.</p>

<p>There is a snake that starts from the "left side" of $M$, and its goal is to reach the "right side" of $M$. To ge... | habedi/stack-exchange-dataset |
29,008 | Is it possible to implement a Neural Network using a graph data structure? | <p>I'm trying to implement a feedforward neural network using a graph.
The thing is: I haven't found any example in which is used a graph data structure.
So far the examples I've found used arrays.</p>

<p>Can anyone please point me in the direction of some literature on the topic or some tutorial?</p>&... | graphs artificial intelligence neural networks | 1 | Is it possible to implement a Neural Network using a graph data structure? -- (graphs artificial intelligence neural networks)
<p>I'm trying to implement a feedforward neural network using a graph.
The thing is: I haven't found any example in which is used a graph data structure.
So far the examples I've found ... | habedi/stack-exchange-dataset |
29,018 | Guessing Number Game | <p>I was solving <a href="https://www.hackerrank.com/contests/addepar/challenges/guessing-numbers">this</a> question. It is as follows</p>

<blockquote>
 <p>Joe picks an integer from the list $1,2,\cdots,N$ with a probability $p_i$ of picking $i$ for all $1\leq i \leq N$. He then gives Jason $K$ attempts t... | algorithms dynamic programming | 1 | Guessing Number Game -- (algorithms dynamic programming)
<p>I was solving <a href="https://www.hackerrank.com/contests/addepar/challenges/guessing-numbers">this</a> question. It is as follows</p>

<blockquote>
 <p>Joe picks an integer from the list $1,2,\cdots,N$ with a probability $p_i$ of picking $i$ for... | habedi/stack-exchange-dataset |
29,021 | How do locks work? | <p>Suppose I have an application with two threads, which both use the same resource.
Normally, a synchronized block keeps these threads from messing with the resource in a way the user doesn't expect.
I understand why you do this, but I need an explanation how it is done, especially on the following part.</p>&#... | concurrency threads synchronization deadlocks | 1 | How do locks work? -- (concurrency threads synchronization deadlocks)
<p>Suppose I have an application with two threads, which both use the same resource.
Normally, a synchronized block keeps these threads from messing with the resource in a way the user doesn't expect.
I understand why you do this, but I need ... | habedi/stack-exchange-dataset |
29,026 | Does modern type theory include specifications and implementations? | <p>Good programming practice distinguishes between specification (at the API level) and implementation. I would have thought that this same distinction would be found in type theory. Perhaps I just don't understand what I'm reading, but I don't see it.</p>

<p>Apologies if I'm completely off (and corrections ap... | terminology type theory | 1 | Does modern type theory include specifications and implementations? -- (terminology type theory)
<p>Good programming practice distinguishes between specification (at the API level) and implementation. I would have thought that this same distinction would be found in type theory. Perhaps I just don't understand what I'm... | habedi/stack-exchange-dataset |
29,033 | Bit distance and disruption | <p>Earlier, I asked <a href="https://cs.stackexchange.com/questions/27950/disruption-in-the-context-of-genetic-algorithms">a question</a> defining disruption in Genetic Algorithms. Given that definition, I'm still confused on how to answer the following question.</p>

<blockquote>
 <p>True or false? For 1... | algorithms genetic algorithms | 1 | Bit distance and disruption -- (algorithms genetic algorithms)
<p>Earlier, I asked <a href="https://cs.stackexchange.com/questions/27950/disruption-in-the-context-of-genetic-algorithms">a question</a> defining disruption in Genetic Algorithms. Given that definition, I'm still confused on how to answer the following que... | habedi/stack-exchange-dataset |
29,040 | Can I use breadth-first search for topological sorting? | <p>Can I use breadth-first search for topologicallly sort vertices and finding strongly connected components in a graph?</p>

<p>If yes, how can I do that? If not, why?</p>

<p>I tried with a simple acyclic graph of 3 vertices, gave the start and finish time as we do in DFS and then sorted them in non-i... | algorithms graphs sorting | 1 | Can I use breadth-first search for topological sorting? -- (algorithms graphs sorting)
<p>Can I use breadth-first search for topologicallly sort vertices and finding strongly connected components in a graph?</p>

<p>If yes, how can I do that? If not, why?</p>

<p>I tried with a simple acyclic graph of 3... | habedi/stack-exchange-dataset |
29,041 | The image of a recursive language under a computable function | <p>Let $f:\Sigma^{*}\to\Sigma^{*}$ be a computable function and let $L$ be a recursive language. Is $f(L):=\left \{{f(w)|w\in L} \right\}$ recursive?</p>

<p>Here, I see clearly, that $f^{-1}(L)$ is recursive (simply by applying $f$ on an input $w$, and then see if $f(w)$ belongs to $L$). </p>

<p>My in... | computability undecidability closure properties | 1 | The image of a recursive language under a computable function -- (computability undecidability closure properties)
<p>Let $f:\Sigma^{*}\to\Sigma^{*}$ be a computable function and let $L$ be a recursive language. Is $f(L):=\left \{{f(w)|w\in L} \right\}$ recursive?</p>

<p>Here, I see clearly, that $f^{-1}(L)$ i... | habedi/stack-exchange-dataset |
29,043 | Why is a program with only atomics in SC-DRF but not in HRF-direct? | <p>In the paper "Heterogeneous-Race-Free Memory Models" [1], the authors state that a program consisting only of atomic is race free in SC-DRF but it is not in HRF-direct. I am not able to understand why this is. Can anyone explain how this can happen?</p>

<p>[1] Derek R. Hower <em>et al.</em>, "Heterogeneous-... | concurrency | 1 | Why is a program with only atomics in SC-DRF but not in HRF-direct? -- (concurrency)
<p>In the paper "Heterogeneous-Race-Free Memory Models" [1], the authors state that a program consisting only of atomic is race free in SC-DRF but it is not in HRF-direct. I am not able to understand why this is. Can anyone explain how... | habedi/stack-exchange-dataset |
29,051 | Can the Euclidean distance function be computed using only XOR's | <p>The Eulidean distance function $d$ of $x$ and $y$ is given by:</p>

<p>$
d(x,y)=\sqrt{x^2-y^2}
$</p>

<p>Let us assume that $x$ and $y$ are fixed-point numbers, or $x,y$ are element of some subfield $f_n$ of $F_p$. We could even assume that $x,y$ have precision $n$ decimal digits. Any facilit... | arithmetic boolean algebra euclidean distance | 1 | Can the Euclidean distance function be computed using only XOR's -- (arithmetic boolean algebra euclidean distance)
<p>The Eulidean distance function $d$ of $x$ and $y$ is given by:</p>

<p>$
d(x,y)=\sqrt{x^2-y^2}
$</p>

<p>Let us assume that $x$ and $y$ are fixed-point numbers, or $x,y$ are ele... | habedi/stack-exchange-dataset |
29,058 | Can we construct a binary tree with width and height Θ(n)? | <p>we know this definition:</p>

<p>Given a binary tree, Width of a tree is maximum of widths of all levels.</p>

<p>Let us consider the below example tree.</p>

<pre><code> 1
 / \
 2 3
 / \ \
4 5 8 
 / \
 6 7
</code></pre... | graphs asymptotics trees binary trees | 1 | Can we construct a binary tree with width and height Θ(n)? -- (graphs asymptotics trees binary trees)
<p>we know this definition:</p>

<p>Given a binary tree, Width of a tree is maximum of widths of all levels.</p>

<p>Let us consider the below example tree.</p>

<pre><code> 1
 / \&#... | habedi/stack-exchange-dataset |
29,062 | Connection of "modern" runtimes and number of steps on a Turing machine | <p>Why an evaluation of Turing machine efficiency is equal to the algorithm which is implemented by this machine and vise versa? For example, we can say that efficiency of merge sorting algorithm is O(nlog(n)) and therefore Turing machine which implements this algorithm will do O(nlog(n)) steps. Why is this conclusion ... | algorithms complexity theory turing machines runtime analysis simulation | 1 | Connection of "modern" runtimes and number of steps on a Turing machine -- (algorithms complexity theory turing machines runtime analysis simulation)
<p>Why an evaluation of Turing machine efficiency is equal to the algorithm which is implemented by this machine and vise versa? For example, we can say that efficiency o... | habedi/stack-exchange-dataset |
29,069 | Does this algorithm on a circular linked list ever terminate? | <p>Suppose we have a circular linked list that has nodes $1$ to $n$. <code>L</code> is a pointer that points to node <code>1</code> (with label $1$). Note <code>i</code> has a link to <code>i+1</code> and we have a link from node <code>n</code> to node <code>1</code> because the list is circular.</p>

<p>Now we... | data structures linked lists | 1 | Does this algorithm on a circular linked list ever terminate? -- (data structures linked lists)
<p>Suppose we have a circular linked list that has nodes $1$ to $n$. <code>L</code> is a pointer that points to node <code>1</code> (with label $1$). Note <code>i</code> has a link to <code>i+1</code> and we have a link from... | habedi/stack-exchange-dataset |
29,071 | Language of a grammar | <p>What's the language of following grammar?</p>

<p>$G: S \to S_1B$</p>

<p>$S_1 \to aS_1b$</p>

<p>$bB \to bbbB$</p>

<p>$aS_1b \to aa$</p>

<p>$B \to \lambda$</p>

<p>any hint or solution?</p>
 | formal languages automata formal grammars finite automata | 1 | Language of a grammar -- (formal languages automata formal grammars finite automata)
<p>What's the language of following grammar?</p>

<p>$G: S \to S_1B$</p>

<p>$S_1 \to aS_1b$</p>

<p>$bB \to bbbB$</p>

<p>$aS_1b \to aa$</p>

<p>$B \to \lambda$</p>

<p>any hint or solut... | habedi/stack-exchange-dataset |
29,073 | Why is the language of even-length non-palindromes context-free? | <p>We know $L_1=\{w_1 w_2 \in (a+b)^*\mid |w_1|=|w_2|, w_2 \neq w_1^{\;\mathrm{R}}\}$
is a context-free language.</p>

<p>Can anyone help me produce a PDA or give me any hint how I can quickly understand why this is context-free?</p>
 | formal languages context free automata | 1 | Why is the language of even-length non-palindromes context-free? -- (formal languages context free automata)
<p>We know $L_1=\{w_1 w_2 \in (a+b)^*\mid |w_1|=|w_2|, w_2 \neq w_1^{\;\mathrm{R}}\}$
is a context-free language.</p>

<p>Can anyone help me produce a PDA or give me any hint how I can quickly unders... | habedi/stack-exchange-dataset |
29,080 | Fast checking Matrix multiplication in mod 10 | <p>I recently faced this problem in a programming contest: Given 3 square matrices N x N of size N up to 1000. All elements in 3 matrices are from 0 to 9. Check if matrix A x B equals to C, mod 10. In other words, return the result of expression <code>(A x B) mod 10 == C</code>.</p>

<p>For example:</p>
&#x... | algorithms number theory matrices modular arithmetic | 1 | Fast checking Matrix multiplication in mod 10 -- (algorithms number theory matrices modular arithmetic)
<p>I recently faced this problem in a programming contest: Given 3 square matrices N x N of size N up to 1000. All elements in 3 matrices are from 0 to 9. Check if matrix A x B equals to C, mod 10. In other words, re... | habedi/stack-exchange-dataset |
29,091 | Choosing error rates for probabilistic algorithms | <p>Probabilistic algorithms often have a parameter that allows one to tune the error rate, typically by running the algorithm repeatedly. This often gives an error rate of something like $2^{-k}$ for $k$ iterations. This is a fine situation to be in, because $2^{-k}$ can be made as close to $1$ as you like without havi... | algorithm analysis randomized algorithms probabilistic algorithms applied theory | 1 | Choosing error rates for probabilistic algorithms -- (algorithm analysis randomized algorithms probabilistic algorithms applied theory)
<p>Probabilistic algorithms often have a parameter that allows one to tune the error rate, typically by running the algorithm repeatedly. This often gives an error rate of something li... | habedi/stack-exchange-dataset |
29,092 | What's the difference between Clock and Second Chance Page-Replacement Algorithm? | <p>I know that they both have reference bit, but I only understand the <a href="http://www.mathcs.emory.edu/~cheung/Courses/355/Syllabus/9-virtual-mem/SC-replace.html" rel="nofollow">Second Chance</a> but not the Clock Page-Replacement algorithm.</p>

<p>could anyone help me understand? </p>
 | algorithms operating systems memory management paging | 1 | What's the difference between Clock and Second Chance Page-Replacement Algorithm? -- (algorithms operating systems memory management paging)
<p>I know that they both have reference bit, but I only understand the <a href="http://www.mathcs.emory.edu/~cheung/Courses/355/Syllabus/9-virtual-mem/SC-replace.html" rel="nofoll... | habedi/stack-exchange-dataset |
29,093 | Automatically generate meaningful queries for a data table | <p>My field of research is not Database or AI. But I have some problems to solve, and would like to know which branch this kind of problems belong to, and what are the results.</p>

<p>The main question is: given a table of data, there are lots of possible queries that can be made. But some queries are meaningf... | artificial intelligence data mining databases database theory data sets | 1 | Automatically generate meaningful queries for a data table -- (artificial intelligence data mining databases database theory data sets)
<p>My field of research is not Database or AI. But I have some problems to solve, and would like to know which branch this kind of problems belong to, and what are the results.</p>
... | habedi/stack-exchange-dataset |
29,100 | Smallest non-halting unlambda program | <p>Is <code>```sii``sii</code> the smallest <a href="http://www.madore.org/~david/programs/unlambda/#ref" rel="nofollow">Unlambda</a> program that doesn't halt?</p>

<p>In other words, what is the smallest non-terminating combinator term in <a href="http://en.wikipedia.org/wiki/SKI_combinator_calculus" rel="nof... | lambda calculus halting problem combinatory logic | 1 | Smallest non-halting unlambda program -- (lambda calculus halting problem combinatory logic)
<p>Is <code>```sii``sii</code> the smallest <a href="http://www.madore.org/~david/programs/unlambda/#ref" rel="nofollow">Unlambda</a> program that doesn't halt?</p>

<p>In other words, what is the smallest non-terminati... | habedi/stack-exchange-dataset |
29,101 | How to reconstruct the image from a neural network output? | <p>I am trying to use the genetic algorithm to optimise a multi-layered neural network for image classification (i am using a subset of the MNIST handwritten digit data set as my initial dataset, but eventually would like to make it more general).</p>

<p>my neural network is represented by connection weight ma... | machine learning neural networks computer vision | 1 | How to reconstruct the image from a neural network output? -- (machine learning neural networks computer vision)
<p>I am trying to use the genetic algorithm to optimise a multi-layered neural network for image classification (i am using a subset of the MNIST handwritten digit data set as my initial dataset, but eventua... | habedi/stack-exchange-dataset |
29,108 | How the below program is taking O(n!) time? | <p>The complexity of the below program is given to be O(n!)</p>

<pre><code>double foo(int n){
int i;
double sum;
if(n==0){
 return 1.0; 
}
else {
 sum=0.0;
 for(i=0;i<n;i++){
 sum+=foo(i);
 }
 return sum;
}
</code></pre>

<p>}... | algorithm analysis runtime analysis | 1 | How the below program is taking O(n!) time? -- (algorithm analysis runtime analysis)
<p>The complexity of the below program is given to be O(n!)</p>

<pre><code>double foo(int n){
int i;
double sum;
if(n==0){
 return 1.0; 
}
else {
 sum=0.0;
 for(i=0;i<n;i++){
 ... | habedi/stack-exchange-dataset |
29,117 | Does the BIOS run on the CPU? | <p>I was just thinking about this: Does the BIOS execute on the CPU? If so, how does it handle multiple CPU architectures/instruction sets? If not, what does it execute on?</p>
 | computer architecture | 1 | Does the BIOS run on the CPU? -- (computer architecture)
<p>I was just thinking about this: Does the BIOS execute on the CPU? If so, how does it handle multiple CPU architectures/instruction sets? If not, what does it execute on?</p>
 | habedi/stack-exchange-dataset |
29,126 | Inserting vertex in an adjacency matrix | <p>If a graph with $v$ vertices is represented in the form of adjacency matrix .</p>

<p>Then, adding a new vertex to the existing graph requires how much time ?</p>

<p>Is it $O(v^2)$ or $O(2v)$ . </p>

<p>We have the adjacency matrix of the graph with $v$ vertices , by adding a new vertex we h... | graphs time complexity runtime analysis | 1 | Inserting vertex in an adjacency matrix -- (graphs time complexity runtime analysis)
<p>If a graph with $v$ vertices is represented in the form of adjacency matrix .</p>

<p>Then, adding a new vertex to the existing graph requires how much time ?</p>

<p>Is it $O(v^2)$ or $O(2v)$ . </p>

<p>We h... | habedi/stack-exchange-dataset |
29,134 | Space complexity analysis of binary recursive sum algorithm | <p>I was reading page 147 of Goodrich and Tamassia, <em>Data Structures and Algorithms in Java</em>, 3rd Ed. (<a href="http://books.google.co.in/books?id=i0NiSv9J4UIC&printsec=frontcover&dq=goodrich+tamassia+data+structures+and+algorithms+in+java&hl=en&sa=X&ei=ehrtU5-tFpLh8AX4r4GgDA&ved=0CCEQ6AE... | algorithm analysis space complexity recursion | 1 | Space complexity analysis of binary recursive sum algorithm -- (algorithm analysis space complexity recursion)
<p>I was reading page 147 of Goodrich and Tamassia, <em>Data Structures and Algorithms in Java</em>, 3rd Ed. (<a href="http://books.google.co.in/books?id=i0NiSv9J4UIC&printsec=frontcover&dq=goodrich+ta... | habedi/stack-exchange-dataset |
29,136 | Back invalidation to maintain inclusion in inclusive cache | <p>For an L2 cache that is strictly inclusive of the L1 cache, if a block to be evicted is also present in L1, then back invalidation is required to maintain the inclusion property.</p>

<p>I am interested in some details of how back invalidation is handled.</p>

<ol>
<li><p>When an L2 block is evic... | cpu cache memory hardware | 1 | Back invalidation to maintain inclusion in inclusive cache -- (cpu cache memory hardware)
<p>For an L2 cache that is strictly inclusive of the L1 cache, if a block to be evicted is also present in L1, then back invalidation is required to maintain the inclusion property.</p>

<p>I am interested in some details ... | habedi/stack-exchange-dataset |
29,148 | $L \in RE$ Question | <p>I see a sentence in one final exam on automaton course. </p>

<blockquote>
 <p>I have one problem: if we want to have a TM that halts for all word in L, it's enough to have L be R.E? or we should have R be R.E and Complement of R be R.E?</p>
</blockquote>

<p>Note: (Recursive Enumerable = R.... | computability turing machines | 1 | $L \in RE$ Question -- (computability turing machines)
<p>I see a sentence in one final exam on automaton course. </p>

<blockquote>
 <p>I have one problem: if we want to have a TM that halts for all word in L, it's enough to have L be R.E? or we should have R be R.E and Complement of R be R.E?</p>
</b... | habedi/stack-exchange-dataset |
29,155 | Why does binary search take $O(\log n)$ time? | <p>My question seems like an elementary question, but it's really not.</p>

<p>Suppose I have one million cars in a line sorted in alphabetical order by license plate. I am standing at the top of the line with the car with license plate AAA111. I want to find the car with license plate ZZZ999. I could do binary... | complexity theory history | 1 | Why does binary search take $O(\log n)$ time? -- (complexity theory history)
<p>My question seems like an elementary question, but it's really not.</p>

<p>Suppose I have one million cars in a line sorted in alphabetical order by license plate. I am standing at the top of the line with the car with license plat... | habedi/stack-exchange-dataset |
29,164 | Karnaugh map with don't care: increasing the number of groups instead of simplifying | <pre><code> AB
 00 01 11 10 
 00 | x | 1 | 0 | 1 |
CD 01 | 0 | 1 | x | 0 |
 11 | 1 | x | x | 0 |
 10 | x | 0 | 0 | x |
</code></pre>

<p>The answer to the above Karnaugh map is $F(ABCD) = B D + \bar B \bar D + \bar A \bar C \bar D + \bar A C D$
ac... | computer architecture boolean algebra digital circuits karnaugh map | 1 | Karnaugh map with don't care: increasing the number of groups instead of simplifying -- (computer architecture boolean algebra digital circuits karnaugh map)
<pre><code> AB
 00 01 11 10 
 00 | x | 1 | 0 | 1 |
CD 01 | 0 | 1 | x | 0 |
 11 | 1 | x | x | 0 |
 10 | x ... | habedi/stack-exchange-dataset |
29,169 | Why BFS is source vertex specific? | <p>Take a graph $G=(V,E)$ .</p>

<p>As we know both DFS and BFS are graph search algorithms . </p>

<p>But why the algorithm for BFS is designed in such a way that it does not cares about the vertices that are not connected to the source vertex $s$ but DFS takes care about all vertices in $V$.</p>
... | algorithms graphs graph traversal | 1 | Why BFS is source vertex specific? -- (algorithms graphs graph traversal)
<p>Take a graph $G=(V,E)$ .</p>

<p>As we know both DFS and BFS are graph search algorithms . </p>

<p>But why the algorithm for BFS is designed in such a way that it does not cares about the vertices that are not connected to the... | habedi/stack-exchange-dataset |
29,175 | Finding number of numbers <= N, containing atleast one of the digits 2,4,6,8 | <p>Given an integer $N$, I want to find the number of numbers $\le N$, that contain at least one of the digits from the set $\{2, 4, 6, 8\}$. How do I go about solving this problem?
I was thinking of constructing all possible numbers that fit into the integer size of the language that I am using, through a recursiv... | combinatorics recursion discrete mathematics | 1 | Finding number of numbers <= N, containing atleast one of the digits 2,4,6,8 -- (combinatorics recursion discrete mathematics)
<p>Given an integer $N$, I want to find the number of numbers $\le N$, that contain at least one of the digits from the set $\{2, 4, 6, 8\}$. How do I go about solving this problem?
I was t... | habedi/stack-exchange-dataset |
29,179 | Problem with my proof that NP = coNP? | <p>Is there a problem with this proof that NP = coNP?</p>

<p>It suffices to show that Satisfiability can be solved efficiently with at most a polynomial number of queries to an oracle for Tautology. The algorithm for a problem P is, pick a variable X in P and fix it to T to obtain a problem P'. Submit ~P' to t... | complexity theory p vs np | 1 | Problem with my proof that NP = coNP? -- (complexity theory p vs np)
<p>Is there a problem with this proof that NP = coNP?</p>

<p>It suffices to show that Satisfiability can be solved efficiently with at most a polynomial number of queries to an oracle for Tautology. The algorithm for a problem P is, pick a va... | habedi/stack-exchange-dataset |
29,187 | LSD and MSD sorting - which requires fixed length keys? | <p>I am studying these sorts, but it is still unclear to me which one of these two would require fixed length keys?</p>
 | algorithms sorting | 1 | LSD and MSD sorting - which requires fixed length keys? -- (algorithms sorting)
<p>I am studying these sorts, but it is still unclear to me which one of these two would require fixed length keys?</p>
 | habedi/stack-exchange-dataset |
29,195 | Sorting when there are only O(log n) many different numbers | <p>We have $n$ integers with lot's of repeated numbers. In this list, the number of distinct elements is $O(\log n)$. What's the best asymptotic number of comparisons for sorting this list?</p>

<p>Any idea or hint or pseudo code? In fact I want to learn pseudo code.</p>
 | algorithms sorting | 1 | Sorting when there are only O(log n) many different numbers -- (algorithms sorting)
<p>We have $n$ integers with lot's of repeated numbers. In this list, the number of distinct elements is $O(\log n)$. What's the best asymptotic number of comparisons for sorting this list?</p>

<p>Any idea or hint or pseudo cod... | habedi/stack-exchange-dataset |
29,203 | Exponential-size numbers in NP completeness reduction | <p>In the proof of Theorem 4 in [GS'12], the authors reduce an instance of PARTITION to their problem. Therefore, they create for each element $a_i$ in the instance of PARTITION a number $2^{c \cdot a_i}$ for a suitable constant $c$, which is later used in the reduction. They argue, that the instance remains of polynom... | complexity theory reductions np hard | 1 | Exponential-size numbers in NP completeness reduction -- (complexity theory reductions np hard)
<p>In the proof of Theorem 4 in [GS'12], the authors reduce an instance of PARTITION to their problem. Therefore, they create for each element $a_i$ in the instance of PARTITION a number $2^{c \cdot a_i}$ for a suitable cons... | habedi/stack-exchange-dataset |
29,204 | How to simulate a die given a fair coin | <p>Suppose that you're given a fair coin and you would like to simulate the probability distribution of repeatedly flipping a fair (six-sided) die. My initial idea is that we need to choose appropriate integers $k,m$, such that $2^k = 6m$. So after flipping the coin $k$ times, we map the number encoded by the k-length ... | probability theory randomness sampling | 1 | How to simulate a die given a fair coin -- (probability theory randomness sampling)
<p>Suppose that you're given a fair coin and you would like to simulate the probability distribution of repeatedly flipping a fair (six-sided) die. My initial idea is that we need to choose appropriate integers $k,m$, such that $2^k = 6... | habedi/stack-exchange-dataset |
29,210 | Is computation expression the same as monad? | <p>I'm still learning functional programming (with f#) and I recently started reading about computation expressions. I still don't fully understand the concept and one thing that keeps me unsure when reading all the articles regarding monads (most of them are written basing on Haskell) is the relation between computati... | functional programming | 1 | Is computation expression the same as monad? -- (functional programming)
<p>I'm still learning functional programming (with f#) and I recently started reading about computation expressions. I still don't fully understand the concept and one thing that keeps me unsure when reading all the articles regarding monads (most... | habedi/stack-exchange-dataset |
29,218 | tightest upper bound on binary search tree insertion? | <p>The upper bound on the runtime of binary search tree insertion algorithm is O(n) which is if it is not balanced
What will be the tighter upper bound on this,will it become O(logn)
I have read that tighter upper and lower bounds are often equivalent to the Theta notation.</p>
 | complexity theory algorithm analysis time complexity runtime analysis binary trees | 1 | tightest upper bound on binary search tree insertion? -- (complexity theory algorithm analysis time complexity runtime analysis binary trees)
<p>The upper bound on the runtime of binary search tree insertion algorithm is O(n) which is if it is not balanced
What will be the tighter upper bound on this,will it become... | habedi/stack-exchange-dataset |
29,224 | Neural Network Weights per input nodes | <p>Sorry, I'm really new to neural networks and this question is probably pretty obvious. If you have any resource that can help clarify these concepts to me it would be much appreciated. </p>

<p>The way I understand neural networks is that each input node, x<sub> i </sub> goes to each hidden layer. Is there a... | neural networks | 1 | Neural Network Weights per input nodes -- (neural networks)
<p>Sorry, I'm really new to neural networks and this question is probably pretty obvious. If you have any resource that can help clarify these concepts to me it would be much appreciated. </p>

<p>The way I understand neural networks is that each input... | habedi/stack-exchange-dataset |
29,227 | NP-hardness of an optimization problem with real value | <p>I have an optimization problem, whose answer is a real value, not an integer such as vertex cover and set cover. Therefore, the decision version of my problem is given an input and a real value $r$.</p>

<p>I have been able to reduce an NP-complete problem to my own problem in polynomial time. I also showed ... | complexity theory np complete proof techniques decision problem np | 1 | NP-hardness of an optimization problem with real value -- (complexity theory np complete proof techniques decision problem np)
<p>I have an optimization problem, whose answer is a real value, not an integer such as vertex cover and set cover. Therefore, the decision version of my problem is given an input and a real va... | habedi/stack-exchange-dataset |
29,250 | Why comparison is dominant time consumption for comparison-based sorting algorithms? | <p>Comparison-based sorting algorithms does a number of different operations to accomplish the sorting, why comparisons are the dominant time consumption? While I understand the standard analyses of asymptotical behavior of number of comparison operations, I don't quite understand why other costs of other types of op... | algorithm analysis sorting comparison | 1 | Why comparison is dominant time consumption for comparison-based sorting algorithms? -- (algorithm analysis sorting comparison)
<p>Comparison-based sorting algorithms does a number of different operations to accomplish the sorting, why comparisons are the dominant time consumption? While I understand the standard ana... | habedi/stack-exchange-dataset |
29,258 | Grammars: is there some connection between non-terminals $S$ and $S'$? | <p>Given a grammar such as the following, does $S'$ have some special meaning or does it just denote another non-terminal like $B$, $A$, $P$, $Q$ etc.?</p>

<p>$$\begin{align*}
 S &\to aBS'\\
 B &\to b\\
 S'&\to bA
\end{align*}$$</p>
 | terminology context free formal grammars | 1 | Grammars: is there some connection between non-terminals $S$ and $S'$? -- (terminology context free formal grammars)
<p>Given a grammar such as the following, does $S'$ have some special meaning or does it just denote another non-terminal like $B$, $A$, $P$, $Q$ etc.?</p>

<p>$$\begin{align*}
 S &\to... | habedi/stack-exchange-dataset |
29,265 | Linear-time algorithm for solving a set of inequalites | <p>We have a set $A$ of $n$ distinct numbers. We want to determine for all $x,y,z \in A$ whether the following relations hold.</p>

<p>$$
x+y>z\qquad x+z>y\qquad y+z>x 
$$</p>

<p>Anyone could describe $O(n)$ Algorithm?</p>
 | algorithms | 1 | Linear-time algorithm for solving a set of inequalites -- (algorithms)
<p>We have a set $A$ of $n$ distinct numbers. We want to determine for all $x,y,z \in A$ whether the following relations hold.</p>

<p>$$
x+y>z\qquad x+z>y\qquad y+z>x 
$$</p>

<p>Anyone could describe $O(n)$ Algori... | habedi/stack-exchange-dataset |
29,267 | Converting generalized NFAs to NFAs | <p>I came across <a href="http://en.wikipedia.org/wiki/Generalized_nondeterministic_finite_automaton" rel="nofollow">generalized nondeterministic finite automata</a> (GNFAs) in Sipser's <em>Introduction to the Theory of Computation</em>. These are automata where transitions are labelled with regular expressions, rather... | automata finite automata simulation | 1 | Converting generalized NFAs to NFAs -- (automata finite automata simulation)
<p>I came across <a href="http://en.wikipedia.org/wiki/Generalized_nondeterministic_finite_automaton" rel="nofollow">generalized nondeterministic finite automata</a> (GNFAs) in Sipser's <em>Introduction to the Theory of Computation</em>. These... | habedi/stack-exchange-dataset |
29,275 | What is the definition of a $\Pi_1$-sentence? | <p>What is meant when somebody says that a problem can be expressed as a $\Pi_1$-sentence?
I know that for the <a href="http://en.wikipedia.org/wiki/Arithmetical_hierarchy" rel="nofollow">arithmetical hierarchy</a>, a $\Pi^0_1$-sentence is a sentence of the form $\forall n_1\forall n_2\dots\forall n_k \psi$ where $... | terminology logic | 1 | What is the definition of a $\Pi_1$-sentence? -- (terminology logic)
<p>What is meant when somebody says that a problem can be expressed as a $\Pi_1$-sentence?
I know that for the <a href="http://en.wikipedia.org/wiki/Arithmetical_hierarchy" rel="nofollow">arithmetical hierarchy</a>, a $\Pi^0_1$-sentence is a sente... | habedi/stack-exchange-dataset |
29,277 | Can coq express its own metatheory? | <p>I'm learning about language metatheory and type systems, and am using <a href="http://coq.inria.fr/">coq</a> to formalize my study. One of the things I'd like to do is examine type systems that include <a href="https://en.wikipedia.org/wiki/Dependent_type">dependent types</a>, which I understand is very involved: b... | type theory dependent types coq | 1 | Can coq express its own metatheory? -- (type theory dependent types coq)
<p>I'm learning about language metatheory and type systems, and am using <a href="http://coq.inria.fr/">coq</a> to formalize my study. One of the things I'd like to do is examine type systems that include <a href="https://en.wikipedia.org/wiki/De... | habedi/stack-exchange-dataset |
29,281 | Check whether it is possible to turn one BST into another using only right-rotations | <p>Given two binary search trees T1 and T2, if it is possible to obtain T2 from T1 using only <a href="http://en.wikipedia.org/wiki/Tree_rotation" rel="nofollow">right-rotation</a>, we say that T1 can be right-converted to T2. For example, given three binary search tree T1, T2 and T3:</p>

<p>For example, given... | algorithms trees binary trees | 1 | Check whether it is possible to turn one BST into another using only right-rotations -- (algorithms trees binary trees)
<p>Given two binary search trees T1 and T2, if it is possible to obtain T2 from T1 using only <a href="http://en.wikipedia.org/wiki/Tree_rotation" rel="nofollow">right-rotation</a>, we say that T1 can... | habedi/stack-exchange-dataset |
29,283 | Difference between weak and strong AI | <p>I'm trying to understand the difference between weak and strong AI. For an example, let's say we would pass the turing test - would it show strong AI or weak AI then?</p>

<p>I don't believe that this is standard terminology, but more philosophical. It was mentioned by John Searle in his "Chinese room argum... | terminology artificial intelligence | 1 | Difference between weak and strong AI -- (terminology artificial intelligence)
<p>I'm trying to understand the difference between weak and strong AI. For an example, let's say we would pass the turing test - would it show strong AI or weak AI then?</p>

<p>I don't believe that this is standard terminology, but ... | habedi/stack-exchange-dataset |
29,284 | What is the notation for bounding running time in worst case with concrete example resulting in that worst case running time | <p>I know that Big O is used to bound worst case running time. So an algorithm with running time $O(n^5)$ means its running time in worse case is less than $n^5$ asymptotically.</p>

<p>Similarly, one can say that for example merge sort's running time is $O(n^2)$ which is correct. But we know that there is a b... | asymptotics landau notation | 1 | What is the notation for bounding running time in worst case with concrete example resulting in that worst case running time -- (asymptotics landau notation)
<p>I know that Big O is used to bound worst case running time. So an algorithm with running time $O(n^5)$ means its running time in worse case is less than $n^5$ ... | habedi/stack-exchange-dataset |
29,312 | Minimum distance between start and end by going through must visit points in a maze | <p>So, suppose i have a maze, which has a start point and an end point, marked with Orange and red respectively and my goal is to find the minimum distance between them. The blocked path is represented by black colour and the open path is represented by white colour . However there are two modification done in this.</p... | algorithms shortest path traveling salesman | 1 | Minimum distance between start and end by going through must visit points in a maze -- (algorithms shortest path traveling salesman)
<p>So, suppose i have a maze, which has a start point and an end point, marked with Orange and red respectively and my goal is to find the minimum distance between them. The blocked path ... | habedi/stack-exchange-dataset |
29,315 | Strange TM Language on Definition | <p>i prepare for Autotmata Course Final Exam.</p>

<p>in one of lecture, our professor draw this Turing Machine, and wrote DELTA is Neutral element of TM.</p>

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

<p>it'w wrote: </p>

<p>Language of t... | turing machines automata | 1 | Strange TM Language on Definition -- (turing machines automata)
<p>i prepare for Autotmata Course Final Exam.</p>

<p>in one of lecture, our professor draw this Turing Machine, and wrote DELTA is Neutral element of TM.</p>

<p><img src="https://i.stack.imgur.com/OfKWc.jpg" alt="enter image description h... | habedi/stack-exchange-dataset |
29,317 | Why multiple return values is not a common thing? | <p>I would like to ask a question about multiple return values, why this construct is not preferrable in programming languages (conceptual and/or technical difficulties). I've heard something about stack frames and how they reserve memory for return value and variable return values could make this problematic, but if s... | programming languages compilers | 1 | Why multiple return values is not a common thing? -- (programming languages compilers)
<p>I would like to ask a question about multiple return values, why this construct is not preferrable in programming languages (conceptual and/or technical difficulties). I've heard something about stack frames and how they reserve m... | habedi/stack-exchange-dataset |
29,336 | Propositional logic --- syntactical completeness | <p>Lets consider propositional logic. We say a proof system for propositional logic is syntactically (negation) complete if for every $\alpha$, either $\alpha$ or $\neg \alpha$ are provable within the system, i.e., $\Sigma \vdash \alpha$ or $\Sigma \vdash \neg \alpha$. (I assume standard definitions for $\Sigma$ and $\... | logic proof techniques first order logic propositional logic | 1 | Propositional logic --- syntactical completeness -- (logic proof techniques first order logic propositional logic)
<p>Lets consider propositional logic. We say a proof system for propositional logic is syntactically (negation) complete if for every $\alpha$, either $\alpha$ or $\neg \alpha$ are provable within the syst... | habedi/stack-exchange-dataset |
29,340 | Why does the solution of an NP problem have to be polynomial size? | <p>I've read in "Introduction to Algorithms" (CLRS) that formal language $L$ is NP-language if and only if there is a polynomial verification algorithm $A(x, y)$ and a constant $c$ such that $$L=\{x\in\{0,1\}\mid \exists y \text{ with } |y| \leq |x|^c\text{ and } A(x, y)=1 \}\,.$$</p>

<p>What is the purpose of... | complexity theory np | 1 | Why does the solution of an NP problem have to be polynomial size? -- (complexity theory np)
<p>I've read in "Introduction to Algorithms" (CLRS) that formal language $L$ is NP-language if and only if there is a polynomial verification algorithm $A(x, y)$ and a constant $c$ such that $$L=\{x\in\{0,1\}\mid \exists y \tex... | habedi/stack-exchange-dataset |
29,365 | baz_num_elts exercise from Software Foundations | <p>I'm at the following exercise in <a href="http://www.cis.upenn.edu/~bcpierce/sf/current/index.html">Software Foundations</a>:</p>

<pre><code>(** **** Exercise: 2 stars (baz_num_elts) *)
(** Consider the following inductive definition: *)

Inductive baz : Type :=
 | x : baz -> baz
 ... | coq | 1 | baz_num_elts exercise from Software Foundations -- (coq)
<p>I'm at the following exercise in <a href="http://www.cis.upenn.edu/~bcpierce/sf/current/index.html">Software Foundations</a>:</p>

<pre><code>(** **** Exercise: 2 stars (baz_num_elts) *)
(** Consider the following inductive definition: *)

... | habedi/stack-exchange-dataset |
29,368 | Do computers actually use carry-lookahead adders? | <p>There are plenty of details about carry lookahead adders such as Kogge-Stone, Lander-Fischer, etc. in college CS courses. They are described as "common in the industry". However, I can't find any evidence (aside from maybe the Manchester carry chain) from recent times that they are actually used anywhere specifical... | computer architecture | 1 | Do computers actually use carry-lookahead adders? -- (computer architecture)
<p>There are plenty of details about carry lookahead adders such as Kogge-Stone, Lander-Fischer, etc. in college CS courses. They are described as "common in the industry". However, I can't find any evidence (aside from maybe the Manchester c... | habedi/stack-exchange-dataset |
29,369 | Probabilty that quicksort partition creates an imbalanced partition | <p>I have come across this question:</p>

<blockquote>
 <p>Let 0<α<.5 be some constant (independent of the input array length n). Recall the Partition subroutine employed by the QuickSort algorithm, as explained in lecture. What is the probability that, with a randomly chosen pivot element, the Parti... | algorithms algorithm analysis probability theory quicksort | 1 | Probabilty that quicksort partition creates an imbalanced partition -- (algorithms algorithm analysis probability theory quicksort)
<p>I have come across this question:</p>

<blockquote>
 <p>Let 0<α<.5 be some constant (independent of the input array length n). Recall the Partition subroutine employe... | habedi/stack-exchange-dataset |
29,379 | Optimal way for grouping events | <p>I am creating an event notification system.</p>

<p>Each event has a user and a subject, such that, <em>'user did event to the subject'</em>. Now while presenting these the events need to be grouped. </p>

<p>All the events in the same group must either refer to the same user or the same subject and ... | algorithms optimization cluster | 1 | Optimal way for grouping events -- (algorithms optimization cluster)
<p>I am creating an event notification system.</p>

<p>Each event has a user and a subject, such that, <em>'user did event to the subject'</em>. Now while presenting these the events need to be grouped. </p>

<p>All the events in the s... | habedi/stack-exchange-dataset |
29,380 | Base conversion puzzle | <p>Here's an old puzzle: Let $s$ be a string of decimal digits ($s[i] \in \{0,\dotsc, 9\}$). Define a function $f(s)$ as follows:</p>

<ul>
<li>Interpret $s$ as a decimal number, $n_{10}$, and convert $n$ to its octal equivalent, $m_8$.</li>
<li>Now treat $m$ as a decimal number, $m_{10}$ and convert it... | reference request base conversion | 1 | Base conversion puzzle -- (reference request base conversion)
<p>Here's an old puzzle: Let $s$ be a string of decimal digits ($s[i] \in \{0,\dotsc, 9\}$). Define a function $f(s)$ as follows:</p>

<ul>
<li>Interpret $s$ as a decimal number, $n_{10}$, and convert $n$ to its octal equivalent, $m_8$.</li>
... | habedi/stack-exchange-dataset |
29,383 | Does "output" always imply halting in computability? | <p>$L = \{P : P(n)$ outputs $n^2$ for all $n \in N \}$ </p>

<p>In questions of this nature, are we supposed to assume that "outputs" means "halts and outputs"? In modern programming languages, I can certainly "output" using a print statement and then have the program go into a loop after that. </p>
 | terminology computability turing machines | 1 | Does "output" always imply halting in computability? -- (terminology computability turing machines)
<p>$L = \{P : P(n)$ outputs $n^2$ for all $n \in N \}$ </p>

<p>In questions of this nature, are we supposed to assume that "outputs" means "halts and outputs"? In modern programming languages, I can certainly ... | habedi/stack-exchange-dataset |
29,386 | What actually is the concept of transparency? Why not call it Abstraction? | <p>I searched this over Google few times but ended up with articles on transparency rather than an answer.
With relation to distributed database study(or distributed OS), what is the concept of transparency?
I mean in replication, fragmentation and everywhere I guess the idea is to implement these concepts but ... | distributed systems databases database theory | 1 | What actually is the concept of transparency? Why not call it Abstraction? -- (distributed systems databases database theory)
<p>I searched this over Google few times but ended up with articles on transparency rather than an answer.
With relation to distributed database study(or distributed OS), what is the concept... | habedi/stack-exchange-dataset |
29,404 | How can I prepare for CS in university | <p>How can I prepare for an introductory CS college course?</p>

<p>I am currently in Grade 12 and next year I will be studying Computer Science at a university in South Africa (<a href="http://www.cs.uwc.ac.za/index.php/Undergraduate-Courses-2009.html" rel="nofollow">syllabus is here</a>). However CS has a ver... | education | 1 | How can I prepare for CS in university -- (education)
<p>How can I prepare for an introductory CS college course?</p>

<p>I am currently in Grade 12 and next year I will be studying Computer Science at a university in South Africa (<a href="http://www.cs.uwc.ac.za/index.php/Undergraduate-Courses-2009.html" rel=... | habedi/stack-exchange-dataset |
29,426 | Context Free or Context Sensitive and why | <p>I was given two languages </p>

<p>$$L_1=\{0^k1^k0^m\mid k,m \in \mathbb{N}\text{ and }k < m\}$$</p>

<p>and</p>

<p>$$L_2=\{a^mb^{m+1}\}$$</p>

<p>and I was asked to prove whether they are context free or sensitive. </p>

<p>For $L_1$ : I did pumping lemma and I cannot cle... | formal languages context free context sensitive | 1 | Context Free or Context Sensitive and why -- (formal languages context free context sensitive)
<p>I was given two languages </p>

<p>$$L_1=\{0^k1^k0^m\mid k,m \in \mathbb{N}\text{ and }k < m\}$$</p>

<p>and</p>

<p>$$L_2=\{a^mb^{m+1}\}$$</p>

<p>and I was asked to prove whether they a... | habedi/stack-exchange-dataset |
29,428 | How is Turing's Solution to the Halting Problem Not Simply "Failure By Design"? | <p>I'm having a hard time viewing Turing's solution to the Halting Problem as a logician, rather than as an engineer. </p>

<p>Here is my understanding of the Halting Problem:</p>

<blockquote>
 <p>Let $M$ be the set of all Turing Machines. </p>
 
 <p>Let $i$ be the set of all inputs fo... | computability halting problem | 1 | How is Turing's Solution to the Halting Problem Not Simply "Failure By Design"? -- (computability halting problem)
<p>I'm having a hard time viewing Turing's solution to the Halting Problem as a logician, rather than as an engineer. </p>

<p>Here is my understanding of the Halting Problem:</p>

<blockq... | habedi/stack-exchange-dataset |
29,438 | Finding a pair of edge disjoint paths in a graph, such that the weight of each of them is bounded | <p>Given an undirected graph $G=(V,E)$, two distinct vertices $s,t\in V$, a weight function $f:E \to \mathbb{N}$, and a constant $M\in \mathbb{N}$, does there exist a pair of edge disjoint paths connecting $s$ and $t$, each of which has weight at most $M$? In other words, we are given an upper bound on the path weight... | complexity theory graphs np complete reductions shortest path | 1 | Finding a pair of edge disjoint paths in a graph, such that the weight of each of them is bounded -- (complexity theory graphs np complete reductions shortest path)
<p>Given an undirected graph $G=(V,E)$, two distinct vertices $s,t\in V$, a weight function $f:E \to \mathbb{N}$, and a constant $M\in \mathbb{N}$, does th... | habedi/stack-exchange-dataset |
29,449 | Binary tree traversals reversed | <p>Am I correct in saying that</p>

<pre><code>traverse(node):
 if node is null, return
 print node
 traverse(node's right subtree)
 traverse(node's left subtree)
</code></pre>

<p>would produce output that is the reverse of post-order traversal?</p>

<pre><code>p... | algorithms trees binary trees graph traversal | 1 | Binary tree traversals reversed -- (algorithms trees binary trees graph traversal)
<p>Am I correct in saying that</p>

<pre><code>traverse(node):
 if node is null, return
 print node
 traverse(node's right subtree)
 traverse(node's left subtree)
</code></pre>

<p>would pr... | habedi/stack-exchange-dataset |
29,457 | Determining execution times of a concurrent system with exclusive resources | <p>A certain system consists of 2 CPUs. The CPU that is not being used is assigned to a task whose execution is requested. On this system, two tasks, A and B, are executed.These tasks both use a common resource R exclusively.The CPU usage of the tasks A and B, the usage of resource R and the execution sequence are show... | concurrency resource allocation | 1 | Determining execution times of a concurrent system with exclusive resources -- (concurrency resource allocation)
<p>A certain system consists of 2 CPUs. The CPU that is not being used is assigned to a task whose execution is requested. On this system, two tasks, A and B, are executed.These tasks both use a common resou... | habedi/stack-exchange-dataset |
29,463 | Is there a program that will tell you the optimal algorithm for ANY problem if the problem is decidable? | <p>Is there a program that will tell you the optimal algorithm for ANY problem if the problem is decidable? If not, why not? If yes, how can such a program be realistically constructed? </p>

<p>I would prefer an intuitive explanation over a formal one, thanks. </p>
 | artificial intelligence | 1 | Is there a program that will tell you the optimal algorithm for ANY problem if the problem is decidable? -- (artificial intelligence)
<p>Is there a program that will tell you the optimal algorithm for ANY problem if the problem is decidable? If not, why not? If yes, how can such a program be realistically constructed? ... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.