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 |
|---|---|---|---|---|---|---|
39,534 | How to find the Branch factor of 8 Puzzle | <p>I would like to know how to find the average <em>branching factor</em> for 8 puzzle.While referring <em>Artificial Intelligence</em> by George F Luger it says that:</p>

<blockquote>
 <p>Suppose,for example we wish to establish the branching factor of the 8-puzzle.We calculate the total number of possib... | algorithm analysis combinatorics search algorithms branch and bound | 1 | How to find the Branch factor of 8 Puzzle -- (algorithm analysis combinatorics search algorithms branch and bound)
<p>I would like to know how to find the average <em>branching factor</em> for 8 puzzle.While referring <em>Artificial Intelligence</em> by George F Luger it says that:</p>

<blockquote>
 <p>Su... | habedi/stack-exchange-dataset |
39,539 | Not Hamiltonian is in NP Class? | <p>I ask a question before, <a href="https://cs.stackexchange.com/questions/39496/questions-on-graph-and-hamiltonian">Questions on Graph and Hamiltonian</a>, but i ask it here with different challenging contest.</p>

<p>From <a href="https://books.google.com/books?id=8535vmYbLGYC&pg=PA400&lpg=PA400&... | complexity theory graphs np complete np hard decision problem | 1 | Not Hamiltonian is in NP Class? -- (complexity theory graphs np complete np hard decision problem)
<p>I ask a question before, <a href="https://cs.stackexchange.com/questions/39496/questions-on-graph-and-hamiltonian">Questions on Graph and Hamiltonian</a>, but i ask it here with different challenging contest.</p>
&... | habedi/stack-exchange-dataset |
39,544 | Reduction to $n\log n$ time problem | <p>If a problem $A$ is poly-time reducible to a problem $B$ ($A <_\mathrm{p} B$), and $B$ can be solved in time $O(n\log n)$, can $A$ also be solved in time $O(n\log n)$?</p>
 | complexity theory reductions | 1 | Reduction to $n\log n$ time problem -- (complexity theory reductions)
<p>If a problem $A$ is poly-time reducible to a problem $B$ ($A <_\mathrm{p} B$), and $B$ can be solved in time $O(n\log n)$, can $A$ also be solved in time $O(n\log n)$?</p>
 | habedi/stack-exchange-dataset |
39,553 | Morgenstern proof for FFT lower bound | <p>I looked at my notes from a class about fast forier transform , and the professor proved in class theorem thanks to Morgenstern , first he defined linear algorithm as a algorithm that inly uses multiplications by scalar and addtions, that he stated Morgenstern's theorem the following way</p>

<blockquote>&#x... | lower bounds fourier transform | 1 | Morgenstern proof for FFT lower bound -- (lower bounds fourier transform)
<p>I looked at my notes from a class about fast forier transform , and the professor proved in class theorem thanks to Morgenstern , first he defined linear algorithm as a algorithm that inly uses multiplications by scalar and addtions, that he s... | habedi/stack-exchange-dataset |
39,555 | Applications of Lamport's Distributed Mutual Exclusion algorithm | <p>I'm trying to understand the relevance of the Lamport distributed mutual exclusion algorithm (or any of its variants), where a group of processes cooperate to gain exclusive access to a resource without relying on a centralized coordinator.</p>

<p>How can this be useful in practice? For instance, if the re... | algorithms distributed systems | 1 | Applications of Lamport's Distributed Mutual Exclusion algorithm -- (algorithms distributed systems)
<p>I'm trying to understand the relevance of the Lamport distributed mutual exclusion algorithm (or any of its variants), where a group of processes cooperate to gain exclusive access to a resource without relying on a ... | habedi/stack-exchange-dataset |
39,557 | Equivalent Straight Line Embedding of a Planar Graph Drawing on a Grid | <p>An embedding of a graph G on a surface Σ is a representation of G on Σ in which points of Σ are associated to vertices and simple arcs are associated to edges in such a way that: </p>

<ul>
<li><p>the endpoints of the arc associated to an edge e are the points
associated to the end vertices of e,</p>... | graphs reference request graph drawing | 1 | Equivalent Straight Line Embedding of a Planar Graph Drawing on a Grid -- (graphs reference request graph drawing)
<p>An embedding of a graph G on a surface Σ is a representation of G on Σ in which points of Σ are associated to vertices and simple arcs are associated to edges in such a way that: </p>

<ul>
... | habedi/stack-exchange-dataset |
39,558 | Data structure to hold and retrieve points in a plane | <p><strong>Definition 1:</strong> Point $(x,y)$ is controlling point $(x',y')$ if and only if $x < x'$ and $y < y'$.</p>

<p><strong>Definition 2:</strong> Point $(x,y)$ is controlled by point $(x',y')$ if and only if $x' < x $ and $ y' < y$.</p>

<p>I'm trying to come up with data structure... | data structures space partitioning | 1 | Data structure to hold and retrieve points in a plane -- (data structures space partitioning)
<p><strong>Definition 1:</strong> Point $(x,y)$ is controlling point $(x',y')$ if and only if $x < x'$ and $y < y'$.</p>

<p><strong>Definition 2:</strong> Point $(x,y)$ is controlled by point $(x',y')$ if and on... | habedi/stack-exchange-dataset |
39,597 | How can I academically say that 'one computer is slower than the other'? | <p>I'm writing a research paper and I have to basically say that one microcontroller is slower than an other microprocessor. However, I'm worried that simply saying that it's 'slower' wouldn't be appropriate in a research paper.</p>

<p>Am I right? Is it OK to just say that one processor is 'slower', or do I ... | terminology computer architecture | 1 | How can I academically say that 'one computer is slower than the other'? -- (terminology computer architecture)
<p>I'm writing a research paper and I have to basically say that one microcontroller is slower than an other microprocessor. However, I'm worried that simply saying that it's 'slower' wouldn't be appropriate... | habedi/stack-exchange-dataset |
39,622 | Designing a DFA and the reverse of it | <p>There is a theorem that says if a language is regular, its reverse is regular as well. How can I draw a DFA that shows if a language is regular, it's regular as well?</p>
 | regular languages automata | 1 | Designing a DFA and the reverse of it -- (regular languages automata)
<p>There is a theorem that says if a language is regular, its reverse is regular as well. How can I draw a DFA that shows if a language is regular, it's regular as well?</p>
 | habedi/stack-exchange-dataset |
39,625 | How should I design a hash table where all the keys are permutations? | <p>I need to create a hash table to store values for (possibly all) permutations of <code>123456789</code>, which is exactly 362 880 keys.</p>

<p>Given that I know how all the keys look up front, it seems I that there should be an optimal hashing function, and an optimal size of the table to store the values i... | data structures hash hash tables permutations | 1 | How should I design a hash table where all the keys are permutations? -- (data structures hash hash tables permutations)
<p>I need to create a hash table to store values for (possibly all) permutations of <code>123456789</code>, which is exactly 362 880 keys.</p>

<p>Given that I know how all the keys look up f... | habedi/stack-exchange-dataset |
39,626 | Branch predictor question | <p>If the branch predictor is placed in the fetch stage then how does it know that the current instruction is actually a branch before trying to predict its outcome? Is some (very little) decoding already done in the fetch stage before going to the actual decode stage? </p>
 | computer architecture | 1 | Branch predictor question -- (computer architecture)
<p>If the branch predictor is placed in the fetch stage then how does it know that the current instruction is actually a branch before trying to predict its outcome? Is some (very little) decoding already done in the fetch stage before going to the actual decode stag... | habedi/stack-exchange-dataset |
39,637 | Algorithm to generate all planar graphs | <p>Is there an algorithm which provides a sequence of all simple planar graphs, unique by graph isomorphism? For instance: first all planar graphs with 1 node, then all planar graphs with 2 nodes, etc.</p>

<p>Note: It is okay if it generates only graphs with a minimal node degree of 1 or 2.</p>
 | algorithms graphs enumeration planar graphs | 1 | Algorithm to generate all planar graphs -- (algorithms graphs enumeration planar graphs)
<p>Is there an algorithm which provides a sequence of all simple planar graphs, unique by graph isomorphism? For instance: first all planar graphs with 1 node, then all planar graphs with 2 nodes, etc.</p>

<p>Note: It is o... | habedi/stack-exchange-dataset |
39,638 | Red Black Tree clarification | <p>I am quite new to Red-Black trees, and therefore I am having a bit of difficult time trying to understand them.</p>

<p>One of the properties of the Red-Black tree is that every red vertex must have two black children, meaning one cannot have two consecutive red vertices.</p>

<p>Can someone explain ... | data structures binary trees search trees | 1 | Red Black Tree clarification -- (data structures binary trees search trees)
<p>I am quite new to Red-Black trees, and therefore I am having a bit of difficult time trying to understand them.</p>

<p>One of the properties of the Red-Black tree is that every red vertex must have two black children, meaning one ca... | habedi/stack-exchange-dataset |
39,660 | Is it Polynomial to decide whether any product of input numbers satisfies a boolean expression? | <p>I have an input number c of n bits and its prime factorization. I want to find a divisor of c with certain fixed bits "f". For example:</p>

