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
26,350
Do RP algorithms exist?
<p>I think I understand the RP complexity class (along with coRP, BPP, and ZPP). However, I can't seem to think of how an RP algorithm might be formulated.</p>&#xA;&#xA;<p>How can the random coin flip possibilities allow for a guaranteed response of NO when the correct answer is NO, yet return with a probabilistic chan...
algorithms randomized algorithms monte carlo
1
Do RP algorithms exist? -- (algorithms randomized algorithms monte carlo) <p>I think I understand the RP complexity class (along with coRP, BPP, and ZPP). However, I can't seem to think of how an RP algorithm might be formulated.</p>&#xA;&#xA;<p>How can the random coin flip possibilities allow for a guaranteed response...
habedi/stack-exchange-dataset
26,361
What is wrong with this seeming contradiction with a paper about AND-compression of SAT?
<p>Got a simple construction seemingly contradicting a paper assuming plausible conjecture. </p>&#xA;&#xA;<p>Since it is unlikely the conjecture to be false, what is wrong with the argument?</p>&#xA;&#xA;<p><a href="http://arxiv.org/abs/1405.4472" rel="nofollow">From a paper</a></p>&#xA;&#xA;<blockquote>&#xA; <p>An A...
logic satisfiability
1
What is wrong with this seeming contradiction with a paper about AND-compression of SAT? -- (logic satisfiability) <p>Got a simple construction seemingly contradicting a paper assuming plausible conjecture. </p>&#xA;&#xA;<p>Since it is unlikely the conjecture to be false, what is wrong with the argument?</p>&#xA;&#xA;...
habedi/stack-exchange-dataset
26,362
Reduction from PARTITION to MAX-CUT
<p>I am trying to prove the NP-Hardness of the <strong>MAX-CUT</strong> problem. Other sources seem to reduce from the <strong>NAE-3SAT</strong> problem, however I have been trying to reduce from <strong>PARTITION</strong> because <strong>PARTITION</strong> and <strong>MAX-CUT</strong> are both in Karp's list of 21 NP-...
complexity theory np complete reductions partition problem max cut
1
Reduction from PARTITION to MAX-CUT -- (complexity theory np complete reductions partition problem max cut) <p>I am trying to prove the NP-Hardness of the <strong>MAX-CUT</strong> problem. Other sources seem to reduce from the <strong>NAE-3SAT</strong> problem, however I have been trying to reduce from <strong>PARTITIO...
habedi/stack-exchange-dataset
26,381
Resolve left-rescursion
<p>Can anybody give me a hint on how to get rid of the left recursion in the following grammar?</p>&#xA;&#xA;<p>$$A \rightarrow B \mid a$$&#xA;$$B \rightarrow b \mid C \mid D \mid E \mid F \mid G$$&#xA;$$C \rightarrow c \mid A d$$&#xA;$$D \rightarrow A e \mid f$$&#xA;$$E \rightarrow g \mid B h$$&#xA;$$F \rightarrow i \...
formal languages context free formal grammars left recursion
1
Resolve left-rescursion -- (formal languages context free formal grammars left recursion) <p>Can anybody give me a hint on how to get rid of the left recursion in the following grammar?</p>&#xA;&#xA;<p>$$A \rightarrow B \mid a$$&#xA;$$B \rightarrow b \mid C \mid D \mid E \mid F \mid G$$&#xA;$$C \rightarrow c \mid A d$$...
habedi/stack-exchange-dataset
26,383
Solving SAT using tableau calculus
<p>I've learned about tableau calculus which is a decision procedure solving the problem of satisfiability of a first order logic formula.&#xA;Now I'm wondering why this technique can't be used to solve the satisfiability problem (SAT)?</p>&#xA;
logic first order logic sat solvers sat
1
Solving SAT using tableau calculus -- (logic first order logic sat solvers sat) <p>I've learned about tableau calculus which is a decision procedure solving the problem of satisfiability of a first order logic formula.&#xA;Now I'm wondering why this technique can't be used to solve the satisfiability problem (SAT)?</p>...
habedi/stack-exchange-dataset
26,400
Join large list of pairs
<p>I have a list of millions of pairs of strings, and I want to join all of the pairs that have matching members into lists without duplicates.</p>&#xA;&#xA;<p>Example input:</p>&#xA;&#xA;<pre><code>[["A", "B"],&#xA; ["A", "D"],&#xA; ["M", "Q"],&#xA; ["A", "F"],&#xA; ["D", "E"],&#xA; ["Q", "Z"]]&#xA;</code></pre>&#xA;&...
algorithms data structures lists
1
Join large list of pairs -- (algorithms data structures lists) <p>I have a list of millions of pairs of strings, and I want to join all of the pairs that have matching members into lists without duplicates.</p>&#xA;&#xA;<p>Example input:</p>&#xA;&#xA;<pre><code>[["A", "B"],&#xA; ["A", "D"],&#xA; ["M", "Q"],&#xA; ["A", ...
habedi/stack-exchange-dataset
26,405
Two functions which can create any computable function by composing?
<p>Do there exist two computable functions, a and b, which can construct every computable function by a finite serie of a's and b's which is function composed? Fx. let's take the serie, <em>a,b,a,b,b,a,a,a</em> , which function composed is the function, a∘b∘a∘b∘b∘a∘a∘a ( =<em>a(b(a(b(b(a(a(a(x))))))))</em> ), this func...
computability turing completeness
1
Two functions which can create any computable function by composing? -- (computability turing completeness) <p>Do there exist two computable functions, a and b, which can construct every computable function by a finite serie of a's and b's which is function composed? Fx. let's take the serie, <em>a,b,a,b,b,a,a,a</em> ,...
habedi/stack-exchange-dataset
26,412
Covering grid with constrained rectangles
<p>I need to place N rects on a 2-dimensional grid with constraints.</p>&#xA;&#xA;<p>For the each rect height/width and placing limitations($x_{min}$-$x_{max}$) are known. </p>&#xA;&#xA;<p>The problem is to place all rects on a grid with no intersections that every rect's bottom left $x$ is in rect's $x_{min}$-$x_{max}...
algorithms computational geometry
1
Covering grid with constrained rectangles -- (algorithms computational geometry) <p>I need to place N rects on a 2-dimensional grid with constraints.</p>&#xA;&#xA;<p>For the each rect height/width and placing limitations($x_{min}$-$x_{max}$) are known. </p>&#xA;&#xA;<p>The problem is to place all rects on a grid with n...
habedi/stack-exchange-dataset
26,417
Greedily Schedule Events based on value/hours
<p>Suppose we are given a list of $n$ events $E = \{E_1, E_2, \ldots, E_n\}$ where each $E_i$ is represented by $(s_i, h_i, v_i)$ or $(start, hours, value)$. So if you attend an <strong>entire</strong> event that lasts 5hrs and has a value of 10 then you will gain 10 points. If you only attend for 3 hours, you only get...
algorithms efficiency greedy algorithms
1
Greedily Schedule Events based on value/hours -- (algorithms efficiency greedy algorithms) <p>Suppose we are given a list of $n$ events $E = \{E_1, E_2, \ldots, E_n\}$ where each $E_i$ is represented by $(s_i, h_i, v_i)$ or $(start, hours, value)$. So if you attend an <strong>entire</strong> event that lasts 5hrs and h...
habedi/stack-exchange-dataset
26,422
does every CFL have an ambiguous CFG?
<p>some questions have been popping up recently on <a href="http://en.wikipedia.org/wiki/Ambiguous_grammar" rel="nofollow noreferrer">ambiguity in CFLs/CFGs</a> which can have subtleties (eg languages vs grammars &amp; ambiguity vs inherent ambiguity). wikipedia states: </p>&#xA;&#xA;<blockquote>&#xA; <p><em>Many</em>...
formal languages formal grammars ambiguity
1
does every CFL have an ambiguous CFG? -- (formal languages formal grammars ambiguity) <p>some questions have been popping up recently on <a href="http://en.wikipedia.org/wiki/Ambiguous_grammar" rel="nofollow noreferrer">ambiguity in CFLs/CFGs</a> which can have subtleties (eg languages vs grammars &amp; ambiguity vs in...
habedi/stack-exchange-dataset
26,435
High Dimensional Data Structures
<p>I have a 20-dimensional dataset, with a large amount of data points. I would like to have each dimension discretized into bins. Per bin, I would like to be able to access two neighbours per dimension (i.e. +1 and -1 per dimension). Basically I want to be able to easily access 2*d (where d is the dimensionality) neig...
data structures big data
1
High Dimensional Data Structures -- (data structures big data) <p>I have a 20-dimensional dataset, with a large amount of data points. I would like to have each dimension discretized into bins. Per bin, I would like to be able to access two neighbours per dimension (i.e. +1 and -1 per dimension). Basically I want to be...
habedi/stack-exchange-dataset
26,438
How to design xml schema for digital circuits?
<p>how can i design XML Schema for logical and digital circuits?</p>&#xA;&#xA;<p>i cant find any help or manual for this work</p>&#xA;&#xA;<p>for example i have a digital circuits with AND OR NOR ,... gates </p>&#xA;&#xA;<p>now i want design xml and schema for that</p>&#xA;&#xA;<p>thanks for help </p>&#xA;&#xA;<p>soryy...
data structures logic circuits
1
How to design xml schema for digital circuits? -- (data structures logic circuits) <p>how can i design XML Schema for logical and digital circuits?</p>&#xA;&#xA;<p>i cant find any help or manual for this work</p>&#xA;&#xA;<p>for example i have a digital circuits with AND OR NOR ,... gates </p>&#xA;&#xA;<p>now i want de...
habedi/stack-exchange-dataset
26,467
Is there a term for a tree where the values of the children add up to a fixed value?
<p>I have a tree with percentages of the following form</p>&#xA;&#xA;<pre><code> 100&#xA; / \&#xA; / \&#xA; / \&#xA; / \&#xA; 25 75&#xA; / \ / | \&#xA; 15 10 35 10 30&#xA; / \ / \&#xA; 1 9 5 5&#xA; / | \&#xA; 3 3 3&#xA;</...
data structures
1
Is there a term for a tree where the values of the children add up to a fixed value? -- (data structures) <p>I have a tree with percentages of the following form</p>&#xA;&#xA;<pre><code> 100&#xA; / \&#xA; / \&#xA; / \&#xA; / \&#xA; 25 75&#xA; / \ / | \&#xA...
habedi/stack-exchange-dataset
26,472
Reducing a system of two boolean algebra assertions to a single one
<p>Given a system of two Boolean Algebra equalities</p>&#xA;&#xA;<pre><code>a = b.&#xA;c = d.&#xA;</code></pre>&#xA;&#xA;<p>one can exhibit a single equation</p>&#xA;&#xA;<pre><code>F(a,b,c,d) = 0.&#xA;</code></pre>&#xA;&#xA;<p>which is equivalent to the former system. (Symmetric difference is pivotal for constructing ...
boolean algebra
1
Reducing a system of two boolean algebra assertions to a single one -- (boolean algebra) <p>Given a system of two Boolean Algebra equalities</p>&#xA;&#xA;<pre><code>a = b.&#xA;c = d.&#xA;</code></pre>&#xA;&#xA;<p>one can exhibit a single equation</p>&#xA;&#xA;<pre><code>F(a,b,c,d) = 0.&#xA;</code></pre>&#xA;&#xA;<p>whi...
habedi/stack-exchange-dataset
26,483
How to store factorials?
<p>Can someone help me to store the factorial of large numbers such as 100! efficiently?</p>&#xA;&#xA;<p>UPDATE: obviously, storing the argument rather than the factorial digits themselves achieves a significant saving. The true challenge is to find a data compression scheme that achieves a significant compression rati...
integers encoding scheme storage
1
How to store factorials? -- (integers encoding scheme storage) <p>Can someone help me to store the factorial of large numbers such as 100! efficiently?</p>&#xA;&#xA;<p>UPDATE: obviously, storing the argument rather than the factorial digits themselves achieves a significant saving. The true challenge is to find a data ...
habedi/stack-exchange-dataset
26,505
Lower complexity bounds without mutation
<p>Lower complexity bounds tend to be a very hard problem in general. Despite this, I was wondering if there are any theoretical results that relate lower complexity bounds for some class of problems in the case where mutation is allowed and in the case it's not allowed? In particular, what type of problems would be in...
algorithms complexity theory functional programming
1
Lower complexity bounds without mutation -- (algorithms complexity theory functional programming) <p>Lower complexity bounds tend to be a very hard problem in general. Despite this, I was wondering if there are any theoretical results that relate lower complexity bounds for some class of problems in the case where muta...
habedi/stack-exchange-dataset
26,508
Name for almost random memory distribution on the heap
<p>If I had a heap like the following: with blue blocks being occupied memory and white blocks being free memory</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/5SREI.png" alt="enter image description here"></p>&#xA;&#xA;<p>What is the general name given to the situation illustrated, where the free and occupied cel...
terminology operating systems virtual memory memory allocation
1
Name for almost random memory distribution on the heap -- (terminology operating systems virtual memory memory allocation) <p>If I had a heap like the following: with blue blocks being occupied memory and white blocks being free memory</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/5SREI.png" alt="enter image desc...
habedi/stack-exchange-dataset
27,507
Graph Theory Handshaking problem
<p>Mr. and Mrs. Smith, a married couple, invited 9 other married couples to a party. (So the party consisted of 10&#xA;couples.) There was a round of handshaking, but no one shook hand with his or her spouse. Afterwards, Mrs.&#xA;Smith asked everyone except herself, “how many persons have you shaken hands with?” All 19...
graphs
1
Graph Theory Handshaking problem -- (graphs) <p>Mr. and Mrs. Smith, a married couple, invited 9 other married couples to a party. (So the party consisted of 10&#xA;couples.) There was a round of handshaking, but no one shook hand with his or her spouse. Afterwards, Mrs.&#xA;Smith asked everyone except herself, “how man...
habedi/stack-exchange-dataset
27,510
Theory of computation introductory curriculum
<p>I want to study theory of computation on my own, so I am looking for books.</p>&#xA;&#xA;<p>What set of books would you recommend for the equivalent of a one-semester course that introduces theory of computation?</p>&#xA;&#xA;<p>Please post answers that describe a complete curriculum, explaining which chapters of ea...
computability automata computation models books
1
Theory of computation introductory curriculum -- (computability automata computation models books) <p>I want to study theory of computation on my own, so I am looking for books.</p>&#xA;&#xA;<p>What set of books would you recommend for the equivalent of a one-semester course that introduces theory of computation?</p>&#...
habedi/stack-exchange-dataset
27,519
Will floating point code return the same arithmetical results on two different computers?
<p>Say I am using boost or the built-in float or double mathematical libraries of my C++ compiler.</p>&#xA;&#xA;<p>I distribute the program.</p>&#xA;&#xA;<p>Will the execution of my C++ program on different machines given different floating point results given that the FPU is CPU specific and AMD may not return exactly...
compilers floating point numerical analysis
1
Will floating point code return the same arithmetical results on two different computers? -- (compilers floating point numerical analysis) <p>Say I am using boost or the built-in float or double mathematical libraries of my C++ compiler.</p>&#xA;&#xA;<p>I distribute the program.</p>&#xA;&#xA;<p>Will the execution of my...
habedi/stack-exchange-dataset
27,521
Shortest path from starting cell to all cells in the grid
<p>I found an algorithm for finding the shortest path on grid between selected cell, to all cells on the grid, with $O(KN)$ where $K$ is the number of neighbor cells and $N$ is the number of cells.</p>&#xA;&#xA;<p>How ever if that's true than it's better than <a href="http://en.wikipedia.org/wiki/A%2a_search_algorithm"...
algorithms search algorithms shortest path square grid
1
Shortest path from starting cell to all cells in the grid -- (algorithms search algorithms shortest path square grid) <p>I found an algorithm for finding the shortest path on grid between selected cell, to all cells on the grid, with $O(KN)$ where $K$ is the number of neighbor cells and $N$ is the number of cells.</p>&...
habedi/stack-exchange-dataset
27,522
Language for teaching basic programming
<p>I'm interesting in teaching programming to middle school students. I'd like a programming language with the following criteria:</p>&#xA;&#xA;<ol>&#xA;<li><em>Simple</em> - pared down to the absolute minimum needed to support sophisticated programming without too much code. As such, for this language, I'm not inter...
programming languages education
1
Language for teaching basic programming -- (programming languages education) <p>I'm interesting in teaching programming to middle school students. I'd like a programming language with the following criteria:</p>&#xA;&#xA;<ol>&#xA;<li><em>Simple</em> - pared down to the absolute minimum needed to support sophisticated ...
habedi/stack-exchange-dataset
27,544
Bayesian Nets & Markov Blanket
<p>As i passed PHD entrance exam, some days ago, i want to find solutions for challenging problem. </p>&#xA;&#xA;<p>In Bayes network on X={X1,...Xn} each random variable has P parents and Q child's. for Xi we want to find minimum number of variable that Xi independent from other variables. at least, how many variable w...
machine learning artificial intelligence information theory hidden markov models bayesian statistics
1
Bayesian Nets & Markov Blanket -- (machine learning artificial intelligence information theory hidden markov models bayesian statistics) <p>As i passed PHD entrance exam, some days ago, i want to find solutions for challenging problem. </p>&#xA;&#xA;<p>In Bayes network on X={X1,...Xn} each random variable has P parents...
habedi/stack-exchange-dataset
27,552
Finding a 4-clique among $k$ node groups
<p>Given a connected graph $G = (V,E)$, assume that there are partitions $\{p_0, p_1, ..., p_k\}$.<br>&#xA;Denote the partition set of a vertex $v \in V$ as $p(v)$.<br>&#xA;The neighborhood of a vertex $v$ is denoted as $N(v)$</p>&#xA;&#xA;<p>I need to find a 4-clique $V' = \{v_0, v_1, v_2, v_3\}$ such that the total d...
algorithms np hard
1
Finding a 4-clique among $k$ node groups -- (algorithms np hard) <p>Given a connected graph $G = (V,E)$, assume that there are partitions $\{p_0, p_1, ..., p_k\}$.<br>&#xA;Denote the partition set of a vertex $v \in V$ as $p(v)$.<br>&#xA;The neighborhood of a vertex $v$ is denoted as $N(v)$</p>&#xA;&#xA;<p>I need to fi...
habedi/stack-exchange-dataset
27,563
What does it mean for a function to be decidable? (homework)
<p><strong>Note:</strong> This is part of a homework exercise. I am asking for clarifications, not a solution!</p>&#xA;&#xA;<p><strong>Given:</strong> Assume $g: \mathbb{N} \mapsto \mathbb{N}, g\in R$ ($R$ is the class of recursive functions) is a strictly monotone function, i.e., $\forall n\in \mathbb{N}: g(n) &lt; g...
terminology computability
1
What does it mean for a function to be decidable? (homework) -- (terminology computability) <p><strong>Note:</strong> This is part of a homework exercise. I am asking for clarifications, not a solution!</p>&#xA;&#xA;<p><strong>Given:</strong> Assume $g: \mathbb{N} \mapsto \mathbb{N}, g\in R$ ($R$ is the class of recurs...
habedi/stack-exchange-dataset
27,564
What is the complexity of depth first traversal that don't label nodes as discovered?
<p>I've found an algorithm that acts like a depth first traversal that don't recognizes nodes that have been visited before.</p>&#xA;&#xA;<pre><code> A&#xA; / \&#xA;B C&#xA; \ /&#xA; D&#xA; |&#xA; E&#xA;</code></pre>&#xA;&#xA;<p>If run on this graph, the algorithm will traverse in this order:</p>&#xA;&#xA;<p><cod...
algorithms algorithm analysis runtime analysis search algorithms graph traversal
1
What is the complexity of depth first traversal that don't label nodes as discovered? -- (algorithms algorithm analysis runtime analysis search algorithms graph traversal) <p>I've found an algorithm that acts like a depth first traversal that don't recognizes nodes that have been visited before.</p>&#xA;&#xA;<pre><code...
habedi/stack-exchange-dataset
27,566
If P != NP, then 3-SAT is not in P
<p>I hope I'm in the right section:</p>&#xA;&#xA;<p>I know that if P = NP, then 3-SAT can be solved in P (Cook), but is the opposite valid, too? If P != NP, then 3-SAT is not in P?</p>&#xA;&#xA;<p>Thanks!</p>&#xA;
complexity theory p vs np 3 sat
1
If P != NP, then 3-SAT is not in P -- (complexity theory p vs np 3 sat) <p>I hope I'm in the right section:</p>&#xA;&#xA;<p>I know that if P = NP, then 3-SAT can be solved in P (Cook), but is the opposite valid, too? If P != NP, then 3-SAT is not in P?</p>&#xA;&#xA;<p>Thanks!</p>&#xA;
habedi/stack-exchange-dataset
27,572
Which one of these two sequences is random, and which one is not?
<p>We let $\alpha = \alpha_1\alpha_2\alpha_3\ldots$ be an infinite random sequence (under the uniform measure) where $\alpha_i$ may be $1$ or $0$, and then define the boolean function $B_k$:</p>&#xA;&#xA;<p>$$&#xA;B_k(\alpha_1\ldots\alpha_k) = &#xA;\begin{cases} &#xA;1 \text{ if at least } \lceil k/2 \rceil \text{ of i...
probability theory randomness
1
Which one of these two sequences is random, and which one is not? -- (probability theory randomness) <p>We let $\alpha = \alpha_1\alpha_2\alpha_3\ldots$ be an infinite random sequence (under the uniform measure) where $\alpha_i$ may be $1$ or $0$, and then define the boolean function $B_k$:</p>&#xA;&#xA;<p>$$&#xA;B_k(\...
habedi/stack-exchange-dataset
27,574
How can I compute the average weight of an undirected graph?
<p>Given a weighted, undirected graph $G = (V,E)$, how can I compute the average weight of edges?<br>&#xA;It seems an easy problem (divide the total weight to the number of edges!)&#xA;but I couldn't manage to find the sum of the edge weights since each&#xA;edge can be counted several times while iterating through the ...
algorithms graphs
1
How can I compute the average weight of an undirected graph? -- (algorithms graphs) <p>Given a weighted, undirected graph $G = (V,E)$, how can I compute the average weight of edges?<br>&#xA;It seems an easy problem (divide the total weight to the number of edges!)&#xA;but I couldn't manage to find the sum of the edge w...
habedi/stack-exchange-dataset
27,578
Can a transcendental number like $e$ or $\pi$ be compressed as not algorithmically random?
<p>The related and interesting fields of <a href="http://en.wikipedia.org/wiki/Information_theory" rel="nofollow">Information Theory</a>, <a href="http://en.wikipedia.org/wiki/Turing_machine" rel="nofollow">Turing Computability</a>, <a href="http://en.wikipedia.org/wiki/Kolmogorov_complexity" rel="nofollow">Kolmogorov ...
turing machines information theory randomness kolmogorov complexity descriptive complexity
1
Can a transcendental number like $e$ or $\pi$ be compressed as not algorithmically random? -- (turing machines information theory randomness kolmogorov complexity descriptive complexity) <p>The related and interesting fields of <a href="http://en.wikipedia.org/wiki/Information_theory" rel="nofollow">Information Theory<...
habedi/stack-exchange-dataset
27,587
Unary in $P$, binary not in $P$
<p>I would like to know if there is a known decision problem with the following characteristics:</p>&#xA;&#xA;<ul>&#xA;<li>Represented in unary, the problem is decidable in polynomial time.</li>&#xA;<li>Represented in binary, the problem is not decidable in polynomial time (and this fact has been proved, not just conje...
complexity theory polynomial time
1
Unary in $P$, binary not in $P$ -- (complexity theory polynomial time) <p>I would like to know if there is a known decision problem with the following characteristics:</p>&#xA;&#xA;<ul>&#xA;<li>Represented in unary, the problem is decidable in polynomial time.</li>&#xA;<li>Represented in binary, the problem is not deci...
habedi/stack-exchange-dataset
27,625
Why do low fitness individuals have a chance to survive to the next generation?
<p>I am currently reading and watching about genetic algorithm and I find it very interesting (I haven't had the chance to study it while I was at the university).</p>&#xA;&#xA;<p>I understand that mutations are based on probability (randomness is the root of evolution) but I don't get why survival is.</p>&#xA;&#xA;<p>...
algorithms optimization genetic algorithms
1
Why do low fitness individuals have a chance to survive to the next generation? -- (algorithms optimization genetic algorithms) <p>I am currently reading and watching about genetic algorithm and I find it very interesting (I haven't had the chance to study it while I was at the university).</p>&#xA;&#xA;<p>I understand...
habedi/stack-exchange-dataset
27,627
Algorithm: Dimension increase in 1D representation of Square Matrix
<p>Consider the matrix with dimension $m \times m$: </p>&#xA;&#xA;<p>$$&#xA;M =&#xA;\begin{array}{cc}&#xA;1 &amp; 1 &amp; 1 \\&#xA;0 &amp; 1 &amp; 1 \\&#xA;1 &amp; 0 &amp; 1 \\&#xA;\end{array}&#xA;$$</p>&#xA;&#xA;<p>Its 1-D representation:&#xA;$$ M^* = \begin{array}{cc} 1 &amp; 1 &amp; 1 &amp;&amp; 0 &amp; 1 &amp; 1 &a...
algorithms matrices
1
Algorithm: Dimension increase in 1D representation of Square Matrix -- (algorithms matrices) <p>Consider the matrix with dimension $m \times m$: </p>&#xA;&#xA;<p>$$&#xA;M =&#xA;\begin{array}{cc}&#xA;1 &amp; 1 &amp; 1 \\&#xA;0 &amp; 1 &amp; 1 \\&#xA;1 &amp; 0 &amp; 1 \\&#xA;\end{array}&#xA;$$</p>&#xA;&#xA;<p>Its 1-D rep...
habedi/stack-exchange-dataset
27,633
Selecting a M.S. in CS focus
<p>I need to pick a focus in my Masters program.<br>&#xA;The running candidates are </p>&#xA;&#xA;<ul>&#xA;<li>Networking </li>&#xA;<li>Bioinformatics</li>&#xA;<li>Data mining</li>&#xA;<li>Computer Image Recognition</li>&#xA;</ul>&#xA;&#xA;<p><strong>In order to avoid this becoming a discussion</strong>, I'd be inte...
computer networks image processing data mining bioinformatics
1
Selecting a M.S. in CS focus -- (computer networks image processing data mining bioinformatics) <p>I need to pick a focus in my Masters program.<br>&#xA;The running candidates are </p>&#xA;&#xA;<ul>&#xA;<li>Networking </li>&#xA;<li>Bioinformatics</li>&#xA;<li>Data mining</li>&#xA;<li>Computer Image Recognition</li>&...
habedi/stack-exchange-dataset
27,656
Why Do Computers Use the Binary Number System (0,1)?
<p>Why Do Computers Use the Binary Number System (0,1)? Why don't they use Ternary Number System (0,1,2) or any other number system instead?</p>&#xA;
computer architecture binary arithmetic
1
Why Do Computers Use the Binary Number System (0,1)? -- (computer architecture binary arithmetic) <p>Why Do Computers Use the Binary Number System (0,1)? Why don't they use Ternary Number System (0,1,2) or any other number system instead?</p>&#xA;
habedi/stack-exchange-dataset
27,657
Why do Computers use Hex Number System at assembly language?
<p>Why do computer use Hex Number System at assembly language? Why don't they use any other number system like binary, octal, decimal? What thing forced computer designer to use hex system at assembly? Why it looked so beneficial to them? </p>&#xA;
time complexity computer architecture mathematical analysis memory hardware computer algebra
1
Why do Computers use Hex Number System at assembly language? -- (time complexity computer architecture mathematical analysis memory hardware computer algebra) <p>Why do computer use Hex Number System at assembly language? Why don't they use any other number system like binary, octal, decimal? What thing forced computer...
habedi/stack-exchange-dataset
27,671
Partial Range Query on Inverted File with Combined Index
<p>I am currently reading <a href="http://rads.stackoverflow.com/amzn/click/0123694469" rel="nofollow">Multidimensional and Metric Data Structures</a> by Hanan Samet for fun. The combined index is discussed on page 5-6. I do understand it in the sense that the inverted file itself is an index, and then we extrapolate a...
data structures combinatorics databases structured data
1
Partial Range Query on Inverted File with Combined Index -- (data structures combinatorics databases structured data) <p>I am currently reading <a href="http://rads.stackoverflow.com/amzn/click/0123694469" rel="nofollow">Multidimensional and Metric Data Structures</a> by Hanan Samet for fun. The combined index is discu...
habedi/stack-exchange-dataset
27,677
Can every DCFG be converted to DGNF?
<p>I know you can convert every context-free grammar into Greibach normal form grammar.</p>&#xA;&#xA;<p>But can I convert every deterministic context-free grammar into deterministic Greibach normal form grammar?</p>&#xA;
context free formal grammars normal forms
1
Can every DCFG be converted to DGNF? -- (context free formal grammars normal forms) <p>I know you can convert every context-free grammar into Greibach normal form grammar.</p>&#xA;&#xA;<p>But can I convert every deterministic context-free grammar into deterministic Greibach normal form grammar?</p>&#xA;
habedi/stack-exchange-dataset
27,683
CFL, pumping lemma
<p>I have difficulty with proving that the language &#xA;$ L = \{ a^p b^q | p \ge 1 , q \ge 1 , p \ge q^2 \vee q \ge p^2\}$</p>&#xA;&#xA;<p>$ w = uvxyz $</p>&#xA;&#xA;<p>I've chosen word $ w = a^{N^2} b^N $ where $ N $ is a constant from pumping lemma and I proved cases where a $ v,y $ is entirely in $ a $ and $ v,y $...
formal languages context free pumping lemma
1
CFL, pumping lemma -- (formal languages context free pumping lemma) <p>I have difficulty with proving that the language &#xA;$ L = \{ a^p b^q | p \ge 1 , q \ge 1 , p \ge q^2 \vee q \ge p^2\}$</p>&#xA;&#xA;<p>$ w = uvxyz $</p>&#xA;&#xA;<p>I've chosen word $ w = a^{N^2} b^N $ where $ N $ is a constant from pumping lemma...
habedi/stack-exchange-dataset
27,685
Can someone explain LazySelect?
<p>The LazySelect algorithm is given in <a href="http://people.cs.umass.edu/~mcgregor/711S09/lec04.pdf" rel="nofollow">these slides</a> as follows.</p>&#xA;&#xA;<p>We have a set $S$ of $n = 2k$ distinct numbers and want to find the $k$th smallest element.</p>&#xA;&#xA;<ol>&#xA;<li>Let $R$ be a set of $n^{3/4}$ elements...
algorithms randomized algorithms randomness
1
Can someone explain LazySelect? -- (algorithms randomized algorithms randomness) <p>The LazySelect algorithm is given in <a href="http://people.cs.umass.edu/~mcgregor/711S09/lec04.pdf" rel="nofollow">these slides</a> as follows.</p>&#xA;&#xA;<p>We have a set $S$ of $n = 2k$ distinct numbers and want to find the $k$th s...
habedi/stack-exchange-dataset
27,688
Explanation of the complexity of a loop
<p>I am confused on the following:<br>&#xA;In the following trivial code: </p>&#xA;&#xA;<pre><code>for (int i = 0; i &lt; n; i++) { &#xA; for(int j = i + 1; j &lt; n; j++) { &#xA; for(int k = j + 1; k &lt; n; k++) { &#xA; //some code here &#xA; } &#xA; } &#xA;} &#xA;</code></pre>&#xA;&#xA;<p...
algorithms complexity theory algorithm analysis loops
1
Explanation of the complexity of a loop -- (algorithms complexity theory algorithm analysis loops) <p>I am confused on the following:<br>&#xA;In the following trivial code: </p>&#xA;&#xA;<pre><code>for (int i = 0; i &lt; n; i++) { &#xA; for(int j = i + 1; j &lt; n; j++) { &#xA; for(int k = j + 1; k &lt; n; k++)...
habedi/stack-exchange-dataset
27,703
What do complexity classes look like, if we use Turing reductions?
<p>For reasoning about things like NP-completeness, we typically use many-one reductions (i.e., Karp reductions). This leads to pictures like this:</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/nEx1X.png" width="255" height="245"></p>&#xA;&#xA;<p>(under standard conjectures). I'm sure we're all familiar with th...
complexity theory reductions complexity classes
1
What do complexity classes look like, if we use Turing reductions? -- (complexity theory reductions complexity classes) <p>For reasoning about things like NP-completeness, we typically use many-one reductions (i.e., Karp reductions). This leads to pictures like this:</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com...
habedi/stack-exchange-dataset
27,705
Solve recurrence relations
<blockquote>&#xA; <p><strong>A)</strong> Solve this recurrence where $T(0)=0$ and write it in O-notation:&#xA; $T(n)= {2 \over n} (T(0)+T(1)+...+T(n-1))+c$</p>&#xA;</blockquote>&#xA;&#xA;<p>So, I started to calculate: </p>&#xA;&#xA;<blockquote>&#xA; <p>$T(1)=2(0)+c=c$ </p>&#xA; &#xA; <p>$T(2)=1(0+c)+c=2c$</p>&#xA;...
recurrence relation check my answer
1
Solve recurrence relations -- (recurrence relation check my answer) <blockquote>&#xA; <p><strong>A)</strong> Solve this recurrence where $T(0)=0$ and write it in O-notation:&#xA; $T(n)= {2 \over n} (T(0)+T(1)+...+T(n-1))+c$</p>&#xA;</blockquote>&#xA;&#xA;<p>So, I started to calculate: </p>&#xA;&#xA;<blockquote>&#xA; ...
habedi/stack-exchange-dataset
27,707
What does "non-pathological data" mean?
<p>I took an algorithms class on Coursera. The professor in the video about hash tables said that </p>&#xA;&#xA;<blockquote>&#xA; <p>What's true is that for non-pathological data, you will get constant time operations in a properly implemented hash table.</p>&#xA;</blockquote>&#xA;&#xA;<p>What does "non-pathological d...
hash tables
1
What does "non-pathological data" mean? -- (hash tables) <p>I took an algorithms class on Coursera. The professor in the video about hash tables said that </p>&#xA;&#xA;<blockquote>&#xA; <p>What's true is that for non-pathological data, you will get constant time operations in a properly implemented hash table.</p>&#x...
habedi/stack-exchange-dataset
27,708
Why can't configuration counting decide undecideable problems?
<p>I know it might sound like a silly question, I just can't get my head around it... </p>&#xA;&#xA;<p>I just read that $DSPACE(f(n))\subseteq DTIME(n\cdot 2^{O(f(n))})$.<br>&#xA;The proof for it relies heavily on the fact that for a given $L\in DSPACE(f(n))$, the turing machine $M_L$ (which decides $L$ while consumin...
undecidability
1
Why can't configuration counting decide undecideable problems? -- (undecidability) <p>I know it might sound like a silly question, I just can't get my head around it... </p>&#xA;&#xA;<p>I just read that $DSPACE(f(n))\subseteq DTIME(n\cdot 2^{O(f(n))})$.<br>&#xA;The proof for it relies heavily on the fact that for a gi...
habedi/stack-exchange-dataset
27,731
Implement "from" function for AVL Tree java
<p>I posted this same question on stackoverflow but I think it might be better suited here as I am having trouble with coming up with an algorithm with O(log(n)) running time.</p>&#xA;&#xA;<p>Question:</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/8Ropb.png" alt="enter image description here"></p>&#xA;&#xA;<p>I a...
algorithms search algorithms search trees
1
Implement "from" function for AVL Tree java -- (algorithms search algorithms search trees) <p>I posted this same question on stackoverflow but I think it might be better suited here as I am having trouble with coming up with an algorithm with O(log(n)) running time.</p>&#xA;&#xA;<p>Question:</p>&#xA;&#xA;<p><img src="h...
habedi/stack-exchange-dataset
27,737
Grammar for a language with 1/3 of a's
<p>I have this language:&#xA;$$ L = \left\{ w \in \{a,b,c\}^* \;\big|\; |w| / |w|_a = 3 \right\} $$&#xA;where $|w|_a$ is the number of occurrences of $a$.</p>&#xA;&#xA;<p>How can I find a grammar that generates it?</p>&#xA;
formal languages context free formal grammars
1
Grammar for a language with 1/3 of a's -- (formal languages context free formal grammars) <p>I have this language:&#xA;$$ L = \left\{ w \in \{a,b,c\}^* \;\big|\; |w| / |w|_a = 3 \right\} $$&#xA;where $|w|_a$ is the number of occurrences of $a$.</p>&#xA;&#xA;<p>How can I find a grammar that generates it?</p>&#xA;
habedi/stack-exchange-dataset
27,742
Deadlock prevention by killing a victim
<p>In our operating systems class, the teacher told us about deadlocks prevention methods. One of them is that to select as a victim the process which requires the CPU time or one that requires a lot of resources, and remove this process. The next time the algorithm is called, it may be possible that again the same pro...
concurrency deadlocks
1
Deadlock prevention by killing a victim -- (concurrency deadlocks) <p>In our operating systems class, the teacher told us about deadlocks prevention methods. One of them is that to select as a victim the process which requires the CPU time or one that requires a lot of resources, and remove this process. The next time ...
habedi/stack-exchange-dataset
27,765
Intersection and partial quantity decidability
<p>I'm still insecure in the section decidability (no proof needed, I want to divine it):</p>&#xA;&#xA;<p>X is decidable and Y is undecidable. Is the intersection of X and Y decidable or undecidable?</p>&#xA;&#xA;<p>X is decidable and Y is a partial quantity of X. Is Y decidable, too or not?</p>&#xA;&#xA;<p>Thanks!</p>...
complexity theory turing machines undecidability
1
Intersection and partial quantity decidability -- (complexity theory turing machines undecidability) <p>I'm still insecure in the section decidability (no proof needed, I want to divine it):</p>&#xA;&#xA;<p>X is decidable and Y is undecidable. Is the intersection of X and Y decidable or undecidable?</p>&#xA;&#xA;<p>X i...
habedi/stack-exchange-dataset
27,776
Longest Repeated (Scattered) Subsequence in a String
<p><strong>Informal Problem Statement:</strong></p>&#xA;&#xA;<p>Given a string, e.g. $ACCABBAB$, we want to colour some letters red and some letters blue (and some not at all), such that reading only the red letters from left to right yields the same result as reading only the blue letters.</p>&#xA;&#xA;<p>In the examp...
algorithms complexity theory np complete strings subsequences
1
Longest Repeated (Scattered) Subsequence in a String -- (algorithms complexity theory np complete strings subsequences) <p><strong>Informal Problem Statement:</strong></p>&#xA;&#xA;<p>Given a string, e.g. $ACCABBAB$, we want to colour some letters red and some letters blue (and some not at all), such that reading only ...
habedi/stack-exchange-dataset
27,777
What's the value of this game (rebalancing counters)?
<p>Suppose you have the following game:</p>&#xA;&#xA;<p>There are infinitely many counters $\{c_1,c_2,\ldots\}$, all initialized to 0.</p>&#xA;&#xA;<p>In each step, you may choose a counter $c_i$ and increase it's value by 1.</p>&#xA;&#xA;<p>Unfortunately, every $T$ steps, each counter that has a positive value is decr...
algorithms counting computer games
1
What's the value of this game (rebalancing counters)? -- (algorithms counting computer games) <p>Suppose you have the following game:</p>&#xA;&#xA;<p>There are infinitely many counters $\{c_1,c_2,\ldots\}$, all initialized to 0.</p>&#xA;&#xA;<p>In each step, you may choose a counter $c_i$ and increase it's value by 1.<...
habedi/stack-exchange-dataset
27,787
Matching training with Neural Network
<p>I have a matching algorithm that is based on making an comparison score. This score is divided into parts.&#xA;Example:</p>&#xA;&#xA;<p>5 - Points for attributes (lets say they have 3 common attributes, would the score be ((3/5)*5) = 3 Points</p>&#xA;&#xA;<p>5 - Points for location</p>&#xA;&#xA;<p>10 - Points for co...
artificial intelligence neural networks
1
Matching training with Neural Network -- (artificial intelligence neural networks) <p>I have a matching algorithm that is based on making an comparison score. This score is divided into parts.&#xA;Example:</p>&#xA;&#xA;<p>5 - Points for attributes (lets say they have 3 common attributes, would the score be ((3/5)*5) = ...
habedi/stack-exchange-dataset
27,801
What is the fastest way to a Publish/Subscribe pattern?
<p>I am running in a conceptual problem in my development which I previously also encountered in the Drupal CMS and was wondering what would be the best solution to circumvent the problem.</p>&#xA;&#xA;<p><a href="http://drupal.org/" rel="nofollow">Drupal</a>, and my own <a href="http://snapwebsites.org/" rel="nofollow...
concurrency software engineering threads
1
What is the fastest way to a Publish/Subscribe pattern? -- (concurrency software engineering threads) <p>I am running in a conceptual problem in my development which I previously also encountered in the Drupal CMS and was wondering what would be the best solution to circumvent the problem.</p>&#xA;&#xA;<p><a href="http...
habedi/stack-exchange-dataset
27,808
Haskell monad bind operator type
<p>In Haskell, the Monads type class has the bind operator, which is represented by the symbol <code>&gt;&gt;=</code></p>&#xA;&#xA;<p>The type of such operator is:</p>&#xA;&#xA;<pre><code>(&gt;&gt;=) :: Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b&#xA;</code></pre>&#xA;&#xA;<p>Why does the function need to be <code>...
functional programming
1
Haskell monad bind operator type -- (functional programming) <p>In Haskell, the Monads type class has the bind operator, which is represented by the symbol <code>&gt;&gt;=</code></p>&#xA;&#xA;<p>The type of such operator is:</p>&#xA;&#xA;<pre><code>(&gt;&gt;=) :: Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b&#xA;</co...
habedi/stack-exchange-dataset
27,812
Complexity of edit distance with block operations
<p>Consider the following problem. I have a pattern $P$ of length $100$ and a text $T$ of length $n$. I want to find the minimum number of operations to transform $P$ into $T$. The operations are:</p>&#xA;&#xA;<ul>&#xA;<li>Insert a single character into $P$</li>&#xA;<li>Delete a single character from $P$</li>&#xA;<li>...
complexity theory time complexity strings string metrics
1
Complexity of edit distance with block operations -- (complexity theory time complexity strings string metrics) <p>Consider the following problem. I have a pattern $P$ of length $100$ and a text $T$ of length $n$. I want to find the minimum number of operations to transform $P$ into $T$. The operations are:</p>&#xA;&#...
habedi/stack-exchange-dataset
27,822
Finding number not in list with wildcards
<p>I have a list like this:</p>&#xA;&#xA;<pre><code>1*0*0&#xA;1**0*&#xA;0*0**&#xA;001**&#xA;</code></pre>&#xA;&#xA;<p>Where the number of elements in each row is $n$ and * is a wildcard for 0 or 1. I need a polynomial-time algorithm that can determine if there exists an $n$-bit number that does not equal any of the row...
algorithms polynomial time lists
1
Finding number not in list with wildcards -- (algorithms polynomial time lists) <p>I have a list like this:</p>&#xA;&#xA;<pre><code>1*0*0&#xA;1**0*&#xA;0*0**&#xA;001**&#xA;</code></pre>&#xA;&#xA;<p>Where the number of elements in each row is $n$ and * is a wildcard for 0 or 1. I need a polynomial-time algorithm that ca...
habedi/stack-exchange-dataset
27,828
The equivalence relations cover problem (in graph theory)
<p>An equivalence relation on a finite vertex set can be represented by an undirected graph that is a disjoint union of cliques. The vertex set represents the elements and an edge represents that two elements are equivalent.</p>&#xA;&#xA;<p>If I have a graph $G$ and graphs $G_1,\dots,G_k$, we say that $G$ is covered by...
algorithms graphs clique
1
The equivalence relations cover problem (in graph theory) -- (algorithms graphs clique) <p>An equivalence relation on a finite vertex set can be represented by an undirected graph that is a disjoint union of cliques. The vertex set represents the elements and an edge represents that two elements are equivalent.</p>&#xA...
habedi/stack-exchange-dataset
27,838
Number of phrases of LZ compression
<p>It is known that for the number $c(n)$ of phrases / tupel of the LZ compression for binary words of length $n$ the following relation holds:&#xA;$$c(n)\leq\frac{n}{(1-\epsilon_n)\log_2 n}$$&#xA;With $\epsilon_n\to 0$ for $n\to\infty$.</p>&#xA;&#xA;<p>The proof is made in <a href="ftp://ftp.esat.kuleuven.ac.be/pub/si...
information theory data compression lempel ziv
1
Number of phrases of LZ compression -- (information theory data compression lempel ziv) <p>It is known that for the number $c(n)$ of phrases / tupel of the LZ compression for binary words of length $n$ the following relation holds:&#xA;$$c(n)\leq\frac{n}{(1-\epsilon_n)\log_2 n}$$&#xA;With $\epsilon_n\to 0$ for $n\to\in...
habedi/stack-exchange-dataset
27,839
NP-complete problems not "obviously" in NP
<p>It occurred to many that in all the $\textbf{NP}$-completeness proofs I've read (that I can remember), it's always trivial to show that a problem is in $\textbf{NP}$, and showing that it is $\textbf{NP}$-hard is the... hard part. What $\textbf{NP}$-complete problems are these whose polynomial-time verifiers are high...
complexity theory np complete np
1
NP-complete problems not "obviously" in NP -- (complexity theory np complete np) <p>It occurred to many that in all the $\textbf{NP}$-completeness proofs I've read (that I can remember), it's always trivial to show that a problem is in $\textbf{NP}$, and showing that it is $\textbf{NP}$-hard is the... hard part. What $...
habedi/stack-exchange-dataset
27,849
What is the algo used for Phonetic Search
<p>I am new to the field of text mining. Could not figure out what to search on google so am here for the same help. &#xA;When we talk of approximate / fuzzy string match. searching for RAT would give RAAT too. i have used utl_match.edit_distance in oracle. searching for BAAT would give BAT. but if i search for RAT. it...
search algorithms
1
What is the algo used for Phonetic Search -- (search algorithms) <p>I am new to the field of text mining. Could not figure out what to search on google so am here for the same help. &#xA;When we talk of approximate / fuzzy string match. searching for RAT would give RAAT too. i have used utl_match.edit_distance in oracl...
habedi/stack-exchange-dataset
27,860
What's the difference between a binary search tree and a binary heap?
<p>These two seem very similar and have almost an identical structure. What's the difference? What are the time complexities for different operations of each?</p>&#xA;
data structures binary trees heaps
1
What's the difference between a binary search tree and a binary heap? -- (data structures binary trees heaps) <p>These two seem very similar and have almost an identical structure. What's the difference? What are the time complexities for different operations of each?</p>&#xA;
habedi/stack-exchange-dataset
27,875
Moore's law and Clock Speed
<p><img src="https://i.stack.imgur.com/tyjWM.jpg" alt="enter image description here"></p>&#xA;&#xA;<p>This figure says according to moore's law number of transistors doubles about two years. but clock speed, power flattening after given stage. can anyone describe the reasons this flattening in clock-speed. Why can't we...
computer architecture
1
Moore's law and Clock Speed -- (computer architecture) <p><img src="https://i.stack.imgur.com/tyjWM.jpg" alt="enter image description here"></p>&#xA;&#xA;<p>This figure says according to moore's law number of transistors doubles about two years. but clock speed, power flattening after given stage. can anyone describe t...
habedi/stack-exchange-dataset
27,884
if $L\in NP\cap Co-NP$ is NP-Hard, then $NP=Co-NP$
<p>I'm looking for a proof to the claim stated in the title:<br>&#xA;if $L\in NP\cap Co-NP$ is $NP$-Hard, then $NP=Co-NP$.<br>&#xA;I read the proof from my professor's recitation, but couldn't understand it, and I was hoping to find more easy-to-understand version of that proof.<br>&#xA;It goes something like that:<br>...
np hard np
1
if $L\in NP\cap Co-NP$ is NP-Hard, then $NP=Co-NP$ -- (np hard np) <p>I'm looking for a proof to the claim stated in the title:<br>&#xA;if $L\in NP\cap Co-NP$ is $NP$-Hard, then $NP=Co-NP$.<br>&#xA;I read the proof from my professor's recitation, but couldn't understand it, and I was hoping to find more easy-to-underst...
habedi/stack-exchange-dataset
27,899
Don't understand one step for AVL tree height log n proof
<p>I came across a proof that the an AVL tree has O(log n) height and there's one step which I do not understand.</p>&#xA;&#xA;<p>Let $N_h$ represent minimum number of nodes that can form an AVL tree of height h. Since we're looking for <strong>minimum</strong> number of nodes, let its children's minimum number of node...
algorithm analysis data structures search trees balanced search trees
1
Don't understand one step for AVL tree height log n proof -- (algorithm analysis data structures search trees balanced search trees) <p>I came across a proof that the an AVL tree has O(log n) height and there's one step which I do not understand.</p>&#xA;&#xA;<p>Let $N_h$ represent minimum number of nodes that can form...
habedi/stack-exchange-dataset
27,905
Why does the NP completeness of the Hartree-Fock method not lead to difficulty in practical calculation?
<p>I read <a href="http://arxiv.org/pdf/0712.0483.pdf" rel="nofollow">Computational Complexity of interacting electrons&#xA;and fundamental limitations of Density Functional Theory</a>. In appendix, it is claimed that </p>&#xA;&#xA;<blockquote>&#xA; <p>In the following, we show that approximating the&#xA; ground sta...
complexity theory np complete
1
Why does the NP completeness of the Hartree-Fock method not lead to difficulty in practical calculation? -- (complexity theory np complete) <p>I read <a href="http://arxiv.org/pdf/0712.0483.pdf" rel="nofollow">Computational Complexity of interacting electrons&#xA;and fundamental limitations of Density Functional Theor...
habedi/stack-exchange-dataset
27,911
Minimum number of tests to identify subset of modules that trigger a bug?
<p>I have an ordered set of $M$ software modules compiled together. The interaction of some $N$-tuple of these modules is causing a bug when the program is run.</p>&#xA;&#xA;<p>I can run the program with any desired subset of the modules enabled/disabled, so I can test the program by running it with a certain subset o...
time complexity search algorithms software testing binary search
1
Minimum number of tests to identify subset of modules that trigger a bug? -- (time complexity search algorithms software testing binary search) <p>I have an ordered set of $M$ software modules compiled together. The interaction of some $N$-tuple of these modules is causing a bug when the program is run.</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
27,913
How to obtain a trilateration ordering in a graph?
<p>In a sensor network graph $G = (V,E)$<br>&#xA;$V = \{1,2,...,n\}$ is the set of sensors and the edge $(i,j)$ denotes that sensor $i$ and sensor $j$ are inside each other's sensing range. The weight of that edge denotes the Euclidean distance between the corresponding sensors.<br>&#xA;The problem is in 2D.</p>&#xA;&#...
algorithms graphs
1
How to obtain a trilateration ordering in a graph? -- (algorithms graphs) <p>In a sensor network graph $G = (V,E)$<br>&#xA;$V = \{1,2,...,n\}$ is the set of sensors and the edge $(i,j)$ denotes that sensor $i$ and sensor $j$ are inside each other's sensing range. The weight of that edge denotes the Euclidean distance b...
habedi/stack-exchange-dataset
27,915
How to implement the regret matching algorithm?
<p>My question is the following: How to calculate the regret in practice?</p>&#xA;&#xA;<p>I am trying to implement the regret matching algorithm but I do not understand how to do it.</p>&#xA;&#xA;<ul>&#xA;<li>First, I have $n$ players with the joint action space $\mathcal{A}=\{a_0, a_1,\cdots,a_m\}^n.$</li>&#xA;<li>The...
machine learning game theory learning theory
1
How to implement the regret matching algorithm? -- (machine learning game theory learning theory) <p>My question is the following: How to calculate the regret in practice?</p>&#xA;&#xA;<p>I am trying to implement the regret matching algorithm but I do not understand how to do it.</p>&#xA;&#xA;<ul>&#xA;<li>First, I have...
habedi/stack-exchange-dataset
27,926
Is a set system an independence system, if and only if it is an accessible system, and has the Interval Property without Lower Bounds
<p>From Wikipedia, &#xA;a finite matroid $M$ is defined to be $(E,F)$, where $E$ is a finite set and $F$ is a family of subsets of $E$, so that it satisfies </p>&#xA;&#xA;<ul>&#xA;<li><p>either <a href="http://en.wikipedia.org/wiki/Matroid#Definition" rel="nofollow">nonempty, the hereditary property, and the augmenta...
combinatorics sets
1
Is a set system an independence system, if and only if it is an accessible system, and has the Interval Property without Lower Bounds -- (combinatorics sets) <p>From Wikipedia, &#xA;a finite matroid $M$ is defined to be $(E,F)$, where $E$ is a finite set and $F$ is a family of subsets of $E$, so that it satisfies </p...
habedi/stack-exchange-dataset
27,935
Maximum length path between any two nodes in a tree with possible negative edge weights
<p>Is there an efficient way to find the longest path between any two nodes in a tree. Given that edges can have negative weights. I know about the diameter problem which finds the longest path in a graph with edge weights 1 but that won't work here.</p>&#xA;&#xA;<p>All I can think of is going for a $O(N^2)$ approach w...
algorithms graphs search algorithms trees weighted graphs
1
Maximum length path between any two nodes in a tree with possible negative edge weights -- (algorithms graphs search algorithms trees weighted graphs) <p>Is there an efficient way to find the longest path between any two nodes in a tree. Given that edges can have negative weights. I know about the diameter problem whic...
habedi/stack-exchange-dataset
27,937
How do I reconstruct the forest of syntax trees from the Earley vector?
<p>Using the Earley vector as a recognizer is quite straightforward: when the end of the string is reached, you just have to check for a completed axiomatic production started at position 0. If you have at least one, then the string is accepted.</p>&#xA;&#xA;<p>Using the Earley vector to reconstruct the parsing tree(s)...
context free dynamic programming parsers ambiguity syntax trees
1
How do I reconstruct the forest of syntax trees from the Earley vector? -- (context free dynamic programming parsers ambiguity syntax trees) <p>Using the Earley vector as a recognizer is quite straightforward: when the end of the string is reached, you just have to check for a completed axiomatic production started at ...
habedi/stack-exchange-dataset
27,950
Disruption in the context of Genetic Algorithms
<p>I'm trying to do a homework problem which references "disruption" in Genetic Algorithms. </p>&#xA;&#xA;<blockquote>&#xA; <p>True or false? For 1-point and 2-point crossover, the schemata &#xA; which have bits that are close together on the string encoding&#xA; are more likely to be disrupted by cros...
algorithms genetic algorithms
1
Disruption in the context of Genetic Algorithms -- (algorithms genetic algorithms) <p>I'm trying to do a homework problem which references "disruption" in Genetic Algorithms. </p>&#xA;&#xA;<blockquote>&#xA; <p>True or false? For 1-point and 2-point crossover, the schemata &#xA; which have bits that are clo...
habedi/stack-exchange-dataset
27,958
Extracting features for texture classification
<p>I'm a beginner in the field of pattern recognition and computer vision. I'm working on a project right now to classify t-shirt patterns into three categories i.e. solids, stripes and checks. I have close up training images of the t-shirt images. A sample shirt image looks like this </p>&#xA;&#xA;<p><img src="https:/...
machine learning image processing pattern recognition
1
Extracting features for texture classification -- (machine learning image processing pattern recognition) <p>I'm a beginner in the field of pattern recognition and computer vision. I'm working on a project right now to classify t-shirt patterns into three categories i.e. solids, stripes and checks. I have close up trai...
habedi/stack-exchange-dataset
27,960
Is there a PDA for every Type 3 Grammar?
<p>we learned that for every type 2 grammar G exists a PDA A with L(A) = L(G). But does for every type 3 grammar G exist a PDA A_G with L(A_G) = L(G)? I think it does, because type 2 grammar is a subset of type 3 grammar. Am I wrong?</p>&#xA;
formal languages regular languages pushdown automata
1
Is there a PDA for every Type 3 Grammar? -- (formal languages regular languages pushdown automata) <p>we learned that for every type 2 grammar G exists a PDA A with L(A) = L(G). But does for every type 3 grammar G exist a PDA A_G with L(A_G) = L(G)? I think it does, because type 2 grammar is a subset of type 3 grammar....
habedi/stack-exchange-dataset
27,962
Shortest-depth routing algorithm
<p>This problem came up in a graph network routing context, it can be expressed as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $n, m &gt; 0$ be integers. Find any smallest list of positive integers $\langle a_1, \cdots, a_k \rangle$ such that:</p>&#xA; &#xA; <p>$$1 + \sum_{i = 1}^k \prod_{j = 1}^i a_j = n$$</p>&#...
algorithms graphs optimization combinatorics trees
1
Shortest-depth routing algorithm -- (algorithms graphs optimization combinatorics trees) <p>This problem came up in a graph network routing context, it can be expressed as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $n, m &gt; 0$ be integers. Find any smallest list of positive integers $\langle a_1, \cdots, a_k \ra...
habedi/stack-exchange-dataset
27,964
What is the state of the art in efficient boolean function operations?
<p>How do you most efficiently combine boolean functions with a large number of variables using AND, OR, and NOT? The most up-to-date work that I can find on this subject is about 20 years old (<a href="http://www.sciencedirect.com/science/article/pii/0012365X9590790R#" rel="nofollow">Efficient data structures for Boo...
reference request boolean algebra
1
What is the state of the art in efficient boolean function operations? -- (reference request boolean algebra) <p>How do you most efficiently combine boolean functions with a large number of variables using AND, OR, and NOT? The most up-to-date work that I can find on this subject is about 20 years old (<a href="http:/...
habedi/stack-exchange-dataset
27,966
Computing the number of bits of a large power of integer
<p><strong>Given two integers $x$ and $n$ in binary representation, what is the complexity of computing the bit-size of $x^n$?</strong></p>&#xA;&#xA;<p>One way to do so is to compute $1+\lfloor \log_2(x^n)\rfloor=1+\lfloor n\log_2(x)\rfloor$ by computing an approximation of $\log_2(x)$ with sufficient precision. It app...
complexity theory time complexity binary arithmetic
1
Computing the number of bits of a large power of integer -- (complexity theory time complexity binary arithmetic) <p><strong>Given two integers $x$ and $n$ in binary representation, what is the complexity of computing the bit-size of $x^n$?</strong></p>&#xA;&#xA;<p>One way to do so is to compute $1+\lfloor \log_2(x^n)\...
habedi/stack-exchange-dataset
27,976
Would it ever be possible for computer viruses to evolve new "genes" to allow them to perform their job?
<p>As an A-level Biology student, I have thought a lot about the links with Biology and Computer Science, and something that often comes to mind are the links between Immunology and Computer Security/Viruses. For example, I (through reading about how the anti-virus programs work) decided that the way the immune system ...
security evolutionary computing
1
Would it ever be possible for computer viruses to evolve new "genes" to allow them to perform their job? -- (security evolutionary computing) <p>As an A-level Biology student, I have thought a lot about the links with Biology and Computer Science, and something that often comes to mind are the links between Immunology ...
habedi/stack-exchange-dataset
27,984
Correct term for “string consisting of words”
<p>In a paper I am writing I want to make distinction between (1) <em>string consisting of any characters</em> and (2) <em>string consisting of a chain of words from known language, with possible delimiters</em>. My intuitive idea is to simply use <em>string</em> for meaning (1) and <em>text</em> for meaning (2). It so...
terminology strings computational linguistics
1
Correct term for “string consisting of words” -- (terminology strings computational linguistics) <p>In a paper I am writing I want to make distinction between (1) <em>string consisting of any characters</em> and (2) <em>string consisting of a chain of words from known language, with possible delimiters</em>. My intuiti...
habedi/stack-exchange-dataset
27,985
B-Tree and how it is used in practice
<p>I understand what a B-Tree is (I already implemented a B-Tree in Java with insert and delete methods that preserve the invariant).</p>&#xA;&#xA;<p>However I do not understand exactly how it is used for example for file systems or databases.</p>&#xA;&#xA;<ol>&#xA;<li><p>How do you choose the keys in these 2 scenarios...
data structures search trees databases filesystems
1
B-Tree and how it is used in practice -- (data structures search trees databases filesystems) <p>I understand what a B-Tree is (I already implemented a B-Tree in Java with insert and delete methods that preserve the invariant).</p>&#xA;&#xA;<p>However I do not understand exactly how it is used for example for file syst...
habedi/stack-exchange-dataset
27,998
How to synchronize a 2d cellular automaton in $\Theta(\sqrt{n} \log n)$ steps
<p>Let's assume we have given a two dimensional cellular automaton with an initial configuration where alls cells are in an quiescent state, expect for one square of cells. Let $n$ be the number of cells in that square. We want to synchronize all cells in the square, so we basically want to solve the firing squad synch...
synchronization cellular automata algorithm design
1
How to synchronize a 2d cellular automaton in $\Theta(\sqrt{n} \log n)$ steps -- (synchronization cellular automata algorithm design) <p>Let's assume we have given a two dimensional cellular automaton with an initial configuration where alls cells are in an quiescent state, expect for one square of cells. Let $n$ be th...
habedi/stack-exchange-dataset
28,001
Dynamic Programming Solution to 0,1 KnapSack Problem
<p>I am trying to understand the DP solution to the basic knapsack problem.However even after reading through a variety of tutorials ,its still beyond my comprehension.I am taking an algorithmics course and need to solve questions based on the classic knapsack problem.However unless I understand the classic problem cle...
dynamic programming knapsack problems
1
Dynamic Programming Solution to 0,1 KnapSack Problem -- (dynamic programming knapsack problems) <p>I am trying to understand the DP solution to the basic knapsack problem.However even after reading through a variety of tutorials ,its still beyond my comprehension.I am taking an algorithmics course and need to solve que...
habedi/stack-exchange-dataset
28,002
Why is there readonly (const) in C++, but not writeonly (sink)?
<p>C++ initially had <a href="http://www.stroustrup.com/bs_faq2.html#constplacement" rel="noreferrer">"readonly" and "writeonly"</a> qualifiers, before "readonly" was renamed to "const", and "writeonly" removed. My question is: What are the problems with "writeonly" (or a "sink" qualifier)?</p>&#xA;&#xA;<hr>&#xA;&#xA;<...
concurrency semantics access control
1
Why is there readonly (const) in C++, but not writeonly (sink)? -- (concurrency semantics access control) <p>C++ initially had <a href="http://www.stroustrup.com/bs_faq2.html#constplacement" rel="noreferrer">"readonly" and "writeonly"</a> qualifiers, before "readonly" was renamed to "const", and "writeonly" removed. My...
habedi/stack-exchange-dataset
28,011
Master Method to solve recurrences is 'a' related to 'b'?
<p>The <a href="https://en.wikipedia.org/wiki/Master_theorem" rel="nofollow">master method</a> allows us to solve certain recurrences of the form</p>&#xA;&#xA;<p>$$T(n) = aT(n/b)+f(n)\,,$$</p>&#xA;&#xA;<p>where $a\ge1$ and $b&gt;1$ are constants and $f(n)$ is a positive function with some further restrictions that aren...
algorithm analysis recurrence relation master theorem
1
Master Method to solve recurrences is 'a' related to 'b'? -- (algorithm analysis recurrence relation master theorem) <p>The <a href="https://en.wikipedia.org/wiki/Master_theorem" rel="nofollow">master method</a> allows us to solve certain recurrences of the form</p>&#xA;&#xA;<p>$$T(n) = aT(n/b)+f(n)\,,$$</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
28,014
exponential lower bound on boolean formula conjunctions, what complexity class?
<p>This new paper <a href="http://arxiv.org/pdf/1406.5970.pdf" rel="nofollow">A Lower Bound for Boolean Satisfiability on Turing Machines</a> by Hsieh asserts an exponential lower bound for a TM time complexity on a problem of finding whether a solution exists to a conjunction of boolean formulas. obviously this proble...
complexity theory time complexity complexity classes lower bounds
1
exponential lower bound on boolean formula conjunctions, what complexity class? -- (complexity theory time complexity complexity classes lower bounds) <p>This new paper <a href="http://arxiv.org/pdf/1406.5970.pdf" rel="nofollow">A Lower Bound for Boolean Satisfiability on Turing Machines</a> by Hsieh asserts an exponen...
habedi/stack-exchange-dataset
28,019
Why is the base used to compute hashes in Rabin–Karp always primes?
<p>The Rabin–Karp string matching algorithm requires a hash function which can be computed quickly. A common choice is&#xA;$$ h(x_0\ldots x_n) = \sum_{i=0}^n b^i x_i, $$&#xA;where $b$ is <em>prime</em> (all computations are module $2^w$, where $w$ is the width of a machine word). Why is it important for $b$ to be prime...
search algorithms strings rolling hash
1
Why is the base used to compute hashes in Rabin–Karp always primes? -- (search algorithms strings rolling hash) <p>The Rabin–Karp string matching algorithm requires a hash function which can be computed quickly. A common choice is&#xA;$$ h(x_0\ldots x_n) = \sum_{i=0}^n b^i x_i, $$&#xA;where $b$ is <em>prime</em> (all c...
habedi/stack-exchange-dataset
28,023
Infinite non-regular decompositions of regular languages
<p>The title pretty much says it: I'm interested in examples of infinite families of non-regular, pairwise disjoint languages whose union is regular.&#xA;When is this the case?</p>&#xA;&#xA;<p>Or, from a different perspective:&#xA;Given some regular language $L$, I want to find a family languages $(L_i)_{i \in \mathbb{...
formal languages regular languages
1
Infinite non-regular decompositions of regular languages -- (formal languages regular languages) <p>The title pretty much says it: I'm interested in examples of infinite families of non-regular, pairwise disjoint languages whose union is regular.&#xA;When is this the case?</p>&#xA;&#xA;<p>Or, from a different perspecti...
habedi/stack-exchange-dataset
28,036
Why is $BPP$ closed under complement?
<p>Why is $\text{BPP}=\text{co-BPP}$?<br>&#xA;I tried to find a proof online but couldn't.<br>&#xA;Can anyone please provide a quick explanation (if it's trivial and I just can't see it) or a link to a proof?</p>&#xA;
complexity theory
1
Why is $BPP$ closed under complement? -- (complexity theory) <p>Why is $\text{BPP}=\text{co-BPP}$?<br>&#xA;I tried to find a proof online but couldn't.<br>&#xA;Can anyone please provide a quick explanation (if it's trivial and I just can't see it) or a link to a proof?</p>&#xA;
habedi/stack-exchange-dataset
28,039
Check constraint under some condition in linear programming
<p>I would like to minimize linear pseudo-boolean function</p>&#xA;&#xA;<p>$$\mathrm{obj} = \sum_i c_i \mathrm{sel}_i$$</p>&#xA;&#xA;<p>subject to $$\sum_i c_i sel_i \geq \mathrm{Value} \qquad\qquad(1)$$ where</p>&#xA;&#xA;<p>$c_1,\dots c_5, \mathrm{Value}$ are some constants;</p>&#xA;&#xA;<p>$\mathrm{sel}_1,\dots,\mat...
optimization satisfiability linear programming
1
Check constraint under some condition in linear programming -- (optimization satisfiability linear programming) <p>I would like to minimize linear pseudo-boolean function</p>&#xA;&#xA;<p>$$\mathrm{obj} = \sum_i c_i \mathrm{sel}_i$$</p>&#xA;&#xA;<p>subject to $$\sum_i c_i sel_i \geq \mathrm{Value} \qquad\qquad(1)$$ wher...
habedi/stack-exchange-dataset
28,046
Difference in Sorting 32- and 64-bit Integers
<p>In 2007, Barrack Obama was <a href="https://www.youtube.com/watch?v=HAY4TKIvSZE">interviewed</a> at Google.</p>&#xA;&#xA;<p>The question was, "What is the best way to sort a million 32-bit integers?" Does the fact that the size range of the integer was specified elude to a different way to sort integers of different...
sorting integers
1
Difference in Sorting 32- and 64-bit Integers -- (sorting integers) <p>In 2007, Barrack Obama was <a href="https://www.youtube.com/watch?v=HAY4TKIvSZE">interviewed</a> at Google.</p>&#xA;&#xA;<p>The question was, "What is the best way to sort a million 32-bit integers?" Does the fact that the size range of the integer ...
habedi/stack-exchange-dataset
28,047
Does the Bible solve an NP-hard problem?
<p>In the Bible, a census is taken of the 12 tribes of Israel:</p>&#xA;&#xA;<p>Simeon: 59,300&#xA;Levi: 22,000&#xA;Judah: 74,600&#xA;Issachar: 54,400&#xA;Joseph: 72,700&#xA;Benjamin: 35,400&#xA;Reuben: 46,500&#xA;Gad: 45,650&#xA;Asher: 41,500&#xA;Zebulun: 57,400&#xA;Dan: 62,700&#xA;Naphtali: 53,400</p>&#xA;&#xA;<p>In t...
np complete
1
Does the Bible solve an NP-hard problem? -- (np complete) <p>In the Bible, a census is taken of the 12 tribes of Israel:</p>&#xA;&#xA;<p>Simeon: 59,300&#xA;Levi: 22,000&#xA;Judah: 74,600&#xA;Issachar: 54,400&#xA;Joseph: 72,700&#xA;Benjamin: 35,400&#xA;Reuben: 46,500&#xA;Gad: 45,650&#xA;Asher: 41,500&#xA;Zebulun: 57,400...
habedi/stack-exchange-dataset
28,051
Computer science for programmers
<p>I'm a self-taught programmer and have been coding for 8 years. Due to this experience, I'm already very familiar with the principles of programming (such as if-statements, classes, polymorphism, etc.).</p>&#xA;&#xA;<p>However, I never learned "computer science," only programming. What are some good resources for som...
reference request
1
Computer science for programmers -- (reference request) <p>I'm a self-taught programmer and have been coding for 8 years. Due to this experience, I'm already very familiar with the principles of programming (such as if-statements, classes, polymorphism, etc.).</p>&#xA;&#xA;<p>However, I never learned "computer science,...
habedi/stack-exchange-dataset
28,063
Problem understanding DFA & NFA equivalence in Theory of Computation
<p>Before asking this question,I had gone through <a href="https://cs.stackexchange.com/questions/9998/equivalence-of-nfa-and-dfa-proof-by-construction">Equivalence of NFA and DFA - proof by construction</a></p>&#xA;&#xA;<p>but my question is a bit different from that. I was reading Michael Sipser's <code>Introduction ...
regular languages automata finite automata nondeterminism
1
Problem understanding DFA & NFA equivalence in Theory of Computation -- (regular languages automata finite automata nondeterminism) <p>Before asking this question,I had gone through <a href="https://cs.stackexchange.com/questions/9998/equivalence-of-nfa-and-dfa-proof-by-construction">Equivalence of NFA and DFA - proof ...
habedi/stack-exchange-dataset
28,067
How Dynamic programming can be used for Coin Change problem?
<p>As far as I can unserstand Dynamic programming stands simply for memoization (which is a fancy name for lazy evaluation or plain "caching"). Now, I read that there is we can <a href="http://c2.com/cgi/wiki?SicpIterationExercise" rel="nofollow">reduce complexity of coin-change problem by truncating some search branch...
combinatorics dynamic programming recursion word combinatorics
1
How Dynamic programming can be used for Coin Change problem? -- (combinatorics dynamic programming recursion word combinatorics) <p>As far as I can unserstand Dynamic programming stands simply for memoization (which is a fancy name for lazy evaluation or plain "caching"). Now, I read that there is we can <a href="http:...
habedi/stack-exchange-dataset
28,068
Is Big-Oh notation preserved under monotonic functions?
<p>I was just looking at the big-Oh notation. I wanted to know if the following is true in general &#xA;$$f(n)=O(g(n)) \implies \log (f(n)) = O(\log (g(n)))$$</p>&#xA;&#xA;<p>I can prove that this is true if $g$ is monotonically increasing, but am not sure if this holds in general.</p>&#xA;
asymptotics landau notation mathematical analysis
1
Is Big-Oh notation preserved under monotonic functions? -- (asymptotics landau notation mathematical analysis) <p>I was just looking at the big-Oh notation. I wanted to know if the following is true in general &#xA;$$f(n)=O(g(n)) \implies \log (f(n)) = O(\log (g(n)))$$</p>&#xA;&#xA;<p>I can prove that this is true if $...
habedi/stack-exchange-dataset
28,075
Describing explicitly the MyHill-Nerode classes created by a language
<p>I want to practice proving a language is regular or not using the MyHill-Nerode theorm, but for that I need to be able to describe the classes. Here's my practice attempt:</p>&#xA;&#xA;<p>For the language&#xA;$$L=\{\omega \in \{a,b\}^* \colon \omega \text{ contains at most 1 } 'a' \}$$&#xA;The classes are&#xA;$$M_1=...
formal languages regular languages finite automata
1
Describing explicitly the MyHill-Nerode classes created by a language -- (formal languages regular languages finite automata) <p>I want to practice proving a language is regular or not using the MyHill-Nerode theorm, but for that I need to be able to describe the classes. Here's my practice attempt:</p>&#xA;&#xA;<p>For...
habedi/stack-exchange-dataset
28,098
A DFA recognizing my name
<p>How can I know if my DFA is implemented correctly?&#xA;For example, I need to build a DFA, and then minimize it which will recognize my name.&#xA;Language which describe my name is:&#xA;L = {pustai, marius}</p>&#xA;&#xA;<p>I came with this solution:</p>&#xA;&#xA;<pre><code>&gt;(0)--p--&gt;(1)--u--&gt;(2)--s--&gt;(3)...
formal languages automata finite automata proof techniques
1
A DFA recognizing my name -- (formal languages automata finite automata proof techniques) <p>How can I know if my DFA is implemented correctly?&#xA;For example, I need to build a DFA, and then minimize it which will recognize my name.&#xA;Language which describe my name is:&#xA;L = {pustai, marius}</p>&#xA;&#xA;<p>I ca...
habedi/stack-exchange-dataset
28,121
How to write this regular expression
<p>Consider the language over the alphabet $\sum= \{a\}$ containing strings whose length is either a multiple of 2 or 3 (including the empty strings). Writing a regular expression for this language</p>&#xA;
formal languages regular languages regular expressions
1
How to write this regular expression -- (formal languages regular languages regular expressions) <p>Consider the language over the alphabet $\sum= \{a\}$ containing strings whose length is either a multiple of 2 or 3 (including the empty strings). Writing a regular expression for this language</p>&#xA;
habedi/stack-exchange-dataset
28,123
Returning a random subset with length k of N strings while only storing at most k of them
<p>Here's the problem. I've written a program that reads strings from stdin, and returns a random subset of those strings. The only other argument provided to the program is the length of the subset, $k$. The subset must contain exactly $k$ strings selected uniformly at random from the entire input set.</p>&#xA;&#xA;<p...
algorithms probability theory sets randomness sampling
1
Returning a random subset with length k of N strings while only storing at most k of them -- (algorithms probability theory sets randomness sampling) <p>Here's the problem. I've written a program that reads strings from stdin, and returns a random subset of those strings. The only other argument provided to the program...
habedi/stack-exchange-dataset
28,126
Why did MIPS include shamt and distinguish funct/opcode?
<p>I'm confused as to why the MIPS designers would include 5 bits dedicated to shifting and have separate opcode and function bits. </p>&#xA;&#xA;<p>Because MIPS is so RISC I assume that only shifting would be done in a few instructions, so those 5 bits seem like they're wasting space when they could be put in the imme...
computer architecture
1
Why did MIPS include shamt and distinguish funct/opcode? -- (computer architecture) <p>I'm confused as to why the MIPS designers would include 5 bits dedicated to shifting and have separate opcode and function bits. </p>&#xA;&#xA;<p>Because MIPS is so RISC I assume that only shifting would be done in a few instructions...
habedi/stack-exchange-dataset