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 |
|---|---|---|---|---|---|---|
45,122 | Find the central point in a metric-space point set, in less than $O(n^2)$? | <p>I have a set of $n$ points which are defined in a metric space – so I can measure a 'distance' between points but nothing else. I want to find the most central point within this set, which I define as the point with the minimum sum of distances to all other points. The metric computation is slow, so needs to b... | complexity theory computational geometry lower bounds search problem | 1 | Find the central point in a metric-space point set, in less than $O(n^2)$? -- (complexity theory computational geometry lower bounds search problem)
<p>I have a set of $n$ points which are defined in a metric space – so I can measure a 'distance' between points but nothing else. I want to find the most central po... | habedi/stack-exchange-dataset |
45,145 | Why unsafe state not always cause deadlock? | <p>I was reading Operating Systems by Galvin and came across the below line,</p>

<blockquote>
 <p>Not all unsafe states are deadlock, however. An unsafe state may lead
 to deadlock</p>
</blockquote>

<p>Can someone please explain how <em>deadlock != unsafe</em> state ?
I also caught t... | operating systems deadlocks | 1 | Why unsafe state not always cause deadlock? -- (operating systems deadlocks)
<p>I was reading Operating Systems by Galvin and came across the below line,</p>

<blockquote>
 <p>Not all unsafe states are deadlock, however. An unsafe state may lead
 to deadlock</p>
</blockquote>

<p>Can someo... | habedi/stack-exchange-dataset |
45,151 | probablistic procedure to permutate array | <p>input : $array[1...n]$<br>
output: permutated array<br>
Our algorithm should be probablistic and complexity should be $O(n)$. </p>

<p>Could you give me hint ? My weakness is probability theory and it is why I have a problem.</p>
 | probabilistic algorithms permutations | 1 | probablistic procedure to permutate array -- (probabilistic algorithms permutations)
<p>input : $array[1...n]$<br>
output: permutated array<br>
Our algorithm should be probablistic and complexity should be $O(n)$. </p>

<p>Could you give me hint ? My weakness is probability theory and it is why I have ... | habedi/stack-exchange-dataset |
45,157 | Complexity of black box satisfiablty | <p>Say I have a black box $f : 2^n \to 2$ and I want to determine if it is satisfiable. That is, does there exist an input how which it returns true. I am for the purposes of this considering $n$ to be the size of the problem. Perhaps that is a bad assumption to make but it seems a reasonable assumption. </p>

... | complexity theory satisfiability | 1 | Complexity of black box satisfiablty -- (complexity theory satisfiability)
<p>Say I have a black box $f : 2^n \to 2$ and I want to determine if it is satisfiable. That is, does there exist an input how which it returns true. I am for the purposes of this considering $n$ to be the size of the problem. Perhaps that is a ... | habedi/stack-exchange-dataset |
45,158 | Reduction from $L_{nonuniversal}$ to $L_{finite}$ | <p>As I'm currently preparing for my Algorithms and Complexity exam, I was facing today an other reduction and I'm not quite sure if I solved it correctly. </p>

<p>Given are two languages $L_{finite}$ and $L_{nonuniversal}$:</p>

<p>$L_{finite} = \{\langle M \rangle \mid \vert L(M) \vert < \infty \}... | computability turing machines reductions | 1 | Reduction from $L_{nonuniversal}$ to $L_{finite}$ -- (computability turing machines reductions)
<p>As I'm currently preparing for my Algorithms and Complexity exam, I was facing today an other reduction and I'm not quite sure if I solved it correctly. </p>

