id int64 1 141k | title stringlengths 15 150 | body stringlengths 45 28.5k | tags stringlengths 1 102 | label int64 1 1 | text stringlengths 128 28.6k | source stringclasses 1
value |
|---|---|---|---|---|---|---|
28,141 | Find the smallest summed distances by uniquely pairing elements of one set to elements of another set | <p>As input I have two sets of points in <strong>R</strong><sup>N</sup>, typically for large N, for example N=40. Supose both sets have m elements:</p>

<p>S = s<sub>1</sub> ... s<sub>m</sub></p>

<p>T = t<sub>1</sub> ... t<sub>m</sub></p>

<p>Semantically both sets are equal, but due to noise (... | algorithms optimization | 1 | Find the smallest summed distances by uniquely pairing elements of one set to elements of another set -- (algorithms optimization)
<p>As input I have two sets of points in <strong>R</strong><sup>N</sup>, typically for large N, for example N=40. Supose both sets have m elements:</p>

<p>S = s<sub>1</sub> ... s<s... | habedi/stack-exchange-dataset |
28,152 | Why is $A_{TM}$ reducible to $HALT_{TM}$? | <p>In Sipser, there is a proof I don't understand. </p>

<p>First he established the undecidability of $A_\mathrm{TM}$, the problem of determining
whether a Turing machine accepts a given input. </p>

<p>$$A_\mathrm{TM}=\left\{\left \langle M,w \right \rangle\mid M \text{ is a TM and }M \text{ accep... | computability reductions undecidability halting problem | 1 | Why is $A_{TM}$ reducible to $HALT_{TM}$? -- (computability reductions undecidability halting problem)
<p>In Sipser, there is a proof I don't understand. </p>

<p>First he established the undecidability of $A_\mathrm{TM}$, the problem of determining
whether a Turing machine accepts a given input. </p>
&... | habedi/stack-exchange-dataset |
28,163 | Finding hash of a substring $[i, j]$ in $O(1)$ using $O(|S|)$ pre computation | <p>Given a string <span class="math-container">$S$</span> of length <span class="math-container">$n$</span> characters, is it possible to calculate the hash of its substring <span class="math-container">$[i, j]$</span> (from index <span class="math-container">$i$</span> to <span class="math-container">$j$</span>, both ... | data structures strings hash rolling hash | 1 | Finding hash of a substring $[i, j]$ in $O(1)$ using $O(|S|)$ pre computation -- (data structures strings hash rolling hash)
<p>Given a string <span class="math-container">$S$</span> of length <span class="math-container">$n$</span> characters, is it possible to calculate the hash of its substring <span class="math-con... | habedi/stack-exchange-dataset |
28,166 | Efficient algorithm for extreme spread of points in a plane | <p>Given a set $X$ of $n$ points in the real plane, designated by their Cartesian coordinates, find the extreme spread of the points, which is defined by</p>

<p>$\qquad\displaystyle \mathrm{ES} = \max_{1 \leq i,j \leq n}: \sqrt{(x_i - x_j)^2 - (y_i - y_j)^2}$,</p>

<p>i.e. the largest Euclidian distanc... | algorithms computational geometry | 1 | Efficient algorithm for extreme spread of points in a plane -- (algorithms computational geometry)
<p>Given a set $X$ of $n$ points in the real plane, designated by their Cartesian coordinates, find the extreme spread of the points, which is defined by</p>

<p>$\qquad\displaystyle \mathrm{ES} = \max_{1 \leq i,j... | habedi/stack-exchange-dataset |
28,175 | Language to Construct Finite State Transducer | <p>I am attempting to write a Finite State Transducer module in OCaml, because I think it's a good exercise, which is because I have been teaching myself Natural Language Processing.</p>

<p>You typically construct finite automata using regular expressions, for example (a | b).</p>

<p>What language doe... | regular languages automata finite automata | 1 | Language to Construct Finite State Transducer -- (regular languages automata finite automata)
<p>I am attempting to write a Finite State Transducer module in OCaml, because I think it's a good exercise, which is because I have been teaching myself Natural Language Processing.</p>

<p>You typically construct fin... | habedi/stack-exchange-dataset |
28,184 | High Level Programming Languages vs Block Programming Environments | <p>I am looking for the opinions of more experienced programmers as to the effectiveness of writing programs in Block Programming Environments such as <a href="http://scratch.mit.edu/" rel="nofollow">Scratch</a> or <a href="http://appinventor.mit.edu/explore/" rel="nofollow">App Inventor</a> as opposed to High Level La... | programming languages | 1 | High Level Programming Languages vs Block Programming Environments -- (programming languages)
<p>I am looking for the opinions of more experienced programmers as to the effectiveness of writing programs in Block Programming Environments such as <a href="http://scratch.mit.edu/" rel="nofollow">Scratch</a> or <a href="ht... | habedi/stack-exchange-dataset |
28,194 | Term for binary search tree using hashes? | <p>I was looking for a way to easily store and access a symbol table using the least memory and code as possible and I went with a BST. Symbols, however, tend to be defined in order as in foo0, foo1, foo2... so tree balance is an issue.</p>

<p>I considered balancing and auto-balancing algorithms, but then I re... | data structures search trees hash dictionaries | 1 | Term for binary search tree using hashes? -- (data structures search trees hash dictionaries)
<p>I was looking for a way to easily store and access a symbol table using the least memory and code as possible and I went with a BST. Symbols, however, tend to be defined in order as in foo0, foo1, foo2... so tree balance is... | habedi/stack-exchange-dataset |
28,197 | Find missing value in period of LCG | <p>It's well known that linear congruential generators have a full period only if a few properties are fulfilled.</p>

<p>Now I need a LCG that does <em>not</em> generate a full period in 2^32 (easy to find, just violate one requirement) and I need one of those values in the period that's not used.</p>

... | algorithms pseudo random generators | 1 | Find missing value in period of LCG -- (algorithms pseudo random generators)
<p>It's well known that linear congruential generators have a full period only if a few properties are fulfilled.</p>

<p>Now I need a LCG that does <em>not</em> generate a full period in 2^32 (easy to find, just violate one requiremen... | habedi/stack-exchange-dataset |
28,200 | Does an Operating System inject its own machine code when you open a program? | <p>I'm studying CPU's and I know how it reads a program from the memory and execute its instructions. I also understand that an OS separates programs in processes, and then alternate between each one so fast that you think that they're running at the same time, but in fact each program runs alone in the CPU. But, if th... | operating systems | 1 | Does an Operating System inject its own machine code when you open a program? -- (operating systems)
<p>I'm studying CPU's and I know how it reads a program from the memory and execute its instructions. I also understand that an OS separates programs in processes, and then alternate between each one so fast that you th... | habedi/stack-exchange-dataset |
28,204 | Layered Structures | <p>I'm trying to check how general and valid protocol suite system ( layered structure ) are.</p>

<p>Does anyone know if radio communication ( broadcast ) via AM or FM , for instance can be viewed in the light of a layered structure ( for example, the OSI model ) as operating at least in one or more in layers ... | computer networks communication protocols | 1 | Layered Structures -- (computer networks communication protocols)
<p>I'm trying to check how general and valid protocol suite system ( layered structure ) are.</p>

<p>Does anyone know if radio communication ( broadcast ) via AM or FM , for instance can be viewed in the light of a layered structure ( for exampl... | habedi/stack-exchange-dataset |
28,206 | Learning, understanding and using algorithms | <p>I am a 2nd year computer science student. We all have subjects about Data Structures, Theories, more more theories we all know that i have a subject this semester Design Analysis of Algorithms. </p>

<p>So my question is. How do you guys understand well all the Algorithms? Any technique? </p>

<p>To ... | algorithms data structures intuition | 1 | Learning, understanding and using algorithms -- (algorithms data structures intuition)
<p>I am a 2nd year computer science student. We all have subjects about Data Structures, Theories, more more theories we all know that i have a subject this semester Design Analysis of Algorithms. </p>

<p>So my question is. ... | habedi/stack-exchange-dataset |
28,218 | Generative Machine Learning algorithms on tree structure | <p>I'm looking into PCFG sentence grammar dependency structure parsing using StanfordNLP PCFG parser. It generates tree structures represented as a string like this:</p>

<pre><code> Happy new year => (ROOT (VP (VBN Happy) (NP (JJ new) (NN year))))
</code></pre>

<p>Or in a more visual way, the t... | machine learning natural language processing | 1 | Generative Machine Learning algorithms on tree structure -- (machine learning natural language processing)
<p>I'm looking into PCFG sentence grammar dependency structure parsing using StanfordNLP PCFG parser. It generates tree structures represented as a string like this:</p>

<pre><code> Happy new year => (... | habedi/stack-exchange-dataset |
28,221 | A "triangular" data structure for commutative relationships | <p>A multiplication table is symmetric over a diagonal, so only about $n^2/2$ of the elements in an $n \times n$ multiplication table contain unique information. Same goes for addition tables. In fact, the same is true for any table that represents a commutative relationship. Is there a data structure that can take adv... | data structures storage | 1 | A "triangular" data structure for commutative relationships -- (data structures storage)
<p>A multiplication table is symmetric over a diagonal, so only about $n^2/2$ of the elements in an $n \times n$ multiplication table contain unique information. Same goes for addition tables. In fact, the same is true for any tabl... | habedi/stack-exchange-dataset |
28,234 | Quantum Computing - Relationship between Hamiltonian and Unitary model | <p>When developing algorithms in quantum computing, I've noticed that there are two primary models in which this is done. Some algorithms - such as for the Hamiltonian NAND tree problem (Farhi, Goldstone, Guttman) - work by designing a Hamiltonian and some initial state, and then letting the system evolve according to ... | algorithms quantum computing computation models | 1 | Quantum Computing - Relationship between Hamiltonian and Unitary model -- (algorithms quantum computing computation models)
<p>When developing algorithms in quantum computing, I've noticed that there are two primary models in which this is done. Some algorithms - such as for the Hamiltonian NAND tree problem (Farhi, Go... | habedi/stack-exchange-dataset |
28,237 | Computing the complement of a set | <p>Suppose I have a set $A$ of elements in $\{1, \ldots, n\}$, given as an unordered list. 
I would like to compute the complement of $A$, i.e., I would like to produce an unordered list of entries in $\{1, \ldots, n\}$ but not in $A$. </p>

<p>One way to do this is to sort the entries of $A$ and then go th... | algorithms algorithm analysis time complexity sorting finite sets | 1 | Computing the complement of a set -- (algorithms algorithm analysis time complexity sorting finite sets)
<p>Suppose I have a set $A$ of elements in $\{1, \ldots, n\}$, given as an unordered list. 
I would like to compute the complement of $A$, i.e., I would like to produce an unordered list of entries in $\{1, \ldo... | habedi/stack-exchange-dataset |
28,243 | Matrix usage in CS | <p>I'm studying a major in CS. I'm interested in taking a few extra courses, specifically math to improve my knowledge as future computer scientist. </p>

<p>Right now I'm thinking to take Matrix Fundamentals but I'm not sure if it is going to help me in my CS career. What are its uses apart from arrays in prog... | matrices mathematical foundations | 1 | Matrix usage in CS -- (matrices mathematical foundations)
<p>I'm studying a major in CS. I'm interested in taking a few extra courses, specifically math to improve my knowledge as future computer scientist. </p>

<p>Right now I'm thinking to take Matrix Fundamentals but I'm not sure if it is going to help me in... | habedi/stack-exchange-dataset |
28,248 | Calculating miss rates of word-addressable and direct-mapped cache | <p>This a problem in a computer architecture course that's giving me some trouble:</p>

<p>You have an application whose memory access pattern is a stream and its entire data set is 128kB. The data cache in your machine has a capacity of 64kB. It is word-addressable and direct-mapped with 32B lines. It is able... | computer architecture cpu cache | 1 | Calculating miss rates of word-addressable and direct-mapped cache -- (computer architecture cpu cache)
<p>This a problem in a computer architecture course that's giving me some trouble:</p>

<p>You have an application whose memory access pattern is a stream and its entire data set is 128kB. The data cache in ... | habedi/stack-exchange-dataset |
28,257 | Search in a partial ordering defined by tuples of numbers | <p>This is a graph theory and partial ordering problem. Consider a set of triples {(d<sub>i</sub>,a<sub>i</sub>,c<sub>i</sub>)}<sup>i=1...N</sup>, which specify edges between two nodes A and B, d denotes a departure time, a an arrival time and c a cost. Technically there can be multiple incomparable costs, for example ... | graphs graph traversal partial order | 1 | Search in a partial ordering defined by tuples of numbers -- (graphs graph traversal partial order)
<p>This is a graph theory and partial ordering problem. Consider a set of triples {(d<sub>i</sub>,a<sub>i</sub>,c<sub>i</sub>)}<sup>i=1...N</sup>, which specify edges between two nodes A and B, d denotes a departure time... | habedi/stack-exchange-dataset |
28,261 | Ant colony optimization for continuous functions | <p>I am trying to do optimization of a voice activity detection function, which is a function with continuous parameters. This is easily accomplished with genetic algorithms, simulated annealing, and tabu search, but I'm somewhat confused on how to accomplish this with Ant Colony Optimization (ACO). </p>

<p>Fr... | algorithms reference request optimization heuristics | 1 | Ant colony optimization for continuous functions -- (algorithms reference request optimization heuristics)
<p>I am trying to do optimization of a voice activity detection function, which is a function with continuous parameters. This is easily accomplished with genetic algorithms, simulated annealing, and tabu search, ... | habedi/stack-exchange-dataset |
28,264 | Generating a set of minimal-length strings that, together, invoke every production of a context free language | <p><strong>Problem</strong> (tl;dr)</p>

<p>Given a context free grammar, $G$, find a set of strings that take $G$ through every production it has at least once. </p>

<p>How and how fast can it be done?</p>

<p><strong>Background</strong></p>

<p>I'm working on a compiler whose parser i... | complexity theory context free formal grammars | 1 | Generating a set of minimal-length strings that, together, invoke every production of a context free language -- (complexity theory context free formal grammars)
<p><strong>Problem</strong> (tl;dr)</p>

<p>Given a context free grammar, $G$, find a set of strings that take $G$ through every production it has at ... | habedi/stack-exchange-dataset |
28,274 | Monotone boolean satisfiability with at most k 1s is NP-Complete | <p>I am to prove that monotone boolean formula satisfiability checking when at most k variables are set to 1 is an NP-Complete problem. Proving that it is in NP is easy, but I'm having difficulty showing that it is in NP-Hard. I have seen <a href="https://cs.stackexchange.com/questions/11558/prove-np-completeness-of-... | np complete np hard satisfiability | 1 | Monotone boolean satisfiability with at most k 1s is NP-Complete -- (np complete np hard satisfiability)
<p>I am to prove that monotone boolean formula satisfiability checking when at most k variables are set to 1 is an NP-Complete problem. Proving that it is in NP is easy, but I'm having difficulty showing that it is... | habedi/stack-exchange-dataset |
28,279 | First Order interpretation of arbitrary structures as a graph | <p>I am currently trying to get some intuition on the concept of First Order reductions, and have come across this exercise question by Immerman, dubbed "Everything is a Graph".</p>

<p>Given some arbitrary relational structure $S$ of some vocabulary $\sigma$, show that there are first-order queries $I$ and $I^... | complexity theory graphs logic descriptive complexity | 1 | First Order interpretation of arbitrary structures as a graph -- (complexity theory graphs logic descriptive complexity)
<p>I am currently trying to get some intuition on the concept of First Order reductions, and have come across this exercise question by Immerman, dubbed "Everything is a Graph".</p>

<p>Given... | habedi/stack-exchange-dataset |
28,281 | Why are computers so complicated? | <p>I'm not sure this is on-topic or even the right website, please point me in the right direction if not.</p>

<p>I was wondering why computers are so incredibly complex. This question is as naive as it sounds, I'm really just looking for a nice explanation of why computers can't be like the airplane from Blyt... | computer architecture software engineering | 1 | Why are computers so complicated? -- (computer architecture software engineering)
<p>I'm not sure this is on-topic or even the right website, please point me in the right direction if not.</p>

<p>I was wondering why computers are so incredibly complex. This question is as naive as it sounds, I'm really just lo... | habedi/stack-exchange-dataset |
28,285 | Does this mean $P = NP$ | <p>I am not a formally trained guy on Complexity theory, but due to interest I am learning it. Based on different feedbacks, I have started my journey with Micheal Sipser's "Theory of Computation" (2013 edition). My question is based upon some statements from the book. My sincere apologies if the question is meaningles... | complexity theory p vs np | 1 | Does this mean $P = NP$ -- (complexity theory p vs np)
<p>I am not a formally trained guy on Complexity theory, but due to interest I am learning it. Based on different feedbacks, I have started my journey with Micheal Sipser's "Theory of Computation" (2013 edition). My question is based upon some statements from the b... | habedi/stack-exchange-dataset |
28,291 | Doubt regarding Maximum Bipartite Matching | <p>I was given this question by a friend:</p>

<p>"<em>You are given 3 sets of size n, X,Y and Z. Devise an algorithm to find maximum number of different pairings (u,v,w,x) such that u,v,w,x belong to X,Y,Z and X respectively (u is not equal to x) and gcd(u,v,w,x)>1.</em>"</p>

<p>My approach is to crea... | graphs | 1 | Doubt regarding Maximum Bipartite Matching -- (graphs)
<p>I was given this question by a friend:</p>

<p>"<em>You are given 3 sets of size n, X,Y and Z. Devise an algorithm to find maximum number of different pairings (u,v,w,x) such that u,v,w,x belong to X,Y,Z and X respectively (u is not equal to x) and gcd(u... | habedi/stack-exchange-dataset |
28,305 | Efficient algorithm to find subgraph | <p>I have a really nasty problem (for me) at hand and I was wishing some of you may know an efficient algorithm to solve it. Thanks to all of you in advance.</p>

<hr>

<h2>My problem</h2>

<p>I have a set of elements (that I would describe as a graph) that may be of three categories:</p>
&#... | algorithms graphs | 1 | Efficient algorithm to find subgraph -- (algorithms graphs)
<p>I have a really nasty problem (for me) at hand and I was wishing some of you may know an efficient algorithm to solve it. Thanks to all of you in advance.</p>

<hr>

<h2>My problem</h2>

<p>I have a set of elements (that I would desc... | habedi/stack-exchange-dataset |
28,307 | Efficient algorithm for iterated find/replace | <p>I'm looking for an algorithm for doing iterated find/replace, where the act of finding the replacement list of tokens for a given find is slow.</p>

<p>Specifically: I have a function, <code>f</code>, that maps a sequence of tokens to either a shorter list of tokens or None. However, it is slow.</p>

... | algorithms search algorithms strings | 1 | Efficient algorithm for iterated find/replace -- (algorithms search algorithms strings)
<p>I'm looking for an algorithm for doing iterated find/replace, where the act of finding the replacement list of tokens for a given find is slow.</p>

<p>Specifically: I have a function, <code>f</code>, that maps a sequence... | habedi/stack-exchange-dataset |
28,313 | Why doesn't Knuth's linear-time multiplication algorithm "count"? | <p>The wikipedia page on multiplication algorithms mentions <a href="http://en.wikipedia.org/wiki/Multiplication_algorithm#Linear_time_multiplication">an interesting one by Donald Knuth</a>. Basically, it involves combining fourier-transform multiplication with a precomputed table of logarithmically-sized multiplicatio... | algorithms runtime analysis multiplication | 1 | Why doesn't Knuth's linear-time multiplication algorithm "count"? -- (algorithms runtime analysis multiplication)
<p>The wikipedia page on multiplication algorithms mentions <a href="http://en.wikipedia.org/wiki/Multiplication_algorithm#Linear_time_multiplication">an interesting one by Donald Knuth</a>. Basically, it i... | habedi/stack-exchange-dataset |
28,319 | Depth of any node x in Weighted Quick-Union Algorithm | <p>I know from Sedgewick's book on algorithms that the max depth of any node x from a set of N nodes is at most log2(N) applying the algorithm(which says to put the shorter tree beneath to avoid tall trees) and he gives an understandable proof by induction. The thing is that I have trouble visualising that result apart... | algorithms data structures trees | 1 | Depth of any node x in Weighted Quick-Union Algorithm -- (algorithms data structures trees)
<p>I know from Sedgewick's book on algorithms that the max depth of any node x from a set of N nodes is at most log2(N) applying the algorithm(which says to put the shorter tree beneath to avoid tall trees) and he gives an under... | habedi/stack-exchange-dataset |
28,320 | Runtime analysis of sorting an array with known number of inversions | <p>I'm having difficulties with analyzing the worst-case runtime of this following case:</p>

<p>I'm given an array that has $n$ natural numbers. Out of all $\binom{n}{2} = \frac{n(n-1)}{2}$ possible pairs there are $\frac{n(n-1)}{2} - 5n$ inversions. Inversion is defined like this: $a[i] < a[j],\ i>j$. <... | algorithm analysis runtime analysis sorting | 1 | Runtime analysis of sorting an array with known number of inversions -- (algorithm analysis runtime analysis sorting)
<p>I'm having difficulties with analyzing the worst-case runtime of this following case:</p>

<p>I'm given an array that has $n$ natural numbers. Out of all $\binom{n}{2} = \frac{n(n-1)}{2}$ pos... | habedi/stack-exchange-dataset |
28,336 | Longest Path A*, Admissible Heuristics, and Optimalness | <p>Im working on a modified A Star algorithm, that instead of attempting to find the shortest path, it tries to find the longest past, or in my specific case, the highest weighted path.</p>

<p>I have some number of classes, each with a list of unique nodes, with each node having its own value. Im attempting t... | algorithms search algorithms heuristics | 1 | Longest Path A*, Admissible Heuristics, and Optimalness -- (algorithms search algorithms heuristics)
<p>Im working on a modified A Star algorithm, that instead of attempting to find the shortest path, it tries to find the longest past, or in my specific case, the highest weighted path.</p>

<p>I have some numbe... | habedi/stack-exchange-dataset |
28,337 | A detail on variant of Mahaney's theorem about reductions of sparse languages vs P/NP | <p>Wikipedia states on <a href="http://en.m.wikipedia.org/wiki/Sparse_language" rel="nofollow">sparse languages</a> that </p>

<blockquote>
 <p>There is a Turing reduction (as opposed to the Karp reduction from Mahaney's theorem) from a NP-complete language to a sparse language iff NP $\subseteq$ P/poly. <... | complexity theory reference request np complete reductions p vs np | 1 | A detail on variant of Mahaney's theorem about reductions of sparse languages vs P/NP -- (complexity theory reference request np complete reductions p vs np)
<p>Wikipedia states on <a href="http://en.m.wikipedia.org/wiki/Sparse_language" rel="nofollow">sparse languages</a> that </p>

<blockquote>
 <p>There... | habedi/stack-exchange-dataset |
28,338 | Find rectangle of minimum area where dimensions are larger than minimum | <p><strong>Problem</strong>: Given a collection $S$ containing $|S|=n$ rectangles defined by dimensions $(x,y)\in R^2$ (width and height of rectangles are real numbers), find the rectangles with the minimum area ($A_i = x_i * y_i$) where $(x_i \geq a)$ and $(y_i \geq b$) for any $(a,b) \in R^2$.</p>

<p>The nai... | algorithms time complexity search algorithms space complexity | 1 | Find rectangle of minimum area where dimensions are larger than minimum -- (algorithms time complexity search algorithms space complexity)
<p><strong>Problem</strong>: Given a collection $S$ containing $|S|=n$ rectangles defined by dimensions $(x,y)\in R^2$ (width and height of rectangles are real numbers), find the re... | habedi/stack-exchange-dataset |
28,339 | Why is the transform in Schönhage–Strassen's multiplication algorithm cheap? | <p>The <a href="http://en.wikipedia.org/wiki/Sch%C3%B6nhage%E2%80%93Strassen_algorithm">Schönhage–Strassen multiplication</a> algorithm works by turning multiplications of size $N$ into many multiplications of size $lg(N)$ with a number-theoretic transform, and recursing. At least I think that's what it does because th... | algorithm analysis time complexity multiplication | 1 | Why is the transform in Schönhage–Strassen's multiplication algorithm cheap? -- (algorithm analysis time complexity multiplication)
<p>The <a href="http://en.wikipedia.org/wiki/Sch%C3%B6nhage%E2%80%93Strassen_algorithm">Schönhage–Strassen multiplication</a> algorithm works by turning multiplications of size $N$ into ma... | habedi/stack-exchange-dataset |
28,347 | Represent a real number without loss of precision | <p>Current floating point (ANSI C float, double) allow to represent an <strong>approximation</strong> of a real number.<br>
Is there any way to <strong>represent real numbers without errors</strong>?<br>
Here's an idea I had, which is anything but perfect.<br><br>
For example, 1/3 is 0.33333333...(base 10) ... | binary arithmetic arithmetic floating point real numbers number formats | 1 | Represent a real number without loss of precision -- (binary arithmetic arithmetic floating point real numbers number formats)
<p>Current floating point (ANSI C float, double) allow to represent an <strong>approximation</strong> of a real number.<br>
Is there any way to <strong>represent real numbers without errors... | habedi/stack-exchange-dataset |
28,353 | Prove that an $n$-length string has $2^n$ i18n-style abbreviations | <p>An i18n-style abbreviation is one in which multiple letters are shortened to that number of letters. E.g., "internationalization" -> "i18n" ("nternationalizatio" is substituted with its length 18). Other abbreviations include "in17n", "i17on", "in16on", etc. I see a pattern in which words with at least 3 characters ... | proof techniques | 1 | Prove that an $n$-length string has $2^n$ i18n-style abbreviations -- (proof techniques)
<p>An i18n-style abbreviation is one in which multiple letters are shortened to that number of letters. E.g., "internationalization" -> "i18n" ("nternationalizatio" is substituted with its length 18). Other abbreviations include "i... | habedi/stack-exchange-dataset |
28,363 | Set cover problem with constant size subset | <p>Consider a variation of the set cover problem in which the size of the subsets is no larger than a constant $k$. Is this variation still NP-hard?</p>
 | algorithms np complete np hard set cover | 1 | Set cover problem with constant size subset -- (algorithms np complete np hard set cover)
<p>Consider a variation of the set cover problem in which the size of the subsets is no larger than a constant $k$. Is this variation still NP-hard?</p>
 | habedi/stack-exchange-dataset |
28,365 | How "coplanar" is a set of points? | <p>Assume that we have 10 points. If all those points are on the same plane, they all are coplanar. But some of them might be at a different place. That disrupts the structure of the plane if we were to draw the surface that passes from all the points.</p>

<p>I need a metric that tells me how fine the structur... | algorithms np complete computational geometry | 1 | How "coplanar" is a set of points? -- (algorithms np complete computational geometry)
<p>Assume that we have 10 points. If all those points are on the same plane, they all are coplanar. But some of them might be at a different place. That disrupts the structure of the plane if we were to draw the surface that passes fr... | habedi/stack-exchange-dataset |
28,379 | Where does the lg(lg(N)) factor come from in Schönhage–Strassen's run time? | <p>According to page 53 of <a href="http://www.loria.fr/~zimmerma/mca/mca-cup-0.5.9.pdf" rel="nofollow">Modern Computer Arithmetic (pdf)</a>, all of the steps in the <a href="http://en.wikipedia.org/wiki/Sch%C3%B6nhage%E2%80%93Strassen_algorithm" rel="nofollow">Schönhage–Strassen Algorithm</a> cost $O(N \cdot \lg(N))$ ... | algorithm analysis runtime analysis multiplication | 1 | Where does the lg(lg(N)) factor come from in Schönhage–Strassen's run time? -- (algorithm analysis runtime analysis multiplication)
<p>According to page 53 of <a href="http://www.loria.fr/~zimmerma/mca/mca-cup-0.5.9.pdf" rel="nofollow">Modern Computer Arithmetic (pdf)</a>, all of the steps in the <a href="http://en.wik... | habedi/stack-exchange-dataset |
28,388 | Advantages and disadvantages of microcoded vs hardcoded architectures | <h3>Preamble</h3>
<p>I can't understand what are the advantages and disadvantages of <a href="http://en.wikipedia.org/wiki/Microcode" rel="nofollow noreferrer">microcoded</a> processor architecture and <a href="http://en.wikipedia.org/wiki/Hardwired_control_unit#Hardwired_control_unit" rel="nofollow noreferrer">har... | computer architecture | 1 | Advantages and disadvantages of microcoded vs hardcoded architectures -- (computer architecture)
<h3>Preamble</h3>
<p>I can't understand what are the advantages and disadvantages of <a href="http://en.wikipedia.org/wiki/Microcode" rel="nofollow noreferrer">microcoded</a> processor architecture and <a href="http://e... | habedi/stack-exchange-dataset |
28,397 | Simulating a sequence of events concurrently subject to a happened-before partial order | <p>I am building a strategy game where multiple units(5 - 20) is fighting each other in the same time. </p>

<p>I have a logic part that calculate those actions for each turn, and than pass it to the game engine to animate. This is the list of action that I currently supporting:</p>

<ul>
<li>perfor... | concurrency threads | 1 | Simulating a sequence of events concurrently subject to a happened-before partial order -- (concurrency threads)
<p>I am building a strategy game where multiple units(5 - 20) is fighting each other in the same time. </p>

<p>I have a logic part that calculate those actions for each turn, and than pass it to the... | habedi/stack-exchange-dataset |
28,402 | Finding Kernel in DAG | <p>Let $G=(V,E)$ be a DAG. A subset $A \subseteq V$ is called a <strong>kernel</strong> if for all $u,v \in A$ $uv \notin E$ and for all $v \in V-A$ there exists an $a \in A$ such that $av \in E$ (note again, this is a directed graph).</p>

<p>I need to find an algorithm that runs in $O(V+E)$ that upon giving a... | algorithms graphs | 1 | Finding Kernel in DAG -- (algorithms graphs)
<p>Let $G=(V,E)$ be a DAG. A subset $A \subseteq V$ is called a <strong>kernel</strong> if for all $u,v \in A$ $uv \notin E$ and for all $v \in V-A$ there exists an $a \in A$ such that $av \in E$ (note again, this is a directed graph).</p>

<p>I need to find an algor... | habedi/stack-exchange-dataset |
28,408 | Lexing and parsing a language with juxtaposition as an operator | <p>Normal human math notation treats juxtaposition as implied multiplication, e.g., $2x$ means $2$ multiplied by $x$. This does not seem to be a common feature of computer languages, although it was, for example, supposed to be included in the language <a href="https://en.wikipedia.org/wiki/Fortress_%28programming_lang... | compilers parsing ambiguity | 1 | Lexing and parsing a language with juxtaposition as an operator -- (compilers parsing ambiguity)
<p>Normal human math notation treats juxtaposition as implied multiplication, e.g., $2x$ means $2$ multiplied by $x$. This does not seem to be a common feature of computer languages, although it was, for example, supposed t... | habedi/stack-exchange-dataset |
28,410 | Bytes--Measured or Counted | <p>I hope the Computer Science section is the appropriate place to ask this question. I’m working on profiling some data sets and I am a bit tripped up on something, I was hoping I could get some assistance. </p>

<p>Part of my project is to determine whether some of my data is an integer and whether is a conti... | discrete mathematics | 1 | Bytes--Measured or Counted -- (discrete mathematics)
<p>I hope the Computer Science section is the appropriate place to ask this question. I’m working on profiling some data sets and I am a bit tripped up on something, I was hoping I could get some assistance. </p>

<p>Part of my project is to determine whether... | habedi/stack-exchange-dataset |
28,413 | How hard is this constrained $n$-rooks problem? | <p>I asked this <a href="https://math.stackexchange.com/q/857400/97480">over on math.stackexchange.com</a>, then I found out about this forum.</p>

<p>Suppose you have an $(n\times n)$-chessboard, together with a constraining function $C : n \times n \to 2$ where $C(i,j) = 1$ iff you're allowed to place a rook ... | complexity theory np hard permutations | 1 | How hard is this constrained $n$-rooks problem? -- (complexity theory np hard permutations)
<p>I asked this <a href="https://math.stackexchange.com/q/857400/97480">over on math.stackexchange.com</a>, then I found out about this forum.</p>

<p>Suppose you have an $(n\times n)$-chessboard, together with a constra... | habedi/stack-exchange-dataset |
28,414 | Use Dijkstra to find negative cycles in a graph | <p>I will state the problem:</p>

<blockquote>
 <p>Suggest an algorithm that works in $O(|E| + |V|log|V|)$ time that checks if there are negative cycles in a graph.</p>
</blockquote>

<p>So, I saw the runtime, and I immediately said we need to use Dijsktra's implementation with a fibonacci heap... | algorithms graphs shortest path | 1 | Use Dijkstra to find negative cycles in a graph -- (algorithms graphs shortest path)
<p>I will state the problem:</p>

<blockquote>
 <p>Suggest an algorithm that works in $O(|E| + |V|log|V|)$ time that checks if there are negative cycles in a graph.</p>
</blockquote>

<p>So, I saw the runtime, ... | habedi/stack-exchange-dataset |
28,428 | Is random access allowed in the Bit Complexity model, or is it just expensive? | <p>In the <a href="http://en.wikipedia.org/wiki/Random-access_machine" rel="nofollow">RAM model</a>, you're allowed to do unbounded indirect access (pointers can be arbitrarily large and still fit in a single machine word).</p>

<p>In the Bit Complexity model (no wiki article, sorry), machine words are constant... | complexity theory terminology computation models | 1 | Is random access allowed in the Bit Complexity model, or is it just expensive? -- (complexity theory terminology computation models)
<p>In the <a href="http://en.wikipedia.org/wiki/Random-access_machine" rel="nofollow">RAM model</a>, you're allowed to do unbounded indirect access (pointers can be arbitrarily large and ... | habedi/stack-exchange-dataset |
28,435 | A Reduction from XORSAT to 2-SAT | <p>Does anyone know of a non-trivial reduction from XORSAT to 2-sat since they are both in P? (By non-trivial I mean one that does not just solve the instance of XORSAT and map it to a fixed instance of 2-sat. Rather I'm looking for a way to solve XORSAT by a different method other than just using Gaussian Eliminatio... | complexity theory reductions satisfiability polynomial time | 1 | A Reduction from XORSAT to 2-SAT -- (complexity theory reductions satisfiability polynomial time)
<p>Does anyone know of a non-trivial reduction from XORSAT to 2-sat since they are both in P? (By non-trivial I mean one that does not just solve the instance of XORSAT and map it to a fixed instance of 2-sat. Rather I'm... | habedi/stack-exchange-dataset |
28,454 | Finding independent sets so that all nodes are hit frequently | <p>I have a problem, and I appreciate it if you could share your thoughts. </p>

<p>Assume that I have a graph. Assume that I have $k$ iterations. I want to find only <em>one</em> independent set (IS) in the graph in each iteration. Then, I will increase a counter for those vertices that are in the selected IS.... | algorithms graphs | 1 | Finding independent sets so that all nodes are hit frequently -- (algorithms graphs)
<p>I have a problem, and I appreciate it if you could share your thoughts. </p>

<p>Assume that I have a graph. Assume that I have $k$ iterations. I want to find only <em>one</em> independent set (IS) in the graph in each itera... | habedi/stack-exchange-dataset |
28,461 | Determining Big O | <pre><code> i<--2
 while (i<n)
 someWork (...)
 i <-- power (i,2)
 done
</code></pre>

<blockquote>
 <p>Given that someWork(...) is an O(n) algorithm, what is the worst case
 time complexity?</p>
</blockquote>

<p>I've found this question ans... | asymptotics | 1 | Determining Big O -- (asymptotics)
<pre><code> i<--2
 while (i<n)
 someWork (...)
 i <-- power (i,2)
 done
</code></pre>

<blockquote>
 <p>Given that someWork(...) is an O(n) algorithm, what is the worst case
 time complexity?</p>
</blockquote>
&... | habedi/stack-exchange-dataset |
28,466 | Can an NP-hard problem be polynomial on average? | <p>I'm wondering if there are any $NP$-hard problems which are ``polynomial" in the average case. I think there are two ways to interpret this?</p>

<ul>
<li>If $P \neq NP$, can there be an algorithm solving an $NP$-hard problem with amortized (average case) running time of $O(n^k)$ for a constant $k$?</li>... | complexity theory reference request np complete probabilistic algorithms amortized analysis | 1 | Can an NP-hard problem be polynomial on average? -- (complexity theory reference request np complete probabilistic algorithms amortized analysis)
<p>I'm wondering if there are any $NP$-hard problems which are ``polynomial" in the average case. I think there are two ways to interpret this?</p>

<ul>
<li>If $... | habedi/stack-exchange-dataset |
28,469 | recursive lambda expressions | <p>From <a href="http://www.seas.gwu.edu/%7Erhyspj/spring09cs145/lab8/lab82.html" rel="nofollow noreferrer">http://www.seas.gwu.edu/~rhyspj/spring09cs145/lab8/lab82.html</a></p>
<blockquote>
<p>The lambda operator does not bind every occurrence of its variable because "shadowing" can occur. A variable... | terminology lambda calculus | 1 | recursive lambda expressions -- (terminology lambda calculus)
<p>From <a href="http://www.seas.gwu.edu/%7Erhyspj/spring09cs145/lab8/lab82.html" rel="nofollow noreferrer">http://www.seas.gwu.edu/~rhyspj/spring09cs145/lab8/lab82.html</a></p>
<blockquote>
<p>The lambda operator does not bind every occurrence of it... | habedi/stack-exchange-dataset |
28,496 | Using singly linked list instead of a doubly linked list? | <p>Are there advantages of implementing a singly instead of a doubly linked list <b>other than space</b>?</p>
 | data structures linked lists | 1 | Using singly linked list instead of a doubly linked list? -- (data structures linked lists)
<p>Are there advantages of implementing a singly instead of a doubly linked list <b>other than space</b>?</p>
 | habedi/stack-exchange-dataset |
28,501 | No need to rename a free variable in substitution? | <p>I wonder if the following two substitutions are correct:
$$(x\,y)[x:=y] = (y\,y)$$</p>

<p>$$ \lambda y. (x\,y) [x:=y] = \lambda z.(y\,z)$$</p>

<p>They are what I understand from <a href="http://en.wikipedia.org/wiki/Lambda_calculus#Substitution" rel="nofollow">http://en.wikipedia.org/wiki/Lambd... | lambda calculus | 1 | No need to rename a free variable in substitution? -- (lambda calculus)
<p>I wonder if the following two substitutions are correct:
$$(x\,y)[x:=y] = (y\,y)$$</p>

<p>$$ \lambda y. (x\,y) [x:=y] = \lambda z.(y\,z)$$</p>

<p>They are what I understand from <a href="http://en.wikipedia.org/wiki/Lambda_... | habedi/stack-exchange-dataset |
28,504 | Algorithm for distributing members over activites (with individual preferences) | <p>So in my school we have a day where everybody participates in different activities. Each projects can have like 10 members. The whole day is divided in 2 or 3 different blocks, in which the pupils assigned to the activity change. (So in block 1 pupil x takes part in activity a and in the second block in activity d).... | algorithms matching assignment problem | 1 | Algorithm for distributing members over activites (with individual preferences) -- (algorithms matching assignment problem)
<p>So in my school we have a day where everybody participates in different activities. Each projects can have like 10 members. The whole day is divided in 2 or 3 different blocks, in which the pup... | habedi/stack-exchange-dataset |
28,507 | Detecting coplanarity by given pairwise distances | <p>Consider an undirected weighted graph $G = (V,E)$, where $V \subset \mathbb{R}^3$ so the points are 3D, and the weight of an edge equals the (Euclidean) distance between its endpoints. Note that we're not given the coordinates of the points in V. We may not even be given all pairwise distances, so the graph need n... | algorithms computational geometry | 1 | Detecting coplanarity by given pairwise distances -- (algorithms computational geometry)
<p>Consider an undirected weighted graph $G = (V,E)$, where $V \subset \mathbb{R}^3$ so the points are 3D, and the weight of an edge equals the (Euclidean) distance between its endpoints. Note that we're not given the coordinates ... | habedi/stack-exchange-dataset |
28,508 | What is an oracle separating IP and PSPACE? | <p>I saw this link on cstheory:</p>

<p><a href="https://cstheory.stackexchange.com/questions/6634/is-there-an-oracle-that-separates-two-complexity-classes-known-to-be-equal">https://cstheory.stackexchange.com/questions/6634/is-there-an-oracle-that-separates-two-complexity-classes-known-to-be-equal</a></p>
... | complexity theory oracle machines | 1 | What is an oracle separating IP and PSPACE? -- (complexity theory oracle machines)
<p>I saw this link on cstheory:</p>

<p><a href="https://cstheory.stackexchange.com/questions/6634/is-there-an-oracle-that-separates-two-complexity-classes-known-to-be-equal">https://cstheory.stackexchange.com/questions/6634/is-t... | habedi/stack-exchange-dataset |
28,517 | Convert DFA to Regular Expression | <p>In this old exam-task I don't understand all the steps to convert the DFA below to a Regular Expression. The $q_2$ state is eliminated first.
The provided solution to eliminate $q_2$ is:</p>

<p>If we first eliminate $q_2$ we obtain an intermediate automata with $3$ states 
$(q_0$,$q_1,q_3)$ such tha... | finite automata regular expressions simulation | 1 | Convert DFA to Regular Expression -- (finite automata regular expressions simulation)
<p>In this old exam-task I don't understand all the steps to convert the DFA below to a Regular Expression. The $q_2$ state is eliminated first.
The provided solution to eliminate $q_2$ is:</p>

<p>If we first eliminate $q... | habedi/stack-exchange-dataset |
28,520 | Adding a node between two others, minimizing its maximum distance to any other node | <p>We are given an undirected graph weighted with positive arc lengths
and a distinguished edge $(a,b)$ in the graph. The problem is to
replace this edge by two edges $(a,c)$ and $(c,b)$ where $c$ is a new
node, such that the length of the path $(a,c,b)$ is equal to the
inital length of $(a,b)$, and suc... | algorithms graphs shortest path weighted graphs | 1 | Adding a node between two others, minimizing its maximum distance to any other node -- (algorithms graphs shortest path weighted graphs)
<p>We are given an undirected graph weighted with positive arc lengths
and a distinguished edge $(a,b)$ in the graph. The problem is to
replace this edge by two edges $(a,c)$ ... | habedi/stack-exchange-dataset |
28,524 | Stable marriage problem preferential to asking side | <p>Watching this youtube video: <a href="https://www.youtube.com/watch?v=w1leqkpDaRw" rel="nofollow">https://www.youtube.com/watch?v=w1leqkpDaRw</a> it described the problem with the stable marriage problem, that the asking side get a better deal then the asked site. Meaning that the result may differ if the woman ask ... | algorithms assignment problem | 1 | Stable marriage problem preferential to asking side -- (algorithms assignment problem)
<p>Watching this youtube video: <a href="https://www.youtube.com/watch?v=w1leqkpDaRw" rel="nofollow">https://www.youtube.com/watch?v=w1leqkpDaRw</a> it described the problem with the stable marriage problem, that the asking side get ... | habedi/stack-exchange-dataset |
28,526 | How append, prepend, and generally insertAt work in RRB-tree | <p>I read the <a href="http://infoscience.epfl.ch/record/169879/files/RMTrees.pdf" rel="nofollow">paper</a> about Relaxed Radix Balanced trees (RRB trees) and am trying to implement them. What I can't get is how insertion at an index should be performed step by step. Can anyone proficient in this data structure describ... | trees persistent data structure | 1 | How append, prepend, and generally insertAt work in RRB-tree -- (trees persistent data structure)
<p>I read the <a href="http://infoscience.epfl.ch/record/169879/files/RMTrees.pdf" rel="nofollow">paper</a> about Relaxed Radix Balanced trees (RRB trees) and am trying to implement them. What I can't get is how insertion ... | habedi/stack-exchange-dataset |
28,531 | Can an intersection of two context-free languages be an undecidable language? | <p>I'm trying to prove that</p>

<p>$\exists L_1, L_2 : L_1$ and $L_2$ are context-free languages $\land\;L_1 \cap L_2 = L_3$ is an undecidable language.</p>

<hr>

<p>I know that context-free languages are not closed under intersection.</p>

<p>This means that I can produce an $L_3$, wh... | computability context free undecidability | 1 | Can an intersection of two context-free languages be an undecidable language? -- (computability context free undecidability)
<p>I'm trying to prove that</p>

<p>$\exists L_1, L_2 : L_1$ and $L_2$ are context-free languages $\land\;L_1 \cap L_2 = L_3$ is an undecidable language.</p>

<hr>

<p>I k... | habedi/stack-exchange-dataset |
28,536 | Can the definition of regular languages be simplified? | <p><a href="https://en.wikipedia.org/wiki/Regular_language#Formal_definition" rel="nofollow">Wikipedia says</a></p>

<blockquote>
 <p>The collection of regular languages over an alphabet Σ is defined
 recursively as follows:</p>
 
 <ul>
 <li>The empty language Ø is a regular language.</... | formal languages terminology regular languages | 1 | Can the definition of regular languages be simplified? -- (formal languages terminology regular languages)
<p><a href="https://en.wikipedia.org/wiki/Regular_language#Formal_definition" rel="nofollow">Wikipedia says</a></p>

<blockquote>
 <p>The collection of regular languages over an alphabet Σ is defined&... | habedi/stack-exchange-dataset |
28,546 | Emulation, interpreters and parallel execution | <p>I'm interested in how software emulators of old game consoles work. These must consist of an interpreter for the machine language of the emulated processor.</p>

<p>If I have understood correctly an interpreter, for each instruction: reads the instruction and scrolls a huge switch-case (or sequence of <code... | distributed systems parallel computing interpreters | 1 | Emulation, interpreters and parallel execution -- (distributed systems parallel computing interpreters)
<p>I'm interested in how software emulators of old game consoles work. These must consist of an interpreter for the machine language of the emulated processor.</p>

<p>If I have understood correctly an inter... | habedi/stack-exchange-dataset |
28,557 | Use of Big-O Notation: Size of Input vs Input | <p>It is my understanding that, when one is describing time complexity with $\mathcal{O}$, $\mathcal{\Theta}$, and $\mathcal{\Omega}$, one must be careful to provide expressions with regards to the <em>size</em> of the input as opposed to the <em>input itself</em> (particularly in the case of numeric algorithms).</p>&#... | terminology asymptotics | 1 | Use of Big-O Notation: Size of Input vs Input -- (terminology asymptotics)
<p>It is my understanding that, when one is describing time complexity with $\mathcal{O}$, $\mathcal{\Theta}$, and $\mathcal{\Omega}$, one must be careful to provide expressions with regards to the <em>size</em> of the input as opposed to the <e... | habedi/stack-exchange-dataset |
28,562 | Closed form solution for a single layer linear perceptron | <p>Let f be a one-layer neural network which is linear (ie. no activation function). Let it have $p$ inputs and $q$ outputs. These are fully connected by weights $W$. We have $n$ inputs $x \in \mathbb{R}^d$ and $n$ outputs $y \in \mathbb{R}^{d'}$. We arrange these (column) vectors into matrices $Y$ and $X$, and the wei... | machine learning artificial intelligence neural networks | 1 | Closed form solution for a single layer linear perceptron -- (machine learning artificial intelligence neural networks)
<p>Let f be a one-layer neural network which is linear (ie. no activation function). Let it have $p$ inputs and $q$ outputs. These are fully connected by weights $W$. We have $n$ inputs $x \in \mathbb... | habedi/stack-exchange-dataset |
28,571 | Reduce Set problem to SAT | <p>So the problem is, given some set $M = \{x_1,x_2,\ldots,x_n\}$ and a set of subsets $S = \{S_1, S_2, \ldots, S_m\}$ where $S_i \subseteq M$. We want to find some set $X \subseteq M$ such that $|X| \le k$ and $X \cap S_i \neq \emptyset$ for all $S_i \in S$. </p>

<p>My solution, I would take some set $M = \{x... | complexity theory reductions satisfiability | 1 | Reduce Set problem to SAT -- (complexity theory reductions satisfiability)
<p>So the problem is, given some set $M = \{x_1,x_2,\ldots,x_n\}$ and a set of subsets $S = \{S_1, S_2, \ldots, S_m\}$ where $S_i \subseteq M$. We want to find some set $X \subseteq M$ such that $|X| \le k$ and $X \cap S_i \neq \emptyset$ for al... | habedi/stack-exchange-dataset |
28,576 | What is the asymptotic behaviour of a sum of powers of three? | <p>I'm more concerned with just finding big oh since that can be used to find big omega. I am also told I cannot use limits to find the answer.</p>

<p>I'm given:
$3+9+27+\dots+3^n$. My first assumption is that $3^n = \Theta(3^n)$. The method we're supposed to use goes something like this:</p>

<p>$... | asymptotics | 1 | What is the asymptotic behaviour of a sum of powers of three? -- (asymptotics)
<p>I'm more concerned with just finding big oh since that can be used to find big omega. I am also told I cannot use limits to find the answer.</p>

<p>I'm given:
$3+9+27+\dots+3^n$. My first assumption is that $3^n = \Theta(3^n)... | habedi/stack-exchange-dataset |
28,582 | Which textbook can I use after a high school CS course? | <p>I just finished the AP Computer Science course in high school and since my school does not have any further classes, I was thinking about getting a textbook and continuing my study. APCS goes through Big O, Arrays + ArrayLists, Recursion, Linked Lists, a rough overview of some other data structures and some sorting ... | algorithms reference request books | 1 | Which textbook can I use after a high school CS course? -- (algorithms reference request books)
<p>I just finished the AP Computer Science course in high school and since my school does not have any further classes, I was thinking about getting a textbook and continuing my study. APCS goes through Big O, Arrays + Array... | habedi/stack-exchange-dataset |
28,585 | Understanding Property Testing with a toy example | <p>I am newbie with this property testing and I am trying to understand it with a few examples. I first dealt with a toy example.</p>

<p>I did not understand the first step of the test in the following slide. Why is the first step $S= 2/\epsilon$?</p>

<p><img src="https://i.stack.imgur.com/Y8W3d.jpg" ... | algorithm analysis randomized algorithms | 1 | Understanding Property Testing with a toy example -- (algorithm analysis randomized algorithms)
<p>I am newbie with this property testing and I am trying to understand it with a few examples. I first dealt with a toy example.</p>

<p>I did not understand the first step of the test in the following slide. Why is... | habedi/stack-exchange-dataset |
28,587 | Are all Chomsky-Type3 grammars LL(1)? | <p>Referring to <a href="https://cs.stackexchange.com/questions/2713/are-regular-expressions-lrk">this Question</a>, where an answer is stating that all Type 3 languages are LL(1), I'd like to know if all Type 3 grammars are possibly LL(1).</p>

<p>If not, why is it so? Are there maybe ambiguous grammars in the... | formal languages formal grammars | 1 | Are all Chomsky-Type3 grammars LL(1)? -- (formal languages formal grammars)
<p>Referring to <a href="https://cs.stackexchange.com/questions/2713/are-regular-expressions-lrk">this Question</a>, where an answer is stating that all Type 3 languages are LL(1), I'd like to know if all Type 3 grammars are possibly LL(1).</p>... | habedi/stack-exchange-dataset |
28,588 | Min-max selection sort | <p>Is there already modified version of selection sort that works like this pseudocode:</p>

<pre><code>a // the array, index starts at 1 (not zero-based)
n = len(a)
for x in 1 to n
 big = x 
 small = x
 last = n-x+1
 for y in x+1 to last
 if a[big] < a[y] then big = y
... | algorithms reference request sorting | 1 | Min-max selection sort -- (algorithms reference request sorting)
<p>Is there already modified version of selection sort that works like this pseudocode:</p>

<pre><code>a // the array, index starts at 1 (not zero-based)
n = len(a)
for x in 1 to n
 big = x 
 small = x
 last = n-x+1
 f... | habedi/stack-exchange-dataset |
28,590 | Can I have a "dependent coproduct type"? | <p>I'm reading through <a href="http://homotopytypetheory.org/book/" rel="noreferrer">the HoTT book</a> and I have a (probably very naive) question about the stuff in the chapter one.</p>
<p>The chapter introduces the <strong>function type</strong>
<span class="math-container">$$ f:A\to B $$</span>
and then... | type theory dependent types homotopy type theory | 1 | Can I have a "dependent coproduct type"? -- (type theory dependent types homotopy type theory)
<p>I'm reading through <a href="http://homotopytypetheory.org/book/" rel="noreferrer">the HoTT book</a> and I have a (probably very naive) question about the stuff in the chapter one.</p>
<p>The chapter introduces the <st... | habedi/stack-exchange-dataset |
28,597 | difference between multilayer perceptron and linear regression | <p>What is the difference between multilayer perceptron and linear regression classifier.
I am trying to learn a model with numerical attributes, and predict a numerical value. </p>

<p>Thanks</p>
 | algorithms algorithm analysis data mining | 1 | difference between multilayer perceptron and linear regression -- (algorithms algorithm analysis data mining)
<p>What is the difference between multilayer perceptron and linear regression classifier.
I am trying to learn a model with numerical attributes, and predict a numerical value. </p>

<p>Thanks</p>&... | habedi/stack-exchange-dataset |
28,599 | If Halting problem is decidable, are all RE languages decidable? | <p>Assume the halting problem was decidable.
Is then every recursively enumerable languagerecursive?</p>
 | computability halting problem | 1 | If Halting problem is decidable, are all RE languages decidable? -- (computability halting problem)
<p>Assume the halting problem was decidable.
Is then every recursively enumerable languagerecursive?</p>
 | habedi/stack-exchange-dataset |
28,606 | Computing binomial coefficients and factorials modulo a composite number | <p>Does anyone know of a fast algorithm to compute factorials and/or binomial coefficients in general or modulo a composite number in particular (for composite moduli I am interested in the case where the factorization is not necessarily known) I know that for primes and factorials we can apply Wilson's Theorem but I ... | algorithms combinatorics | 1 | Computing binomial coefficients and factorials modulo a composite number -- (algorithms combinatorics)
<p>Does anyone know of a fast algorithm to compute factorials and/or binomial coefficients in general or modulo a composite number in particular (for composite moduli I am interested in the case where the factorizatio... | habedi/stack-exchange-dataset |
28,609 | Difference between hypervisor and exokernel | <p>An <a href="http://en.wikipedia.org/wiki/Hypervisor" rel="nofollow">hypervisor</a> (1st type) is a software that creates and run virtual machines, managing guest's operative systems's requests to the hardware.<br>
An <a href="http://en.wikipedia.org/wiki/Exokernel" rel="nofollow">exokernel</a> is an operative sy... | terminology operating systems os kernel | 1 | Difference between hypervisor and exokernel -- (terminology operating systems os kernel)
<p>An <a href="http://en.wikipedia.org/wiki/Hypervisor" rel="nofollow">hypervisor</a> (1st type) is a software that creates and run virtual machines, managing guest's operative systems's requests to the hardware.<br>
An <a href... | habedi/stack-exchange-dataset |
28,610 | Non-Approximate Dynamic All-Pairs Shortest Path algorithm for Undirected, Unweighted Graphs? | <p>I am looking for an algorithm involving adding unweighted edges to an empty, undirected graph (with vertices) and then for each, updating the table of shortest paths.</p>

<p>An example is if we have vertices 1 to 5. We can see that initially, all of the paths are infinite except for the diagonal entries, i.... | algorithms graphs shortest path | 1 | Non-Approximate Dynamic All-Pairs Shortest Path algorithm for Undirected, Unweighted Graphs? -- (algorithms graphs shortest path)
<p>I am looking for an algorithm involving adding unweighted edges to an empty, undirected graph (with vertices) and then for each, updating the table of shortest paths.</p>

<p>An e... | habedi/stack-exchange-dataset |
28,611 | Explanation of Tag, Index, and Offset in Direct Mapping Cache | <p>I'm going through an exercise trying to store address references into a direct mapped cache with 128 blocks and a block size of 32 bytes. The address are 20000, 20004, 20008, and 20016 in base 10.</p>

<p>When I start to store them, I realize that the offset is the only value that changes. All of the examp... | computer architecture cpu cache | 1 | Explanation of Tag, Index, and Offset in Direct Mapping Cache -- (computer architecture cpu cache)
<p>I'm going through an exercise trying to store address references into a direct mapped cache with 128 blocks and a block size of 32 bytes. The address are 20000, 20004, 20008, and 20016 in base 10.</p>

<p>When... | habedi/stack-exchange-dataset |
28,616 | Call by need compared to pass by function | <p>SML uses pass‑by‑value, Haskell uses call‑by‑need. Unless I'm wrong (the purpose of this question), one can do call‑by‑need with SML, passing a function instead of a value; a function to be later evaluated when needed.</p>

<p>Adapting a classical example:</p>

<pre><code>(* This will print `0` *)&#x... | functional programming semantics | 1 | Call by need compared to pass by function -- (functional programming semantics)
<p>SML uses pass‑by‑value, Haskell uses call‑by‑need. Unless I'm wrong (the purpose of this question), one can do call‑by‑need with SML, passing a function instead of a value; a function to be later evaluated when needed.</p>

<p>Ad... | habedi/stack-exchange-dataset |
28,631 | Call‑by‑name will succeeds where call‑by‑value may fails: some example cases? | <p>I've landed to SML pages, comparing call‑by‑name and call‑by‑value, asserting the former always succeed while the latter may fails. As this seems counter intuitive to me, I feel at least an example case would be useful.</p>

<p><a href="http://homepages.inf.ed.ac.uk/stg/NOTES/node72.html" rel="nofollow">Call... | programming languages lambda calculus functional programming semantics evaluation strategies | 1 | Call‑by‑name will succeeds where call‑by‑value may fails: some example cases? -- (programming languages lambda calculus functional programming semantics evaluation strategies)
<p>I've landed to SML pages, comparing call‑by‑name and call‑by‑value, asserting the former always succeed while the latter may fails. As this s... | habedi/stack-exchange-dataset |
28,635 | Find an MST in a graph with edge weights from {1,2} | <p>I've been asked the following question:</p>

<blockquote>
 <p>Given a connected undirected graph $G=(V,E)$ and a weight function $w: E \to \{1,2\}$, suggest an <strong>efficient</strong> algorithm that finds an MST of the graph.</p>
</blockquote>

<p>After a few clarifications, the algorithm... | algorithms spanning trees | 1 | Find an MST in a graph with edge weights from {1,2} -- (algorithms spanning trees)
<p>I've been asked the following question:</p>

<blockquote>
 <p>Given a connected undirected graph $G=(V,E)$ and a weight function $w: E \to \{1,2\}$, suggest an <strong>efficient</strong> algorithm that finds an MST of the... | habedi/stack-exchange-dataset |
28,642 | Recovering a point embedding from a graph with edges weighted by point distance | <p>Suppose I give you an undirected graph with weighted edges, and tell you that each node corresponds to a point in 3d space. Whenever there's an edge between two nodes, the weight of the edge is the distance between the points.</p>
<p>Your goal is to reconstruct the relative positions of the points, given only th... | complexity theory graphs computational geometry euclidean distance | 1 | Recovering a point embedding from a graph with edges weighted by point distance -- (complexity theory graphs computational geometry euclidean distance)
<p>Suppose I give you an undirected graph with weighted edges, and tell you that each node corresponds to a point in 3d space. Whenever there's an edge between two node... | habedi/stack-exchange-dataset |
28,648 | Combinatory interpretation of lambda calculus | <p>According to <a href="http://www.mathstat.dal.ca/~selinger/" rel="nofollow">Peter Selinger</a>, <em><a href="http://www.mathstat.dal.ca/~selinger/papers/combinatory.pdf" rel="nofollow">The Lambda Calculus is Algebraic</a></em> (PDF). Early in this article he says:</p>

<blockquote>
 <p>The combinatory i... | terminology lambda calculus combinatory logic | 1 | Combinatory interpretation of lambda calculus -- (terminology lambda calculus combinatory logic)
<p>According to <a href="http://www.mathstat.dal.ca/~selinger/" rel="nofollow">Peter Selinger</a>, <em><a href="http://www.mathstat.dal.ca/~selinger/papers/combinatory.pdf" rel="nofollow">The Lambda Calculus is Algebraic</a... | habedi/stack-exchange-dataset |
28,656 | Calculate winding number | <p>How can one calculate the winding number of a polygon given as
a list of vertices in some (counter-clockwise or clockwise) order?</p>

<p>The complexity of the algorithm must be linear time.</p>
 | algorithms computational geometry | 1 | Calculate winding number -- (algorithms computational geometry)
<p>How can one calculate the winding number of a polygon given as
a list of vertices in some (counter-clockwise or clockwise) order?</p>

<p>The complexity of the algorithm must be linear time.</p>
 | habedi/stack-exchange-dataset |
28,662 | Visualization of Lamport's three-dimensional "space-time diagram" with introduced "tick lines" | <p>In the third page (the third paragraph in the right column) of the paper <a href="http://web.stanford.edu/class/cs240/readings/lamport.pdf">"Time, Clocks, and the Ordering of Events in a Distributed System"</a> by Leslie Lamport, it says that</p>

<blockquote>
 <p>The reader may find it helpful to visua... | distributed systems intuition clocks | 1 | Visualization of Lamport's three-dimensional "space-time diagram" with introduced "tick lines" -- (distributed systems intuition clocks)
<p>In the third page (the third paragraph in the right column) of the paper <a href="http://web.stanford.edu/class/cs240/readings/lamport.pdf">"Time, Clocks, and the Ordering of Event... | habedi/stack-exchange-dataset |
28,671 | Lexicographical position of a string in its type class | <p>I have the following problem:</p>

<p>Given a string $x\in\{1,...,M\}^+$ of length $n$.
Let $S$ be the set of all words with exactly the same numbers of occurences of smybols as in $x$. In fact, $S$ consists of all permutations of $x$. We call this set the type class of $x$.</p>

<p>My question:<... | coding theory encoding scheme word combinatorics | 1 | Lexicographical position of a string in its type class -- (coding theory encoding scheme word combinatorics)
<p>I have the following problem:</p>

<p>Given a string $x\in\{1,...,M\}^+$ of length $n$.
Let $S$ be the set of all words with exactly the same numbers of occurences of smybols as in $x$. In fact, $... | habedi/stack-exchange-dataset |
28,672 | Does #$P$-Completeness imply approximation hardness? | <p>Let $\Pi$ be some counting problem which is known to be <a href="http://en.wikipedia.org/wiki/Sharp-P-complete">#$P$-Complete</a>.</p>

<p>Does it imply that $\Pi$ is <a href="http://en.wikipedia.org/wiki/APX">$APX$-hard</a> (i.e. no <a href="http://en.wikipedia.org/wiki/Polynomial-time_approximation_scheme"... | complexity theory complexity classes approximation counting | 1 | Does #$P$-Completeness imply approximation hardness? -- (complexity theory complexity classes approximation counting)
<p>Let $\Pi$ be some counting problem which is known to be <a href="http://en.wikipedia.org/wiki/Sharp-P-complete">#$P$-Complete</a>.</p>

<p>Does it imply that $\Pi$ is <a href="http://en.wikip... | habedi/stack-exchange-dataset |
28,682 | Meaning of type inference rule for abstraction in lambda-calculus | <p>Below is a snippet about simply typed lambda-calculus from <a href="https://homes.cs.washington.edu/~djg/2011sp/lec9.pdf" rel="nofollow">CS152: Programming Languages Lecture 9 | Simply Typed Lambda Calculus</a>, on printed‑page 15, indexed 23.</p>

<p>$$
\frac {\Gamma, x: \tau_1 \vdash e: \tau_2}{\Gamma ... | lambda calculus semantics typing type inference type checking | 1 | Meaning of type inference rule for abstraction in lambda-calculus -- (lambda calculus semantics typing type inference type checking)
<p>Below is a snippet about simply typed lambda-calculus from <a href="https://homes.cs.washington.edu/~djg/2011sp/lec9.pdf" rel="nofollow">CS152: Programming Languages Lecture 9 | Simply... | habedi/stack-exchange-dataset |
28,688 | Incorporating newline-as-statement-terminator heuristics into context-free languages | <p>Several block structured languages (Scala, Go, Ruby, Julia, Quorum, ...) use semicolons as statement terminators, but allow newlines instead of semicolons under certain circumstances.</p>

<p>My question is: how can I represent Scala-like optional semicolons in a context free grammar? The specific issue is ... | context free programming languages pushdown automata | 1 | Incorporating newline-as-statement-terminator heuristics into context-free languages -- (context free programming languages pushdown automata)
<p>Several block structured languages (Scala, Go, Ruby, Julia, Quorum, ...) use semicolons as statement terminators, but allow newlines instead of semicolons under certain circu... | habedi/stack-exchange-dataset |
28,689 | Does $\#W$[1]-hardness imply approximation hardness? | <p>Let $\Pi$ be a <em>parametrized counting problem</em>, where the parameter is the solution cost, e.g. counting the number of $k$-sized vertex cover in a graph, parametrized by $k$.</p>

<p>Assume that $\Pi$ is <a href="http://web.stanford.edu/~rrwill/presentations/counting-k-paths.pdf" rel="nofollow noreferr... | complexity theory approximation counting parameterized complexity | 1 | Does $\#W$[1]-hardness imply approximation hardness? -- (complexity theory approximation counting parameterized complexity)
<p>Let $\Pi$ be a <em>parametrized counting problem</em>, where the parameter is the solution cost, e.g. counting the number of $k$-sized vertex cover in a graph, parametrized by $k$.</p>

... | habedi/stack-exchange-dataset |
28,695 | What is $Prop$ in the calculus of constructions? | <p>I'm looking at the <a href="http://en.wikipedia.org/wiki/Calculus_of_constructions">Calculus of Constructions</a> and its place in the <a href="http://en.wikipedia.org/wiki/Lambda_cube">Lambda Cube</a>.</p>

<p>If I understand correctly, each axis of the cube can be thought of as adding another operation inv... | terminology lambda calculus type theory dependent types | 1 | What is $Prop$ in the calculus of constructions? -- (terminology lambda calculus type theory dependent types)
<p>I'm looking at the <a href="http://en.wikipedia.org/wiki/Calculus_of_constructions">Calculus of Constructions</a> and its place in the <a href="http://en.wikipedia.org/wiki/Lambda_cube">Lambda Cube</a>.</p>&... | habedi/stack-exchange-dataset |
28,701 | Is path induction constructive? | <p>I'm reading through <a href="http://homotopytypetheory.org/book/">the HoTT book</a> and I have a hard time with path induction.</p>

<p>When I look at the type in the section <strong>1.12.1</strong>:
$$\text{ind}_{=_A}:\prod_{C:\prod\limits_{x,y:A}(x=_Ay)\to \mathcal{U}}
\left(
\left(\prod_{x:A}C... | induction dependent types homotopy type theory | 1 | Is path induction constructive? -- (induction dependent types homotopy type theory)
<p>I'm reading through <a href="http://homotopytypetheory.org/book/">the HoTT book</a> and I have a hard time with path induction.</p>

<p>When I look at the type in the section <strong>1.12.1</strong>:
$$\text{ind}_{=_A}:\p... | habedi/stack-exchange-dataset |
28,702 | Complexity of the decision version of determining a min-cut | <p>I was wondering what the complexity of the following problem is:</p>

<blockquote>
 <p><em>Given:</em> A flow network $N$ with a source $s$, sink $t$ and a number $k$.<br>
 <em>Question:</em> Is there an $s$-$t$ cut of capacity at most $k$?</p>
</blockquote>

<p>Obviously, the problem i... | complexity theory graphs time complexity polynomial time network flow | 1 | Complexity of the decision version of determining a min-cut -- (complexity theory graphs time complexity polynomial time network flow)
<p>I was wondering what the complexity of the following problem is:</p>

<blockquote>
 <p><em>Given:</em> A flow network $N$ with a source $s$, sink $t$ and a number $k$.<b... | habedi/stack-exchange-dataset |
28,709 | Progressive discrete multifunction optimization | <p>I have a set of functions $F$.</p>

<p>The functions effectively take a set $S$ that is always a subset of a global set of all possible values $G$, where $|G|>1000$. <em>(alternatively, they could take a $|G|$tuple of booleans, if that's easier)</em>. The functions return a real result. I want to minimize... | algorithms optimization neural networks genetic algorithms | 1 | Progressive discrete multifunction optimization -- (algorithms optimization neural networks genetic algorithms)
<p>I have a set of functions $F$.</p>

<p>The functions effectively take a set $S$ that is always a subset of a global set of all possible values $G$, where $|G|>1000$. <em>(alternatively, they cou... | habedi/stack-exchange-dataset |
28,719 | Variable Length Encoding of Integers | <p>I was just researching Fibonacci encoding of integers. Numbers are encoded in binary and where no two consecutive bits are equal to 1 - other than to terminate the number.</p>

<p>Now other schemes are possible, for example having three or more 1's terminating the number. These representations are more effic... | algorithms optimization | 1 | Variable Length Encoding of Integers -- (algorithms optimization)
<p>I was just researching Fibonacci encoding of integers. Numbers are encoded in binary and where no two consecutive bits are equal to 1 - other than to terminate the number.</p>

<p>Now other schemes are possible, for example having three or mor... | habedi/stack-exchange-dataset |
28,729 | Unable to understand an inequality in an application of the pumping lemma for context-free languages | <p><strong>The problem</strong></p>

<p>Prove that the language</p>

<p>$\qquad L = \{a^n b^j \mid n = j^2\}$ </p>

<p>is not context free using pumping lemma.</p>

<p><strong>Approach taken by the <a href="http://books.google.co.in/books?id=Cgooanwdo9AC&printsec=frontcover#v=onepage... | formal languages context free pumping lemma | 1 | Unable to understand an inequality in an application of the pumping lemma for context-free languages -- (formal languages context free pumping lemma)
<p><strong>The problem</strong></p>

<p>Prove that the language</p>

<p>$\qquad L = \{a^n b^j \mid n = j^2\}$ </p>

<p>is not context free using p... | habedi/stack-exchange-dataset |
28,734 | Edit distance (Levenshtein-Distance) algorithm explanation | <p>I want to calculate the edit distance (aka <strong><em>Levenshtein-Distance</em></strong>) between two words: «<em>solo</em>» and «<em>oslo</em>».</p>

<p>According to <a href="http://odur.let.rug.nl/kleiweg/lev/" rel="nofollow noreferrer">this site</a> we'll get the result matrix:</p>

<p><img src="... | algorithms dynamic programming strings string metrics edit distance | 1 | Edit distance (Levenshtein-Distance) algorithm explanation -- (algorithms dynamic programming strings string metrics edit distance)
<p>I want to calculate the edit distance (aka <strong><em>Levenshtein-Distance</em></strong>) between two words: «<em>solo</em>» and «<em>oslo</em>».</p>

<p>According to <a href="... | habedi/stack-exchange-dataset |
28,739 | Non Deterministic PDA accepted language not clear | <p>This is a PDA from the lecture slides I'm using:</p>

<p><img src="https://i.imgur.com/gpOYBco.png" alt=""></p>

<p>They say it accepts all words that contain double a's. While it makes some sense it's not full proof. </p>

<p>What prevents the second a to be read in the left branch not the r... | formal languages automata pushdown automata | 1 | Non Deterministic PDA accepted language not clear -- (formal languages automata pushdown automata)
<p>This is a PDA from the lecture slides I'm using:</p>

<p><img src="https://i.imgur.com/gpOYBco.png" alt=""></p>

<p>They say it accepts all words that contain double a's. While it makes some sense it's ... | habedi/stack-exchange-dataset |
28,756 | Conceptual question about entropy and information | <p>Shannon's entropy measures the information content by means of probability. Is it the information content or the information that increases or decreases with entropy? Increase in entropy means that we are more uncertain about what will happen next. </p>

<ol>
<li><p>What I would like to know is if entro... | terminology information theory entropy | 1 | Conceptual question about entropy and information -- (terminology information theory entropy)
<p>Shannon's entropy measures the information content by means of probability. Is it the information content or the information that increases or decreases with entropy? Increase in entropy means that we are more uncertain ab... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.