<pre><code>INPUT:
c=1100011 (99) (n=7)
prime factorization = 11,11,1011 (3,3,11)
f=0??1?0?

OUTPUT:
o=0001001 (9)
</code></pre>

<p>... | np complete decision problem polynomial time | 1 | Is it Polynomial to decide whether any product of input numbers satisfies a boolean expression? -- (np complete decision problem polynomial time)
<p>I have an input number c of n bits and its prime factorization. I want to find a divisor of c with certain fixed bits "f". For example:</p>

<pre><code>INPUT:
... | habedi/stack-exchange-dataset |
39,668 | Examples for directed graphs with super polynomial cover time | <p>The cover time of a graph is the expected number of steps in a random walk on the graph until we visit all the nodes.</p>

<p>For undirected graphs the cover time is upperbounded by $O(n^3)$.
What about directed graphs? I'm looking for examples of super-polynomial cover time.</p>

<p>Is there an ... | graphs random walks | 1 | Examples for directed graphs with super polynomial cover time -- (graphs random walks)
<p>The cover time of a graph is the expected number of steps in a random walk on the graph until we visit all the nodes.</p>

<p>For undirected graphs the cover time is upperbounded by $O(n^3)$.
What about directed graphs... | habedi/stack-exchange-dataset |
39,669 | Monotone Frameworks: Transfer functions for flow edges instead of labels | <p>So, in generic program analysis, we have a lattice $L$ with a join operation $\sqcup$, program with statements labelled, and for each label $b$, a transfer function $F_b : L \rightarrow L$.</p>

<p>The goal is to find, for each label $b$, a fix-point $x$ such that $F_b(x)=x$. This is a common approach used i... | reference request optimization programming languages compilers lattices | 1 | Monotone Frameworks: Transfer functions for flow edges instead of labels -- (reference request optimization programming languages compilers lattices)
<p>So, in generic program analysis, we have a lattice $L$ with a join operation $\sqcup$, program with statements labelled, and for each label $b$, a transfer function $F... | habedi/stack-exchange-dataset |
39,676 | P is undecidable and not semidecidable, Q is undecidable and semidecidable and P ⊂ Q | <p>My problem: Define two sets P and Q of words (that is, two problems) such that: P is undecidable and not semidecidable, Q is undecidable and semidecidable and P ⊂ Q</p>
 | undecidability semi decidability | 1 | P is undecidable and not semidecidable, Q is undecidable and semidecidable and P ⊂ Q -- (undecidability semi decidability)
<p>My problem: Define two sets P and Q of words (that is, two problems) such that: P is undecidable and not semidecidable, Q is undecidable and semidecidable and P ⊂ Q</p>
 | habedi/stack-exchange-dataset |
39,677 | Is a stack overflow detected by hardware or software? | <p>Is it the task of the software (operating system) to detect stack overflows or is a stack overflow detected in hardware, causing an exception in the CPU?</p>
 | computer architecture stacks | 1 | Is a stack overflow detected by hardware or software? -- (computer architecture stacks)
<p>Is it the task of the software (operating system) to detect stack overflows or is a stack overflow detected in hardware, causing an exception in the CPU?</p>
 | habedi/stack-exchange-dataset |
39,682 | Some Algorithm on Decidablitly | <p>Anyone could correct me that Why just (1) is False. i'm not sure why others are true: ( G is a Context Free Grammar). any brief description? </p>

<ol>
<li><p>There is an algorithm that decides whether the complement of $L(G)$ (language generated by $G$) is empty or not.</p></li>
<li><p>There is an ... | computability context free formal grammars undecidability decision problem | 1 | Some Algorithm on Decidablitly -- (computability context free formal grammars undecidability decision problem)
<p>Anyone could correct me that Why just (1) is False. i'm not sure why others are true: ( G is a Context Free Grammar). any brief description? </p>

<ol>
<li><p>There is an algorithm that decides... | habedi/stack-exchange-dataset |
39,685 | Complement and Context Free Surprising | <p>Anyone can describe why $L_{1}$ is not the complement of $L_{2}$, and why $L_{2}$ is not context free?</p>

<p>$$L_{1}= \{w_{1}cw_{2} : w_{1},w_{2} \in \{a,b\}^{\ast}, w_{1} \neq w_{2}\}$$
$$L_{2}= \{w_{1}cw_{2} : w_{1},w_{2} \in \{a,b\}^{\ast}, w_{1} = w_{2}\}$$</p>
 | formal languages context free | 1 | Complement and Context Free Surprising -- (formal languages context free)
<p>Anyone can describe why $L_{1}$ is not the complement of $L_{2}$, and why $L_{2}$ is not context free?</p>