<p>Given are two languages $L_{finite}$ and $L_{nonuni... | habedi/stack-exchange-dataset |
45,159 | Can someone explain this diagram about Slab Allocation? | <p>I'm trying to understand how Slab Allocation works and why it is different or better than ordinary paging.</p>

<p>I <a href="http://web.cs.wpi.edu/~cs502/emc09/LectureNotes--EMC09/Week%203,%20Malloc%20and%20Slab%20Allocation.ppt" rel="noreferrer">found this diagram</a> which I believe would be helpful if it... | operating systems paging memory allocation | 1 | Can someone explain this diagram about Slab Allocation? -- (operating systems paging memory allocation)
<p>I'm trying to understand how Slab Allocation works and why it is different or better than ordinary paging.</p>

<p>I <a href="http://web.cs.wpi.edu/~cs502/emc09/LectureNotes--EMC09/Week%203,%20Malloc%20and... | habedi/stack-exchange-dataset |
45,168 | find path in directed graph according to word | <p>I have a tricky problem, look:<br>
$n, \le 100, m\le 1000 $ where $m$ is number of edges and $n$ is number of nodes.
On every directed edge there is word $w$ such that $|w| \le 1000$. There is given one word $s$ ($|s|\le 100000$). Our task is asnwer to question:
Is there transition in this graph such th... | graphs | 1 | find path in directed graph according to word -- (graphs)
<p>I have a tricky problem, look:<br>
$n, \le 100, m\le 1000 $ where $m$ is number of edges and $n$ is number of nodes.
On every directed edge there is word $w$ such that $|w| \le 1000$. There is given one word $s$ ($|s|\le 100000$). Our task is asnwer ... | habedi/stack-exchange-dataset |
45,175 | Decidable language: set of context-free langauges containing 1 string | <p>ONE = {(G) : G is a CFG such that L(G) contains exactly one string} .</p>

<p>I know to prove this is decidable I need to create a DTM that would recognize it and HALT on all input. 
I am struggling at coming up with a high level definition.</p>

<p>My Possible Solution:</p>

<p>On input ... | formal languages turing machines context free | 1 | Decidable language: set of context-free langauges containing 1 string -- (formal languages turing machines context free)
<p>ONE = {(G) : G is a CFG such that L(G) contains exactly one string} .</p>

<p>I know to prove this is decidable I need to create a DTM that would recognize it and HALT on all input. 
I... | habedi/stack-exchange-dataset |
45,176 | Simple algorithm for listing all 6-cycles in a directed graph | <p>What's an easy-to-program way of listing all 6-cycles in a directed graph? I've done some reading on the general case of even cycles, but it's rather complicated. I found a really neat approach for 4-cycles, <a href="https://mathoverflow.net/questions/16393/finding-a-cycle-of-fixed-length">in this post</a>, and I wa... | graphs | 1 | Simple algorithm for listing all 6-cycles in a directed graph -- (graphs)
<p>What's an easy-to-program way of listing all 6-cycles in a directed graph? I've done some reading on the general case of even cycles, but it's rather complicated. I found a really neat approach for 4-cycles, <a href="https://mathoverflow.net/q... | habedi/stack-exchange-dataset |
45,178 | What's a side-effect free expression in Timed Automata? | <p>I'm trying to get myself more familiar with Timed Automata theory. At some point I came across the expression "side-effect free" like in the following:</p>

<blockquote>
 <p>A guard is a side-effect free expression that evaluates to a boolean.</p>
</blockquote>

<p>But except for the followi... | automata model checking software verification | 1 | What's a side-effect free expression in Timed Automata? -- (automata model checking software verification)
<p>I'm trying to get myself more familiar with Timed Automata theory. At some point I came across the expression "side-effect free" like in the following:</p>

<blockquote>
 <p>A guard is a side-effec... | habedi/stack-exchange-dataset |
45,184 | Regular expression for words in a language where each letter appears at least once | <p>What is a regular expression or finite automaton that will accept words in the alphabet $\{a,b,c \}$ where each letter appears at least once? </p>

<p>Acceptable words: $ abc, cba, cbcbcba, abbbcaabb$</p>

<p>Unacceptable words: $aab, babababababa, bbbbbaaaaa$</p>

<p>I would be interested i... | regular languages finite automata regular expressions | 1 | Regular expression for words in a language where each letter appears at least once -- (regular languages finite automata regular expressions)
<p>What is a regular expression or finite automaton that will accept words in the alphabet $\{a,b,c \}$ where each letter appears at least once? </p>

<p>Acceptable words... | habedi/stack-exchange-dataset |
45,195 | What is an array of arrays called when all arrays have the same size? | <p>If I have an array <em>a</em> of arrays, in many languages they may have different size. Is there a word for an array of arrays where all the arrays have the same length?</p>

<p>Edit:
An array of arrays may have the following form:</p>

<pre>
[ 
 [ 1, 2, 3 ]
 [ 1, 2, 3, 4 ]
 [... | terminology data structures arrays | 1 | What is an array of arrays called when all arrays have the same size? -- (terminology data structures arrays)
<p>If I have an array <em>a</em> of arrays, in many languages they may have different size. Is there a word for an array of arrays where all the arrays have the same length?</p>

<p>Edit:
An array o... | habedi/stack-exchange-dataset |
45,217 | Creating a list of minimum-distance pairs from two lists | <p>Let's say there are two lists of objects, list1 and list2, and that there is a function that can generate the "distance" between an object in list1 and an object in list2. What I would like to do is create a list of pairs of objects from each list such that the sum of all the distances of each of the pairs is minima... | algorithms lists | 1 | Creating a list of minimum-distance pairs from two lists -- (algorithms lists)
<p>Let's say there are two lists of objects, list1 and list2, and that there is a function that can generate the "distance" between an object in list1 and an object in list2. What I would like to do is create a list of pairs of objects from ... | habedi/stack-exchange-dataset |
45,218 | Compression type that can be searched | <p>Is there <strong>ANY</strong> compression type that can compress a file, and then that compressed file can be searched <strong>without</strong> uncompressing the file?</p>
 | search algorithms strings data compression | 1 | Compression type that can be searched -- (search algorithms strings data compression)
<p>Is there <strong>ANY</strong> compression type that can compress a file, and then that compressed file can be searched <strong>without</strong> uncompressing the file?</p>
 | habedi/stack-exchange-dataset |
45,222 | Collisions in independent hashing | <p>Let $H$ be a $s$-wise independent family of hash functions from $\{1,\ldots,M\}$ to $\{1,\ldots,N\}$. It is easy to bound one collision, but are there good bounds for muliple collision ?</p>
 | computability data structures probability theory hash hash tables | 1 | Collisions in independent hashing -- (computability data structures probability theory hash hash tables)
<p>Let $H$ be a $s$-wise independent family of hash functions from $\{1,\ldots,M\}$ to $\{1,\ldots,N\}$. It is easy to bound one collision, but are there good bounds for muliple collision ?</p>
 | habedi/stack-exchange-dataset |
45,227 | looking for a strongly NP Complete related problem | <p>I'm looking for a problem that is NP-Complete (even) if the number of input values is at most a polylog of the input size. So some or each value in the input should be so large that the number of values is "negligable".</p>

<p>One way to do this is to say that there is only one input value that should be sp... | np complete | 1 | looking for a strongly NP Complete related problem -- (np complete)
<p>I'm looking for a problem that is NP-Complete (even) if the number of input values is at most a polylog of the input size. So some or each value in the input should be so large that the number of values is "negligable".</p>

<p>One way to do... | habedi/stack-exchange-dataset |
45,232 | Difference between "data dependence graph", "data dependency graph", and "data flow graph" | <p>Is there a difference between a "data dependence graph" and a "data dependency graph"? I have seen both terms - sometimes used interchangeably sometimes not. </p>

<p>To make things even more complicated, a "data dependency graph" is sometimes also called a "data flow graph" (see e.g. <a href="http://webdocs... | terminology programming languages data flow analysis | 1 | Difference between "data dependence graph", "data dependency graph", and "data flow graph" -- (terminology programming languages data flow analysis)
<p>Is there a difference between a "data dependence graph" and a "data dependency graph"? I have seen both terms - sometimes used interchangeably sometimes not. </p>
&... | habedi/stack-exchange-dataset |
45,234 | Find the number of values between i & j(given as input) in an unsorted array in O(1) time | <p>Given an unsorted array $A$ of $n$ numbers and inputs $i$ and $j$, can we find the number of values $i<k<j$ in $A$ in O(1) time complexity by doing some preprocessing? An additional requirement is that the preprocessing should be $O(n)$ in both time and space.</p>

<p>I tried calculating an auxiliary a... | algorithms search algorithms arrays | 1 | Find the number of values between i & j(given as input) in an unsorted array in O(1) time -- (algorithms search algorithms arrays)
<p>Given an unsorted array $A$ of $n$ numbers and inputs $i$ and $j$, can we find the number of values $i<k<j$ in $A$ in O(1) time complexity by doing some preprocessing? An additiona... | habedi/stack-exchange-dataset |
45,250 | Uniform random number generation from random bits | <p>I need to generate random number in a given interval using random bits. For example, If I want to generate a random number between 1 to 6, inclusive, I can concatenate three random bits which gives me a possible range of 000 to 111 (0 to 7), inclusive. My intuition says after concatenating 3 random bits, if the resu... | random number generator | 1 | Uniform random number generation from random bits -- (random number generator)
<p>I need to generate random number in a given interval using random bits. For example, If I want to generate a random number between 1 to 6, inclusive, I can concatenate three random bits which gives me a possible range of 000 to 111 (0 to ... | habedi/stack-exchange-dataset |
45,255 | Are there any paradigms that describe how to save program state checkpoints that can be restored later? | <p>I was wondering if there were any paradigms that describe how to save "state checkpoints" in a program so that a user may go back and reopen a program to the given state. </p>

<p>In my situation I see that there are many ways to do it each with their own drawbacks. I wanted to know if there is a way that ha... | programming paradigms | 1 | Are there any paradigms that describe how to save program state checkpoints that can be restored later? -- (programming paradigms)
<p>I was wondering if there were any paradigms that describe how to save "state checkpoints" in a program so that a user may go back and reopen a program to the given state. </p>

<... | habedi/stack-exchange-dataset |
45,256 | Given an analysis of an algorithm, can we get Big-O, Theta, and Omega from this analysis? | <p>If we are given an analysis of an algorithm to be, for example, $5n^3 + 100n^2 + 32n$, can we therefore say that $T(n) = O(n^3)$, and $T(n) = \Theta(n^2)$, and $T(n) = \Omega(n)$, and all of those be correct for that analysis?</p>

<p>I have read the formal definitions for all of these and it does not help m... | algorithm analysis landau notation | 1 | Given an analysis of an algorithm, can we get Big-O, Theta, and Omega from this analysis? -- (algorithm analysis landau notation)
<p>If we are given an analysis of an algorithm to be, for example, $5n^3 + 100n^2 + 32n$, can we therefore say that $T(n) = O(n^3)$, and $T(n) = \Theta(n^2)$, and $T(n) = \Omega(n)$, and all... | habedi/stack-exchange-dataset |
45,258 | Use of Landau notation for determining bounds | <p>Assume that we have $l \leq \frac{u}{v}$ and assume that $u=O(x^2)$ and $v=\Omega(x)$. Can we say that $l=O(x)$?</p>

<p>Thank you.</p>
 | time complexity landau notation | 1 | Use of Landau notation for determining bounds -- (time complexity landau notation)
<p>Assume that we have $l \leq \frac{u}{v}$ and assume that $u=O(x^2)$ and $v=\Omega(x)$. Can we say that $l=O(x)$?</p>

<p>Thank you.</p>
 | habedi/stack-exchange-dataset |
45,265 | How do you determine the number of errors in the Welch-Berlekamp algorithm? | <p>In the Welch-Berlekamp algorithm for decoding Reed-Solomon codes, one is given a list of points $(a_i, b_i)$ representing a message with $e$ errors on the $b_i$ in unknown locations (and $e$ is given to the algorithm). The output is a polynomial passing through all of the given points except those in which errors oc... | algorithms error correcting codes | 1 | How do you determine the number of errors in the Welch-Berlekamp algorithm? -- (algorithms error correcting codes)
<p>In the Welch-Berlekamp algorithm for decoding Reed-Solomon codes, one is given a list of points $(a_i, b_i)$ representing a message with $e$ errors on the $b_i$ in unknown locations (and $e$ is given to... | habedi/stack-exchange-dataset |
45,272 | Greedy algorithm proof | <p>There are <code>2n</code> product and their prices: <code>P={p_1, p_2, ..., p_2n}</code>.
When we buy the products in pairs we get the product with lower price for free.</p>

<p>I'm trying to prove formally that the following algorithm results in optimal solution:</p>

<ol>
<li>Sort P from hi... | greedy algorithms | 1 | Greedy algorithm proof -- (greedy algorithms)
<p>There are <code>2n</code> product and their prices: <code>P={p_1, p_2, ..., p_2n}</code>.
When we buy the products in pairs we get the product with lower price for free.</p>

<p>I'm trying to prove formally that the following algorithm results in optimal solu... | habedi/stack-exchange-dataset |
45,273 | Is there a described algorithm converting _from_ Continuation Passing Style? | <p><strong><a href="https://en.wikipedia.org/wiki/Continuation-passing_style" rel="nofollow noreferrer">Continuation Passing Style</a></strong> (CPS) is a form of code where the control is passed explicitly, by passing the <strong><a href="https://en.wikipedia.org/wiki/Continuation" rel="nofollow noreferrer">continuati... | code generation | 1 | Is there a described algorithm converting _from_ Continuation Passing Style? -- (code generation)
<p><strong><a href="https://en.wikipedia.org/wiki/Continuation-passing_style" rel="nofollow noreferrer">Continuation Passing Style</a></strong> (CPS) is a form of code where the control is passed explicitly, by passing the... | habedi/stack-exchange-dataset |
45,274 | Algorithm Design Manual Question | <p>In the book, Algorithm Design Manual by Steven S. Skiena, he states "Becoming familiar with many different algorithmic graph problems is more important than understanding the details of particular graph algorithms." Unfortunately, I don't quite understand this phrase, as this is my first experience with Algorithm De... | algorithms algorithm analysis graphs | 1 | Algorithm Design Manual Question -- (algorithms algorithm analysis graphs)
<p>In the book, Algorithm Design Manual by Steven S. Skiena, he states "Becoming familiar with many different algorithmic graph problems is more important than understanding the details of particular graph algorithms." Unfortunately, I don't qui... | habedi/stack-exchange-dataset |
45,275 | What is a "geometric rectangle"? | <p>In the [Kushilevitz and Nisan 2006, P.10] they give an exercise which says as following:</p>

<blockquote>
 <p><strong>Exercise 1.18:</strong> Let $X=Y=\{1,\ldots,n\}$. A geometric rectangle is a set of the form $\{(x,y)|x_{\min} \leq x \leq x_{\max}, y_{\min} \leq y \leq y_{\max}\}$, for some values $x... | communication complexity | 1 | What is a "geometric rectangle"? -- (communication complexity)
<p>In the [Kushilevitz and Nisan 2006, P.10] they give an exercise which says as following:</p>

<blockquote>
 <p><strong>Exercise 1.18:</strong> Let $X=Y=\{1,\ldots,n\}$. A geometric rectangle is a set of the form $\{(x,y)|x_{\min} \leq x \leq... | habedi/stack-exchange-dataset |
45,281 | Should activation function be monotonic in neural networks? | <p>A lot of activation functions in neural networks (sigmoid, tanh, softmax) are monotonic, continuous and differentiable (except of may be a couple of points, where derivative does not exist).</p>

<p>I understand the reason for continuity and differentiability, but can not really understand a reason for monot... | machine learning neural networks | 1 | Should activation function be monotonic in neural networks? -- (machine learning neural networks)
<p>A lot of activation functions in neural networks (sigmoid, tanh, softmax) are monotonic, continuous and differentiable (except of may be a couple of points, where derivative does not exist).</p>

<p>I understand... | habedi/stack-exchange-dataset |
45,286 | What's the difference between $a^*+b^*$ and $(a+b)^*$? | <p>What's the difference between the regular expressions $a^*+b^*$ and $(a+b)^*$. Do both of these generate the same language? I was told in a lecture that $(a+b)^*$ will generate string concatenation of $a$ and $b$. How could this be possible?</p>
 | regular languages regular expressions | 1 | What's the difference between $a^*+b^*$ and $(a+b)^*$? -- (regular languages regular expressions)
<p>What's the difference between the regular expressions $a^*+b^*$ and $(a+b)^*$. Do both of these generate the same language? I was told in a lecture that $(a+b)^*$ will generate string concatenation of $a$ and $b$. How c... | habedi/stack-exchange-dataset |
45,291 | Are syntax and semantic just 2 structures such that one is a model of the other? | <ul>
<li>The syntax of a language is a structure. </li>
<li>The semantic of a language is a structure.</li>
<li>The semantic of a language is a model of its syntax.</li>
</ul>

<p>And that's all ? The duality syntax/semantic is just model theory applied to languages ?</p>

<p>(A short an... | programming languages semantics natural language processing syntax | 1 | Are syntax and semantic just 2 structures such that one is a model of the other? -- (programming languages semantics natural language processing syntax)
<ul>
<li>The syntax of a language is a structure. </li>
<li>The semantic of a language is a structure.</li>
<li>The semantic of a language is a model of it... | habedi/stack-exchange-dataset |
45,299 | Clear interrupt instruction in a pipelined CPU | <p>Say you execute a clear interrupt instruction (CLI) in a pipelined CPU. While that instruction is being fetched, an interrupt occurs, so the instruction after the CLI is from the interrupt handler.<br>
You excepted no interrupts because of the CLI instruction but you still got one. How is this problem solved? </... | computer architecture cpu pipelines | 1 | Clear interrupt instruction in a pipelined CPU -- (computer architecture cpu pipelines)
<p>Say you execute a clear interrupt instruction (CLI) in a pipelined CPU. While that instruction is being fetched, an interrupt occurs, so the instruction after the CLI is from the interrupt handler.<br>
You excepted no interru... | habedi/stack-exchange-dataset |
45,304 | Why does taking a gamma value > 1 make the image darker? | <p>If I've understood gamma correction correctly (and I probably haven't), a gamma transform to an image raises the value of the intensity level of the input pixel to the power of gamma, where gamma can be greater than one or less than one.</p>

<p>Pout = (some_constant) x Pin^(gamma)</p>

<p>In every e... | image processing | 1 | Why does taking a gamma value > 1 make the image darker? -- (image processing)
<p>If I've understood gamma correction correctly (and I probably haven't), a gamma transform to an image raises the value of the intensity level of the input pixel to the power of gamma, where gamma can be greater than one or less than one.<... | habedi/stack-exchange-dataset |
45,312 | Name of Bomberman algorithm? | <p>Last couple of days I've been pulling my hair trying to find the name of a 
<em>bomberman-esque</em> algorithm which finds solutions to the question of where to place a single bomb so as to blow all targets up, either directly if all targets are within the blast radius (and axis) of a single bomb (placed in an e... | algorithms | 1 | Name of Bomberman algorithm? -- (algorithms)
<p>Last couple of days I've been pulling my hair trying to find the name of a 
<em>bomberman-esque</em> algorithm which finds solutions to the question of where to place a single bomb so as to blow all targets up, either directly if all targets are within the blast radiu... | habedi/stack-exchange-dataset |
45,317 | Help needed with lesson on recursion | <p>I'm studying CS online, and I'm reading <a href="http://webdocs.cs.ualberta.ca/~holte/T26/rec-pb-solving.html" rel="nofollow">this</a> lecture on recursion, see "3.2. A Mathematical Example".</p>

<p>I understood the beginning and I even made a <a href="https://dotnetfiddle.net/j3fQ9a" rel="nofollow">program... | algorithms recursion divide and conquer | 1 | Help needed with lesson on recursion -- (algorithms recursion divide and conquer)
<p>I'm studying CS online, and I'm reading <a href="http://webdocs.cs.ualberta.ca/~holte/T26/rec-pb-solving.html" rel="nofollow">this</a> lecture on recursion, see "3.2. A Mathematical Example".</p>

<p>I understood the beginning ... | habedi/stack-exchange-dataset |
45,325 | If the list lengths are m and n, why does the merge take O(m+n) operations? | <p>If I have two sorted lists.</p>

<pre><code>list A => 1 -> 2 -> 4 -> 11 -> 31
list B => 2 -> 31 -> 54
</code></pre>

<p>Now what should be the order of (sorted) merge and why?</p>

<p>According to the rule, If the list lengths are m and n, the merge takes $O(m+... | algorithm analysis runtime analysis linked lists | 1 | If the list lengths are m and n, why does the merge take O(m+n) operations? -- (algorithm analysis runtime analysis linked lists)
<p>If I have two sorted lists.</p>

<pre><code>list A => 1 -> 2 -> 4 -> 11 -> 31
list B => 2 -> 31 -> 54
</code></pre>

<p>Now what should be ... | habedi/stack-exchange-dataset |
45,336 | Is the Projection Matrix estimated using least-squares pose specific? | <p>I am calibrating a camera and estimating the projection matrix using the least-squares technique described <a href="http://www.cim.mcgill.ca/~langer/558/19-cameracalibration.pdf" rel="nofollow">here</a>. </p>

<p>So far, I thought that the projection matrix that I got with this method was invariant, e.g., I ... | computer vision | 1 | Is the Projection Matrix estimated using least-squares pose specific? -- (computer vision)
<p>I am calibrating a camera and estimating the projection matrix using the least-squares technique described <a href="http://www.cim.mcgill.ca/~langer/558/19-cameracalibration.pdf" rel="nofollow">here</a>. </p>

<p>So fa... | habedi/stack-exchange-dataset |
45,341 | Please explain linear programming as seen for this load balancing problem | <p>I have at hand a linear program related to load balancing. However I have no idea what this is and wikipedia gives me something too simplified/abstract to be useful.</p>

<p>I wonder if someone can explain the basic lingo used in the formulation of the linear program. The goal of the program is of course to ... | terminology linear programming modelling | 1 | Please explain linear programming as seen for this load balancing problem -- (terminology linear programming modelling)
<p>I have at hand a linear program related to load balancing. However I have no idea what this is and wikipedia gives me something too simplified/abstract to be useful.</p>

<p>I wonder if som... | habedi/stack-exchange-dataset |
45,346 | Why does a color video compress better than a black and white video? | <p>It was asked in an exam why a color video compress better than a black and white (grayscale) video using MPEG but can't find anything explaining it.</p>

<p>In other words, we would apparently get a better compression ratio when compressing color videos than when compressing BW videos.</p>
 | algorithms image processing data compression video | 1 | Why does a color video compress better than a black and white video? -- (algorithms image processing data compression video)
<p>It was asked in an exam why a color video compress better than a black and white (grayscale) video using MPEG but can't find anything explaining it.</p>

<p>In other words, we would ap... | habedi/stack-exchange-dataset |
45,348 | Why does this sort algorithm work? | <p>The following O(n^2) sorting algorithm works but I can't figure out why.</p>

<pre><code>array a // length n, indexed 0 to n-1 

for ( i = 0; i < n; i++)
 for ( j = 0; j < n; j++)
 if(a[i]<=a[j])
 swap(a[i],a[j]);
</code></pre>

<p>It seems it is no... | algorithms sorting correctness proof | 1 | Why does this sort algorithm work? -- (algorithms sorting correctness proof)
<p>The following O(n^2) sorting algorithm works but I can't figure out why.</p>

<pre><code>array a // length n, indexed 0 to n-1 

for ( i = 0; i < n; i++)
 for ( j = 0; j < n; j++)
 if(a[i]<=a[j])
... | habedi/stack-exchange-dataset |
45,357 | Boolean algebraic expression vs Propositional logic expression | <p>There is a lot of similarity between Propositional logic and Boolean algebraic expressions.</p>

<p><strong>Similar aspects :</strong> </p>

<p>1) Both has variables of two states.</p>

<p>2) Operations of Boolean algebra and propositional logic are similar.</p>

<p>3) Simplification ... | boolean algebra propositional logic | 1 | Boolean algebraic expression vs Propositional logic expression -- (boolean algebra propositional logic)
<p>There is a lot of similarity between Propositional logic and Boolean algebraic expressions.</p>

<p><strong>Similar aspects :</strong> </p>

<p>1) Both has variables of two states.</p>

<p>... | habedi/stack-exchange-dataset |
45,367 | Why is the star property important | <p>According to the Bell-Lapadula model, write access is only to Subject $S$ on object $O$ provided if: 
$L(S) \leq L(O)$ where $L$ is the clearance level for $S$ and classification for $O$. This seams counter intuitive. Are there any attacks that this protects against and what other benefits are presented by it?</... | security | 1 | Why is the star property important -- (security)
<p>According to the Bell-Lapadula model, write access is only to Subject $S$ on object $O$ provided if: 
$L(S) \leq L(O)$ where $L$ is the clearance level for $S$ and classification for $O$. This seams counter intuitive. Are there any attacks that this protects again... | habedi/stack-exchange-dataset |
45,372 | Minimum edge deletion partitioning | <p>I'm interested in the time complexity of the following problem: </p>

<p>Given an undirected graph $G=(V,E)$ and a weight function $w: E \rightarrow \mathbb{Z}$ (so weights can be negative, too), color the vertices in such a way that the sum of the weights of the monochromatic edges (i.e. those between same ... | complexity theory time complexity np hard | 1 | Minimum edge deletion partitioning -- (complexity theory time complexity np hard)
<p>I'm interested in the time complexity of the following problem: </p>

<p>Given an undirected graph $G=(V,E)$ and a weight function $w: E \rightarrow \mathbb{Z}$ (so weights can be negative, too), color the vertices in such a wa... | habedi/stack-exchange-dataset |
45,374 | prove that minimal number of comparisons to find median among five elements is 5 | <p>I would like to prove that we need at least five comparisons to find median amoung five numbers.</p>

<p>And my proposition:
Let's consider tree of comparisons. There are at least $5 \cdot {4\choose 2} = 30$ possiblities, so in our tree we have at least $30$ leaves. So what is minimal height of this tre... | selection problem comparison | 1 | prove that minimal number of comparisons to find median among five elements is 5 -- (selection problem comparison)
<p>I would like to prove that we need at least five comparisons to find median amoung five numbers.</p>

<p>And my proposition:
Let's consider tree of comparisons. There are at least $5 \cdot {... | habedi/stack-exchange-dataset |
45,376 | Chomsky NF or Greibach NF benefits for LR parser? | <p>Are there any benefits of having grammar in CNF/GNF for LR parser? I have those in mind:</p>

<ul>
<li>total speed of creating a parser (that is time for creating CNF/GNF out of the grammar, and then creating action table),</li>
<li>the size of action/goto table (in total)</li>
<li>is there any "... | context free formal grammars parsers lr k | 1 | Chomsky NF or Greibach NF benefits for LR parser? -- (context free formal grammars parsers lr k)
<p>Are there any benefits of having grammar in CNF/GNF for LR parser? I have those in mind:</p>

<ul>
<li>total speed of creating a parser (that is time for creating CNF/GNF out of the grammar, and then creating... | habedi/stack-exchange-dataset |
45,383 | Which research languages have a stronger typesystem than Haskell and why? | <p><a href="https://github.com/Gabriel439/post-rfc/blob/master/sotu.md#type-system" rel="noreferrer">Here</a> I read that:</p>

<blockquote>
 <p>Haskell definitely does not have the most advanced type system (not
 even close if you count research languages) but out of all languages
 that are actu... | programming languages type theory | 1 | Which research languages have a stronger typesystem than Haskell and why? -- (programming languages type theory)
<p><a href="https://github.com/Gabriel439/post-rfc/blob/master/sotu.md#type-system" rel="noreferrer">Here</a> I read that:</p>

<blockquote>
 <p>Haskell definitely does not have the most advance... | habedi/stack-exchange-dataset |
45,397 | Intrinsic matrices in stereo camera calibration | <p>Suppose I have two cameras, c1 and c2, observing the same scene. I can now</p>

<ol>
<li>Calibrate each camera independently (e.g., with MATLAB's Camera Calibration App)</li>
<li>Calibrate both cameras simultaneously (e.g., with MATLAB's Stereo Camera Calibration App).</li>
</ol>

<p>Inte... | image processing computer vision | 1 | Intrinsic matrices in stereo camera calibration -- (image processing computer vision)
<p>Suppose I have two cameras, c1 and c2, observing the same scene. I can now</p>

<ol>
<li>Calibrate each camera independently (e.g., with MATLAB's Camera Calibration App)</li>
<li>Calibrate both cameras simultaneousl... | habedi/stack-exchange-dataset |
45,409 | prove sufficient number of comparisons for the merge problem | <p>It is given two subsequences. Their length are following: $2$ and $5$.<br>
I can show that lower bound of comparisons is $5$. My problem is that I can't show that $5$ is sufficient number of comparisons to merge these subsequences.<br>
In order to show lower bound I use tree of comparisons (number of leaves ... | correctness proof comparison | 1 | prove sufficient number of comparisons for the merge problem -- (correctness proof comparison)
<p>It is given two subsequences. Their length are following: $2$ and $5$.<br>
I can show that lower bound of comparisons is $5$. My problem is that I can't show that $5$ is sufficient number of comparisons to merge these ... | habedi/stack-exchange-dataset |
45,410 | Are non-trivial sets formed by set operations on NPC sets still in NPC? | <p>I know that from <a href="https://cs.stackexchange.com/a/24271/20154">this answer</a> to a question on the class NPC, that NPC is not in general closed under intersection and union. However, the answer used languages which form trivial languages under these set operations and trivial languages are of course not NP-... | complexity theory np complete | 1 | Are non-trivial sets formed by set operations on NPC sets still in NPC? -- (complexity theory np complete)
<p>I know that from <a href="https://cs.stackexchange.com/a/24271/20154">this answer</a> to a question on the class NPC, that NPC is not in general closed under intersection and union. However, the answer used la... | habedi/stack-exchange-dataset |
45,417 | If an NP-complete problem is shown to have a non-polynomial lower bound, would that prove that P != NP? | <p>I understand that the Cook-Levin theorem proved that any NP problem is reducible to an NP-complete problem, which signifies that if a polynomial-time algorithm for an NP-complete problem is found, it will mean that all problems in NP can be solved in polynomial time.</p>

<p>My question is: does this proof a... | complexity theory np complete decision problem lower bounds p vs np | 1 | If an NP-complete problem is shown to have a non-polynomial lower bound, would that prove that P != NP? -- (complexity theory np complete decision problem lower bounds p vs np)
<p>I understand that the Cook-Levin theorem proved that any NP problem is reducible to an NP-complete problem, which signifies that if a polyno... | habedi/stack-exchange-dataset |
45,422 | Delivery Algorithm - Find shortest paths | <p>Given -</p>

<ul>
<li>A center(lat=x,lng=y) 'C' from which a delivery boy makes a round
trip. </li>
<li>A delivery boy has a bag which may contain at the most 10
boxes to deliver. </li>
<li>A set of points Di (lat=xi,lng=yi) around 'C'
where the delivery has to be done. D=number of D... | algorithms shortest path greedy algorithms | 1 | Delivery Algorithm - Find shortest paths -- (algorithms shortest path greedy algorithms)
<p>Given -</p>

<ul>
<li>A center(lat=x,lng=y) 'C' from which a delivery boy makes a round
trip. </li>
<li>A delivery boy has a bag which may contain at the most 10
boxes to deliver. </li>
<li>A set of ... | habedi/stack-exchange-dataset |
45,430 | Simplifying an upper O-bound in two variables | <p>I have an algorithm that depends on two input sizes n and m. The complexity breaks down to the following equation:</p>

<p>$\frac{nm - 1}{n-1} = O(?)$</p>

<p>Is Big-O of the Formula $O(mn)$ or $O(m)$ because $n$ cancels out? Thank you in advance!</p>

<p>PS: I know that if $O(m)$ is the uppe... | asymptotics landau notation | 1 | Simplifying an upper O-bound in two variables -- (asymptotics landau notation)
<p>I have an algorithm that depends on two input sizes n and m. The complexity breaks down to the following equation:</p>

<p>$\frac{nm - 1}{n-1} = O(?)$</p>

<p>Is Big-O of the Formula $O(mn)$ or $O(m)$ because $n$ cancels o... | habedi/stack-exchange-dataset |
45,431 | time complexity analysis of recurrence relation | <p>I am not able to solve time complexity analysis of this recurrence relation: T(n)=3T(n/2)+n^2.I want to find time complexity analysis of this recurrence relation without using masters theorem could you please help me to do so.</p>
 | recurrence relation master theorem | 1 | time complexity analysis of recurrence relation -- (recurrence relation master theorem)
<p>I am not able to solve time complexity analysis of this recurrence relation: T(n)=3T(n/2)+n^2.I want to find time complexity analysis of this recurrence relation without using masters theorem could you please help me to do so.</p... | habedi/stack-exchange-dataset |
45,443 | Schedule two trains whose tracks overlap so they don't crash | <p>I've encountered scheduling problems in my algorithms class before like the type we use vertex cover to solve.</p>

<p>Recently I was asked this question and did not even know what algorithmic technique to use to answer it!</p>

<p>There are two trains, which run between stations and share a portion ... | algorithms scheduling algorithm design | 1 | Schedule two trains whose tracks overlap so they don't crash -- (algorithms scheduling algorithm design)
<p>I've encountered scheduling problems in my algorithms class before like the type we use vertex cover to solve.</p>

<p>Recently I was asked this question and did not even know what algorithmic technique t... | habedi/stack-exchange-dataset |
45,447 | Do we want largest or smallest priority in the A* algorithm? | <p>On this site <a href="http://algs4.cs.princeton.edu/25applications/" rel="nofollow">http://algs4.cs.princeton.edu/25applications/</a> is described A* algothihm this way </p>

<blockquote>
 <p>The A* algorithm is a problem-solving process where we put the start
 configuration on the priority queue, ... | algorithms terminology graphs search algorithms shortest path | 1 | Do we want largest or smallest priority in the A* algorithm? -- (algorithms terminology graphs search algorithms shortest path)
<p>On this site <a href="http://algs4.cs.princeton.edu/25applications/" rel="nofollow">http://algs4.cs.princeton.edu/25applications/</a> is described A* algothihm this way </p>

<block... | habedi/stack-exchange-dataset |
45,450 | Have non-regular language classes of infinite words been studied? | <p>For regular languages we have $\omega$-regular languages which extend them to infinite words.</p>

<p>Are there such extensions for CFG's, CSG's and recursively enumerable languages?</p>
 | formal languages context free reference request context sensitive | 1 | Have non-regular language classes of infinite words been studied? -- (formal languages context free reference request context sensitive)
<p>For regular languages we have $\omega$-regular languages which extend them to infinite words.</p>

<p>Are there such extensions for CFG's, CSG's and recursively enumerable ... | habedi/stack-exchange-dataset |
45,455 | How does the operating system set up memory boundaries? | <p>Is there a hardware interrupt that is pre-configured by the OS or something? Try to keep the answer on the scale of a register or so. </p>

<p>Are some special preparatory signals sent across the bridges to the hardware to make boundaries?</p>
 | computer architecture memory management memory access | 1 | How does the operating system set up memory boundaries? -- (computer architecture memory management memory access)
<p>Is there a hardware interrupt that is pre-configured by the OS or something? Try to keep the answer on the scale of a register or so. </p>

<p>Are some special preparatory signals sent across ... | habedi/stack-exchange-dataset |
45,456 | Is determining if there is a prime in an interval known to be in P or NP-complete? | <p>I saw from <a href="https://stackoverflow.com/questions/453793/which-is-the-fastest-algorithm-to-find-prime-numbers?rq=1">this post</a> on stackoverflow that there are some relatively fast algorithms for sieving an interval of numbers to see if there is a prime in that interval. However, does this mean that the ov... | complexity theory np polynomial time primes | 1 | Is determining if there is a prime in an interval known to be in P or NP-complete? -- (complexity theory np polynomial time primes)
<p>I saw from <a href="https://stackoverflow.com/questions/453793/which-is-the-fastest-algorithm-to-find-prime-numbers?rq=1">this post</a> on stackoverflow that there are some relatively f... | habedi/stack-exchange-dataset |
45,460 | How does one generate a list of size N of all possibilities using a dictionary of size D? | <p>Say that we have a list of size $N$ to fill with elements of a dictionary of size $D$. So we would have in total $D^N$ elements/possibilities.</p>

<p>It makes sense to me how to write an algorithm for this when the number of possible slots to fill $N$ is fixed. For example if $N = 2$:</p>

<pre><cod... | algorithms enumeration | 1 | How does one generate a list of size N of all possibilities using a dictionary of size D? -- (algorithms enumeration)
<p>Say that we have a list of size $N$ to fill with elements of a dictionary of size $D$. So we would have in total $D^N$ elements/possibilities.</p>

<p>It makes sense to me how to write an alg... | habedi/stack-exchange-dataset |
45,464 | Bytes and bits conversion? | <p>It is claimed in my textbook that </p>

<blockquote>
 <p>In a 32-bit system, The instruction LDR r4,[r6] lets you address a
 logical space of 4GB.</p>
</blockquote>

<p>I know where the 4GB comes from, It is simply 2^32 / (1024 x 1024 x 1024).</p>

<p>However, My question is why... | computer architecture memory access | 1 | Bytes and bits conversion? -- (computer architecture memory access)
<p>It is claimed in my textbook that </p>

<blockquote>
 <p>In a 32-bit system, The instruction LDR r4,[r6] lets you address a
 logical space of 4GB.</p>
</blockquote>

<p>I know where the 4GB comes from, It is simply 2^32... | habedi/stack-exchange-dataset |
45,466 | Regular expression - every b preceded and followed by an even number of a's | <p>I'm trying to write a regular expression over the alphabet $\{a, b\}$ for the language in which every $b$ is preceded and followed by an even number of $a$'s.</p>

<p>I think the regular expression should include something like $((aa)^*b(aa)^*)^*$ but I don't know how to extend it in order to get to the corr... | formal languages regular languages regular expressions | 1 | Regular expression - every b preceded and followed by an even number of a's -- (formal languages regular languages regular expressions)
<p>I'm trying to write a regular expression over the alphabet $\{a, b\}$ for the language in which every $b$ is preceded and followed by an even number of $a$'s.</p>

<p>I thin... | habedi/stack-exchange-dataset |
45,469 | Consequence of $\mathsf{NP\subseteq BPP}$ to $\mathsf{NP\subseteq ZPP}$? | <p>If $\mathsf{NP\subseteq BPP}$, then we know that $\mathsf{NP\subseteq RP}$ (<a href="http://www.csie.ntu.edu.tw/~lyuu/complexity/2011/20120103s.pdf" rel="nofollow">http://www.csie.ntu.edu.tw/~lyuu/complexity/2011/20120103s.pdf</a>). Does $\mathsf{NP\subseteq BPP}$ also imply $\mathsf{NP\subseteq coRP}$ and hence $\m... | complexity theory complexity classes | 1 | Consequence of $\mathsf{NP\subseteq BPP}$ to $\mathsf{NP\subseteq ZPP}$? -- (complexity theory complexity classes)
<p>If $\mathsf{NP\subseteq BPP}$, then we know that $\mathsf{NP\subseteq RP}$ (<a href="http://www.csie.ntu.edu.tw/~lyuu/complexity/2011/20120103s.pdf" rel="nofollow">http://www.csie.ntu.edu.tw/~lyuu/compl... | habedi/stack-exchange-dataset |
45,478 | Multi object image segmentation methods | <p>I want to survey the state-of-the-art in image segmentation. Is there a paper on how to segment multiple objects in an image? The segmentation papers I read, normally identify one of the many objects in the image. This object is typically in the center of the frame, or most-foreground compared to other objects in th... | reference request image processing computer vision pattern recognition | 1 | Multi object image segmentation methods -- (reference request image processing computer vision pattern recognition)
<p>I want to survey the state-of-the-art in image segmentation. Is there a paper on how to segment multiple objects in an image? The segmentation papers I read, normally identify one of the many objects i... | habedi/stack-exchange-dataset |
45,486 | How can a language whose compiler is written in C ever be faster than C? | <p>Taking a look at <a href="http://julialang.org/" rel="noreferrer">Julia's webpage</a>, you can see some benchmarks of several languages across several algorithms (timings shown below). How can a language with a compiler originally written in C, outperform C code?</p>

<p><a href="https://i.stack.imgur.com/2... | programming languages compilers efficiency | 1 | How can a language whose compiler is written in C ever be faster than C? -- (programming languages compilers efficiency)
<p>Taking a look at <a href="http://julialang.org/" rel="noreferrer">Julia's webpage</a>, you can see some benchmarks of several languages across several algorithms (timings shown below). How can a l... | habedi/stack-exchange-dataset |
45,496 | Algortihm for path existence in a N by N board moving with a chess knight | <p>I have a problem which goes like this.</p>

<p>There is an $N$ x $N$ board in which some squares are maked with $x$. The upper left and lower right corner squares are also marked. You have a chess knight with which you want to go from the upper left to the lower right corner, using only marked squares. Find ... | algorithms shortest path | 1 | Algortihm for path existence in a N by N board moving with a chess knight -- (algorithms shortest path)
<p>I have a problem which goes like this.</p>

<p>There is an $N$ x $N$ board in which some squares are maked with $x$. The upper left and lower right corner squares are also marked. You have a chess knight w... | habedi/stack-exchange-dataset |
45,501 | Using a counting semaphore as a binary semaphore | <p>Are there any methods, so that I can use a <a href="https://en.wikipedia.org/wiki/Semaphore_(programming)" rel="nofollow noreferrer"><em>counting semaphore</em></a> as a <em>binary semaphore</em>?</p>

<p>A binary semaphore should have two possible states: <code>0</code> and <code>1</code>. The operation <c... | operating systems concurrency synchronization | 1 | Using a counting semaphore as a binary semaphore -- (operating systems concurrency synchronization)
<p>Are there any methods, so that I can use a <a href="https://en.wikipedia.org/wiki/Semaphore_(programming)" rel="nofollow noreferrer"><em>counting semaphore</em></a> as a <em>binary semaphore</em>?</p>

<p>A bi... | habedi/stack-exchange-dataset |
45,504 | In fast multiplier circuits, what is the difference between a Counter and a Compressor? | <p>When working on fast parallel multiplier circuit designs, like <a href="https://en.wikipedia.org/wiki/Wallace_tree" rel="nofollow">Wallace tree multipliers</a> or <a href="https://en.wikipedia.org/wiki/Dadda_multiplier" rel="nofollow">Dada tree multipliers</a> I found many papers and books refer to different compone... | arithmetic multiplication digital circuits | 1 | In fast multiplier circuits, what is the difference between a Counter and a Compressor? -- (arithmetic multiplication digital circuits)
<p>When working on fast parallel multiplier circuit designs, like <a href="https://en.wikipedia.org/wiki/Wallace_tree" rel="nofollow">Wallace tree multipliers</a> or <a href="https://e... | habedi/stack-exchange-dataset |
45,525 | Efficient algorithm for 'unsumming' a set of sums | <p>Given a multiset of natural numbers X, consider the set of all possible sums:</p>

<p>$$\textrm{sums}(X)= \left\{ \sum_{i \in A} i \,|\, A \subseteq X \right\}$$</p>

<p>For example, $\textrm{sums}(\left\{1,5\right\}) = \left\{0, 1, 5, 6\right\}$ while $\textrm{sums}(\left\{1,1\right\}) = \left\{0, ... | algorithms optimization combinatorics integers | 1 | Efficient algorithm for 'unsumming' a set of sums -- (algorithms optimization combinatorics integers)
<p>Given a multiset of natural numbers X, consider the set of all possible sums:</p>

<p>$$\textrm{sums}(X)= \left\{ \sum_{i \in A} i \,|\, A \subseteq X \right\}$$</p>

<p>For example, $\textrm{sums}(\... | habedi/stack-exchange-dataset |
45,535 | Is my theorem about $P \neq NP$ correct? | <p>It is known that there are problems in P that, provably, are not
solvable in less than $O(N^k)$, for some $k$. Now consider some infinite
set $K \subseteq \mathbb{R}^+_0$ such as K is unbounded from above (you
can think of $K$ as being $\mathbb{N}$, for easy reasoning).</p>

<p><strong>Theorem:</... | complexity theory np complete p vs np | 1 | Is my theorem about $P \neq NP$ correct? -- (complexity theory np complete p vs np)
<p>It is known that there are problems in P that, provably, are not
solvable in less than $O(N^k)$, for some $k$. Now consider some infinite
set $K \subseteq \mathbb{R}^+_0$ such as K is unbounded from above (you
can think o... | habedi/stack-exchange-dataset |
45,542 | Starvation Condition in CPU/Process Scheduling? | <p>Let's say OS is using preemptive CPU scheduling. A process P1 gets a chance to run for some time and then next higher priority process comes and preempts P1. After that higher priority processes are coming regularly and P1 never gets chance. Is this condition called starvation or not?</p>
 | operating systems process scheduling | 1 | Starvation Condition in CPU/Process Scheduling? -- (operating systems process scheduling)
<p>Let's say OS is using preemptive CPU scheduling. A process P1 gets a chance to run for some time and then next higher priority process comes and preempts P1. After that higher priority processes are coming regularly and P1 neve... | habedi/stack-exchange-dataset |
45,543 | Why precondition strengtening is sound in Hoare logic | <p>I have problem with understanding why precondition strengthening is sound rule in Hoare logic. The rule is:</p>

<p>$$
{P \implies Q, \{Q\} C \{X\} } \over {\{P\} C \{X\}}
$$</p>

<p>I really do not understand why precondition in consequence goes in reverse direction that implication works (m... | logic program correctness imperative programming hoare logic | 1 | Why precondition strengtening is sound in Hoare logic -- (logic program correctness imperative programming hoare logic)
<p>I have problem with understanding why precondition strengthening is sound rule in Hoare logic. The rule is:</p>

<p>$$
{P \implies Q, \{Q\} C \{X\} } \over {\{P\} C \{X\}}
$$</p>&#x... | habedi/stack-exchange-dataset |
45,556 | O(n) time algorithm for maximum earnings | <p>There are $n$ plates $p_1$ to $p_n$ each filled with money of value $a_1$ to $a_n$. You can take the money from one or more plates if the sum of the money in them is divisible by three. I need a $\mathcal{O} (n)$ asymptotic time logarithm for finding the maximum earnings that can be achieved. I have no idea for such... | algorithms optimization | 1 | O(n) time algorithm for maximum earnings -- (algorithms optimization)
<p>There are $n$ plates $p_1$ to $p_n$ each filled with money of value $a_1$ to $a_n$. You can take the money from one or more plates if the sum of the money in them is divisible by three. I need a $\mathcal{O} (n)$ asymptotic time logarithm for find... | habedi/stack-exchange-dataset |
45,559 | Bin packing with twin items | <p>Assume we are given $k$ bins of capacity $b$ and $n$ items with integral sizes $x_1,\dots,x_n$. The bin packing problem is to decide whether there exists an assignment of items to bins such that no bin exceeds its capacity. In this standard from, the bin packing problem is well known to be NP-hard. However, consider... | reductions np hard packing | 1 | Bin packing with twin items -- (reductions np hard packing)
<p>Assume we are given $k$ bins of capacity $b$ and $n$ items with integral sizes $x_1,\dots,x_n$. The bin packing problem is to decide whether there exists an assignment of items to bins such that no bin exceeds its capacity. In this standard from, the bin pa... | habedi/stack-exchange-dataset |
45,569 | Sort deck of cards with least no of moves | <p>We have n cards with each card numbered from 1 to n.</p>

<p>All cards are randomly shuffled but all cards are visible</p>

<p>We are allowed only operation MoveCard(n) which moves the card with value n to the top of the pile.</p>

<p>We need to sort the pile of cards with minimum number of M... | algorithms sorting | 1 | Sort deck of cards with least no of moves -- (algorithms sorting)
<p>We have n cards with each card numbered from 1 to n.</p>

<p>All cards are randomly shuffled but all cards are visible</p>

<p>We are allowed only operation MoveCard(n) which moves the card with value n to the top of the pile.</p>
... | habedi/stack-exchange-dataset |
45,575 | Improve minimum spanning tree with new edge, with better running time than O(|V|)? | <p>The problem gives a MST $T$ and a series of $Q$ queries, each one with a new edge $e = \{u,v\}$ such that no edge between $u$ and $v$ exists in $T$. For every query, we have to improve $T$ with $e$ and print the new weight of $T$.</p>

<p>The best I can do is run a DFS ($O(|V|)$) to find the current path $P$... | algorithms graphs weighted graphs minimum spanning tree | 1 | Improve minimum spanning tree with new edge, with better running time than O(|V|)? -- (algorithms graphs weighted graphs minimum spanning tree)
<p>The problem gives a MST $T$ and a series of $Q$ queries, each one with a new edge $e = \{u,v\}$ such that no edge between $u$ and $v$ exists in $T$. For every query, we have... | habedi/stack-exchange-dataset |
45,578 | Selective Background Updating in Running Gaussian Average Method for Background Subtraction | <p>I am studying the Running Gaussian Average Method for background subtraction. One alternative, as described in <a href="https://en.wikipedia.org/wiki/Background_subtraction" rel="nofollow">Wikipedia</a>, also known as Selective Background Updating, is to only update the distribution of background pixels. </p>
&#... | image processing computer vision modelling | 1 | Selective Background Updating in Running Gaussian Average Method for Background Subtraction -- (image processing computer vision modelling)
<p>I am studying the Running Gaussian Average Method for background subtraction. One alternative, as described in <a href="https://en.wikipedia.org/wiki/Background_subtraction" rel... | habedi/stack-exchange-dataset |
45,582 | While using K-means, how do I represent IP addresses and languages on the coordinate axis? | <p>I'm using K-means for unsupervised learning, using data vectors with an IP address and a language. I need to represent them in an abstract way, so that I can use this algorithm. </p>
 | machine learning | 1 | While using K-means, how do I represent IP addresses and languages on the coordinate axis? -- (machine learning)
<p>I'm using K-means for unsupervised learning, using data vectors with an IP address and a language. I need to represent them in an abstract way, so that I can use this algorithm. </p>
 | habedi/stack-exchange-dataset |
45,583 | Implications of $NP = \Sigma_2 P$ for PH collapse | <p>A simple fact is that $P = NP \to P = coNP$, which follows from the observation that $P$ is closed under complement.</p>

<p>I am having trouble seeing that an analogous statement is true at higher levels of $PH$. For example, is it known that $NP = \Sigma_2 P$ implies $NP = \Pi_2 P$? If so, is there an ea... | complexity theory complexity classes | 1 | Implications of $NP = \Sigma_2 P$ for PH collapse -- (complexity theory complexity classes)
<p>A simple fact is that $P = NP \to P = coNP$, which follows from the observation that $P$ is closed under complement.</p>

<p>I am having trouble seeing that an analogous statement is true at higher levels of $PH$. Fo... | habedi/stack-exchange-dataset |
45,594 | Pumping lemma regular language can't be pumped | <p>Suppose we have a regular language that describes every string with the exact length of 3.That is obviously a regular language and it still can't be pumped because there is no cyclic behavior in that string/ the corresponding dfa</p>

<p>Can you please help me figure out my mistake? </p>
 | regular expressions pumping lemma | 1 | Pumping lemma regular language can't be pumped -- (regular expressions pumping lemma)
<p>Suppose we have a regular language that describes every string with the exact length of 3.That is obviously a regular language and it still can't be pumped because there is no cyclic behavior in that string/ the corresponding dfa</... | habedi/stack-exchange-dataset |
45,596 | Automated optimization of 0-1 matrix vector multiplication | <p><strong>Question:</strong></p>

<p>Is there established procedure or theory for generating code that efficiently applies a matrix-vector multiplication, when the matrix is dense and filled with only zeros and ones? Ideally, the optimized code would make systematic use of previously computed information to re... | linear algebra matrices program optimization | 1 | Automated optimization of 0-1 matrix vector multiplication -- (linear algebra matrices program optimization)
<p><strong>Question:</strong></p>

<p>Is there established procedure or theory for generating code that efficiently applies a matrix-vector multiplication, when the matrix is dense and filled with only z... | habedi/stack-exchange-dataset |
45,606 | Executing an NFA | <p>I am trying to verify that the NFA below does not accept <code>babba</code>. However, when I tried to do it by hand I must have made a mistake:
$$\{q_1\}, \{q_2,q_3\}, \{q_1, q_2, q_3\}, \{q_2, q_3\}, \{q_3\}, \{q_1\} \rightarrow \text{Accept}$$
Where is my error?</p>

<p><a href="https://i.stack.img... | automata finite automata nondeterminism | 1 | Executing an NFA -- (automata finite automata nondeterminism)
<p>I am trying to verify that the NFA below does not accept <code>babba</code>. However, when I tried to do it by hand I must have made a mistake:
$$\{q_1\}, \{q_2,q_3\}, \{q_1, q_2, q_3\}, \{q_2, q_3\}, \{q_3\}, \{q_1\} \rightarrow \text{Accept}$$
W... | habedi/stack-exchange-dataset |
45,613 | Understanding the fundamentals of building an in-Memory Distributed Graph | <p>I am working on a project where I have to build an in-memory distributed graph capturing the relation between similar files(based on some similarity metric) stored in shared file system over multiple nodes in a network.</p>

<p>I know basic graph data structure. I googled to know about distributed graph, but... | graphs data structures reference request distributed systems | 1 | Understanding the fundamentals of building an in-Memory Distributed Graph -- (graphs data structures reference request distributed systems)
<p>I am working on a project where I have to build an in-memory distributed graph capturing the relation between similar files(based on some similarity metric) stored in shared fil... | habedi/stack-exchange-dataset |
45,620 | How to calculate the size of a page in a two level paging CPU? | <p>I am having difficulties with understanding the concept of paging.</p>

<p>As a result I've got no idea how I can solve the following exercise - I'm lacking one more equation to solve it.</p>

<p>I've read a lot about paging and watched a few tutorials, but I still cannot solve paging problems easily... | computer architecture memory management virtual memory paging cpu | 1 | How to calculate the size of a page in a two level paging CPU? -- (computer architecture memory management virtual memory paging cpu)
<p>I am having difficulties with understanding the concept of paging.</p>

<p>As a result I've got no idea how I can solve the following exercise - I'm lacking one more equation ... | habedi/stack-exchange-dataset |
45,635 | Is it allowed to do a binary search with an oracle when proving NP-completeness? | <p>In <a href="https://cs.stackexchange.com/a/45524/28999">https://cs.stackexchange.com/a/45524/28999</a>, they do a binary search using an oracle for an NP-Complete problem. They show that the original problem can be reduced to that NP-Complete problem, implying that the original problem is in NP.</p>

<p>Why ... | np complete reductions oracle machines | 1 | Is it allowed to do a binary search with an oracle when proving NP-completeness? -- (np complete reductions oracle machines)
<p>In <a href="https://cs.stackexchange.com/a/45524/28999">https://cs.stackexchange.com/a/45524/28999</a>, they do a binary search using an oracle for an NP-Complete problem. They show that the o... | habedi/stack-exchange-dataset |
45,640 | Prove that $coRP \subseteq RP^{RP}$ | <p>I've read in an article that $coRP = RP$ is an open question, but that it is obvious that $coRP \subseteq RP^{RP}$.</p>

<p>If $L \in coRP$, I don't understand how access to the oracle helps to build a probabilistic machine that proves $L \in RP^{RP}$.</p>

<p>Any explanation would be appreciated.</p... | complexity theory complexity classes | 1 | Prove that $coRP \subseteq RP^{RP}$ -- (complexity theory complexity classes)
<p>I've read in an article that $coRP = RP$ is an open question, but that it is obvious that $coRP \subseteq RP^{RP}$.</p>

<p>If $L \in coRP$, I don't understand how access to the oracle helps to build a probabilistic machine that pr... | habedi/stack-exchange-dataset |
45,643 | Half-SAT intractability proof | <p>I've been struggling lately with a problem that was in my last complex algorithms exam, and I can't find a solution.
The problem is as follows:</p>
<blockquote>
<p>Half-SAT is a problem where C is a CNF boolean formula with n variables and m clauses, where m is even. We have to determine if there exists ... | reductions satisfiability np | 1 | Half-SAT intractability proof -- (reductions satisfiability np)
<p>I've been struggling lately with a problem that was in my last complex algorithms exam, and I can't find a solution.
The problem is as follows:</p>
<blockquote>
<p>Half-SAT is a problem where C is a CNF boolean formula with n variables and m... | habedi/stack-exchange-dataset |
45,645 | Classification problem where one attribute is a vector | <p>Hello I am a layman trying to analyze game data from League of Legends, specifically looking at predicting the win rate for a given champion given an item build.</p>
<h3>Outline</h3>
<p>A player can own up to 6 items at the end of a game. They could have purchased these items in different orders or adjusted ... | machine learning classification | 1 | Classification problem where one attribute is a vector -- (machine learning classification)
<p>Hello I am a layman trying to analyze game data from League of Legends, specifically looking at predicting the win rate for a given champion given an item build.</p>
<h3>Outline</h3>
<p>A player can own up to 6 items ... | habedi/stack-exchange-dataset |
45,654 | Example of reduction in communication complexity | <p>Let us assume the standard situation in communication complexity with two players $P_1,P_2.$</p>

<p>We have a function $f:[n] \times [n] \mapsto \{0,1\}$ that both players known in advance. They wish to compute $f(x,y)$ given that the first player only knows $y$ and the second player only knows $x.$ The co... | complexity theory communication protocols communication complexity | 1 | Example of reduction in communication complexity -- (complexity theory communication protocols communication complexity)
<p>Let us assume the standard situation in communication complexity with two players $P_1,P_2.$</p>

<p>We have a function $f:[n] \times [n] \mapsto \{0,1\}$ that both players known in advanc... | habedi/stack-exchange-dataset |
45,655 | Arden's lemma applicability on context free grammars | <p>The Arden's lemma states that there exists a solution to the equation between regular expressions
r = sr + t, with r unknown, and it is s*t.</p>

<p>I went through some other topics on the forum and I always saw it being applied, for example, on grammars that have productions like</p>

<p>S->AS|b... | formal languages context free formal grammars regular expressions | 1 | Arden's lemma applicability on context free grammars -- (formal languages context free formal grammars regular expressions)
<p>The Arden's lemma states that there exists a solution to the equation between regular expressions
r = sr + t, with r unknown, and it is s*t.</p>

<p>I went through some other topics... | habedi/stack-exchange-dataset |
45,670 | What's the error in the following proof of the halting problem decidability? | <p>Let's encode every state and tape word (with position of Turing machine on it) with a single integer. Then the transition function can be represented as a total function from integers to themselves. Now let's apply any known algorithm for searching a cycle in the chain of pointers to that function and we've got it!<... | computability halting problem | 1 | What's the error in the following proof of the halting problem decidability? -- (computability halting problem)
<p>Let's encode every state and tape word (with position of Turing machine on it) with a single integer. Then the transition function can be represented as a total function from integers to themselves. Now le... | habedi/stack-exchange-dataset |
45,674 | Edit distance between two strings | <p>If X denotes the length of string s1 and Y denotes the length of the string s2, then the edit distance between s1 and s2 is never more than <br/>
<code>Min(X,Y)</code> or <code>Max(X,Y)</code>? <br/>
Please explain.</p>
 | edit distance | 1 | Edit distance between two strings -- (edit distance)
<p>If X denotes the length of string s1 and Y denotes the length of the string s2, then the edit distance between s1 and s2 is never more than <br/>
<code>Min(X,Y)</code> or <code>Max(X,Y)</code>? <br/>
Please explain.</p>
 | habedi/stack-exchange-dataset |
45,681 | What is language of repeat(L) = {ww | w ∊ L}? | <blockquote>
<p>What is language of repeat(L) = {ww | w ∊ L} ?</p>
</blockquote>
<hr />
<h3>My try:</h3>
<p>I know it {ww | w ∊ (a,b)*} is context sensitive language. Here , what is meant by "repeat(L)" ? Can you explain it ? It is not a homework question.</p>
 | regular languages regular expressions context sensitive | 1 | What is language of repeat(L) = {ww | w ∊ L}? -- (regular languages regular expressions context sensitive)
<blockquote>
<p>What is language of repeat(L) = {ww | w ∊ L} ?</p>
</blockquote>
<hr />
<h3>My try:</h3>
<p>I know it {ww | w ∊ (a,b)*} is context sensitive language. Here , what is meant by &q... | habedi/stack-exchange-dataset |
45,683 | Given two total Turing machines, is it undecidable problem to detect whether they give the same output on all inputs? | <p>See title. And by all inputs I mean providing the functions with the same input and checking whether they give the same output for each case.</p>

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

<p>If it can be reduced to Halting problem, then how?</p>

<p><strong>EDIT 2</strong></p>

<p>@Ariel's answe... | turing machines undecidability | 1 | Given two total Turing machines, is it undecidable problem to detect whether they give the same output on all inputs? -- (turing machines undecidability)
<p>See title. And by all inputs I mean providing the functions with the same input and checking whether they give the same output for each case.</p>

<p><stro... | habedi/stack-exchange-dataset |
45,697 | Equivalence of two context free grammars [for the given example] | <p>I know that in general it is undecidable whether two context free grammars generate the same language, but I have to do this exercise and I am finding myself somewhat stuck:</p>

<p><strong>G1:</strong> </p>

<ul>
<li>S->e|aB|bA</li>
<li>B->bS|aBB</li>
<li>A->aS|bAA</li>
</ul>
&#x... | formal languages context free formal grammars | 1 | Equivalence of two context free grammars [for the given example] -- (formal languages context free formal grammars)
<p>I know that in general it is undecidable whether two context free grammars generate the same language, but I have to do this exercise and I am finding myself somewhat stuck:</p>

<p><strong>G1:... | habedi/stack-exchange-dataset |
45,698 | What's wrong with this LL(1) grammar? | <p>I am trying to build a LL(1) parse table for the following grammar:</p>

<pre class="lang-none prettyprint-override"><code>S -> L
L -> L : L
L -> id R
R -> ( L )
R -> ( )
R -> Epsilon
</code></pre>

<p>There are two problems here. First, the <code>L</code> ru... | context free formal grammars parsers | 1 | What's wrong with this LL(1) grammar? -- (context free formal grammars parsers)
<p>I am trying to build a LL(1) parse table for the following grammar:</p>

<pre class="lang-none prettyprint-override"><code>S -> L
L -> L : L
L -> id R
R -> ( L )
R -> ( )
R -> Epsilon
</c... | habedi/stack-exchange-dataset |
45,700 | What is the difference of temporal dynamics in RNNs and the NEF | <p>Both spiking neural networks created with the Neural Engineering Framework (NEF) and Recurrent Neural Networks (RNNs) can be connected recurrently to exhibit neural dynamics. What is the difference between the set of dynamics that they can approximate and/or exhibit?</p>
 | neural networks | 1 | What is the difference of temporal dynamics in RNNs and the NEF -- (neural networks)
<p>Both spiking neural networks created with the Neural Engineering Framework (NEF) and Recurrent Neural Networks (RNNs) can be connected recurrently to exhibit neural dynamics. What is the difference between the set of dynamics that t... | habedi/stack-exchange-dataset |
45,724 | How to construct a grammar that generates language L? | <p>I'm in a Formal languages class and have a grammar quiz coming up. I'm assuming something like this will appear.</p>

<p>Consider the alphabet $\Sigma$ = {a, b, c}. Construct a grammar that generates the language $L = \{bab^nabc^na^p \mid n ≥ 0, p ≥ 1\}$. Assume that the start variable is $S$.</p>
 | context free formal grammars | 1 | How to construct a grammar that generates language L? -- (context free formal grammars)
<p>I'm in a Formal languages class and have a grammar quiz coming up. I'm assuming something like this will appear.</p>

<p>Consider the alphabet $\Sigma$ = {a, b, c}. Construct a grammar that generates the language $L = \{b... | habedi/stack-exchange-dataset |
45,736 | Prove or disprove that $NL$ is closed under polynomial many-one reductions | <blockquote>
 <p>If $B \in NL$ and there exists a Karp reduction (polynomial-time many-one reduction) from $A$ to $B$, then $A \in NL$.
 <br>Prove that the above claim is correct, incorrect, or equivalent to an open question.</p>
</blockquote>

<p>Trying to solve this, I was pretty sure that the s... | complexity theory time complexity complexity classes space complexity | 1 | Prove or disprove that $NL$ is closed under polynomial many-one reductions -- (complexity theory time complexity complexity classes space complexity)
<blockquote>
 <p>If $B \in NL$ and there exists a Karp reduction (polynomial-time many-one reduction) from $A$ to $B$, then $A \in NL$.
 <br>Prove that the abov... | habedi/stack-exchange-dataset |
45,739 | Search problem when the effects of actions are not deterministic | <p>The standard search problem studied in AI contains:</p>

<ul>
<li>An initial state $A$;</li>
<li>A final (goal) state $Z$;</li>
<li>A set of actions that can change the state; each action takes as input a certain state and returns another state.</li>
<li>A solution to such a problem is a sequ... | reference request search algorithms heuristics | 1 | Search problem when the effects of actions are not deterministic -- (reference request search algorithms heuristics)
<p>The standard search problem studied in AI contains:</p>

<ul>
<li>An initial state $A$;</li>
<li>A final (goal) state $Z$;</li>
<li>A set of actions that can change the state; each... | habedi/stack-exchange-dataset |
45,755 | Difference between regular expression and grammar in automata | <p>I am new to automata, and I have been given a brief introduction to regular expressions only yesterday. I have read the various rules which to define a regular expression. But I am unable to differentiate between regular expressions and grammar of a language( I have not been taught the grammar for regular expression... | automata formal grammars regular expressions | 1 | Difference between regular expression and grammar in automata -- (automata formal grammars regular expressions)
<p>I am new to automata, and I have been given a brief introduction to regular expressions only yesterday. I have read the various rules which to define a regular expression. But I am unable to differentiate ... | habedi/stack-exchange-dataset |
45,760 | How to determine how many dots are in a resource in a resource allocation graph? | <p>I understand most concepts regard a resource allocation graph but I see that some resources have more dots (not sure what they are actually referred to) in them than others such as the example below, R1 and R3 have one dot, R2 has two dots and R4 has three dots. I cannot find anything online that explains this so I ... | resource allocation | 1 | How to determine how many dots are in a resource in a resource allocation graph? -- (resource allocation)
<p>I understand most concepts regard a resource allocation graph but I see that some resources have more dots (not sure what they are actually referred to) in them than others such as the example below, R1 and R3 h... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.