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
54,963
Exclusive queue problem
<p>There is the exclusive queue problem in <a href="http://greenteapress.com/semaphores/downey08semaphores.pdf" rel="nofollow">The Little Book of Semaphores</a>, which is stated as follows:</p>&#xA;&#xA;<p>Imagine that threads represent ballroom dancers and that two kinds of dancers, leaders and followers, wait in two ...
concurrency synchronization
1
Exclusive queue problem -- (concurrency synchronization) <p>There is the exclusive queue problem in <a href="http://greenteapress.com/semaphores/downey08semaphores.pdf" rel="nofollow">The Little Book of Semaphores</a>, which is stated as follows:</p>&#xA;&#xA;<p>Imagine that threads represent ballroom dancers and that ...
habedi/stack-exchange-dataset
54,966
Dijkstra's algorithm on huge graphs
<p>I am very familiar with Dijkstra and I have a specific question about the algorithm. If I have a huge graph, for example 3.5 billion nodes (all OpenStreetMap data) then I clearly wouldn't be able to have the graph in memory, so the graph is stored on disk in a database.</p>&#xA;&#xA;<p>There are libraries available ...
algorithms graphs shortest path
1
Dijkstra's algorithm on huge graphs -- (algorithms graphs shortest path) <p>I am very familiar with Dijkstra and I have a specific question about the algorithm. If I have a huge graph, for example 3.5 billion nodes (all OpenStreetMap data) then I clearly wouldn't be able to have the graph in memory, so the graph is sto...
habedi/stack-exchange-dataset
54,974
First Harshad number with given sum
<p>How can we compute the least Harshad number with given sum of decimal digits $S$? Harshad number in base 10 is any number divisible by sum of its decimal digits.</p>&#xA;&#xA;<p>I think that some kind of dynamic programming should be used. But which one? </p>&#xA;&#xA;<p>Thanks in advance for any ideas.</p>&#xA;
dynamic programming number theory
1
First Harshad number with given sum -- (dynamic programming number theory) <p>How can we compute the least Harshad number with given sum of decimal digits $S$? Harshad number in base 10 is any number divisible by sum of its decimal digits.</p>&#xA;&#xA;<p>I think that some kind of dynamic programming should be used. B...
habedi/stack-exchange-dataset
54,985
How to detect intersecting segments based on length of the segments
<p>As part of a larger problem, I am trying to detect based on the distance matrix which segments intersect in the original 2D space that originated the matrix. I don´t have coordinates (lat/long, x/y or any other for the points).</p>&#xA;&#xA;<p>As an example, on the image below, the answer to the question for the top...
graphs computational geometry euclidean distance
1
How to detect intersecting segments based on length of the segments -- (graphs computational geometry euclidean distance) <p>As part of a larger problem, I am trying to detect based on the distance matrix which segments intersect in the original 2D space that originated the matrix. I don´t have coordinates (lat/long, x...
habedi/stack-exchange-dataset
54,990
Filling bins with pairs of balls
<p>A bin is called <em>full</em> if it contains at least $k$ balls. Our goal is to make as many bins as possible full. </p>&#xA;&#xA;<p>In the simplest scenario, we are given $n$ balls and may arrange them arbitrarily. In that case, obviously the best we can do is pick $\lfloor n/k \rfloor$ bins arbitrarily and put $k$...
combinatorics balls and bins
1
Filling bins with pairs of balls -- (combinatorics balls and bins) <p>A bin is called <em>full</em> if it contains at least $k$ balls. Our goal is to make as many bins as possible full. </p>&#xA;&#xA;<p>In the simplest scenario, we are given $n$ balls and may arrange them arbitrarily. In that case, obviously the best w...
habedi/stack-exchange-dataset
54,996
Boolean expression logic law confusion
<p>I've been trying to attempt a particular question that I need to translate truth table into boolean expression but I'm completely stuck on one point now.</p>&#xA;&#xA;<p>First, I worked it out by using Sums of product by getting X first. </p>&#xA;&#xA;<p>(I did this by taking the inputs with X = 1)</p>&#xA;&#xA;<p>A...
logic boolean algebra karnaugh map
1
Boolean expression logic law confusion -- (logic boolean algebra karnaugh map) <p>I've been trying to attempt a particular question that I need to translate truth table into boolean expression but I'm completely stuck on one point now.</p>&#xA;&#xA;<p>First, I worked it out by using Sums of product by getting X first. ...
habedi/stack-exchange-dataset
55,012
What is the fastest online sorting algorithm?
<p>Quoting <a href="https://en.wikipedia.org/wiki/Online_algorithm" rel="nofollow">Online algorithm</a> from Wikipedia:</p>&#xA;&#xA;<blockquote>&#xA; <p>In computer science, an online algorithm[1] is one that can process its input piece-by-piece in a serial fashion, i.e., in the order that the input is fed to the alg...
algorithms sorting online algorithms
1
What is the fastest online sorting algorithm? -- (algorithms sorting online algorithms) <p>Quoting <a href="https://en.wikipedia.org/wiki/Online_algorithm" rel="nofollow">Online algorithm</a> from Wikipedia:</p>&#xA;&#xA;<blockquote>&#xA; <p>In computer science, an online algorithm[1] is one that can process its input...
habedi/stack-exchange-dataset
55,013
What is the difference between formal language, regular language and regular expression?
<p>I want to know the difference between these three languages and it would be great if you would give some examples as well.</p>&#xA;
formal languages terminology regular languages
1
What is the difference between formal language, regular language and regular expression? -- (formal languages terminology regular languages) <p>I want to know the difference between these three languages and it would be great if you would give some examples as well.</p>&#xA;
habedi/stack-exchange-dataset
55,017
Question on the properties of red black trees
<p><strong>Problem statement</strong></p>&#xA;&#xA;<p>Let $T$ be a red black tree and $u$ some internal node of $T$. Suppose that in the left subtree of $u$ we have $n$ nodes. What is the maximum number of nodes that we can have in the right subtree of $u$, before the properties of the red black tree are broken?</p>&#x...
algorithms trees binary trees search trees balanced search trees
1
Question on the properties of red black trees -- (algorithms trees binary trees search trees balanced search trees) <p><strong>Problem statement</strong></p>&#xA;&#xA;<p>Let $T$ be a red black tree and $u$ some internal node of $T$. Suppose that in the left subtree of $u$ we have $n$ nodes. What is the maximum number o...
habedi/stack-exchange-dataset
55,019
Is the Nearest Neighbor Algorithm a valid algorithm to find a Minimum Spanning Tree?
<p>I just wrote a program that runs the Travelling Salesman Problem using the Nearest Neighbor Algorithm. Afterwards, I started looking into <a href="https://www.ics.uci.edu/~eppstein/161/960206.html" rel="nofollow noreferrer">Minimum Spanning Trees</a> (MST). </p>&#xA;&#xA;<p>From my understanding:</p>&#xA;&#xA;<p>The...
graphs graph traversal minimum spanning tree nearest neighbour
1
Is the Nearest Neighbor Algorithm a valid algorithm to find a Minimum Spanning Tree? -- (graphs graph traversal minimum spanning tree nearest neighbour) <p>I just wrote a program that runs the Travelling Salesman Problem using the Nearest Neighbor Algorithm. Afterwards, I started looking into <a href="https://www.ics.u...
habedi/stack-exchange-dataset
55,024
How to prove that the decidable languages are closed against iteration only by enumerators?
<p>We have the $L\in R$, how can we prove that $L^*\in R$ only by enumerators?</p>&#xA;&#xA;<p>I try to use induction, but as I understand I wrong...<br>&#xA;I'd like to get any help!</p>&#xA;
computability closure properties enumeration
1
How to prove that the decidable languages are closed against iteration only by enumerators? -- (computability closure properties enumeration) <p>We have the $L\in R$, how can we prove that $L^*\in R$ only by enumerators?</p>&#xA;&#xA;<p>I try to use induction, but as I understand I wrong...<br>&#xA;I'd like to get any ...
habedi/stack-exchange-dataset
55,025
half precision floating point multiplication
<p>A = 0 10011 0011110111</p>&#xA;&#xA;<p>B = 1 00011 0010011000</p>&#xA;&#xA;<p>exponent is 15, mantissa is 10 bits and first bit is implicit. Can somebody please tell me the final answer cause I am having trouble figuring out what is happening with exponent since there are 3 extra zeroes in front of mantissa ...
arithmetic floating point
1
half precision floating point multiplication -- (arithmetic floating point) <p>A = 0 10011 0011110111</p>&#xA;&#xA;<p>B = 1 00011 0010011000</p>&#xA;&#xA;<p>exponent is 15, mantissa is 10 bits and first bit is implicit. Can somebody please tell me the final answer cause I am having trouble figuring out what is ...
habedi/stack-exchange-dataset
55,026
Achieving better than the theoretical False Positive Rate for Bloom Filters
<p>I implemented a standard Bloom Filter in C++, and tested it on different sizes, with varying values of the ratio ${c = n/m}$ where ${n}$ is the size of the filter, and ${m}$ is the number of elements inserted. </p>&#xA;&#xA;<p>For a Bloom Filter, I created ${k}$ Hash functions, and set the value in the filter for ea...
algorithms data structures statistics bloom filters
1
Achieving better than the theoretical False Positive Rate for Bloom Filters -- (algorithms data structures statistics bloom filters) <p>I implemented a standard Bloom Filter in C++, and tested it on different sizes, with varying values of the ratio ${c = n/m}$ where ${n}$ is the size of the filter, and ${m}$ is the num...
habedi/stack-exchange-dataset
55,035
Is there an algorithm that will fill any shape with points a given distance away from each other?
<p>I would like to know if there is an algorithm that if I give a 2D polygon it will give me a set of 2D points. More specifically, those points should have M neighbors that are D apart. The shape is continually filled up with points until no new points can be found without exceeding the bounds of the polygon. The poly...
computational geometry
1
Is there an algorithm that will fill any shape with points a given distance away from each other? -- (computational geometry) <p>I would like to know if there is an algorithm that if I give a 2D polygon it will give me a set of 2D points. More specifically, those points should have M neighbors that are D apart. The sha...
habedi/stack-exchange-dataset
55,038
How to pick Hamming distance
<p>Wikipedia's article <a href="https://en.wikipedia.org/wiki/Cyclic_redundancy_check">Cyclic redundancy check</a> states that for the same n (bits) there are multiple CRCs possible with different polynomial. Then it lists this <a href="https://users.ece.cmu.edu/~koopman/crc/">Best CRC Polynomials</a> article that give...
coding theory error correcting codes hamming code
1
How to pick Hamming distance -- (coding theory error correcting codes hamming code) <p>Wikipedia's article <a href="https://en.wikipedia.org/wiki/Cyclic_redundancy_check">Cyclic redundancy check</a> states that for the same n (bits) there are multiple CRCs possible with different polynomial. Then it lists this <a href=...
habedi/stack-exchange-dataset
55,039
3SUM problem solution on the basis of cubic function and a line?
<p>The <a href="http://en.wikipedia.org/wiki/3SUM" rel="nofollow">3SUM</a> problem formulation: in a given set of <strong>n</strong> real numbers find <strong>3</strong> elements that sum to specified value <strong>S</strong>.</p>&#xA;&#xA;<p>I am trying to understand mathematical solution of the 3SUM problem based on ...
algorithms algorithm analysis combinatorics search algorithms
1
3SUM problem solution on the basis of cubic function and a line? -- (algorithms algorithm analysis combinatorics search algorithms) <p>The <a href="http://en.wikipedia.org/wiki/3SUM" rel="nofollow">3SUM</a> problem formulation: in a given set of <strong>n</strong> real numbers find <strong>3</strong> elements that sum ...
habedi/stack-exchange-dataset
55,076
What is the resulting set for {0,1}*\{0}*?
<p>If we have a language $L = \{0\}^*$ over the alphabet $\Sigma=\{0,1\}$, what is $\Sigma^*\backslash L$?</p>&#xA;&#xA;<p>That's what I think: </p>&#xA;&#xA;<p>$\{0,1\}^* = \{\epsilon, 0, 1, 00, 01, 10, 11, 000, 001, ... \}$<br>&#xA;$\{0\}^* = \{\epsilon, 0, 00, 000, 0000, ... \}$<br>&#xA;$\{0,1\}^*\backslash \{0\}^*=...
formal languages
1
What is the resulting set for {0,1}*\{0}*? -- (formal languages) <p>If we have a language $L = \{0\}^*$ over the alphabet $\Sigma=\{0,1\}$, what is $\Sigma^*\backslash L$?</p>&#xA;&#xA;<p>That's what I think: </p>&#xA;&#xA;<p>$\{0,1\}^* = \{\epsilon, 0, 1, 00, 01, 10, 11, 000, 001, ... \}$<br>&#xA;$\{0\}^* = \{\epsilon...
habedi/stack-exchange-dataset
55,081
Is it possible to build a heap from the root to the leaves?
<p>Most books on data-structures will briefly introduce heaps (aka priority queues) and then move to describe the &quot;trick&quot; allowing heaps to be implemented as arrays.</p>&#xA;<p>I've been looking for a way to implement a heap as an actual tree (call it pointers to structs, cons cells etc.) This would also imp...
data structures heaps persistent data structure
1
Is it possible to build a heap from the root to the leaves? -- (data structures heaps persistent data structure) <p>Most books on data-structures will briefly introduce heaps (aka priority queues) and then move to describe the &quot;trick&quot; allowing heaps to be implemented as arrays.</p>&#xA;<p>I've been looking fo...
habedi/stack-exchange-dataset
55,085
Heap comparison based sorting question
<p>I need some help with this question from my problem set. I do not want a solution but some $\textbf{hints}$ on how to proceed.</p>&#xA;&#xA;<blockquote>&#xA; <p>Given $n$ records in a file that are so numerous, that just storing&#xA; the $n$ keys alone would require more RAM than is available on your&#xA; compute...
data structures
1
Heap comparison based sorting question -- (data structures) <p>I need some help with this question from my problem set. I do not want a solution but some $\textbf{hints}$ on how to proceed.</p>&#xA;&#xA;<blockquote>&#xA; <p>Given $n$ records in a file that are so numerous, that just storing&#xA; the $n$ keys alone wo...
habedi/stack-exchange-dataset
55,087
Merkle tree collision probability
<p>Say I use a perfect 128-bit hash function to construct a merkle tree.&#xA;By perfect I mean that any of the values in the $0$&ndash;$2^{128}$ range has an equal probability to be an outcome of the function, over a large enough domain of hashed entities.</p>&#xA;&#xA;<p>Does the root have a higher collision probabili...
hashing
1
Merkle tree collision probability -- (hashing) <p>Say I use a perfect 128-bit hash function to construct a merkle tree.&#xA;By perfect I mean that any of the values in the $0$&ndash;$2^{128}$ range has an equal probability to be an outcome of the function, over a large enough domain of hashed entities.</p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
55,093
What is the difference between F+ (closure of F) and F* (cover of F) for Functional Dependencies?
<p>F+ and F* is defined as follows:</p>&#xA;&#xA;<ul>&#xA;<li><p><strong>F+: closure of F</strong></p>&#xA;&#xA;<ul>&#xA;<li>F+ = {fd | F |= fd} </li>&#xA;<li>Set of all FDs deduced from inference rule (normally: Armstrong axioms)</li>&#xA;</ul></li>&#xA;<li><p><strong>F: cover of F</strong> </p>&#xA;&#xA;<ul>&#xA;<li>...
database theory databases
1
What is the difference between F+ (closure of F) and F* (cover of F) for Functional Dependencies? -- (database theory databases) <p>F+ and F* is defined as follows:</p>&#xA;&#xA;<ul>&#xA;<li><p><strong>F+: closure of F</strong></p>&#xA;&#xA;<ul>&#xA;<li>F+ = {fd | F |= fd} </li>&#xA;<li>Set of all FDs deduced from infe...
habedi/stack-exchange-dataset
55,098
Is there a canonical form that uses AND and XOR?
<p>Is there something like the sum of products form of a circuit which uses AND and XOR instead of AND and OR?</p>&#xA;&#xA;<p>I know that you can create an OR gate from AND and XOR (but i can't remember or find the details of that at the moment), but am wondering if there is anything more straightforward, as in an act...
circuits digital circuits
1
Is there a canonical form that uses AND and XOR? -- (circuits digital circuits) <p>Is there something like the sum of products form of a circuit which uses AND and XOR instead of AND and OR?</p>&#xA;&#xA;<p>I know that you can create an OR gate from AND and XOR (but i can't remember or find the details of that at the m...
habedi/stack-exchange-dataset
55,099
What is the chance that this code terminates?
<p>I wrote this Python code, and wondered if it sometimes <em>simply doesn't</em> terminate (assuming we had infinite memory/time and no recursion depth limit).</p>&#xA;&#xA;<p>Intuitively you'd think it terminates, since at some point you must get <em>lucky</em>, and if it doesn't terminate you have an infinite amount...
trees probability theory termination
1
What is the chance that this code terminates? -- (trees probability theory termination) <p>I wrote this Python code, and wondered if it sometimes <em>simply doesn't</em> terminate (assuming we had infinite memory/time and no recursion depth limit).</p>&#xA;&#xA;<p>Intuitively you'd think it terminates, since at some po...
habedi/stack-exchange-dataset
55,105
Typical NP-complete/hard problems in machine learning
<p>I know little about machine Learning, but I work on optimization (solving NP-hard problems with SAT solvers or MIP). Examples of this would be solving TSP, Steiner tree problems, path finding with constraints, etc.</p>&#xA;&#xA;<p>I was wondering, is there any problem in ML that is NP-hard for which there are only a...
optimization np complete machine learning np hard
1
Typical NP-complete/hard problems in machine learning -- (optimization np complete machine learning np hard) <p>I know little about machine Learning, but I work on optimization (solving NP-hard problems with SAT solvers or MIP). Examples of this would be solving TSP, Steiner tree problems, path finding with constraints...
habedi/stack-exchange-dataset
55,115
Is the unweighted vertex cover problem equivalent to its weighted version?
<p>Consider the unweighted and weighted versions of the vertex cover problem (UVC and WVC for short, respectively). As UVC is a special case of WVC, is it true that $$\text{UVC} \leq_\mathrm{m} \text{WVC}$$ but $$\text{UVC} \not \equiv_\mathrm{m} \text{WVC} \enspace ?$$</p>&#xA;&#xA;<p>I think the first part is easy to...
algorithms complexity theory graphs np complete reductions
1
Is the unweighted vertex cover problem equivalent to its weighted version? -- (algorithms complexity theory graphs np complete reductions) <p>Consider the unweighted and weighted versions of the vertex cover problem (UVC and WVC for short, respectively). As UVC is a special case of WVC, is it true that $$\text{UVC} \le...
habedi/stack-exchange-dataset
55,141
Can we make a non-regular language regular via concatentation?
<p>My question is basically given three languages A, B and L, where L is A and B concatenated together and B is proven to be non regular, is it possible to find an A that makes L regular?</p>&#xA;
formal languages regular languages
1
Can we make a non-regular language regular via concatentation? -- (formal languages regular languages) <p>My question is basically given three languages A, B and L, where L is A and B concatenated together and B is proven to be non regular, is it possible to find an A that makes L regular?</p>&#xA;
habedi/stack-exchange-dataset
55,144
Variation of MAX 3-SAT
<p>Suppose we are given a 3CNF, and we want to know whether k clauses from this 3CNF can be satisfied (k being any natural number)?</p>&#xA;&#xA;<p>I'm trying to think of an efficient algorithm to solve this problem. This is sort of a variation of the MAX 3-SAT, but with a fixed k. If we have m clauses, checking naivel...
complexity theory satisfiability 3 sat
1
Variation of MAX 3-SAT -- (complexity theory satisfiability 3 sat) <p>Suppose we are given a 3CNF, and we want to know whether k clauses from this 3CNF can be satisfied (k being any natural number)?</p>&#xA;&#xA;<p>I'm trying to think of an efficient algorithm to solve this problem. This is sort of a variation of the M...
habedi/stack-exchange-dataset
55,150
Characterizing a CFG equivalent to a special type of PDA
<p>Consider a nondeterministic PDA $P$ which pushes/pops at most one stack symbol on a transition. Suppose that for every string $\sigma \in L(P)$, there is an accept computation of $\sigma$ in $P$ which starts with an empty stack and ends with an empty stack and which has the additional property that during this compu...
context free pushdown automata
1
Characterizing a CFG equivalent to a special type of PDA -- (context free pushdown automata) <p>Consider a nondeterministic PDA $P$ which pushes/pops at most one stack symbol on a transition. Suppose that for every string $\sigma \in L(P)$, there is an accept computation of $\sigma$ in $P$ which starts with an empty st...
habedi/stack-exchange-dataset
55,153
I want to pursue a career in computer programming. Where do I start?
<p>I am currently finishing up my junior year as a Biochemistry major at a 4-year university. In a year, I will graduate with a B.S. in Biochemistry and way more credit hours than anyone should ever have due to AP classes in high school. To make a long story short, I want to pursue computer programming once I graduate ...
programming languages
1
I want to pursue a career in computer programming. Where do I start? -- (programming languages) <p>I am currently finishing up my junior year as a Biochemistry major at a 4-year university. In a year, I will graduate with a B.S. in Biochemistry and way more credit hours than anyone should ever have due to AP classes in...
habedi/stack-exchange-dataset
55,159
How do you call this typical file name order?
<pre><code>log1.gz&#xA;log10.gz&#xA;log100.gz&#xA;log101.gz&#xA;log102.gz&#xA;log103.gz&#xA;</code></pre>&#xA;
terminology sorting strings
1
How do you call this typical file name order? -- (terminology sorting strings) <pre><code>log1.gz&#xA;log10.gz&#xA;log100.gz&#xA;log101.gz&#xA;log102.gz&#xA;log103.gz&#xA;</code></pre>&#xA;
habedi/stack-exchange-dataset
55,165
Why do we pop the dollar symbol when it's already present in the stack in PDA?
<p>Could anyone tell the reason for popping the top of stack(dollar symbol) as said in this <a href="https://onedrive.live.com/redir?resid=66031715C5F84356!660&amp;authkey=!AOq3YLlkKKfswak&amp;ithint=file%2cpdf" rel="nofollow">lecture</a>(p.54) when there's already dollar symbol in the stack.</p>&#xA;&#xA;<p>I would li...
automata pushdown automata
1
Why do we pop the dollar symbol when it's already present in the stack in PDA? -- (automata pushdown automata) <p>Could anyone tell the reason for popping the top of stack(dollar symbol) as said in this <a href="https://onedrive.live.com/redir?resid=66031715C5F84356!660&amp;authkey=!AOq3YLlkKKfswak&amp;ithint=file%2cpd...
habedi/stack-exchange-dataset
55,170
Why there is no constraint on "Prover" in definition of $IP$?
<p>According to the definition of <a href="https://en.wikipedia.org/wiki/IP_%28complexity%29" rel="nofollow">$IP$</a> given in Sanjeev Arora and Barak there is no constraint on the running time of the "Prover" ( when "verifier" sends a message to the "Prover" and expects a message in return from it ). Why is it so ?&#...
complexity theory interactive proof systems
1
Why there is no constraint on "Prover" in definition of $IP$? -- (complexity theory interactive proof systems) <p>According to the definition of <a href="https://en.wikipedia.org/wiki/IP_%28complexity%29" rel="nofollow">$IP$</a> given in Sanjeev Arora and Barak there is no constraint on the running time of the "Prover"...
habedi/stack-exchange-dataset
55,176
Is it decidable whether a linear language contains a square?
<p>A square is a word of the form $ww$. A linear grammar is a CFG that has productions of the form $A\to uBv$ or $A\to u$ (with lower case symbols corresponding to terminal strings).</p>&#xA;&#xA;<p><strong>Question:</strong> Is it decidable whether a linear grammar generates a square?</p>&#xA;&#xA;<p>What did I do? I ...
formal languages computability context free formal grammars undecidability
1
Is it decidable whether a linear language contains a square? -- (formal languages computability context free formal grammars undecidability) <p>A square is a word of the form $ww$. A linear grammar is a CFG that has productions of the form $A\to uBv$ or $A\to u$ (with lower case symbols corresponding to terminal string...
habedi/stack-exchange-dataset
55,182
Equivalent formulae with different CNF
<p>I was not able to find or come up with two formulae which are equivalent but have different CNF. All my ideas reduce to the same formula after applying transformations. The requirements are the following:</p>&#xA;&#xA;<p>Give an example which shows that proving equivalence of two formulas by bringing them into conju...
logic first order logic propositional logic
1
Equivalent formulae with different CNF -- (logic first order logic propositional logic) <p>I was not able to find or come up with two formulae which are equivalent but have different CNF. All my ideas reduce to the same formula after applying transformations. The requirements are the following:</p>&#xA;&#xA;<p>Give an ...
habedi/stack-exchange-dataset
55,185
Coercing a list of nodes into the most probable tree
<p>Suppose that we have an RTF document which contains sections and sub-sections. The sections and subsections all have headings that are visually marked up (e.g., bold and italic), but the document structure is not made explicit (i.e., we have a linear flow of text). From the section headings, we wish to automatically...
algorithms graphs optimization trees
1
Coercing a list of nodes into the most probable tree -- (algorithms graphs optimization trees) <p>Suppose that we have an RTF document which contains sections and sub-sections. The sections and subsections all have headings that are visually marked up (e.g., bold and italic), but the document structure is not made expl...
habedi/stack-exchange-dataset
55,197
How to read 'max min' and 'min max'?
<p>Here is an exercise I came across while studying MaxFlow / MinCut and I'm rather stumped:</p>&#xA;<blockquote>&#xA;<p>Designate <span class="math-container">$G = (V, E)$</span> as an undirected graph that has at least two vertices. Every edge <span class="math-container">$(e)$</span> on this graph has capacity <span...
notation mathematical foundations
1
How to read 'max min' and 'min max'? -- (notation mathematical foundations) <p>Here is an exercise I came across while studying MaxFlow / MinCut and I'm rather stumped:</p>&#xA;<blockquote>&#xA;<p>Designate <span class="math-container">$G = (V, E)$</span> as an undirected graph that has at least two vertices. Every edg...
habedi/stack-exchange-dataset
55,199
Is it correct to say that an algorithm ALG is an O(1)-approximation algorithm?
<p>I read it in not only one place. People write theorems of the form:</p>&#xA;&#xA;<blockquote>&#xA; <p><em>Theorem:</em> ALG is an O(1)-approximation algorithm</p>&#xA;</blockquote>&#xA;&#xA;<p>It means that ALG is a constant factor approximation algorithm but is it safe to say that? I mean it misleads. Why am I ask...
approximation
1
Is it correct to say that an algorithm ALG is an O(1)-approximation algorithm? -- (approximation) <p>I read it in not only one place. People write theorems of the form:</p>&#xA;&#xA;<blockquote>&#xA; <p><em>Theorem:</em> ALG is an O(1)-approximation algorithm</p>&#xA;</blockquote>&#xA;&#xA;<p>It means that ALG is a co...
habedi/stack-exchange-dataset
55,206
Difference between Binomial and Fibonacci heap (marking)
<p>I am confused why Binomial heaps do not utilize marking. </p>&#xA;&#xA;<p><a href="https://stackoverflow.com/questions/12864914/what-is-the-purpose-behind-marking-some-of-the-nodes-in-fibonacci-heap">Concerning Fibonacci heap children</a>:</p>&#xA;&#xA;<pre><code>Each tree in a Fibonacci heap is allowed to lose at m...
algorithms sorting heaps
1
Difference between Binomial and Fibonacci heap (marking) -- (algorithms sorting heaps) <p>I am confused why Binomial heaps do not utilize marking. </p>&#xA;&#xA;<p><a href="https://stackoverflow.com/questions/12864914/what-is-the-purpose-behind-marking-some-of-the-nodes-in-fibonacci-heap">Concerning Fibonacci heap chil...
habedi/stack-exchange-dataset
55,213
Decomposing the n-cube into vertex-disjoint paths
<p>I am not sure if this question is better suited for cs.stackexchange or math.stackexchange - This is of interested to me in the context of a data structure problem, but the question itself may be better suited elsewhere. If so, please feel free to move my question.</p>&#xA;&#xA;<p>Let $\mathcal{Q}_n$ denote the $n$-...
algorithms graphs
1
Decomposing the n-cube into vertex-disjoint paths -- (algorithms graphs) <p>I am not sure if this question is better suited for cs.stackexchange or math.stackexchange - This is of interested to me in the context of a data structure problem, but the question itself may be better suited elsewhere. If so, please feel free...
habedi/stack-exchange-dataset
55,222
High Dimensional Spaces for Images
<p>Can anyone explain why pictures are not considered 2D, but rather high dimensional? Especially with regards to CV and AI.</p>&#xA;
image processing
1
High Dimensional Spaces for Images -- (image processing) <p>Can anyone explain why pictures are not considered 2D, but rather high dimensional? Especially with regards to CV and AI.</p>&#xA;
habedi/stack-exchange-dataset
55,226
Is it true that P is not equal to deterministic linear space complexity class?
<p>I'm curious, how could I know that P (polynomial time complexity class) is not equal to deterministic linear space complexity class?</p>&#xA;&#xA;<p>Is there some proof? Or should I find some algorithm which is not in P but it is in polynomial time complexity class or opposite way? </p>&#xA;&#xA;<p>Do you know about...
complexity theory time complexity space complexity polynomial time
1
Is it true that P is not equal to deterministic linear space complexity class? -- (complexity theory time complexity space complexity polynomial time) <p>I'm curious, how could I know that P (polynomial time complexity class) is not equal to deterministic linear space complexity class?</p>&#xA;&#xA;<p>Is there some pro...
habedi/stack-exchange-dataset
55,227
Variable rule in dependent type theory
<p>This is the = Type variable rule that I'm seeing through out the my course and unable to grasp it completely. </p>&#xA;&#xA;<p>$$\dfrac{\phi \vdash \Gamma[\mathrm{ctx}] \qquad \Gamma(x) = \tau}&#xA; {\phi; \Gamma \vdash x : \tau}&#xA; \textsf{(ty-var)}$$ </p>&#xA;&#xA;<p>The first thing in antecedent l...
type theory dependent types
1
Variable rule in dependent type theory -- (type theory dependent types) <p>This is the = Type variable rule that I'm seeing through out the my course and unable to grasp it completely. </p>&#xA;&#xA;<p>$$\dfrac{\phi \vdash \Gamma[\mathrm{ctx}] \qquad \Gamma(x) = \tau}&#xA; {\phi; \Gamma \vdash x : \tau}&#xA; ...
habedi/stack-exchange-dataset
55,231
Why is `map insertionsort` not to equal to`map mergesort`?
<p>In the <a href="http://typetheorypodcast.com/2015/01/episode-3-dan-licata-on-homotopy-type-theory/" rel="nofollow">type theory podcast ep. 3</a>, Dan Licata claims that the fact that for every input, insertionsort and mergesort give the same result does not imply that the result would be equal when used as higher or...
type theory functional programming equality homotopy type theory
1
Why is `map insertionsort` not to equal to`map mergesort`? -- (type theory functional programming equality homotopy type theory) <p>In the <a href="http://typetheorypodcast.com/2015/01/episode-3-dan-licata-on-homotopy-type-theory/" rel="nofollow">type theory podcast ep. 3</a>, Dan Licata claims that the fact that for e...
habedi/stack-exchange-dataset
55,237
Is this a well-known NP-hard problem?
<p>Let $R = \{1, \ldots, n\}$ and $S = \{S_1, \ldots, S_m\}$ a collection of subsets of $R$ such that $R = \bigcup_{i = 1}^m S_i$ and, for $n &gt; 3$, $$3 \leq \vert S_i \vert \leq 4 \, , \enspace i \in \{1, \ldots, m\} \, .$$</p>&#xA;&#xA;<p>Then, I want to know the subset—or subsets, since there may be more than one ...
algorithms complexity theory optimization np complete reductions
1
Is this a well-known NP-hard problem? -- (algorithms complexity theory optimization np complete reductions) <p>Let $R = \{1, \ldots, n\}$ and $S = \{S_1, \ldots, S_m\}$ a collection of subsets of $R$ such that $R = \bigcup_{i = 1}^m S_i$ and, for $n &gt; 3$, $$3 \leq \vert S_i \vert \leq 4 \, , \enspace i \in \{1, \ldo...
habedi/stack-exchange-dataset
55,245
Explanation of a simple algorithm's Big O complexity
<p>I'm looking at a past paper, where there is the following Algorithm, and we are asked to give the runtime in O notation:</p>&#xA;&#xA;<pre><code>Loop2(n)&#xA; for i := 0 to n&#xA; j := 0&#xA; s := 0&#xA; while s &lt;= i&#xA; j := j + 1&#xA; s := s + j&#xA;</code></pre>&#...
algorithm analysis runtime analysis loops
1
Explanation of a simple algorithm's Big O complexity -- (algorithm analysis runtime analysis loops) <p>I'm looking at a past paper, where there is the following Algorithm, and we are asked to give the runtime in O notation:</p>&#xA;&#xA;<pre><code>Loop2(n)&#xA; for i := 0 to n&#xA; j := 0&#xA; s := 0&#...
habedi/stack-exchange-dataset
55,274
Question about simple perceptron code
<p>I'm reading through Sebastian Raschka's Python Machine Learning, and I see something confusing that is not explained in the text.</p>&#xA;<p>In the code on this page:&#xA;<a href="https://github.com/rasbt/python-machine-learning-book/blob/master/code/ch02/ch02.ipynb" rel="nofollow noreferrer">https://github.com/rasb...
machine learning perceptron
1
Question about simple perceptron code -- (machine learning perceptron) <p>I'm reading through Sebastian Raschka's Python Machine Learning, and I see something confusing that is not explained in the text.</p>&#xA;<p>In the code on this page:&#xA;<a href="https://github.com/rasbt/python-machine-learning-book/blob/master/...
habedi/stack-exchange-dataset
55,293
Why did RSA encryption become popular for key exchange?
<p>This is a soft question. I don't know a lot about cryptography or its history, but it seems like a common use for RSA is to do key exchange by encrypting a symmetric key to send a longer message (e.g., the description of iMessage <a href="http://blog.cryptographyengineering.com/2016/03/attack-of-week-apple-imessage...
cryptography history
1
Why did RSA encryption become popular for key exchange? -- (cryptography history) <p>This is a soft question. I don't know a lot about cryptography or its history, but it seems like a common use for RSA is to do key exchange by encrypting a symmetric key to send a longer message (e.g., the description of iMessage <a h...
habedi/stack-exchange-dataset
55,295
Computing the hit and miss ratio of a cache organized as either direct mapped or two-way associative
<p>This is an example problem in a computer organization and architecture course that's giving me some trouble. It goes as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider a cache of 4 lines of 16 bytes each. Main memory is divided&#xA; into blocks of 16 bytes each. That is, block 0 has bytes with&#xA; addresses ...
computer architecture cpu cache
1
Computing the hit and miss ratio of a cache organized as either direct mapped or two-way associative -- (computer architecture cpu cache) <p>This is an example problem in a computer organization and architecture course that's giving me some trouble. It goes as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider a cach...
habedi/stack-exchange-dataset
55,297
Closure properties of the class of inherently ambiguous CFLs
<p>is set of inherently ambiguous context free languages close under operations such that union, intersection, kleene star, concatenation, reverse, complementation and etc. how many of theme are answered? </p>&#xA;
formal languages context free closure properties
1
Closure properties of the class of inherently ambiguous CFLs -- (formal languages context free closure properties) <p>is set of inherently ambiguous context free languages close under operations such that union, intersection, kleene star, concatenation, reverse, complementation and etc. how many of theme are answered? ...
habedi/stack-exchange-dataset
55,305
How to use Type application Rule to get a desired type
<p>In type application Rule :</p>&#xA;&#xA;<p>$$\dfrac{ \Gamma \vdash t_1 : T_{11} \to T_{12} \qquad \Gamma \vdash t_2 : T_{11}}&#xA; { \Gamma \vdash t_1 \ t_2 : T_{12} }&#xA; \textsf{ (T-App)}$$ </p>&#xA;&#xA;<p>if we deriving the term from bottom up, how to get $T_{11}$ from ? How you'll know what is ...
type theory
1
How to use Type application Rule to get a desired type -- (type theory) <p>In type application Rule :</p>&#xA;&#xA;<p>$$\dfrac{ \Gamma \vdash t_1 : T_{11} \to T_{12} \qquad \Gamma \vdash t_2 : T_{11}}&#xA; { \Gamma \vdash t_1 \ t_2 : T_{12} }&#xA; \textsf{ (T-App)}$$ </p>&#xA;&#xA;<p>if we deriving the ...
habedi/stack-exchange-dataset
55,323
How to design a top-1 select algorithm to maximize a variable and minimize other variable?
<p>I want to implement an algorithm thats select the best group, which maximize the variable A and minimize the variable B.</p>&#xA;&#xA;<p>For instance, I have the following groups:</p>&#xA;&#xA;<p>G1 - A = 10 B = 2</p>&#xA;&#xA;<p>G2 - A = 10 B = 3</p>&#xA;&#xA;<p>G3 - A = 12 B = 1</p>&#xA;&#xA;<p>G4 - A = 10 B = 4</...
sorting selection problem
1
How to design a top-1 select algorithm to maximize a variable and minimize other variable? -- (sorting selection problem) <p>I want to implement an algorithm thats select the best group, which maximize the variable A and minimize the variable B.</p>&#xA;&#xA;<p>For instance, I have the following groups:</p>&#xA;&#xA;<p...
habedi/stack-exchange-dataset
55,325
Trying to understand this Dynamic Programming solution
<p>The problem is as follows.</p>&#xA;&#xA;<p>Minimize the sum of absolute differences between a matching of $n$ values from two sets, $A=\{a_1,a_2,\cdots, a_n\}$ and the set $B=\{b_1, b_2,\cdots, b_m \}$, with $n\leq m$. </p>&#xA;&#xA;<p>So, we can use two list of indexes $\ I$, $J$, such that $I\subseteq [n]$, $J\su...
algorithms dynamic programming recursion
1
Trying to understand this Dynamic Programming solution -- (algorithms dynamic programming recursion) <p>The problem is as follows.</p>&#xA;&#xA;<p>Minimize the sum of absolute differences between a matching of $n$ values from two sets, $A=\{a_1,a_2,\cdots, a_n\}$ and the set $B=\{b_1, b_2,\cdots, b_m \}$, with $n\leq m...
habedi/stack-exchange-dataset
55,328
Search Heuristics Where the Search Space Has No Gradient
<p>If I'm not mistaken, search heuristics rely on problems where the best answer is very close to pretty-good answers. For example, the traveling salesman problem. If there is a route which is the optimal except for a small anomaly somewhere, where the route isn't <em>quite</em> optimal, the algorithms still says that'...
algorithms search algorithms heuristics
1
Search Heuristics Where the Search Space Has No Gradient -- (algorithms search algorithms heuristics) <p>If I'm not mistaken, search heuristics rely on problems where the best answer is very close to pretty-good answers. For example, the traveling salesman problem. If there is a route which is the optimal except for a ...
habedi/stack-exchange-dataset
55,334
Which is more fundamental: key-value or subject-predicate-object?
<p>There seems to be two approaches to store data in <a href="https://en.wikipedia.org/wiki/NoSQL" rel="nofollow">NoSQL databases</a>:</p>&#xA;&#xA;<p><strong>Key-Value</strong> - The <code>Key</code> is usually stored in a hash-table referencing a <code>Value</code>, or <code>Object</code>, which can be either a key (...
graphs data structures database theory
1
Which is more fundamental: key-value or subject-predicate-object? -- (graphs data structures database theory) <p>There seems to be two approaches to store data in <a href="https://en.wikipedia.org/wiki/NoSQL" rel="nofollow">NoSQL databases</a>:</p>&#xA;&#xA;<p><strong>Key-Value</strong> - The <code>Key</code> is usuall...
habedi/stack-exchange-dataset
55,337
Property of cyclic codes
<p>Let $C$ be a $[n,k]$ cyclic code over $\mathbb{F}_q$ with $(n,q)=1$.</p>&#xA;&#xA;<p>I want to show that $(1, \dots, 1)$ is a codeword iff $X-1 \nmid g(X)$.</p>&#xA;&#xA;<p>$g(x)$ is the generator polynomial.</p>&#xA;&#xA;<p>We suppose that $(1, \dots, 1)$ is a codeword. </p>&#xA;&#xA;<p>We consider the following co...
coding theory
1
Property of cyclic codes -- (coding theory) <p>Let $C$ be a $[n,k]$ cyclic code over $\mathbb{F}_q$ with $(n,q)=1$.</p>&#xA;&#xA;<p>I want to show that $(1, \dots, 1)$ is a codeword iff $X-1 \nmid g(X)$.</p>&#xA;&#xA;<p>$g(x)$ is the generator polynomial.</p>&#xA;&#xA;<p>We suppose that $(1, \dots, 1)$ is a codeword. <...
habedi/stack-exchange-dataset
55,338
Does MiniSAT need exponential time?
<p>I'm asking for a sequence of instances for SAT, one instance for each length, such that the sequence takes exponential time with MiniSAT.</p>&#xA;
satisfiability sat solvers
1
Does MiniSAT need exponential time? -- (satisfiability sat solvers) <p>I'm asking for a sequence of instances for SAT, one instance for each length, such that the sequence takes exponential time with MiniSAT.</p>&#xA;
habedi/stack-exchange-dataset
55,342
How to generate a degree sequence of a degree distribution
<p>How to generate a degree sequence of a degree distribution that follows the power-law in which I know $N=10^2$ and $\gamma=2.5$?</p>&#xA;&#xA;<p>The degree distribution of power-law is $p_k \sim k^{-\gamma}$.</p>&#xA;&#xA;<p>I want to generate a power-law network using the <strong>configuration model</strong>, but t...
graphs
1
How to generate a degree sequence of a degree distribution -- (graphs) <p>How to generate a degree sequence of a degree distribution that follows the power-law in which I know $N=10^2$ and $\gamma=2.5$?</p>&#xA;&#xA;<p>The degree distribution of power-law is $p_k \sim k^{-\gamma}$.</p>&#xA;&#xA;<p>I want to generate a ...
habedi/stack-exchange-dataset
55,346
Uses of the type Unit
<p>The <code>Unit</code> type is a singleton type containing the constant <code>unit</code>. In functional languages with side effects, <code>unit</code> is used in functions that perform side effects. For example <code>print</code> is a function from <code>string</code> to <code>Unit</code>.</p>&#xA;&#xA;<p><code>Unit...
lambda calculus curry howard
1
Uses of the type Unit -- (lambda calculus curry howard) <p>The <code>Unit</code> type is a singleton type containing the constant <code>unit</code>. In functional languages with side effects, <code>unit</code> is used in functions that perform side effects. For example <code>print</code> is a function from <code>string...
habedi/stack-exchange-dataset
55,353
Correcting two-bit error using a CRC
<p>What algorithm can be used to correct a two-bit error in a message protected by a 32-bit CRC, assuming the CRC polynomial allows that? I'm seeking something for 480-bit payload, able to detect uncorrectable errors, fast in the worst case, and compact.</p>&#xA;&#xA;<p>Because I have hardware support for that, I'm mos...
error correcting codes crc
1
Correcting two-bit error using a CRC -- (error correcting codes crc) <p>What algorithm can be used to correct a two-bit error in a message protected by a 32-bit CRC, assuming the CRC polynomial allows that? I'm seeking something for 480-bit payload, able to detect uncorrectable errors, fast in the worst case, and compa...
habedi/stack-exchange-dataset
55,357
How does equality works for qubit-vectors?
<p>A bitvector of length <code>N</code> has <code>2^N</code> different values. How many different values has a quantum bit vector of length <code>N</code>? Is it possible to test two quantum bit vectors for equality?</p>&#xA;
quantum computing
1
How does equality works for qubit-vectors? -- (quantum computing) <p>A bitvector of length <code>N</code> has <code>2^N</code> different values. How many different values has a quantum bit vector of length <code>N</code>? Is it possible to test two quantum bit vectors for equality?</p>&#xA;
habedi/stack-exchange-dataset
55,364
How a file is determined
<p>If I have the integer ""1234" stored in a file, the size of the file when I use the command "ls -l" or "wc -c" is 5. If I have "12345" the size of the file is 6. Basically the number of bytes in a file = (number of individual digits) + 1. Now, I am assuming the "+1" comes from the space it takes to create the name o...
filesystems
1
How a file is determined -- (filesystems) <p>If I have the integer ""1234" stored in a file, the size of the file when I use the command "ls -l" or "wc -c" is 5. If I have "12345" the size of the file is 6. Basically the number of bytes in a file = (number of individual digits) + 1. Now, I am assuming the "+1" comes fr...
habedi/stack-exchange-dataset
55,370
How to find left-hand side of tape on a Turing Machine?
<p>I am pretty new to Turing Machines and am trying to figure something out. So let's say I have a tape with input </p>&#xA;&#xA;<pre><code>0 0 1 0 0 1&#xA;</code></pre>&#xA;&#xA;<p>The language is twice as many 0's than 1's. So first time through, I will mark an X on the first 1 I find. Then when I am heading back to ...
turing machines
1
How to find left-hand side of tape on a Turing Machine? -- (turing machines) <p>I am pretty new to Turing Machines and am trying to figure something out. So let's say I have a tape with input </p>&#xA;&#xA;<pre><code>0 0 1 0 0 1&#xA;</code></pre>&#xA;&#xA;<p>The language is twice as many 0's than 1's. So first time thr...
habedi/stack-exchange-dataset
55,382
Are there adversarial inputs for randomized quicksort?
<p>Someone recently claimed that there's an adversarial input for <em>randomized</em> quicksort; he referenced <a href="http://www.cs.dartmouth.edu/~doug/mdmspe.pdf" rel="nofollow">this paper</a>. This defies my intuition because there are results that say that randomized quicksort runs in $O(n \log n)$ time with high ...
algorithms algorithm analysis runtime analysis sorting randomized algorithms
1
Are there adversarial inputs for randomized quicksort? -- (algorithms algorithm analysis runtime analysis sorting randomized algorithms) <p>Someone recently claimed that there's an adversarial input for <em>randomized</em> quicksort; he referenced <a href="http://www.cs.dartmouth.edu/~doug/mdmspe.pdf" rel="nofollow">th...
habedi/stack-exchange-dataset
55,394
EXP-complete example
<p>Is there an explicit example of a language which is EXP-complete? Or a weaker question, i.e., is there an explicit example of a language which is proven to be in EXP but not in P? By diagonalization theorem, we know the existence of such a language but is there a construction or explicit example known till date?</p>...
complexity theory
1
EXP-complete example -- (complexity theory) <p>Is there an explicit example of a language which is EXP-complete? Or a weaker question, i.e., is there an explicit example of a language which is proven to be in EXP but not in P? By diagonalization theorem, we know the existence of such a language but is there a construct...
habedi/stack-exchange-dataset
55,401
An algorithm to check if all intervals are disjoint
<blockquote>&#xA; <p>There are $n$ intervals on the real line , the intervals are given with start- and end point. The $i$-th interval is $(d_i,f_i)$ where $d_i$ is the start point and $f_i$ is the end point$d_i&lt;f_i$. it is given that $d_i,f_i\in \mathbb Z$ and $0&lt;d_i,f_i&lt;n^4$</p>&#xA; &#xA; <p>Write an al...
algorithms data structures
1
An algorithm to check if all intervals are disjoint -- (algorithms data structures) <blockquote>&#xA; <p>There are $n$ intervals on the real line , the intervals are given with start- and end point. The $i$-th interval is $(d_i,f_i)$ where $d_i$ is the start point and $f_i$ is the end point$d_i&lt;f_i$. it is given t...
habedi/stack-exchange-dataset
55,402
Why is the counting variant of a hard decision problem not automatically hard?
<p>It is well-known that 2-SAT is in P. However, it seems quite interesting that counting the number of solutions to a given 2-SAT formula, i.e., #2-SAT is #P-hard. That is, we have an example of a problem for which decision is easy, but counting is hard.</p>&#xA;&#xA;<p>But consider an arbitrary NP-complete problem (s...
complexity theory counting
1
Why is the counting variant of a hard decision problem not automatically hard? -- (complexity theory counting) <p>It is well-known that 2-SAT is in P. However, it seems quite interesting that counting the number of solutions to a given 2-SAT formula, i.e., #2-SAT is #P-hard. That is, we have an example of a problem for...
habedi/stack-exchange-dataset
55,421
Need help with ER diagram
<p>I am making database on Disaster Management. There are four tables.</p>&#xA;&#xA;<ol>&#xA;<li><p><code>DisasterEvent (eventid, name, glideID, status, description, date_occurred, date_ended, disaster_type)</code></p></li>&#xA;<li><p><code>People(eventid, num_deaths, num_injuries, num_affected)</code></p></li>&#xA;<l...
databases
1
Need help with ER diagram -- (databases) <p>I am making database on Disaster Management. There are four tables.</p>&#xA;&#xA;<ol>&#xA;<li><p><code>DisasterEvent (eventid, name, glideID, status, description, date_occurred, date_ended, disaster_type)</code></p></li>&#xA;<li><p><code>People(eventid, num_deaths, num_injur...
habedi/stack-exchange-dataset
55,424
Is emulation and/or virtualization faster when the host and guest systems are more similar?
<p>Is emulation and/ or virtualization performance faster when the guest and host OS are similar? If yes, how big, relatively speaking, is the difference? And whether the answer is yes or no, <em>why is it so</em>?</p>&#xA;&#xA;<p>For example:</p>&#xA;&#xA;<p><strong>Same architecture</strong></p>&#xA;&#xA;<p>Will a x8...
computer architecture operating systems
1
Is emulation and/or virtualization faster when the host and guest systems are more similar? -- (computer architecture operating systems) <p>Is emulation and/ or virtualization performance faster when the guest and host OS are similar? If yes, how big, relatively speaking, is the difference? And whether the answer is ye...
habedi/stack-exchange-dataset
55,426
Can one consider living (biological) cell to be Turing Complete?
<p>Universal Turing Machine can be boiled down to two components.&#xA;Infinite tape of input and an action table, a finite state machine that moves read/write head along the tape and writes to it depending on input provided by the tape.</p>&#xA;&#xA;<p>From this point of view cells have some properties very similar to ...
computability computation models turing completeness bio inspired computing
1
Can one consider living (biological) cell to be Turing Complete? -- (computability computation models turing completeness bio inspired computing) <p>Universal Turing Machine can be boiled down to two components.&#xA;Infinite tape of input and an action table, a finite state machine that moves read/write head along the ...
habedi/stack-exchange-dataset
55,432
Confusion in Banker's Algorithm: How resources are allocated?
<p>I have seen examples about <code>Banker's Algorithm</code> from <a href="https://en.wikipedia.org/wiki/Banker%27s_algorithm#Example" rel="nofollow noreferrer">this Wikipedia link</a>, <a href="http://rads.stackoverflow.com/amzn/click/1118129385" rel="nofollow noreferrer">this book</a> and many other places. In all t...
operating systems deadlocks
1
Confusion in Banker's Algorithm: How resources are allocated? -- (operating systems deadlocks) <p>I have seen examples about <code>Banker's Algorithm</code> from <a href="https://en.wikipedia.org/wiki/Banker%27s_algorithm#Example" rel="nofollow noreferrer">this Wikipedia link</a>, <a href="http://rads.stackoverflow.com...
habedi/stack-exchange-dataset
55,433
What is meant by superlinear speedup? Is it possible to have superlinear speedup in practice?
<p>In parallel computing, I know the speed up equation is </p>&#xA;&#xA;<p>$$ \frac{1}{ s + \frac{1-s}{p} } $$</p>&#xA;&#xA;<p>But what is meant by superlinear speed up? Is it something theoritical? Could you explain it with equations?</p>&#xA;
parallel computing multi tasking
1
What is meant by superlinear speedup? Is it possible to have superlinear speedup in practice? -- (parallel computing multi tasking) <p>In parallel computing, I know the speed up equation is </p>&#xA;&#xA;<p>$$ \frac{1}{ s + \frac{1-s}{p} } $$</p>&#xA;&#xA;<p>But what is meant by superlinear speed up? Is it something th...
habedi/stack-exchange-dataset
55,434
How to handle missing continuous attribute values in ID3 (Iterative Dichotomiser 3)?
<p>I'm implementing the <a href="https://en.wikipedia.org/wiki/ID3_algorithm" rel="nofollow">ID3 algorithm</a> (Iterative Dichotomiser 3). I have an attribute which happens to be continuous like 12.21, 3.01, etc. AND have missing values which are marked as "NA".</p>&#xA;&#xA;<p>How I'm discretizing the data: I'm findin...
machine learning
1
How to handle missing continuous attribute values in ID3 (Iterative Dichotomiser 3)? -- (machine learning) <p>I'm implementing the <a href="https://en.wikipedia.org/wiki/ID3_algorithm" rel="nofollow">ID3 algorithm</a> (Iterative Dichotomiser 3). I have an attribute which happens to be continuous like 12.21, 3.01, etc. ...
habedi/stack-exchange-dataset
55,445
Exhaustive list of ways to distribute n objects to k sets
<p>I am working on a research paper and we are developing a brute force algorithm to examine another clustering technique.</p>&#xA;&#xA;<p>In this brute force algorithm we test every possible clustering example and see what natural clusters occur.</p>&#xA;&#xA;<p>The problem comes from the assignment of every possible ...
combinatorics data mining
1
Exhaustive list of ways to distribute n objects to k sets -- (combinatorics data mining) <p>I am working on a research paper and we are developing a brute force algorithm to examine another clustering technique.</p>&#xA;&#xA;<p>In this brute force algorithm we test every possible clustering example and see what natural...
habedi/stack-exchange-dataset
55,451
Number of states in an AND-OR DAG
<p>Consider a DAG of $N$ nodes, where each node can take on one of two value, either false, $0$ or true, $1$. Additionally, let each non-leaf nodes (nodes with parents) be assigned a type: either an AND node or an OR node.</p>&#xA;&#xA;<p>Under this setting, I define a notion of a <em>feasible state</em>. A state is a ...
counting dag
1
Number of states in an AND-OR DAG -- (counting dag) <p>Consider a DAG of $N$ nodes, where each node can take on one of two value, either false, $0$ or true, $1$. Additionally, let each non-leaf nodes (nodes with parents) be assigned a type: either an AND node or an OR node.</p>&#xA;&#xA;<p>Under this setting, I define ...
habedi/stack-exchange-dataset
55,462
How/when is calculus used in Computer Science?
<p>Many computer science programs require two or three calculus classes.</p>&#xA;&#xA;<p>I'm wondering, how and when is calculus used in computer science? The CS content of a degree in computer science tends to focus on algorithms, operating systems, data structures, artificial intelligence, software engineering, etc. ...
education mathematical analysis
1
How/when is calculus used in Computer Science? -- (education mathematical analysis) <p>Many computer science programs require two or three calculus classes.</p>&#xA;&#xA;<p>I'm wondering, how and when is calculus used in computer science? The CS content of a degree in computer science tends to focus on algorithms, oper...
habedi/stack-exchange-dataset
55,471
What exactly (and precisely) is "hash?"
<p>I have heard the word "hash" being used in different contexts (all within the world of computing) with different meanings. For example, in the book Learn Python the Hard Way, in <a href="http://learnpythonthehardway.org/book/ex39.html" rel="noreferrer">the chapter on dictionaries</a> it is said "Python calls them "d...
terminology hashing
1
What exactly (and precisely) is "hash?" -- (terminology hashing) <p>I have heard the word "hash" being used in different contexts (all within the world of computing) with different meanings. For example, in the book Learn Python the Hard Way, in <a href="http://learnpythonthehardway.org/book/ex39.html" rel="noreferrer"...
habedi/stack-exchange-dataset
55,475
Family of types in type theory
<p>Can anyone simplify the meaning of families of types index by a type. It looks i get it but quite not understood it. What do you mean by a "family" ? </p>&#xA;&#xA;<p>I understand index by a value (n length sequence) then what you mean by index by a type. Any example how you index by a type ? Thanks.</p>&#xA;
type theory dependent types
1
Family of types in type theory -- (type theory dependent types) <p>Can anyone simplify the meaning of families of types index by a type. It looks i get it but quite not understood it. What do you mean by a "family" ? </p>&#xA;&#xA;<p>I understand index by a value (n length sequence) then what you mean by index by a typ...
habedi/stack-exchange-dataset
55,480
What is the number of degrees of freedom of my problem in this Simulated Annealing context?
<p>I'm trying to apply a Simulated Annealing technique to solve my (NP-complete) optimization problem. I'm using <a href="http://www.springer.com/us/book/9783540230229" rel="nofollow">this</a> book to help myself out.</p>&#xA;&#xA;<p>In the section on Simulated Annealing and more specifically in the section on practica...
heuristics
1
What is the number of degrees of freedom of my problem in this Simulated Annealing context? -- (heuristics) <p>I'm trying to apply a Simulated Annealing technique to solve my (NP-complete) optimization problem. I'm using <a href="http://www.springer.com/us/book/9783540230229" rel="nofollow">this</a> book to help myself...
habedi/stack-exchange-dataset
55,489
Theoretical machines which are more powerful than Turing machines
<p>Are there any theoretical machines which exceed Turing machines capability in at least some areas?</p>&#xA;
computability turing machines hypercomputation
1
Theoretical machines which are more powerful than Turing machines -- (computability turing machines hypercomputation) <p>Are there any theoretical machines which exceed Turing machines capability in at least some areas?</p>&#xA;
habedi/stack-exchange-dataset
55,494
Why do these NFAs need epsilon transitions?
<p>In the picture below, I'm trying to figure out why there's a need of epsilon in there and what would be the difference if we didn't put epsilon.</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/maVWj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/maVWj.png" alt="enter image description here"></...
automata finite automata nondeterminism
1
Why do these NFAs need epsilon transitions? -- (automata finite automata nondeterminism) <p>In the picture below, I'm trying to figure out why there's a need of epsilon in there and what would be the difference if we didn't put epsilon.</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/maVWj.png" rel="nofollow norefer...
habedi/stack-exchange-dataset
55,500
context sensitive language finite or infinite
<p>let L be a <a href="https://en.wikipedia.org/wiki/Context-sensitive_language" rel="nofollow">CSL</a>. (my understanding/ memory/ expectation is) the problem </p>&#xA;&#xA;<blockquote>&#xA; <p>is L finite or infinite? </p>&#xA;</blockquote>&#xA;&#xA;<p>is undecidable.</p>&#xA;&#xA;<ul>&#xA;<li><p>where was this 1<su...
formal languages computability reference request undecidability context sensitive
1
context sensitive language finite or infinite -- (formal languages computability reference request undecidability context sensitive) <p>let L be a <a href="https://en.wikipedia.org/wiki/Context-sensitive_language" rel="nofollow">CSL</a>. (my understanding/ memory/ expectation is) the problem </p>&#xA;&#xA;<blockquote>&...
habedi/stack-exchange-dataset
55,507
Proving that the scramble of a regular language is context-free
<blockquote>&#xA; <p>For strings $w$ and $t$, if they have the same length and comprise the same characters (namely, they are two permutations of these characters), then $w\sim t$. For a string $w$, define an operator $\operatorname {SCRAMBLE}$ such that &#xA; $$\operatorname {SCRAMBLE}(w):=\{t\mid t\sim w\}, $$&#xA;...
formal languages regular languages context free
1
Proving that the scramble of a regular language is context-free -- (formal languages regular languages context free) <blockquote>&#xA; <p>For strings $w$ and $t$, if they have the same length and comprise the same characters (namely, they are two permutations of these characters), then $w\sim t$. For a string $w$, def...
habedi/stack-exchange-dataset
55,511
Which algorithm for counting the occurrences of a certain pattern (spots) in an image?
<p><strong>The Problem :</strong></p>&#xA;&#xA;<p>Finding the number of occurrences of a certain pattern (or shape) in an image. In my example, the problem is about finding the number of spots (in variety of sizes) in an image. See figure 1 below:&#xA;<a href="https://i.stack.imgur.com/5RK0E.png" rel="nofollow noreferr...
machine learning image processing computer vision pattern recognition
1
Which algorithm for counting the occurrences of a certain pattern (spots) in an image? -- (machine learning image processing computer vision pattern recognition) <p><strong>The Problem :</strong></p>&#xA;&#xA;<p>Finding the number of occurrences of a certain pattern (or shape) in an image. In my example, the problem is...
habedi/stack-exchange-dataset
55,526
How did 'Isabelle' (the theorem prover) get its name?
<p>The title says it all, but I'm curious because it isn't obvious how a theorem prover came to be named 'Isabelle'. Was it named for a person? I couldn't find out by some Google searches.</p>&#xA;
history automated theorem proving isabelle
1
How did 'Isabelle' (the theorem prover) get its name? -- (history automated theorem proving isabelle) <p>The title says it all, but I'm curious because it isn't obvious how a theorem prover came to be named 'Isabelle'. Was it named for a person? I couldn't find out by some Google searches.</p>&#xA;
habedi/stack-exchange-dataset
55,528
Upper bound for #Monotone k-SAT
<p><em>(I've recently started studying satisfiability problems. I've tried to be as clear as possible, but I'm not sure if all of the terminology used is correct.)</em> </p>&#xA;&#xA;<p>Consider a collection of $n$ Boolean variables, $x_1,\ldots,x_n$ and a function $F$ on this collection of variables, $F(x_1,\ldots,x_n...
complexity theory combinatorics satisfiability
1
Upper bound for #Monotone k-SAT -- (complexity theory combinatorics satisfiability) <p><em>(I've recently started studying satisfiability problems. I've tried to be as clear as possible, but I'm not sure if all of the terminology used is correct.)</em> </p>&#xA;&#xA;<p>Consider a collection of $n$ Boolean variables, $x...
habedi/stack-exchange-dataset
55,530
How does coarser lock granularity cause an decrease in time required to acquire and release locks?
<p>I understand the principles required to program locks and I have run into the following problem:</p>&#xA;&#xA;<p>In my Operating Systems course, as well as on Wikipedia, one of the notions associated with lock overhead is the time required to acquire and release locks. And it is also implied that coarser granularity...
synchronization
1
How does coarser lock granularity cause an decrease in time required to acquire and release locks? -- (synchronization) <p>I understand the principles required to program locks and I have run into the following problem:</p>&#xA;&#xA;<p>In my Operating Systems course, as well as on Wikipedia, one of the notions associat...
habedi/stack-exchange-dataset
55,531
non LL(1) grammar but LL(1) language
<p>I'm reading a <a href="http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/" rel="nofollow">Basics of Compiler Design</a> and on page 84 it is making the following statement:</p>&#xA;&#xA;<blockquote>&#xA; <p>A language may well be LL(1) even though the grammar used to describe&#xA; it is not.</p>&#xA;</blockquo...
formal languages formal grammars
1
non LL(1) grammar but LL(1) language -- (formal languages formal grammars) <p>I'm reading a <a href="http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/" rel="nofollow">Basics of Compiler Design</a> and on page 84 it is making the following statement:</p>&#xA;&#xA;<blockquote>&#xA; <p>A language may well be LL(1) e...
habedi/stack-exchange-dataset
55,537
Expectation Maximization Algorithm for simple naive Bayesian network
<p>I am trying to understand the following network&#xA;A has two children - B &amp; C (aka common cause)</p>&#xA;&#xA;<p>All the variables are binary and can be either 0 or 1.&#xA;In data values are missing only for some records. Only values that are missing are values A.</p>&#xA;&#xA;<p>How does the Expectation step l...
algorithms machine learning artificial intelligence probability theory bayesian statistics
1
Expectation Maximization Algorithm for simple naive Bayesian network -- (algorithms machine learning artificial intelligence probability theory bayesian statistics) <p>I am trying to understand the following network&#xA;A has two children - B &amp; C (aka common cause)</p>&#xA;&#xA;<p>All the variables are binary and c...
habedi/stack-exchange-dataset
55,547
Regular expression for a binary string containing even number of 0's
<p>To get the regular expression I made a finite automata as the following (not sure if you can directly write regular expression without it): </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/3ztNx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3ztNx.png" alt="enter image description here"></a></...
formal languages finite automata regular expressions
1
Regular expression for a binary string containing even number of 0's -- (formal languages finite automata regular expressions) <p>To get the regular expression I made a finite automata as the following (not sure if you can directly write regular expression without it): </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.co...
habedi/stack-exchange-dataset
55,563
Context free grammar for nested arrays separated by commas
<p>I have to define a context free grammar for the following rules:</p>&#xA;&#xA;<p>(i) A pair of square bracket tokens [] surrounding zero or more values separated by commas.&#xA;(ii) A value can be another array or a number.</p>&#xA;&#xA;<p>A number is represented by the token <code>NUMBER</code>. So for example, <co...
context free formal grammars
1
Context free grammar for nested arrays separated by commas -- (context free formal grammars) <p>I have to define a context free grammar for the following rules:</p>&#xA;&#xA;<p>(i) A pair of square bracket tokens [] surrounding zero or more values separated by commas.&#xA;(ii) A value can be another array or a number.<...
habedi/stack-exchange-dataset
55,575
How to find longest recurring pattern from lage string data set?
<p>I need to find the substring that is from a 100,000 characters this substring must be most repeated and it need to be longest substring for example</p>&#xA;&#xA;<p>TYUF<strong>RIETEY</strong>M0SQZLHBCTN0W1KA9HELAT4LTQ14W7ZW484GSK1XTNOBJ2R6AMGW9KU36G7ITMPF315Y7ESYPR1XE2C1953J0DXUNBJLNTDG7IHS63854SGSS7YDEFJYSFP0DLL54G...
algorithms algorithm analysis strings longest common substring
1
How to find longest recurring pattern from lage string data set? -- (algorithms algorithm analysis strings longest common substring) <p>I need to find the substring that is from a 100,000 characters this substring must be most repeated and it need to be longest substring for example</p>&#xA;&#xA;<p>TYUF<strong>RIETEY</...
habedi/stack-exchange-dataset
55,578
Show L1 /L2 is regular
<blockquote>&#xA; <p>Let $L_1$ and $L_2$ be two languages over an alphabet $\Sigma$. The quotient of $L_1$ and $L_2$ is the language&#xA; $L_1/L_2 = \{x : \exists y \in L_2, xy \in L_1\}$</p>&#xA; &#xA; <p>Show that if $L_1$ is regular and $L_2$ is any language, then $L_1/L_2$ is regular.</p>&#xA;</blockquote>&#xA;...
regular languages
1
Show L1 /L2 is regular -- (regular languages) <blockquote>&#xA; <p>Let $L_1$ and $L_2$ be two languages over an alphabet $\Sigma$. The quotient of $L_1$ and $L_2$ is the language&#xA; $L_1/L_2 = \{x : \exists y \in L_2, xy \in L_1\}$</p>&#xA; &#xA; <p>Show that if $L_1$ is regular and $L_2$ is any language, then $L...
habedi/stack-exchange-dataset
55,592
Proof that whether a regular language is finite is decidable
<p>I have this question for a homework. The question stems from the fact that you can determine whether a regular language is empty by using a Turing machine to count the states <em>n</em> in the given FSM. When you generate all strings from length <em>0</em> to <em>n</em>, if the machine accepts any of them then the l...
computability finite automata pumping lemma decision problem
1
Proof that whether a regular language is finite is decidable -- (computability finite automata pumping lemma decision problem) <p>I have this question for a homework. The question stems from the fact that you can determine whether a regular language is empty by using a Turing machine to count the states <em>n</em> in t...
habedi/stack-exchange-dataset
55,594
Show language is not regular
<p>Show that the following languages are not regular in two ways: first by using&#xA;closure properties then by using the Pumping lemma:</p>&#xA;&#xA;<p>$$\text{(1) L1} = {a^n b^k c^{n+k} : n &gt;= 0; k &gt;= 0}$$</p>&#xA;&#xA;<p>$$\text{(2) L2} = {a^n b^k : n \ne k}$$</p>&#xA;&#xA;<p>So far for </p>&#xA;&#xA;<ol>&#xA;...
formal languages regular languages pumping lemma
1
Show language is not regular -- (formal languages regular languages pumping lemma) <p>Show that the following languages are not regular in two ways: first by using&#xA;closure properties then by using the Pumping lemma:</p>&#xA;&#xA;<p>$$\text{(1) L1} = {a^n b^k c^{n+k} : n &gt;= 0; k &gt;= 0}$$</p>&#xA;&#xA;<p>$$\text...
habedi/stack-exchange-dataset
55,597
Why do ACLs (access control lists) have better persistence than capabilities?
<p>Although I understand the principles on which both ACLs and Capabilities operate, I do not see why on system restart it would be favourable to store privileges by using ACLs, instead of capabilities lists as it is suggested in the Operating systems course I am taking. In other words, why do ACLs have better persiste...
operating systems security
1
Why do ACLs (access control lists) have better persistence than capabilities? -- (operating systems security) <p>Although I understand the principles on which both ACLs and Capabilities operate, I do not see why on system restart it would be favourable to store privileges by using ACLs, instead of capabilities lists as...
habedi/stack-exchange-dataset
55,600
What defines a tool as a "compiler"
<p>I've been trying to figure out what technically makes a tool or program a <em>compiler</em>. </p>&#xA;&#xA;<p>For example, I know that <a href="https://gcc.gnu.org/" rel="nofollow noreferrer">gcc</a> will compile source code to object files or assembly, hence transforming a programming language to a different form b...
terminology compilers
1
What defines a tool as a "compiler" -- (terminology compilers) <p>I've been trying to figure out what technically makes a tool or program a <em>compiler</em>. </p>&#xA;&#xA;<p>For example, I know that <a href="https://gcc.gnu.org/" rel="nofollow noreferrer">gcc</a> will compile source code to object files or assembly, ...
habedi/stack-exchange-dataset
55,601
What's the difference between the concatenation and union of symbols within a language
<p>I feel like I'm confusing myself perhaps but I'm having a bit of trouble figuring out how exactly this language works. I'm given the following regular expression</p>&#xA;<blockquote>&#xA;<p>(a + b)* (abba* + (ab)*ba)</p>&#xA;</blockquote>&#xA;<p>Can someone clarify to what union is compared to concatenation? Looking...
formal languages regular languages notation
1
What's the difference between the concatenation and union of symbols within a language -- (formal languages regular languages notation) <p>I feel like I'm confusing myself perhaps but I'm having a bit of trouble figuring out how exactly this language works. I'm given the following regular expression</p>&#xA;<blockquote...
habedi/stack-exchange-dataset
55,611
Ideal value of d in a d-ary heap for Dijkstra's algorithm
<p>I stumbled upon the following statement: </p>&#xA;&#xA;<blockquote>&#xA; <p>By using a $ d $-ary heap with $ d = m/n $, the total times for these two types of operations may be balanced against each other, leading to a total time of $ O(m \log_{m/n} n) $ for the algorithm, an improvement over the $ O(m \log n) $ ru...
algorithms data structures shortest path heaps
1
Ideal value of d in a d-ary heap for Dijkstra's algorithm -- (algorithms data structures shortest path heaps) <p>I stumbled upon the following statement: </p>&#xA;&#xA;<blockquote>&#xA; <p>By using a $ d $-ary heap with $ d = m/n $, the total times for these two types of operations may be balanced against each other, ...
habedi/stack-exchange-dataset
55,627
Induced subgraph problem in trees
<p>Let $~G~$ be unweighted unordered tree. I have some number of pairs of this tree's vertices $~(u_1, v_1), \dots, (u_n, v_n)$. I need to construct a smallest subgraph of original tree such that for each pair $~(u_i, v_i)~$ there is path connecting this pair of vertices. "Smallest" in the sense that the number of edge...
graphs reference request trees
1
Induced subgraph problem in trees -- (graphs reference request trees) <p>Let $~G~$ be unweighted unordered tree. I have some number of pairs of this tree's vertices $~(u_1, v_1), \dots, (u_n, v_n)$. I need to construct a smallest subgraph of original tree such that for each pair $~(u_i, v_i)~$ there is path connecting ...
habedi/stack-exchange-dataset
55,646
Strict positivity
<p>From This reference : <a href="http://wiki.portal.chalmers.se/agda/pmwiki.php?n=ReferenceManual.SimpleInductiveTypes?from=ReferenceManual.Datatypes" rel="noreferrer">Strict positivity</a></p>&#xA;&#xA;<p>The strict positivity condition rules out declarations such as</p>&#xA;&#xA;<pre><code>data Bad : Set where&#xA; ...
type theory inductive datatypes
1
Strict positivity -- (type theory inductive datatypes) <p>From This reference : <a href="http://wiki.portal.chalmers.se/agda/pmwiki.php?n=ReferenceManual.SimpleInductiveTypes?from=ReferenceManual.Datatypes" rel="noreferrer">Strict positivity</a></p>&#xA;&#xA;<p>The strict positivity condition rules out declarations suc...
habedi/stack-exchange-dataset