<p>$$L_{1}= \{w_{1}cw_{2} : w_{1},w_{2} \in \{a,b\}^{\ast}, w_{1} \neq w_{2}\}$$
$$L_{2}= \{w_{1}cw_{2} : w_{1},w_{2} \in \... | habedi/stack-exchange-dataset |
39,686 | Rating elements via partial orders | <p>I would like to rate a set of $n$ elements, with each element assigned a rating from ${0,\dots, 10}$.</p>

<p>The way in which I want to rate is by repeatedly selecting subsets of $k$ elements and querying a user to rank them relative to each other. I would like a means of minimizing the number of necessary ... | ordering | 1 | Rating elements via partial orders -- (ordering)
<p>I would like to rate a set of $n$ elements, with each element assigned a rating from ${0,\dots, 10}$.</p>

<p>The way in which I want to rate is by repeatedly selecting subsets of $k$ elements and querying a user to rank them relative to each other. I would li... | habedi/stack-exchange-dataset |
39,693 | Sum of $\log n$ $n$-bit integers is in $\mathsf{AC^0}$ | <p>I am trying to show that the sum of $\log n$ $n$-bit integers can be computed in $\mathsf{AC^0}$. I know that the iterated addition is computable by fan-in $2$ circuits of depth $O(\log n)$, so the sum of $n$ $n$-bit integers is in $\mathsf{NC^1}$. This means that the bound is very tight. I found somes notes <a href... | complexity theory circuits | 1 | Sum of $\log n$ $n$-bit integers is in $\mathsf{AC^0}$ -- (complexity theory circuits)
<p>I am trying to show that the sum of $\log n$ $n$-bit integers can be computed in $\mathsf{AC^0}$. I know that the iterated addition is computable by fan-in $2$ circuits of depth $O(\log n)$, so the sum of $n$ $n$-bit integers is i... | habedi/stack-exchange-dataset |
39,705 | PDA with N-Stacks comparison with Turing Machines | <p>Is it possible to compare PDA having N-Stacks with Turning Machines. Are they equally powerful in this situation?</p>

<p>It's been told that PDA with 2-Stacks is equally powerful to Turning Machine. But what if we add more stacks i.e. 3, 4, 5...N to PDA; will it become more powerful or it can serve same pur... | turing machines pushdown automata | 1 | PDA with N-Stacks comparison with Turing Machines -- (turing machines pushdown automata)
<p>Is it possible to compare PDA having N-Stacks with Turning Machines. Are they equally powerful in this situation?</p>

<p>It's been told that PDA with 2-Stacks is equally powerful to Turning Machine. But what if we add m... | habedi/stack-exchange-dataset |
39,716 | Decomposition of the set of computable functions into base functions | <p>Say I have some computation model/programming language $M$ (e.g. Turing machine or equivalent), and let $C_M$ be the set of all partial or total functions $f : \mathbb{N} \to \mathbb{N}$ computable by that model. Also, assume that $C_M$ is countable.</p>

<p>Now let $B = \{ B_1, B_2, ... , B_n \}$ a finite s... | computability computation models | 1 | Decomposition of the set of computable functions into base functions -- (computability computation models)
<p>Say I have some computation model/programming language $M$ (e.g. Turing machine or equivalent), and let $C_M$ be the set of all partial or total functions $f : \mathbb{N} \to \mathbb{N}$ computable by that mode... | habedi/stack-exchange-dataset |
39,721 | Given a PRAM may use arbitrarily many processors, why is Hamiltonian Cycle not in NC? | <p>In my parallel algorithms class, the PRAM model is described as having an "arbitrary number of processors, bounded by some polynomial in the input size."</p>

<p>I think that this may be missing a constraint. For example, this would imply that finding a Hamiltonian cycle is in NC:</p>

<p>If I give ... | complexity theory parallel computing computation models nc | 1 | Given a PRAM may use arbitrarily many processors, why is Hamiltonian Cycle not in NC? -- (complexity theory parallel computing computation models nc)
<p>In my parallel algorithms class, the PRAM model is described as having an "arbitrary number of processors, bounded by some polynomial in the input size."</p>

... | habedi/stack-exchange-dataset |
39,724 | Language intersections (set theory) - Understanding better | <p>I've joined computer science classes at high school because I have a wide knowledge and a few years of experience in programming in multiple of languages, however I didn't fit in the requirements of the class, which is a specific mathematics level. I am a low level mathematics student, I don't really know formal mat... | sets | 1 | Language intersections (set theory) - Understanding better -- (sets)
<p>I've joined computer science classes at high school because I have a wide knowledge and a few years of experience in programming in multiple of languages, however I didn't fit in the requirements of the class, which is a specific mathematics level.... | habedi/stack-exchange-dataset |
39,730 | Richard Karp's 21 NP-Hard problems, the meaning of his research? | <p>In Richard Karp's paper "Reducability among combinatorial problems" he lists 21 NP-Hard problems. Though I can somewhat understand the ideas and motivation behind the paper I am searching for some clarity. </p>

<p>From what I know and understand this paper showed the parallels between the various problems. ... | complexity theory np hard history | 1 | Richard Karp's 21 NP-Hard problems, the meaning of his research? -- (complexity theory np hard history)
<p>In Richard Karp's paper "Reducability among combinatorial problems" he lists 21 NP-Hard problems. Though I can somewhat understand the ideas and motivation behind the paper I am searching for some clarity. </p>&#x... | habedi/stack-exchange-dataset |
39,738 | Computing a Sequence of People Entering and Leaving a Room | <p>I've been working on a problem for my Algorithms class, but I've found myself stuck. The prompt is as follows.</p>

<blockquote>
 <p>You start with an empty room and a group of n people waiting outside. At each step, you may either admit one person into the room, or let one out. Please design an algorit... | algorithms combinatorics permutations towers of hanoi | 1 | Computing a Sequence of People Entering and Leaving a Room -- (algorithms combinatorics permutations towers of hanoi)
<p>I've been working on a problem for my Algorithms class, but I've found myself stuck. The prompt is as follows.</p>

<blockquote>
 <p>You start with an empty room and a group of n people ... | habedi/stack-exchange-dataset |
39,740 | Did 'Eugene Goostman' really pass the Turing test? | <p><a href="http://www.bbc.com/news/technology-27762088">It is being said that 'Eugene Goostman', a computer programme developed to simulate a 13-year-old boy, managed to convince 33 per cent of the judges that it was human, and thus passed the Turing Test.</a></p>

<p>The computer programme, aka a chatbot, was... | reference request artificial intelligence history turing test | 1 | Did 'Eugene Goostman' really pass the Turing test? -- (reference request artificial intelligence history turing test)
<p><a href="http://www.bbc.com/news/technology-27762088">It is being said that 'Eugene Goostman', a computer programme developed to simulate a 13-year-old boy, managed to convince 33 per cent of the jud... | habedi/stack-exchange-dataset |
39,746 | Are class methods closures? | <p>In <a href="http://en.wikipedia.org/wiki/Closure_(computer_programming)">the wiki article about closures</a> one can read:</p>

<blockquote>
 <p>closure ... is a function or reference to a function together with a
 referencing environment</p>
</blockquote>

<p>At the same time in <a hre... | terminology programming languages object oriented | 1 | Are class methods closures? -- (terminology programming languages object oriented)
<p>In <a href="http://en.wikipedia.org/wiki/Closure_(computer_programming)">the wiki article about closures</a> one can read:</p>

<blockquote>
 <p>closure ... is a function or reference to a function together with a
 r... | habedi/stack-exchange-dataset |
39,753 | Pseudo-polynomial time algorithm for NP-Complete Problems | <p>For problems like Knapsack there is a pseudo-polynomial time algorithm and it is NP-complete. So we reduce every other problem in NP in polytime to Knapsack.</p>

<p>But why don't we have then a pseudo-polynomial time algorithm for all problems in NP?</p>
 | complexity theory np complete np hard np | 1 | Pseudo-polynomial time algorithm for NP-Complete Problems -- (complexity theory np complete np hard np)
<p>For problems like Knapsack there is a pseudo-polynomial time algorithm and it is NP-complete. So we reduce every other problem in NP in polytime to Knapsack.</p>

<p>But why don't we have then a pseudo-pol... | habedi/stack-exchange-dataset |
39,764 | Generate scale-free networks with power-law degree distributions using Barabasi-Albert | <p>I'm trying to reproduce the synthetic networks (graphs) described in some papers.</p>

<p>It is stated that the <strong>Barabasi-Albert</strong> model was used to create "scale-free networks with power-law degree distributions, $P_A(k) ∝ k^{-λ}$".</p>

<p>$P_A$ is a probability distribution that retu... | algorithms graphs randomness sampling | 1 | Generate scale-free networks with power-law degree distributions using Barabasi-Albert -- (algorithms graphs randomness sampling)
<p>I'm trying to reproduce the synthetic networks (graphs) described in some papers.</p>

<p>It is stated that the <strong>Barabasi-Albert</strong> model was used to create "scale-fr... | habedi/stack-exchange-dataset |
39,768 | Examples of processes / problems that cannot be tackled by Turing Machines | <p>I know that there are problems that cannot be solved by any algorithm, such as the Halting problem.
I also know that some processes cannot be even adequately approximated by any Turing Machine (equivalently, any digital computer), meaning that some property of the process cannot be simulated due to its intrinsic... | turing machines church turing thesis | 1 | Examples of processes / problems that cannot be tackled by Turing Machines -- (turing machines church turing thesis)
<p>I know that there are problems that cannot be solved by any algorithm, such as the Halting problem.
I also know that some processes cannot be even adequately approximated by any Turing Machine (eq... | habedi/stack-exchange-dataset |
39,771 | How to find out if a piecewise function is partially computable? | <p>I know exactly what a <a href="https://cs.stackexchange.com/questions/31981/what-is-a-partially-computable-function">partially computable function</a> is, but I've seen a few functions that I really can not understand why they are not partially computable. As an example in Davis book page 78, he says the following f... | terminology computability semi decidability | 1 | How to find out if a piecewise function is partially computable? -- (terminology computability semi decidability)
<p>I know exactly what a <a href="https://cs.stackexchange.com/questions/31981/what-is-a-partially-computable-function">partially computable function</a> is, but I've seen a few functions that I really can ... | habedi/stack-exchange-dataset |
39,774 | Set the parameters of a Erdos-Renyi graph generator to get a specific mean degree | <p>I'm trying to reproduce the synthetic networks (graphs) described in some papers.</p>

<p>The topic is the same as a <a href="https://cs.stackexchange.com/q/39764">previous question</a> of mine, but with a different focus.</p>

<p>It is stated that the <strong>Erdos-Renyi</strong> model was used to c... | algorithms graphs randomness sampling modelling | 1 | Set the parameters of a Erdos-Renyi graph generator to get a specific mean degree -- (algorithms graphs randomness sampling modelling)
<p>I'm trying to reproduce the synthetic networks (graphs) described in some papers.</p>

<p>The topic is the same as a <a href="https://cs.stackexchange.com/q/39764">previous q... | habedi/stack-exchange-dataset |
39,777 | Finding the two largest of five small integers as quickly as possible | <p>I use a variation of a 5-cross median filter on image data
on a small embedded system, i.e.</p>

<pre><code> x
 x x x
 x
</code></pre>

<p>The algorithm is really simple: read 5 unsigned integer values, get the highest 2, do some calculations on those and write back the unsigne... | algorithms efficiency selection problem | 1 | Finding the two largest of five small integers as quickly as possible -- (algorithms efficiency selection problem)
<p>I use a variation of a 5-cross median filter on image data
on a small embedded system, i.e.</p>

<pre><code> x
 x x x
 x
</code></pre>

<p>The algorithm is really ... | habedi/stack-exchange-dataset |
39,779 | What type is this sorting algorithm? | <p>I needed to sort vertices into buckets as an optimization for collision detection later. I came up with this:</p>

<ol>
<li><p>Go over all the vertices and count the size that each bucket needs to be to contain them into an array.</p></li>
<li><p>Shift the size array index by -1 unit and use it as of... | algorithms terminology sorting | 1 | What type is this sorting algorithm? -- (algorithms terminology sorting)
<p>I needed to sort vertices into buckets as an optimization for collision detection later. I came up with this:</p>

<ol>
<li><p>Go over all the vertices and count the size that each bucket needs to be to contain them into an array.</... | habedi/stack-exchange-dataset |
39,789 | Interpretation of '1/3' in IEEE floating point representation | <p>For a rational number <code>1/3</code> below is the floating point representation(64 bit) of decimal expansion 0.3333333....</p>

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

<p>As per the above bit structure, I would like to interpret the value of expo... | floating point number formats | 1 | Interpretation of '1/3' in IEEE floating point representation -- (floating point number formats)
<p>For a rational number <code>1/3</code> below is the floating point representation(64 bit) of decimal expansion 0.3333333....</p>

<h2><img src="https://i.stack.imgur.com/AyCTR.png" alt="enter image description he... | habedi/stack-exchange-dataset |
39,809 | What's the purpose of ANDing a bit mask with all bits set to a value? | <p>I'm adapting an algorithm for calculating a CRC 16-bit CCITT (XModem) value from an ASCII input. I've found some code <a href="https://social.msdn.microsoft.com/Forums/en-US/c6975d0a-4be3-46f1-ae4b-9b27f1ce0049/xmodem-crcccitt-with-hex-input?forum=vbgeneral" rel="nofollow">here</a>. I'm using the function the poste... | logic | 1 | What's the purpose of ANDing a bit mask with all bits set to a value? -- (logic)
<p>I'm adapting an algorithm for calculating a CRC 16-bit CCITT (XModem) value from an ASCII input. I've found some code <a href="https://social.msdn.microsoft.com/Forums/en-US/c6975d0a-4be3-46f1-ae4b-9b27f1ce0049/xmodem-crcccitt-with-hex... | habedi/stack-exchange-dataset |
39,812 | A finite automaton accept no string | <p>How can a finite automaton over(0,1) doesn't accept any string? I only can think of </p>

<pre><code>s->a->q->F
</code></pre>

<p>Where the final state F is empty set. Is that true please?</p>
 | automata finite automata | 1 | A finite automaton accept no string -- (automata finite automata)
<p>How can a finite automaton over(0,1) doesn't accept any string? I only can think of </p>

<pre><code>s->a->q->F
</code></pre>

<p>Where the final state F is empty set. Is that true please?</p>
 | habedi/stack-exchange-dataset |
39,821 | Construction of a counter automaton for the complement of the palindromes | <p>How would I go about constructing a nondeterministic 1-counter automaton for the language $L$ that is the complement of the palindromes $\overline{L}=\{ww^{rev}\}$ over a 2 symbol alphabet $\Sigma = \{0,1\}$? </p>

<p>The definition I am using for 1-NCAs consists of:</p>

<ul>
<li>$S$, the set of... | context free automata pushdown automata | 1 | Construction of a counter automaton for the complement of the palindromes -- (context free automata pushdown automata)
<p>How would I go about constructing a nondeterministic 1-counter automaton for the language $L$ that is the complement of the palindromes $\overline{L}=\{ww^{rev}\}$ over a 2 symbol alphabet $\Sigma =... | habedi/stack-exchange-dataset |
39,827 | LL(k) Prediction Techniques (and Insight on method applied) | <blockquote>
 <p>I'm requesting references for <code>LL(k)</code> in situations where <code>k > 1</code> for reasons described below.</p>
</blockquote>

<p>I'm looking for research/notes/anything involving LL(k) predictions.</p>

<p>Any time I look up <code>LL(k)</code> I end up with the des... | reference request finite automata compilers parsers ll k | 1 | LL(k) Prediction Techniques (and Insight on method applied) -- (reference request finite automata compilers parsers ll k)
<blockquote>
 <p>I'm requesting references for <code>LL(k)</code> in situations where <code>k > 1</code> for reasons described below.</p>
</blockquote>

<p>I'm looking for resear... | habedi/stack-exchange-dataset |
39,839 | If $A \cap B$ or $A \cup B$ or $A \times B$ is recursively enumerable is it true to say that both $A$ and $B$ are recursively enumerable? | <p>Sets $A$ and $B$ are given but we don't know what kind of sets they are. If we know that $A \cap B$ is recursively enumerable is it true to say that both $A$ and $B$ are recursively enumerable?</p>

<p>what about $\cup$ and $\times$ operators? If $A \cup B$ or $A \times B$ is recursively enumerable is it tru... | computability sets | 1 | If $A \cap B$ or $A \cup B$ or $A \times B$ is recursively enumerable is it true to say that both $A$ and $B$ are recursively enumerable? -- (computability sets)
<p>Sets $A$ and $B$ are given but we don't know what kind of sets they are. If we know that $A \cap B$ is recursively enumerable is it true to say that both $... | habedi/stack-exchange-dataset |
39,846 | Rubik Cube Algorithm for general n | <p>I am not sure if this is the right place , but:</p>

<p>Is there an algorithm for solving $n\times n \times n$ rubik's cube (non-trivial one)? If so how efficent is it? Now say I have a $n \times \ldots \times n$ ($d$ times) rubic cube , is there an algorithm that works effiecently for this case?(of course n... | algorithms board games | 1 | Rubik Cube Algorithm for general n -- (algorithms board games)
<p>I am not sure if this is the right place , but:</p>

<p>Is there an algorithm for solving $n\times n \times n$ rubik's cube (non-trivial one)? If so how efficent is it? Now say I have a $n \times \ldots \times n$ ($d$ times) rubic cube , is there... | habedi/stack-exchange-dataset |
39,851 | What is the meaning of undecidability in Rice Theorem? | <p>Rice theorem says <strong>every non-trivial property of languages of Turing machines is undecidable</strong>. what is the meaning of undecidability here? is it semi-decidable? </p>

<p>As an example the following language is R.E but it contains a non-trivial property</p>

<p>$A = \{x | \phi_x$ is def... | terminology computability undecidability semi decidability rice theorem | 1 | What is the meaning of undecidability in Rice Theorem? -- (terminology computability undecidability semi decidability rice theorem)
<p>Rice theorem says <strong>every non-trivial property of languages of Turing machines is undecidable</strong>. what is the meaning of undecidability here? is it semi-decidable? </p>
... | habedi/stack-exchange-dataset |
39,858 | How do I show that a DFA accepts only one word? | <p>I want to show that</p>

<p>$\qquad\displaystyle O = \{M : M \text{ is a DFA}, |L(M)| = 1\}$. </p>

<p>Here $|L(M)|=1$ means the DFA contains only one state. I really don't know where to get started in this problem. </p>

<p>Should I do something like this?</p>

<pre><code>M = On inpu... | computability finite automata | 1 | How do I show that a DFA accepts only one word? -- (computability finite automata)
<p>I want to show that</p>

<p>$\qquad\displaystyle O = \{M : M \text{ is a DFA}, |L(M)| = 1\}$. </p>

<p>Here $|L(M)|=1$ means the DFA contains only one state. I really don't know where to get started in this problem. </... | habedi/stack-exchange-dataset |
39,871 | Why are comparisons so expensive on a GPU? | <p>While trying to improve the performance of my collision detection class, I found that ~80% of the time spent at the gpu, it spent on if/else conditions just trying to figure out the bounds for the buckets it should loop through.</p>

<p>More precisely: </p>

<ol>
<li><p>each thread gets an ID, by... | computer architecture parallel computing | 1 | Why are comparisons so expensive on a GPU? -- (computer architecture parallel computing)
<p>While trying to improve the performance of my collision detection class, I found that ~80% of the time spent at the gpu, it spent on if/else conditions just trying to figure out the bounds for the buckets it should loop through.... | habedi/stack-exchange-dataset |
39,878 | Shortest path in a mutable graph | <p>I have an acyclic edge-weighted graph and have used Dijkstra's Algorithm with topological sort to find <strong>any</strong> shortest path to every other node from a root $s$. This is performed in time proportional to $V + E$, where $V$ is the number of vertices and $E$ the number of edges. I have $V= N^2$ vertices i... | algorithms graphs shortest path | 1 | Shortest path in a mutable graph -- (algorithms graphs shortest path)
<p>I have an acyclic edge-weighted graph and have used Dijkstra's Algorithm with topological sort to find <strong>any</strong> shortest path to every other node from a root $s$. This is performed in time proportional to $V + E$, where $V$ is the numb... | habedi/stack-exchange-dataset |
39,889 | Algorithm for a special case of SAT/#SAT | <p>Does anyone know of an algorithm that can solve the following special case of SAT in polynomial time? Are there any algorithms that can solve the counting (#SAT) version of it in polynomial time?</p>

<p>Special case:
If clause $a$ and clause $b$ have one or more variables in common, that is, there exist... | algorithms complexity theory satisfiability polynomial time counting | 1 | Algorithm for a special case of SAT/#SAT -- (algorithms complexity theory satisfiability polynomial time counting)
<p>Does anyone know of an algorithm that can solve the following special case of SAT in polynomial time? Are there any algorithms that can solve the counting (#SAT) version of it in polynomial time?</p>&#x... | habedi/stack-exchange-dataset |
39,893 | What is the name of this size method calculating the size of a node? | <p>My confusion is that if the recursive call calls the left nodes, and then adds with the right nodes, how are the nodes that are to to right of the left nodes and vice versa being called?</p>

<pre><code>int size (BinaryNode t) {
 if (t == null) 
 return 0;
 else
 return 1 + size(t.lef... | terminology data structures trees binary trees recursion | 1 | What is the name of this size method calculating the size of a node? -- (terminology data structures trees binary trees recursion)
<p>My confusion is that if the recursive call calls the left nodes, and then adds with the right nodes, how are the nodes that are to to right of the left nodes and vice versa being called?... | habedi/stack-exchange-dataset |
39,894 | How do Computer Algebra Systems work? | <p>In Computer Architecture course, I have learnt how computer performs numerical computations.<br>
While using MATLAB, I was introduced to symbolic mathematics toolbox.<br>
I was amazed to see it manipulating trigonometric expressions, indefinite integration etc.<br>
What sorts type of algorithms are used ... | mathematical software | 1 | How do Computer Algebra Systems work? -- (mathematical software)
<p>In Computer Architecture course, I have learnt how computer performs numerical computations.<br>
While using MATLAB, I was introduced to symbolic mathematics toolbox.<br>
I was amazed to see it manipulating trigonometric expressions, indefinite... | habedi/stack-exchange-dataset |
39,898 | Why separate lexing and parsing? | <p>It's possible to parse a document using a single pass from a state machine. What is the benefit of having two passes, ie. having a lexer to convert text to tokens, and having a parser to test production rules on those tokens? Why not have a single pass that applies production rules directly to the text?</p>
 | compilers parsers | 1 | Why separate lexing and parsing? -- (compilers parsers)
<p>It's possible to parse a document using a single pass from a state machine. What is the benefit of having two passes, ie. having a lexer to convert text to tokens, and having a parser to test production rules on those tokens? Why not have a single pass that app... | habedi/stack-exchange-dataset |
39,899 | Parallel algorithms on a fixed number of processors | <p>Usual parallel algorithms require a number of processors that grow with the size of the input, usually $O(\log n)$ or $O(n)$.</p>

<p>This is great from a theoric point of view, but strange from a practical point of view, where the number of the processors that we can use is bounded by a constant. A corollar... | algorithms algorithm analysis parallel computing | 1 | Parallel algorithms on a fixed number of processors -- (algorithms algorithm analysis parallel computing)
<p>Usual parallel algorithms require a number of processors that grow with the size of the input, usually $O(\log n)$ or $O(n)$.</p>

<p>This is great from a theoric point of view, but strange from a practi... | habedi/stack-exchange-dataset |
39,905 | Runtime of a recursive algorithm | <p>I have a simple recursive solution as below:</p>

<pre><code>public int countPaths(int x, int y) {

 if(x == 0 && y == 0) {
 return 0;
 } else if(x == 0) {
 return 1;
 } else if(y == 0) {
 return 1;
 } else {
 int count = cou... | algorithm analysis runtime analysis recursion memoization | 1 | Runtime of a recursive algorithm -- (algorithm analysis runtime analysis recursion memoization)
<p>I have a simple recursive solution as below:</p>

<pre><code>public int countPaths(int x, int y) {

 if(x == 0 && y == 0) {
 return 0;
 } else if(x == 0) {
 return 1... | habedi/stack-exchange-dataset |
39,906 | Implications of Rice's theorem | <p>Every time I think I get what Rice's theorem means, I find a counterexample to confuse myself. Maybe someone can tell me where I'm thinking wrong.</p>

<p>Lets take some non-trivial property of the set of computable functions, for example let $L = \{ f : \mathbb{N} \to \mathbb{N} \;|\; \text{f is a computabl... | computability undecidability | 1 | Implications of Rice's theorem -- (computability undecidability)
<p>Every time I think I get what Rice's theorem means, I find a counterexample to confuse myself. Maybe someone can tell me where I'm thinking wrong.</p>

<p>Lets take some non-trivial property of the set of computable functions, for example let $... | habedi/stack-exchange-dataset |
39,920 | Is Morse Code binary, ternary or quinary? | <p>I am reading the book: "<a href="http://rads.stackoverflow.com/amzn/click/B00JDMPOK2" rel="noreferrer">Code: The Hidden Language of Computer Hardware and Software</a>" and in Chapter 2 author says:</p>

<blockquote>
 <p>Morse code is said to be a binary (literally meaning two by two) code
 because... | information theory coding theory encoding scheme | 1 | Is Morse Code binary, ternary or quinary? -- (information theory coding theory encoding scheme)
<p>I am reading the book: "<a href="http://rads.stackoverflow.com/amzn/click/B00JDMPOK2" rel="noreferrer">Code: The Hidden Language of Computer Hardware and Software</a>" and in Chapter 2 author says:</p>

<blockquo... | habedi/stack-exchange-dataset |
39,925 | Finding the time complexity of fibonacci sequence | <p>I tried it as follows and would like to know if it is correct.</p>

<p><img src="https://i.stack.imgur.com/hVgso.jpg" alt="enter image description here"></p>
 | algorithm analysis runtime analysis recursion | 1 | Finding the time complexity of fibonacci sequence -- (algorithm analysis runtime analysis recursion)
<p>I tried it as follows and would like to know if it is correct.</p>

<p><img src="https://i.stack.imgur.com/hVgso.jpg" alt="enter image description here"></p>
 | habedi/stack-exchange-dataset |
39,940 | Expected number of random interval flips needed for sorting a random array | <p>This question is inspired by the <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.148.7743" rel="nofollow noreferrer">Bogo-Sort</a> algorithm and the discussion of whether <a href="https://stackoverflow.com/questions/2609857/are-there-any-worse-sorting-algorithms-than-bogosort-a-k-a-monkey-sort">ther... | algorithms algorithm analysis sorting | 1 | Expected number of random interval flips needed for sorting a random array -- (algorithms algorithm analysis sorting)
<p>This question is inspired by the <a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.148.7743" rel="nofollow noreferrer">Bogo-Sort</a> algorithm and the discussion of whether <a href="ht... | habedi/stack-exchange-dataset |
39,948 | Efficient computation of Kronecker product | <p>Given matrices $A \in \mathbb{C}^{n_1,m_1}, B \in \mathbb{C}^{n_2,m_2}$ a naive way to computer the Kronecker product would be as such:</p>

<p>$M = \operatorname{zeros}(n_1n_2,m_1m_2)$ (initialize an empty array) <br>
 For $p = 1,2,\ldots n_1n_2:$<br>
 &... | algorithms algorithm analysis linear algebra | 1 | Efficient computation of Kronecker product -- (algorithms algorithm analysis linear algebra)
<p>Given matrices $A \in \mathbb{C}^{n_1,m_1}, B \in \mathbb{C}^{n_2,m_2}$ a naive way to computer the Kronecker product would be as such:</p>

<p>$M = \operatorname{zeros}(n_1n_2,m_1m_2)$ (initialize an empty array) <b... | habedi/stack-exchange-dataset |
39,949 | Type of undecidability in Rice Theorem | <p>Rice theorem says every non-trivial property of languages of Turing machines is undecidable. As <a href="https://cs.stackexchange.com/users/9550/david-richerby">David Richerby</a> said in <a href="https://cs.stackexchange.com/questions/39851/what-is-the-meaning-of-undecidability-in-rice-theorem">here</a> : </p>
... | terminology computability semi decidability | 1 | Type of undecidability in Rice Theorem -- (terminology computability semi decidability)
<p>Rice theorem says every non-trivial property of languages of Turing machines is undecidable. As <a href="https://cs.stackexchange.com/users/9550/david-richerby">David Richerby</a> said in <a href="https://cs.stackexchange.com/qu... | habedi/stack-exchange-dataset |
39,950 | How to prove that there is a function index t so that t³ + t + 1 is an index of the same function? | <p>I would like to prove $\exists t\phi_t = \phi_{t^3+t+1}$ where $\phi_0,\phi_1,\phi_2,...$ are sequence of all of the partially computable function.</p>

<p>$\phi_t = \phi_{t^3+t+1}$ only if $t = t^3+t+1$ and it means $t=-1$! and there is no program with number $-1$!</p>
 | computability | 1 | How to prove that there is a function index t so that t³ + t + 1 is an index of the same function? -- (computability)
<p>I would like to prove $\exists t\phi_t = \phi_{t^3+t+1}$ where $\phi_0,\phi_1,\phi_2,...$ are sequence of all of the partially computable function.</p>

<p>$\phi_t = \phi_{t^3+t+1}$ only if $... | habedi/stack-exchange-dataset |
39,959 | Is it true, If $A$ is turing recognizable and $A \leq_m\bar{A}$ then $A$ is recursive? | <p>If $A$ is turing recognizable and $A \leq_m\bar{A}$ then $A$ is recursive? 
If it is true how to prove it?</p>

<p><strong>Update</strong></p>

<p>It is my attempt, If $A$ is turing recognizable (r.e.) and $\bar{A}$ is r.e. then $A$ is recursive. but by $A \leq_m\bar{A}$ I can't deduce that $\bar... | computability turing machines reductions | 1 | Is it true, If $A$ is turing recognizable and $A \leq_m\bar{A}$ then $A$ is recursive? -- (computability turing machines reductions)
<p>If $A$ is turing recognizable and $A \leq_m\bar{A}$ then $A$ is recursive? 
If it is true how to prove it?</p>

<p><strong>Update</strong></p>

<p>It is my attempt,... | habedi/stack-exchange-dataset |
39,960 | DFA for a strings whose every subsequence of length five has at least two zeroes | <p>I have a regular language consisting of such <code>{0,1}^k</code> sequences, in which every subsequence of length 5 has at least two <code>0</code>'s in it (which also means every sequence of length <5 is 'good'). I need to find a DFA which generates this language.</p>

<p>I can't say I tried everything, ... | formal languages regular languages automata finite automata | 1 | DFA for a strings whose every subsequence of length five has at least two zeroes -- (formal languages regular languages automata finite automata)
<p>I have a regular language consisting of such <code>{0,1}^k</code> sequences, in which every subsequence of length 5 has at least two <code>0</code>'s in it (which also mea... | habedi/stack-exchange-dataset |
39,965 | Big-O Time Complexity of nested for loops | <p>My gut tells me the time-complexity of the following code is simply O(n^2). However, I'm not convinced, thinking it could possibly be O(n^3):</p>

<pre><code>cin >> n;
sum = 0;
for (int i = 0; i < n; i++)
 for (int j = 0; j < n * n; j++)
 sum++;
</code></pre>
&#... | algorithm analysis runtime analysis loops | 1 | Big-O Time Complexity of nested for loops -- (algorithm analysis runtime analysis loops)
<p>My gut tells me the time-complexity of the following code is simply O(n^2). However, I'm not convinced, thinking it could possibly be O(n^3):</p>

<pre><code>cin >> n;
sum = 0;
for (int i = 0; i < n; i+... | habedi/stack-exchange-dataset |
39,971 | What parts of linear algebra are used in computer science? | <p>I've been reading <em>Linear Algebra and its Applications</em> to help understand computer science material (mainly machine learning), but I'm concerned that a lot of the information isn't useful to CS. For example, knowing how to efficiently solve systems of linear equations doesn't seem very useful unless you're t... | education linear algebra didactics mathematical foundations | 1 | What parts of linear algebra are used in computer science? -- (education linear algebra didactics mathematical foundations)
<p>I've been reading <em>Linear Algebra and its Applications</em> to help understand computer science material (mainly machine learning), but I'm concerned that a lot of the information isn't usef... | habedi/stack-exchange-dataset |
39,973 | How is the complexity of algorithms to solve 3CNF (decision problem) specified? | <p>For k inputs, the complexity of naive algorithm is O(2^k). I understood this one.</p>

<p>What is meant by "the size of the instance to be solved should be polynomial in k". Is it equivalent to the statement "The number of clauses in CNF of the boolean expression is polynomial in k"?</p>

<p>What sho... | np complete satisfiability sat solvers | 1 | How is the complexity of algorithms to solve 3CNF (decision problem) specified? -- (np complete satisfiability sat solvers)
<p>For k inputs, the complexity of naive algorithm is O(2^k). I understood this one.</p>

<p>What is meant by "the size of the instance to be solved should be polynomial in k". Is it equiv... | habedi/stack-exchange-dataset |
39,976 | Data structure for a static set of sets | <p>I have collection $U$ of sets, where each set is of size at most 95 (corresponding to each printable ASCII character). For example, $\{h,r,l,a\}$ is one set, and $U = \{\{h,r,l,a\}, \{l,e,d\}, \ldots\}$. The number of sets in $U$ is nearly a million. Also a set in $U$ will mostly contains 8-20 elements.</p>

... | data structures sets | 1 | Data structure for a static set of sets -- (data structures sets)
<p>I have collection $U$ of sets, where each set is of size at most 95 (corresponding to each printable ASCII character). For example, $\{h,r,l,a\}$ is one set, and $U = \{\{h,r,l,a\}, \{l,e,d\}, \ldots\}$. The number of sets in $U$ is nearly a million. ... | habedi/stack-exchange-dataset |
39,982 | If $B$, $\overline{B}\neq \varnothing$ , then for every recursive set $A$, $A \leq_m B$ | <p>How to prove if $B$, $\overline{B}\neq \varnothing$ , then for every recursive set $A$, $A \leq_m B$ ?</p>

<p>it means every recursive set is mapping reducible to set $B\neq \aleph$. I really have no idea to prove this.</p>

<p><strong>UPDATE</strong></p>

<p>$A,B$ are sets, $A \leq_m B$ if ... | computability reductions | 1 | If $B$, $\overline{B}\neq \varnothing$ , then for every recursive set $A$, $A \leq_m B$ -- (computability reductions)
<p>How to prove if $B$, $\overline{B}\neq \varnothing$ , then for every recursive set $A$, $A \leq_m B$ ?</p>

<p>it means every recursive set is mapping reducible to set $B\neq \aleph$. I reall... | habedi/stack-exchange-dataset |
39,992 | Restricted Integer Programming | <p>The integer feasibility problem is NP-complete:</p>

<p>$Ax=b, x \geq 0, x \mbox{ integer}$</p>

<p>$A$ contains elements in $\mathbb{R}$</p>

<p>If we restrict this:</p>

<p>$A$ contains only elements in:</p>

<ol>
<li>$\{1,0\}$</li>
<li>$\{1,0,-1\}$</li>
<li>$\ma... | complexity theory np complete reductions integer programming | 1 | Restricted Integer Programming -- (complexity theory np complete reductions integer programming)
<p>The integer feasibility problem is NP-complete:</p>

<p>$Ax=b, x \geq 0, x \mbox{ integer}$</p>

<p>$A$ contains elements in $\mathbb{R}$</p>

<p>If we restrict this:</p>

<p>$A$ contains ... | habedi/stack-exchange-dataset |
39,998 | What does normalizing with hidden bit really mean? | <p>I have a question related to representing numbers in base 2 with floating point. For example, if I have such a number $$0.000011 \cdot 2^3$$ then is its normalized form this?
$$1.1\cdot 2^{-2}$$ 
Generally speaking about normalizing, normalizing with hidden bit, does it imply that the first number of mantis... | floating point number formats normal forms | 1 | What does normalizing with hidden bit really mean? -- (floating point number formats normal forms)
<p>I have a question related to representing numbers in base 2 with floating point. For example, if I have such a number $$0.000011 \cdot 2^3$$ then is its normalized form this?
$$1.1\cdot 2^{-2}$$ 
Generally spe... | habedi/stack-exchange-dataset |
40,002 | Prove that a stable algorithm cannot solve an ill-conditioned problem with a precision greater than that of input values | <p>How can I prove that a stable algorithm cannot solve an ill-conditioned problem with a precision greater than that of input values ? </p>

<p>It seems obvious to me, since an ill-conditioned problem is that in which exact input values(D) are totally different from error valuesI(D') (judging by something), th... | algorithm analysis | 1 | Prove that a stable algorithm cannot solve an ill-conditioned problem with a precision greater than that of input values -- (algorithm analysis)
<p>How can I prove that a stable algorithm cannot solve an ill-conditioned problem with a precision greater than that of input values ? </p>

<p>It seems obvious to me... | habedi/stack-exchange-dataset |
40,005 | Solving Subproblem in Logic (first-order, propositional, pddl) | <h2>One sentence question</h2>

<p>Is there any algorithm able to prove (solve) a logic problem (first-order, propositional, pddl) by finite induction?</p>

<h2>Background</h2>

<p>I am researching Hierarchical planning solvers and I found the following problem.
Let a problem climb a stairwa... | logic induction | 1 | Solving Subproblem in Logic (first-order, propositional, pddl) -- (logic induction)
<h2>One sentence question</h2>

<p>Is there any algorithm able to prove (solve) a logic problem (first-order, propositional, pddl) by finite induction?</p>

<h2>Background</h2>

<p>I am researching Hierarchical p... | habedi/stack-exchange-dataset |
40,019 | What is the best solution to find whether the sum of an array is even or odd | <p>I was asked this question in an interview. I was not able to find a better solution than $O(n)$ which is just going over the array and finding the sum. Can it be done any better? I am not really interested in the actual sum, I just want to know whether it's even or odd.</p>

<p>Or how do I prove that it cann... | algorithms efficiency arrays | 1 | What is the best solution to find whether the sum of an array is even or odd -- (algorithms efficiency arrays)
<p>I was asked this question in an interview. I was not able to find a better solution than $O(n)$ which is just going over the array and finding the sum. Can it be done any better? I am not really interested ... | habedi/stack-exchange-dataset |
40,033 | Algorithm to determine two binary expression trees will give the same result based on associative and commutative properties of some operators | <p>Given <em>n</em> different numbers, I would like to find out whether there exists an algebraic expression using all the <em>n</em> numbers, with <em>n</em>−1 binary operators and unlimited number of parentheses, that evaluates to a certain number <em>T</em>. My idea is to make use of binary expression trees, c... | algorithms search algorithms binary trees | 1 | Algorithm to determine two binary expression trees will give the same result based on associative and commutative properties of some operators -- (algorithms search algorithms binary trees)
<p>Given <em>n</em> different numbers, I would like to find out whether there exists an algebraic expression using all the <em>n</... | habedi/stack-exchange-dataset |
40,039 | Why does quicksort work well with virtual memory? | <p><em>Introduction to Algorithms</em> said that quicksort "works well even in virtual-memory environments," but didn't explain why. I've tried looking an Wikipedia and Stack Exchange, but found no reason why. Is it just because quicksort sorts in place? </p>
 | algorithms algorithm analysis sorting virtual memory quicksort | 1 | Why does quicksort work well with virtual memory? -- (algorithms algorithm analysis sorting virtual memory quicksort)
<p><em>Introduction to Algorithms</em> said that quicksort "works well even in virtual-memory environments," but didn't explain why. I've tried looking an Wikipedia and Stack Exchange, but found no reas... | habedi/stack-exchange-dataset |
40,041 | Is equivalence of a CFG and an RG undecidable? | <p>I know that the equivalence of two context-free grammars is undecidable, but what about the equivalence of a regular grammar and a context-free grammar?</p>
 | computability formal grammars decision problem | 1 | Is equivalence of a CFG and an RG undecidable? -- (computability formal grammars decision problem)
<p>I know that the equivalence of two context-free grammars is undecidable, but what about the equivalence of a regular grammar and a context-free grammar?</p>
 | habedi/stack-exchange-dataset |
40,061 | Happened-before and Causal order | <p>I'm reading Lamport's "Time, Clocks, and the Ordering of Events in a Distributed System" and there's a detail that's bugging me.</p>

<p>Lamport defines the "happened before" partial order, which I understand. Then he says that "Another way of viewing the definition is to say that a -> b means that it is pos... | algorithms distributed systems clocks | 1 | Happened-before and Causal order -- (algorithms distributed systems clocks)
<p>I'm reading Lamport's "Time, Clocks, and the Ordering of Events in a Distributed System" and there's a detail that's bugging me.</p>

<p>Lamport defines the "happened before" partial order, which I understand. Then he says that "Anot... | habedi/stack-exchange-dataset |
40,079 | Is it possible to convert a graph with one negative capacity to a graph with only positive capacities? | <p>I am interested in whether a graph (say, a complete graph) with one capacity negative (or many, but one should suffice) can be reconstructed as a graph with all non-negative capacities where the max flow between vertices of the original graph can be identified with max flows between vertices of the new graph. It is ... | graphs weighted graphs | 1 | Is it possible to convert a graph with one negative capacity to a graph with only positive capacities? -- (graphs weighted graphs)
<p>I am interested in whether a graph (say, a complete graph) with one capacity negative (or many, but one should suffice) can be reconstructed as a graph with all non-negative capacities w... | habedi/stack-exchange-dataset |
40,094 | Sufficient condition for simple graph isomorphism? | <p>Say I have two simple graphs, $A$ and $B$</p>

<ul>
<li><p>In $A$, I know:</p>

<ul>
<li>one node has 3 nodes at distance of 1, 4 nodes at distance 2, etc.</li>
<li>one node has 4 nodes at distance of 1, 1 nodes at distance 2, etc.</li>
<li>etc.</li>
</ul></li>
<li><p>In $B$, ... | graphs | 1 | Sufficient condition for simple graph isomorphism? -- (graphs)
<p>Say I have two simple graphs, $A$ and $B$</p>

<ul>
<li><p>In $A$, I know:</p>

<ul>
<li>one node has 3 nodes at distance of 1, 4 nodes at distance 2, etc.</li>
<li>one node has 4 nodes at distance of 1, 1 nodes at distance 2,... | habedi/stack-exchange-dataset |
40,097 | What do we gain by having "dependent types"? | <p>I thought I understood dependent typing (DT) properly, but the answer to this question: <a href="https://cstheory.stackexchange.com/questions/30651/why-was-there-a-need-for-martin-l%C3%B6f-to-create-intuitionistic-type-theory">https://cstheory.stackexchange.com/questions/30651/why-was-there-a-need-for-martin-l%C3%B6... | logic type theory intuition | 1 | What do we gain by having "dependent types"? -- (logic type theory intuition)
<p>I thought I understood dependent typing (DT) properly, but the answer to this question: <a href="https://cstheory.stackexchange.com/questions/30651/why-was-there-a-need-for-martin-l%C3%B6f-to-create-intuitionistic-type-theory">https://csth... | habedi/stack-exchange-dataset |
40,107 | Can a Von Neumann CPU be pipelined? | <p>Can you pipeline a pure Von Neumann architecture based CPU or do you need seperate data and instruction caches for this? If you include seperate instruction and data caches (then it isn't a von neumann CPU anymore, it's a modified Harvard), how do you unify the data of these caches so that they get stored in a singl... | computer architecture | 1 | Can a Von Neumann CPU be pipelined? -- (computer architecture)
<p>Can you pipeline a pure Von Neumann architecture based CPU or do you need seperate data and instruction caches for this? If you include seperate instruction and data caches (then it isn't a von neumann CPU anymore, it's a modified Harvard), how do you un... | habedi/stack-exchange-dataset |
40,109 | PCA and Eigenvectors | <p>I am trying to understand how PCA works, and think I got most of it except...</p>

<p>By calculating eigenvalues/vectors of the covariance matrix of the original dataset allows to find those dimensions where data is least correlated (lowest covariance). Sorting them based on eigenvalues is the method which a... | machine learning | 1 | PCA and Eigenvectors -- (machine learning)
<p>I am trying to understand how PCA works, and think I got most of it except...</p>

<p>By calculating eigenvalues/vectors of the covariance matrix of the original dataset allows to find those dimensions where data is least correlated (lowest covariance). Sorting them... | habedi/stack-exchange-dataset |
40,115 | Complexity bound on $RP^{RP}$ | <p>This is a homework question, I'm wondering if anyone could help. Recall $RP$ is the set of languages recognized by randomized algorithms in polynomial time. The question is given an algorithm in $RP$ allowed to consult an oracle in $RP$, prove the "lowest complexity bound" for a set recognized by this algorithm.</... | algorithms complexity theory time complexity randomized algorithms | 1 | Complexity bound on $RP^{RP}$ -- (algorithms complexity theory time complexity randomized algorithms)
<p>This is a homework question, I'm wondering if anyone could help. Recall $RP$ is the set of languages recognized by randomized algorithms in polynomial time. The question is given an algorithm in $RP$ allowed to co... | habedi/stack-exchange-dataset |
40,117 | Something wrong with this definition of factorial with structural recursion? | <p>In <a href="http://rads.stackoverflow.com/amzn/click/013507245X" rel="nofollow">The Algebra of Programming</a> page 5, the authors defined structural recursion <code>foldn (c, h)</code> over natural numbers:</p>

<pre><code>f 0 = c
f (n+1) = h (f n)
</code></pre>

<p>They then went on to ... | recursion functional programming | 1 | Something wrong with this definition of factorial with structural recursion? -- (recursion functional programming)
<p>In <a href="http://rads.stackoverflow.com/amzn/click/013507245X" rel="nofollow">The Algebra of Programming</a> page 5, the authors defined structural recursion <code>foldn (c, h)</code> over natural num... | habedi/stack-exchange-dataset |
40,129 | Amdahl's law or gustafson's law | <p>I am a little confused which of the two laws above i should use:</p>

<p>Suppose I have a computer program that can be parallelized by 70%. 30% cannot be parallelized. Every single data (100% of data) will pass the parallelizable part and also pass the non-parallelizable part.</p>

<p>I want to calcu... | computer architecture parallel computing performance | 1 | Amdahl's law or gustafson's law -- (computer architecture parallel computing performance)
<p>I am a little confused which of the two laws above i should use:</p>

<p>Suppose I have a computer program that can be parallelized by 70%. 30% cannot be parallelized. Every single data (100% of data) will pass the para... | habedi/stack-exchange-dataset |
40,130 | Why there is light source? | <p>In ray tracing if we are tracing a ray from camera to the object, then why there is need for light source as in this image and also rays are going towards the light source instead of outgoing from the light source?</p>

<p><img src="https://i.stack.imgur.com/cQrHl.png" alt="Ray Tracing"><br>
Recursive ra... | graphics | 1 | Why there is light source? -- (graphics)
<p>In ray tracing if we are tracing a ray from camera to the object, then why there is need for light source as in this image and also rays are going towards the light source instead of outgoing from the light source?</p>

<p><img src="https://i.stack.imgur.com/cQrHl.png... | habedi/stack-exchange-dataset |
40,134 | Is the following statement about turing machines true? | <p>Here's the statement:</p>

<blockquote>
 <p>Take a set of finite inputs from some alphabet. If for any two turing machines:</p>
 
 <ol>
 <li>All inputs in the set produce the same output for both machines</li>
 <li>In both machines, the following is true: every state transition (i.e.... | turing machines | 1 | Is the following statement about turing machines true? -- (turing machines)
<p>Here's the statement:</p>

<blockquote>
 <p>Take a set of finite inputs from some alphabet. If for any two turing machines:</p>
 
 <ol>
 <li>All inputs in the set produce the same output for both machines</li>
... | habedi/stack-exchange-dataset |
40,142 | How to find a subset of potentially maximal vectors (of numbers) in a set of vectors | <p>I have a set S (so no duplicates) of d-dimensional vectors of non-negative real numbers (or if you would prefer, floats).</p>

<p>I say a vector u "covers" a vector v if, in every dimension 1..d, u[i] >= v[i]. So for d=3, (3,3,2) covers (2, 3, 1), but (3, 3, 1) doesn't cover (2, 2, 2).</p>

<p>I am i... | algorithms computational geometry discrete mathematics | 1 | How to find a subset of potentially maximal vectors (of numbers) in a set of vectors -- (algorithms computational geometry discrete mathematics)
<p>I have a set S (so no duplicates) of d-dimensional vectors of non-negative real numbers (or if you would prefer, floats).</p>

<p>I say a vector u "covers" a vector... | habedi/stack-exchange-dataset |
40,146 | Assistance with Notation in the Paper Entitled: "Search Through Systematic Set Enumeration" | <p>So I'm reading "Search Through Systematic Set Enumeration" by Ron Rymon (currently <a href="http://repository.upenn.edu/cgi/viewcontent.cgi?article=1312&context=cis_reports" rel="nofollow noreferrer">available online for free</a>. I'm having a problem with the notation in the following definition pres... | trees sets enumeration | 1 | Assistance with Notation in the Paper Entitled: "Search Through Systematic Set Enumeration" -- (trees sets enumeration)
<p>So I'm reading "Search Through Systematic Set Enumeration" by Ron Rymon (currently <a href="http://repository.upenn.edu/cgi/viewcontent.cgi?article=1312&context=cis_reports" rel="nofo... | habedi/stack-exchange-dataset |
40,156 | Complexity of self-reducible set | <p>I am trying to solve the following problem:</p>

<blockquote>
 <p>A set $S$ is self-reducible if the following holds: $x \in S$ iff $x = 1$(Base case) or (recursively) $l(x) \in S$ and $r(x) \in S$ where $\left|l(x)\right| < \left|x\right|$, $\left|r(x)\right| < |x|$, and $l$ and $r$ are both dete... | complexity theory formal languages computability time complexity | 1 | Complexity of self-reducible set -- (complexity theory formal languages computability time complexity)
<p>I am trying to solve the following problem:</p>

<blockquote>
 <p>A set $S$ is self-reducible if the following holds: $x \in S$ iff $x = 1$(Base case) or (recursively) $l(x) \in S$ and $r(x) \in S$ whe... | habedi/stack-exchange-dataset |
40,160 | How to solve this recurrence using recursion tree method | <p>How to solve this using the recursive tree method? I'm stuck with the $\max$.</p>

<p>$$T(n) = T\left(\left\lceil \frac{n}{\max\,\{\sqrt{n},2\}}\right\rceil\right) + n\,.$$</p>
 | recurrence relation | 1 | How to solve this recurrence using recursion tree method -- (recurrence relation)
<p>How to solve this using the recursive tree method? I'm stuck with the $\max$.</p>

<p>$$T(n) = T\left(\left\lceil \frac{n}{\max\,\{\sqrt{n},2\}}\right\rceil\right) + n\,.$$</p>
 | habedi/stack-exchange-dataset |
40,167 | Finding all circuits that contain a given edge | <p>Given a <em>directed graph</em> $G = (V, E)$ and an edge $e \in E$, I'm trying to come up with an algorithm to construct the minimum induced subgraph $H$ of $G$ with the property that every circuit in $G$ that traverses $e$ is in also in $H$.</p>

<p>As an example, suppose graph $G$ has vertices $V = \{1,2,3... | algorithms graphs search algorithms | 1 | Finding all circuits that contain a given edge -- (algorithms graphs search algorithms)
<p>Given a <em>directed graph</em> $G = (V, E)$ and an edge $e \in E$, I'm trying to come up with an algorithm to construct the minimum induced subgraph $H$ of $G$ with the property that every circuit in $G$ that traverses $e$ is in... | habedi/stack-exchange-dataset |
40,168 | Particular function communication complexity computation | <p>Consider a boolean function $f:\{0,1\}^n\rightarrow\{0,1\}$. If $f$ satisfies $f(\bar{0})=0$ where $\bar{0}$ is vector of $0$, $f(x)=1$ with every $0/1$ vector of hamming weight $1$, then communication complexity of function is $\Omega(n)$. This is claim $4.23$ in Jukna's book. If $f$ satisfies $f(\bar{0})=0$ where ... | complexity theory lower bounds communication complexity | 1 | Particular function communication complexity computation -- (complexity theory lower bounds communication complexity)
<p>Consider a boolean function $f:\{0,1\}^n\rightarrow\{0,1\}$. If $f$ satisfies $f(\bar{0})=0$ where $\bar{0}$ is vector of $0$, $f(x)=1$ with every $0/1$ vector of hamming weight $1$, then communicati... | habedi/stack-exchange-dataset |
40,170 | Definition of opposite category | <p>From page 29 of <a href="http://rads.stackoverflow.com/amzn/click/013507245X" rel="nofollow">The algebra of programming</a> : </p>

<blockquote>
 <p>For any category C the opposite category $C^{op}$ is defined to have
 the same objects and arrows as C, but the source and target operators
 are ... | functional programming category theory | 1 | Definition of opposite category -- (functional programming category theory)
<p>From page 29 of <a href="http://rads.stackoverflow.com/amzn/click/013507245X" rel="nofollow">The algebra of programming</a> : </p>

<blockquote>
 <p>For any category C the opposite category $C^{op}$ is defined to have
 the ... | habedi/stack-exchange-dataset |
40,178 | Why are NP-complete problems so different in terms of their approximation? | <p>I'd like to begin the question by saying I'm a programmer, and I don't have a lot of background in complexity theory.</p>

<p>One thing that I've noticed is that while many problems are NP-complete, when extended to optimization problems, some are far more difficult to approximate than others.</p>

<... | complexity theory optimization np approximation | 1 | Why are NP-complete problems so different in terms of their approximation? -- (complexity theory optimization np approximation)
<p>I'd like to begin the question by saying I'm a programmer, and I don't have a lot of background in complexity theory.</p>

<p>One thing that I've noticed is that while many problems... | habedi/stack-exchange-dataset |
40,190 | Iterative lengthening search: iterative version of Uniform Cost Search or DFS? | <p>Actually my question has two parts:</p>

<p>1) I wanted to know that whether Iterative Lengthening Search is used in combination with DFS or Uniform Cost Search? Actually, in Russell and Norvig book (on page 90), it is described as follow:</p>

<blockquote>
 <p>It would seem worthwhile to develo... | algorithms artificial intelligence search algorithms graph traversal | 1 | Iterative lengthening search: iterative version of Uniform Cost Search or DFS? -- (algorithms artificial intelligence search algorithms graph traversal)
<p>Actually my question has two parts:</p>

<p>1) I wanted to know that whether Iterative Lengthening Search is used in combination with DFS or Uniform Cost Se... | habedi/stack-exchange-dataset |
40,196 | Graph cycles on 40 vertices | <p>I'm trying to create an algorithm in polynomial time, that detects wether or not a graph is in a language.</p>

<p>The language specifies that a graph is only part of this language if it has a <strong>cycle on 40 vertices.</strong> (The cycle doesn't need to be induced.)</p>

<p>Now, I'm considering ... | algorithms graphs polynomial time search problem | 1 | Graph cycles on 40 vertices -- (algorithms graphs polynomial time search problem)
<p>I'm trying to create an algorithm in polynomial time, that detects wether or not a graph is in a language.</p>

<p>The language specifies that a graph is only part of this language if it has a <strong>cycle on 40 vertices.</str... | habedi/stack-exchange-dataset |
40,201 | $k$-gifts problem | <p>Consider the following problem:</p>

<blockquote>
 <p>Suppose you have $k$ nephews and $d$ dollars in your pocket all of which you need to spend. Given a set of $n$ toys with different prices, find whether there exists $k$ gifts with total cost exactly $d$.</p>
</blockquote>

<p>If $k=2$, is... | algorithms assignment problem | 1 | $k$-gifts problem -- (algorithms assignment problem)
<p>Consider the following problem:</p>

<blockquote>
 <p>Suppose you have $k$ nephews and $d$ dollars in your pocket all of which you need to spend. Given a set of $n$ toys with different prices, find whether there exists $k$ gifts with total cost exactl... | habedi/stack-exchange-dataset |
40,213 | Big O notation and functions | <p>$$
f_1(n) = n^2 
$$
$$
f_2(n) = n^2 + 1000n
$$</p>

<p>Are the following statements true or false?
$$
f_1(n) = O (f_2(n)),
$$
$$
f_2(n) = O (f_1(n)),
$$
Based on what I know about big O notation, I think the first statement is true and the second false, however... | asymptotics | 1 | Big O notation and functions -- (asymptotics)
<p>$$
f_1(n) = n^2 
$$
$$
f_2(n) = n^2 + 1000n
$$</p>

<p>Are the following statements true or false?
$$
f_1(n) = O (f_2(n)),
$$
$$
f_2(n) = O (f_1(n)),
$$
Based on what I know about big O notation, I think the first s... | habedi/stack-exchange-dataset |
40,216 | How do we derive the runtime cost of Karatsuba's algorithm? | <p>I've read the Wikipedia article explaining the complexity analysis of the Karatsuba algorithm, but I'm not fully grasping it. I seem to have gotten about 75% of the way to the solution on my own, but lack the last 25% to fully understand why the complexity is $O(N^{\log3})$ where the log function is base $2$.<... | algorithm analysis runtime analysis master theorem | 1 | How do we derive the runtime cost of Karatsuba's algorithm? -- (algorithm analysis runtime analysis master theorem)
<p>I've read the Wikipedia article explaining the complexity analysis of the Karatsuba algorithm, but I'm not fully grasping it. I seem to have gotten about 75% of the way to the solution on my own, but ... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.