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
50,710
Busy Beaver problem - Proof by contradiction
<p>I am trying to understand a proof regarding the Busy Beaver problem that uses a proof by contradiction approach to show <span class="math-container">$\sum(n)$</span> is Turing-uncomputable:</p>&#xA;&#xA;<blockquote>&#xA; <p>Find <span class="math-container">$\sum(n) = max \{\sum(M) | M \in M(n) \}$</span></p>&#xA;<...
computability undecidability busy beaver
1
Busy Beaver problem - Proof by contradiction -- (computability undecidability busy beaver) <p>I am trying to understand a proof regarding the Busy Beaver problem that uses a proof by contradiction approach to show <span class="math-container">$\sum(n)$</span> is Turing-uncomputable:</p>&#xA;&#xA;<blockquote>&#xA; <p>F...
habedi/stack-exchange-dataset
50,722
Algorithm A vs Algorithm A*: What's the difference?
<p>I can find quite a bit of literature on A* but very little on A.</p>&#xA;&#xA;<p>What is the difference between the two search algorithms?</p>&#xA;
algorithms graphs search algorithms shortest path heuristics
1
Algorithm A vs Algorithm A*: What's the difference? -- (algorithms graphs search algorithms shortest path heuristics) <p>I can find quite a bit of literature on A* but very little on A.</p>&#xA;&#xA;<p>What is the difference between the two search algorithms?</p>&#xA;
habedi/stack-exchange-dataset
50,728
Relation between number of edges and vertices in a DAG
<p>I conjecture that, in a Directed Acyclic Graph, $O(|V|) = O(|E|)$. Is this statement correct, can it be refined? This is probably standard material; is there a simple reference about this?</p>&#xA;
graphs
1
Relation between number of edges and vertices in a DAG -- (graphs) <p>I conjecture that, in a Directed Acyclic Graph, $O(|V|) = O(|E|)$. Is this statement correct, can it be refined? This is probably standard material; is there a simple reference about this?</p>&#xA;
habedi/stack-exchange-dataset
50,730
Proving that two sets of strings are equal
<p>I am stucked at this problem:</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Let $A=(\Sigma, Q, q_1, F, \delta)$ be a finite <strong>deterministic</strong> automaton (I.e. $\delta:Q\times\Sigma\to Q$) such that $Q=\{q_1,...,q_m\}$.</p>&#xA;&#xA;<p>Let's define foreach $i,j\in\{1,...,m\}$, $k\in\{0,1,...,m\}$ </p>&#xA;&#xA;<p>(Note: ...
formal languages regular languages automata finite automata
1
Proving that two sets of strings are equal -- (formal languages regular languages automata finite automata) <p>I am stucked at this problem:</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Let $A=(\Sigma, Q, q_1, F, \delta)$ be a finite <strong>deterministic</strong> automaton (I.e. $\delta:Q\times\Sigma\to Q$) such that $Q=\{q_1,...,q_...
habedi/stack-exchange-dataset
50,733
Backpropagation on a matrix of functions
<p>As nicely described in <a href="http://neuralnetworksanddeeplearning.com/chap2.html" rel="nofollow">this article</a>, backpropagation for multi-layer perceptrons defines the error term for a neuron in terms of the partial derivative of the weights.</p>&#xA;&#xA;<p>It's traditional to represent the weights between ne...
machine learning neural networks
1
Backpropagation on a matrix of functions -- (machine learning neural networks) <p>As nicely described in <a href="http://neuralnetworksanddeeplearning.com/chap2.html" rel="nofollow">this article</a>, backpropagation for multi-layer perceptrons defines the error term for a neuron in terms of the partial derivative of th...
habedi/stack-exchange-dataset
50,753
Update labels of a tree depending on ancestors of nodes in linear time
<blockquote>&#xA; <p>You are given a tree $T=(V,E)$ along with a designated root node $r \in V$.The parent of any node $v \ne r$, denoted $p(v)$, is defined to be the node adjacent to $v$ in the path from $r$ to $v$. By convention, $p(r) = r$. </p>&#xA; &#xA; <p>For $k &gt; 1$, define $p^k(v) = p^{k−1}(p(v))$ and $p...
algorithms trees graph traversal
1
Update labels of a tree depending on ancestors of nodes in linear time -- (algorithms trees graph traversal) <blockquote>&#xA; <p>You are given a tree $T=(V,E)$ along with a designated root node $r \in V$.The parent of any node $v \ne r$, denoted $p(v)$, is defined to be the node adjacent to $v$ in the path from $r$ t...
habedi/stack-exchange-dataset
50,754
Scientifically acceptable method for comparing performance of algorithms
<p>I am comparing several different algorithms for navigation applications. Since I may possibly be publishing a paper comparing the performance of these algorithms with each other, I was wondering the best way to go about measuring performance.</p>&#xA;&#xA;<p>As far as I know, there are two ways to compare performanc...
algorithm analysis performance
1
Scientifically acceptable method for comparing performance of algorithms -- (algorithm analysis performance) <p>I am comparing several different algorithms for navigation applications. Since I may possibly be publishing a paper comparing the performance of these algorithms with each other, I was wondering the best way ...
habedi/stack-exchange-dataset
50,767
Why is not known whether integer factorization can be done in polynomial time knowing how to do primality tests efficiently?
<p>First of all, I have just started studying computer science by myself and maybe I just need some clarification of what "polynomial time" means regarding the time complexity of an algorithm and references to study it well.</p>&#xA;&#xA;<p>As I have understood it, whether integer factorization can be done in polynomia...
algorithms complexity theory time complexity factoring
1
Why is not known whether integer factorization can be done in polynomial time knowing how to do primality tests efficiently? -- (algorithms complexity theory time complexity factoring) <p>First of all, I have just started studying computer science by myself and maybe I just need some clarification of what "polynomial t...
habedi/stack-exchange-dataset
50,771
Find the longest contiguous subsequence such that its sum $(a_i + a_{i+1} + \cdots + a_j)$ is divisible by $D$
<p>You are given $N$ $(1 \le N \le 10^6)$ positive integers $a_1, a_2, \ldots, a_N (1 \le a_i \le 10^6)$&#xA;and two positive integers $D$ $(1 \le D \le 10^6)$ and $M$ $(1 \le M \le 10^6)$</p>&#xA;&#xA;<p>Find the longest contiguous subsequence such that </p>&#xA;&#xA;<ol>&#xA;<li>its sum $(a_i + a_{i+1} + \cdots + a_j...
algorithms optimization combinatorics number theory
1
Find the longest contiguous subsequence such that its sum $(a_i + a_{i+1} + \cdots + a_j)$ is divisible by $D$ -- (algorithms optimization combinatorics number theory) <p>You are given $N$ $(1 \le N \le 10^6)$ positive integers $a_1, a_2, \ldots, a_N (1 \le a_i \le 10^6)$&#xA;and two positive integers $D$ $(1 \le D \le...
habedi/stack-exchange-dataset
50,774
Lower Bound for Comparison-based sorting algorithms
<p>We know that the lower bound for comparison-based sorting algorithms is Ω(nlogn), where logn being the binary logarithm of n. But what about for the best-case scenario of the bubble sort, which takes O(n) time? Of course, n is faster than nlogn. Why is that?</p>&#xA;&#xA;<p>However, I don't know if this bound only a...
algorithms sorting lower bounds
1
Lower Bound for Comparison-based sorting algorithms -- (algorithms sorting lower bounds) <p>We know that the lower bound for comparison-based sorting algorithms is Ω(nlogn), where logn being the binary logarithm of n. But what about for the best-case scenario of the bubble sort, which takes O(n) time? Of course, n is f...
habedi/stack-exchange-dataset
50,777
Examples of maximal paths in undirected graphs
<p>According to me, maximal paths in a graph are those paths which cannot be included in any other larger paths. Could anyone please explain me this with some examples? Also what would happen if the graph happens to contain cycles?</p>&#xA;
graphs discrete mathematics
1
Examples of maximal paths in undirected graphs -- (graphs discrete mathematics) <p>According to me, maximal paths in a graph are those paths which cannot be included in any other larger paths. Could anyone please explain me this with some examples? Also what would happen if the graph happens to contain cycles?</p>&#xA;
habedi/stack-exchange-dataset
50,791
Certificates and NP?
<p>My book says a language is in NP if it can polynomially verified if a string belongs to the language with a certificate. It puts no restrictions on what the certificate can be.</p>&#xA;&#xA;<p>For instance, for SAT, the certificate could simply be be the assignment values. We just sub them in and see if it satisfies...
complexity theory time complexity np
1
Certificates and NP? -- (complexity theory time complexity np) <p>My book says a language is in NP if it can polynomially verified if a string belongs to the language with a certificate. It puts no restrictions on what the certificate can be.</p>&#xA;&#xA;<p>For instance, for SAT, the certificate could simply be be the...
habedi/stack-exchange-dataset
50,804
What exactly is the LL(k) grammar condition?
<p>I have a bit of trouble understanding the definition of LL(k) grammars.</p>&#xA;&#xA;<p><a href="http://web.cse.ohio-state.edu/~gurari/course/cse756/cse756su32.xht" rel="nofollow">Here</a> it's defined as:</p>&#xA;&#xA;<blockquote>&#xA; <p>for every pair of production rules &#xA; $A\rightarrow&#xA;α$&#xA; and &#...
context free formal grammars parsers ll k
1
What exactly is the LL(k) grammar condition? -- (context free formal grammars parsers ll k) <p>I have a bit of trouble understanding the definition of LL(k) grammars.</p>&#xA;&#xA;<p><a href="http://web.cse.ohio-state.edu/~gurari/course/cse756/cse756su32.xht" rel="nofollow">Here</a> it's defined as:</p>&#xA;&#xA;<block...
habedi/stack-exchange-dataset
50,816
Conditionals with normal order evaluation
<p>From what I've read, conditionals (like the <strong>cond</strong> statement in lisp) do not need to be primitive if normal order evaluation is used.</p>&#xA;&#xA;<p>Using lambda calculus and normal order evaluation, how can you emulate <strong>if</strong> and <strong>cond</strong> statements?</p>&#xA;&#xA;<pre><code...
lambda calculus evaluation strategies
1
Conditionals with normal order evaluation -- (lambda calculus evaluation strategies) <p>From what I've read, conditionals (like the <strong>cond</strong> statement in lisp) do not need to be primitive if normal order evaluation is used.</p>&#xA;&#xA;<p>Using lambda calculus and normal order evaluation, how can you emul...
habedi/stack-exchange-dataset
50,817
Algorithms on random geometric graphs
<p>A random geometric graph (<a href="https://en.wikipedia.org/wiki/Random_geometric_graph">https://en.wikipedia.org/wiki/Random_geometric_graph</a>) is constructed by choosing $n$ points in $\mathbb{R}^d$ at random according to some distribution, and setting $p_i \sim p_j$ if $\|p_i - p_j\|&lt;r$, for some parameter $...
algorithms graphs
1
Algorithms on random geometric graphs -- (algorithms graphs) <p>A random geometric graph (<a href="https://en.wikipedia.org/wiki/Random_geometric_graph">https://en.wikipedia.org/wiki/Random_geometric_graph</a>) is constructed by choosing $n$ points in $\mathbb{R}^d$ at random according to some distribution, and setting...
habedi/stack-exchange-dataset
50,828
Do polynomial reduction functions work both ways?
<p>For example to prove 3-Sat ≤p Independent Set do I just have to prove this theorem:</p>&#xA;&#xA;<p>Theorem- Formula F is satisfiable IFF graph has an independent set.</p>&#xA;&#xA;<p>If I have to prove it this way does this also mean that Independent Set ≤p 3-Sat as well since the theorem goes both ways?</p>&#xA;
complexity theory reductions proof techniques 3 sat
1
Do polynomial reduction functions work both ways? -- (complexity theory reductions proof techniques 3 sat) <p>For example to prove 3-Sat ≤p Independent Set do I just have to prove this theorem:</p>&#xA;&#xA;<p>Theorem- Formula F is satisfiable IFF graph has an independent set.</p>&#xA;&#xA;<p>If I have to prove it this...
habedi/stack-exchange-dataset
50,833
Machines whose languages are their own encoding
<p>Is the language $S = \{\langle M \rangle \mid M \text{ is a Turing Machine and } L(M) = \{\langle M \rangle\}\,\}$ decidable, recognizable and/or co-recognizable?</p>&#xA;&#xA;<p>I tried diagonalization but can only prove that $R = \{\langle M \rangle \mid M \text{ is a Turing Machine and } \langle M \rangle \notin ...
computability reductions undecidability
1
Machines whose languages are their own encoding -- (computability reductions undecidability) <p>Is the language $S = \{\langle M \rangle \mid M \text{ is a Turing Machine and } L(M) = \{\langle M \rangle\}\,\}$ decidable, recognizable and/or co-recognizable?</p>&#xA;&#xA;<p>I tried diagonalization but can only prove th...
habedi/stack-exchange-dataset
50,834
How to simplify boolean expression?
<p>I am having trouble simplifying logical expressions to a much simpler form, can someone provide me some insight on how to approach the problem?</p>&#xA;&#xA;<p>Let's assume i have the following expression: $ABCD + A\bar{B}CD$.</p>&#xA;&#xA;<p>I am aware of the De Morgan's law, but not sure how to apply them in this ...
logic proof techniques boolean algebra
1
How to simplify boolean expression? -- (logic proof techniques boolean algebra) <p>I am having trouble simplifying logical expressions to a much simpler form, can someone provide me some insight on how to approach the problem?</p>&#xA;&#xA;<p>Let's assume i have the following expression: $ABCD + A\bar{B}CD$.</p>&#xA;&#...
habedi/stack-exchange-dataset
50,844
VC dimension of monotone disjunctions of length k over n variables?
<p>There are of course $n \choose k$ monotone disjunctions which bounds the VC dimension at $\log_2 {n \choose k}$. I'm wondering if this is bound at $k \log_2 n$? (Possibly follows from combinatorial identities).</p>&#xA;&#xA;<p>More generally I'm looking at the claim in <a href="http://rd.springer.com/article/10.1007...
learning theory vc dimension
1
VC dimension of monotone disjunctions of length k over n variables? -- (learning theory vc dimension) <p>There are of course $n \choose k$ monotone disjunctions which bounds the VC dimension at $\log_2 {n \choose k}$. I'm wondering if this is bound at $k \log_2 n$? (Possibly follows from combinatorial identities).</p>&...
habedi/stack-exchange-dataset
50,882
AVL tree such that each insert causes rotation (single or double)
<p>Could you give me an example of an AVL tree for which inserting an element at an <em>arbitrary</em> (i.e. every) position causes a rotation (double or single)?</p>&#xA;&#xA;<p>I have tried to come up with an example, but I didn't manage to.</p>&#xA;
data structures binary trees search trees balanced search trees
1
AVL tree such that each insert causes rotation (single or double) -- (data structures binary trees search trees balanced search trees) <p>Could you give me an example of an AVL tree for which inserting an element at an <em>arbitrary</em> (i.e. every) position causes a rotation (double or single)?</p>&#xA;&#xA;<p>I have...
habedi/stack-exchange-dataset
50,898
Dynamic Learning (Machine Learning)
<p>I have been given a task to dynamically learn the optimum value of a parameter in a Heuristics Filtering Algorithm used in a tool.</p>&#xA;&#xA;<p>The accuracy of the tool increase as the value of <strong><em>K</em></strong> in the heuristics filtering algorithm increases. How ever a lower <strong><em>K</em></strong...
machine learning artificial intelligence
1
Dynamic Learning (Machine Learning) -- (machine learning artificial intelligence) <p>I have been given a task to dynamically learn the optimum value of a parameter in a Heuristics Filtering Algorithm used in a tool.</p>&#xA;&#xA;<p>The accuracy of the tool increase as the value of <strong><em>K</em></strong> in the heu...
habedi/stack-exchange-dataset
50,904
Proving that language, with $|\Sigma|=1$, is irregular by Myhill–Nerode theorem
<p>We have $\Sigma =\{0\}$ and $$L=\{0^{2^n} \mid n\ge 0\}$$&#xA;How to prove that $L$ is irregular by using Myhill–Nerode theorem?</p>&#xA;&#xA;<p>At other languages with $\Sigma &gt;1$ we can usually separate the word or something like this with combination and this how we can show that two words are not at the same ...
regular languages
1
Proving that language, with $|\Sigma|=1$, is irregular by Myhill–Nerode theorem -- (regular languages) <p>We have $\Sigma =\{0\}$ and $$L=\{0^{2^n} \mid n\ge 0\}$$&#xA;How to prove that $L$ is irregular by using Myhill–Nerode theorem?</p>&#xA;&#xA;<p>At other languages with $\Sigma &gt;1$ we can usually separate the wo...
habedi/stack-exchange-dataset
50,912
Variations of Depth First Travesal
<p>While learning depth first traversal, I realise there are two approaches that are followed. </p>&#xA;&#xA;<p><strong>Method 1</strong>. The first one is as given in the <a href="http://rads.stackoverflow.com/amzn/click/0534390803" rel="nofollow noreferrer">Forouzan's book</a> is as follows:</p>&#xA;&#xA;<ol>&#xA;<li...
algorithms graphs data structures graph traversal
1
Variations of Depth First Travesal -- (algorithms graphs data structures graph traversal) <p>While learning depth first traversal, I realise there are two approaches that are followed. </p>&#xA;&#xA;<p><strong>Method 1</strong>. The first one is as given in the <a href="http://rads.stackoverflow.com/amzn/click/05343908...
habedi/stack-exchange-dataset
50,922
Is the following intuition valid for understanding $k$-wise independent hash functions?
<p>I really enjoy reading up on algorithms and data structures and in the course of doing so often come across ones that rely on $k$-wise independent families of hash functions. I'm perfectly comfortable working with these families of hash functions as black boxes (that is, I understand the relevant definitions and how...
hash number theory intuition
1
Is the following intuition valid for understanding $k$-wise independent hash functions? -- (hash number theory intuition) <p>I really enjoy reading up on algorithms and data structures and in the course of doing so often come across ones that rely on $k$-wise independent families of hash functions. I'm perfectly comfor...
habedi/stack-exchange-dataset
50,925
Algorithms for logical synthesis
<p>Let's say that I want to map some string of binary digits to a single binary digit of output, like the below:</p>&#xA;&#xA;<p>$&#xA;\begin{array}{l|l}&#xA;\text{Input}&amp;\text{Output}\\&#xA;\hline&#xA;0001&amp;0\\&#xA;0011&amp;1\\&#xA;0111&amp;0\\&#xA;1111&amp;1&#xA;\end{array}&#xA;$</p>&#xA;&#xA;<p>If inputs besi...
algorithms logic circuits
1
Algorithms for logical synthesis -- (algorithms logic circuits) <p>Let's say that I want to map some string of binary digits to a single binary digit of output, like the below:</p>&#xA;&#xA;<p>$&#xA;\begin{array}{l|l}&#xA;\text{Input}&amp;\text{Output}\\&#xA;\hline&#xA;0001&amp;0\\&#xA;0011&amp;1\\&#xA;0111&amp;0\\&#xA...
habedi/stack-exchange-dataset
50,931
How to prove P ⊆ Co-NP
<p>My approach</p>&#xA;&#xA;<blockquote>&#xA; <p>Let L ∈ P</p>&#xA; &#xA; <p>$\exists$ Turing Machine $M_1$ which decides L. </p>&#xA; &#xA; <p>We can easily construct $M_2$ which decides $\bar{L}$</p>&#xA; &#xA; <p>$\bar{L}$ ∈ CO-NP $\implies$ P ⊆ Co-NP</p>&#xA;</blockquote>&#xA;&#xA;<p>I'm not sure whether its...
complexity theory complexity classes np p vs np
1
How to prove P ⊆ Co-NP -- (complexity theory complexity classes np p vs np) <p>My approach</p>&#xA;&#xA;<blockquote>&#xA; <p>Let L ∈ P</p>&#xA; &#xA; <p>$\exists$ Turing Machine $M_1$ which decides L. </p>&#xA; &#xA; <p>We can easily construct $M_2$ which decides $\bar{L}$</p>&#xA; &#xA; <p>$\bar{L}$ ∈ CO-NP $\i...
habedi/stack-exchange-dataset
50,932
maximum flow with all or nothing through each edge
<p>Consider a maximum flow problem, where each edge has a small integer capacity. Now, I want a solution that for each edge uses the entire capacity, or no flow through that edge at all. To avoid the subset-sum problem, the capacities are small. Is this solvable in polynomial time or is it NP-Complete?</p>&#xA;
algorithms graphs np complete network flow
1
maximum flow with all or nothing through each edge -- (algorithms graphs np complete network flow) <p>Consider a maximum flow problem, where each edge has a small integer capacity. Now, I want a solution that for each edge uses the entire capacity, or no flow through that edge at all. To avoid the subset-sum problem, t...
habedi/stack-exchange-dataset
50,937
How to generate graphs with a Hamiltonian path?
<p>I need to create a graph generator for my next project. Generally algorithms are trying to find a Hamiltonian path in a graph. So I can create a graph generator, generate a graph, and then I can decide whether the graph has a Hamiltonian path or not. If not, I can regenerate the graph but this is not a cool way.</p>...
graphs hamiltonian path
1
How to generate graphs with a Hamiltonian path? -- (graphs hamiltonian path) <p>I need to create a graph generator for my next project. Generally algorithms are trying to find a Hamiltonian path in a graph. So I can create a graph generator, generate a graph, and then I can decide whether the graph has a Hamiltonian pa...
habedi/stack-exchange-dataset
50,939
counterexample for this graph isomorphism algorithm
<p>I'm trying to learn about graph isomorphism and I stumbled upon coloring. When given 2 graphs, you give each vertex a color according to properties of their neighbors and any vertex on graph 1 can only map to any vertex on graph 2 with the same color. This way you cannot have false negatives (if the algorithm says t...
graphs graph isomorphism
1
counterexample for this graph isomorphism algorithm -- (graphs graph isomorphism) <p>I'm trying to learn about graph isomorphism and I stumbled upon coloring. When given 2 graphs, you give each vertex a color according to properties of their neighbors and any vertex on graph 1 can only map to any vertex on graph 2 with...
habedi/stack-exchange-dataset
50,940
Is queue a storage allocation area in memory?
<p>We mainly study about heap and stack data structures which act as storage allocation area in memory. Is it that queue is also a storage allocation area in memory? As far as I know, process control blocks are made in OS region and actually they also act as storage allocation area only so can I consider queue to be a ...
data structures operating systems
1
Is queue a storage allocation area in memory? -- (data structures operating systems) <p>We mainly study about heap and stack data structures which act as storage allocation area in memory. Is it that queue is also a storage allocation area in memory? As far as I know, process control blocks are made in OS region and ac...
habedi/stack-exchange-dataset
50,952
1-to-1 cryptographically secure bit shuffling
<p>Given an input item (N bytes), I'm looking for a function that will map this to an output (still N bytes). The function should have the following qualities:</p>&#xA;&#xA;<ul>&#xA;<li>It should be 1-to-1 so that all inputs map to some output and so that no two inputs map to the same output.</li>&#xA;<li>Given an out...
discrete mathematics cryptography hash
1
1-to-1 cryptographically secure bit shuffling -- (discrete mathematics cryptography hash) <p>Given an input item (N bytes), I'm looking for a function that will map this to an output (still N bytes). The function should have the following qualities:</p>&#xA;&#xA;<ul>&#xA;<li>It should be 1-to-1 so that all inputs map ...
habedi/stack-exchange-dataset
50,964
Confusion in CLRS's version of Prim's algorithm
<p>The algorithm is as follows:</p>&#xA;&#xA;<pre><code>MST-PRIM(G,w,r)&#xA;1 for each u ∈ G.V //initialization&#xA;2 u.key = ∞&#xA;3 u.π = NIL&#xA;4 r.key = 0&#xA;5 Q = G.V //end initialization&#xA;6 while Q ≠ ∅&#xA;7 u = EXTRACT-MIN(Q)&#xA;8 for each v ∈ G.Adj[u]&#xA;9 i...
graphs greedy algorithms prims algorithm
1
Confusion in CLRS's version of Prim's algorithm -- (graphs greedy algorithms prims algorithm) <p>The algorithm is as follows:</p>&#xA;&#xA;<pre><code>MST-PRIM(G,w,r)&#xA;1 for each u ∈ G.V //initialization&#xA;2 u.key = ∞&#xA;3 u.π = NIL&#xA;4 r.key = 0&#xA;5 Q = G.V //end initialization&#xA;...
habedi/stack-exchange-dataset
50,967
User level threads are transparent to the kernel?
<p>Find whether given statement True or False? Explain.</p>&#xA;<blockquote>&#xA;<p>User level threads are transparent to the kernel?</p>&#xA;</blockquote>&#xA;<hr />&#xA;<h3>My attempt :</h3>&#xA;<p>False. Since, user level threads are managed by a user level library however, they still require a kernel system call to...
operating systems concurrency process scheduling threads os kernel
1
User level threads are transparent to the kernel? -- (operating systems concurrency process scheduling threads os kernel) <p>Find whether given statement True or False? Explain.</p>&#xA;<blockquote>&#xA;<p>User level threads are transparent to the kernel?</p>&#xA;</blockquote>&#xA;<hr />&#xA;<h3>My attempt :</h3>&#xA;<...
habedi/stack-exchange-dataset
50,981
Is reference counting GC vs. tracing GC a language property or an implementation property?
<p>We sometimes hear "Swift doesn't do classic (tracing) GC, it uses ARC."</p>&#xA;&#xA;<p>But I'm not sure if there is anything in the Swift semantics that requires reference counting. It seems that one could build one's own Swift compiler and runtime to use tracing GC.</p>&#xA;&#xA;<p>So what exactly is "reference-co...
semantics garbage collection
1
Is reference counting GC vs. tracing GC a language property or an implementation property? -- (semantics garbage collection) <p>We sometimes hear "Swift doesn't do classic (tracing) GC, it uses ARC."</p>&#xA;&#xA;<p>But I'm not sure if there is anything in the Swift semantics that requires reference counting. It seems ...
habedi/stack-exchange-dataset
50,987
Algorithms for logical synthesis of multiple output bits?
<p>Karnaugh maps and the Quine–McCluskey algorithm can be good choices for coming up with fairly minimal logical expressions that match the requirements of a truth table.</p>&#xA;&#xA;<p>What if I have a situation where I have $M$ input bits and $N$ output bits though?</p>&#xA;&#xA;<p>A naive way to deal with it would ...
algorithms optimization logic digital circuits
1
Algorithms for logical synthesis of multiple output bits? -- (algorithms optimization logic digital circuits) <p>Karnaugh maps and the Quine–McCluskey algorithm can be good choices for coming up with fairly minimal logical expressions that match the requirements of a truth table.</p>&#xA;&#xA;<p>What if I have a situat...
habedi/stack-exchange-dataset
50,990
Can we enumerate provably non-terminating functions?
<p>In trying to understand the Halting Problem better, I am trying to come up with classes of provably non-terminating programs. </p>&#xA;&#xA;<p>For example, any program (including input) which leads to a finite-length infinite loop (with perfectly repeating state+tape) should be detectable. That leaves mostly inducti...
halting problem correctness proof
1
Can we enumerate provably non-terminating functions? -- (halting problem correctness proof) <p>In trying to understand the Halting Problem better, I am trying to come up with classes of provably non-terminating programs. </p>&#xA;&#xA;<p>For example, any program (including input) which leads to a finite-length infinite...
habedi/stack-exchange-dataset
50,991
Is < binary relation a strict partial order on IEEE doubles?
<p>To me it looks that it is:</p>&#xA;&#xA;<ul>&#xA;<li>irreflexivity: NaN &lt; NaN == false</li>&#xA;<li>transitivity: if a &lt; b and b &lt; c then a &lt; c (the antecedent is never true for NaNs)</li>&#xA;<li>asymmetry: if a &lt; b then not b &lt; a (again, the antecedent is never true for NaNs)</li>&#xA;</ul>&#xA;&...
floating point partial order
1
Is < binary relation a strict partial order on IEEE doubles? -- (floating point partial order) <p>To me it looks that it is:</p>&#xA;&#xA;<ul>&#xA;<li>irreflexivity: NaN &lt; NaN == false</li>&#xA;<li>transitivity: if a &lt; b and b &lt; c then a &lt; c (the antecedent is never true for NaNs)</li>&#xA;<li>asymmetry: if...
habedi/stack-exchange-dataset
50,992
Is a Pushdown Automata possible for this language?
<p>PDA for a Language L = { $a^i b^j \mid i \neq 2j+1 \}$ over the Alphabet $\Sigma = \{a,b\}$</p>&#xA;&#xA;<p>If it can be constructed, how?</p>&#xA;&#xA;<p><strong>Edit</strong> : I've tried make the PDA for $$L = \{ a^i b^j \mid i = 2j+1 \}$$ (with the intention of editing the PDA to accept if $a$ or $b$ is leftover...
automata pushdown automata
1
Is a Pushdown Automata possible for this language? -- (automata pushdown automata) <p>PDA for a Language L = { $a^i b^j \mid i \neq 2j+1 \}$ over the Alphabet $\Sigma = \{a,b\}$</p>&#xA;&#xA;<p>If it can be constructed, how?</p>&#xA;&#xA;<p><strong>Edit</strong> : I've tried make the PDA for $$L = \{ a^i b^j \mid i = 2...
habedi/stack-exchange-dataset
50,993
Order of growth definition from Reynolds & Tymann
<p>I am reading a book called <em>Principles of Computer Science</em> (2008), by Carl Reynolds and Paul Tymann (published by Schaum's Outlines).</p>&#xA;&#xA;<p>The second chapter introduces algorithms with an example of a sequential search which simply iterates through a list of names and returns TRUE if a given name ...
algorithms algorithm analysis landau notation notation
1
Order of growth definition from Reynolds & Tymann -- (algorithms algorithm analysis landau notation notation) <p>I am reading a book called <em>Principles of Computer Science</em> (2008), by Carl Reynolds and Paul Tymann (published by Schaum's Outlines).</p>&#xA;&#xA;<p>The second chapter introduces algorithms with an ...
habedi/stack-exchange-dataset
51,003
Is an expression in normal form if terminates on normal order but not applicative?
<p>Just wondering if something like this...</p>&#xA;&#xA;<pre><code>(λx. y)((λx. (x x))(λx. (x x))) &#xA;</code></pre>&#xA;&#xA;<p>Would be considered to be in normal form since it terminates with y if done by normal order but does not terminate if done by applicative order</p>&#xA;
lambda calculus
1
Is an expression in normal form if terminates on normal order but not applicative? -- (lambda calculus) <p>Just wondering if something like this...</p>&#xA;&#xA;<pre><code>(λx. y)((λx. (x x))(λx. (x x))) &#xA;</code></pre>&#xA;&#xA;<p>Would be considered to be in normal form since it terminates with y if done by normal...
habedi/stack-exchange-dataset
51,014
Proving/Disproving that language L is non-regular/CFL
<p>Here are three examples of questions I run into. <strong>I'm not looking for solutions.</strong></p>&#xA;&#xA;<blockquote>&#xA; <ol>&#xA; <li>If $L$ is CFL then $L' = \{ ww^R | w \in L \}$ is non-regular.</li>&#xA; <li>If $L$ is non-regular then $L' = \{ ww^R | w \in L \}$ is non-regular too.</li>&#xA; <li>If $L...
formal languages context free finite automata proof techniques
1
Proving/Disproving that language L is non-regular/CFL -- (formal languages context free finite automata proof techniques) <p>Here are three examples of questions I run into. <strong>I'm not looking for solutions.</strong></p>&#xA;&#xA;<blockquote>&#xA; <ol>&#xA; <li>If $L$ is CFL then $L' = \{ ww^R | w \in L \}$ is n...
habedi/stack-exchange-dataset
51,017
Longest cycle in a digraph
<p>Given a directed graph $G$, we want a (simple) cycle in $G$ of maximal length. The cycle does not need to be an induced subgraph of $G$. What is known about this optimization problem?</p>&#xA;&#xA;<p>Do we know its complexity? Is it much harder than the decision problem of detecting a Hamiltonian cycle? How well-app...
complexity theory graphs optimization
1
Longest cycle in a digraph -- (complexity theory graphs optimization) <p>Given a directed graph $G$, we want a (simple) cycle in $G$ of maximal length. The cycle does not need to be an induced subgraph of $G$. What is known about this optimization problem?</p>&#xA;&#xA;<p>Do we know its complexity? Is it much harder th...
habedi/stack-exchange-dataset
51,020
How do genetic algorithms work exactly?
<p>I was looking at the basic genetic algorithm here</p>&#xA;&#xA;<p><a href="http://www.ai-junkie.com/ga/intro/gat1.html" rel="nofollow">http://www.ai-junkie.com/ga/intro/gat1.html</a></p>&#xA;&#xA;<p>But I have some questions about things I didn't get.</p>&#xA;&#xA;<p>To reiterate:</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>You h...
genetic algorithms
1
How do genetic algorithms work exactly? -- (genetic algorithms) <p>I was looking at the basic genetic algorithm here</p>&#xA;&#xA;<p><a href="http://www.ai-junkie.com/ga/intro/gat1.html" rel="nofollow">http://www.ai-junkie.com/ga/intro/gat1.html</a></p>&#xA;&#xA;<p>But I have some questions about things I didn't get.</...
habedi/stack-exchange-dataset
51,025
Cast to boolean, for integer linear programming
<p>I want to express the following constraint, in an integer linear program:</p>&#xA;&#xA;<p>$$y = \begin{cases}&#xA;0 &amp;\text{if } x=0\\&#xA;1 &amp;\text{if } x\ne 0.&#xA;\end{cases}$$</p>&#xA;&#xA;<p>I already have the integer variables $x,y$ and I'm promised that $-100 \le x \le 100$. How can I express the above...
linear programming integer programming
1
Cast to boolean, for integer linear programming -- (linear programming integer programming) <p>I want to express the following constraint, in an integer linear program:</p>&#xA;&#xA;<p>$$y = \begin{cases}&#xA;0 &amp;\text{if } x=0\\&#xA;1 &amp;\text{if } x\ne 0.&#xA;\end{cases}$$</p>&#xA;&#xA;<p>I already have the inte...
habedi/stack-exchange-dataset
51,027
How to find a minimum set of axioms within a set of propositions?
<p>I have a set of propositions, for example $\{a_1,a_2,\dots,a_n\}$. Some propositions depend on others (for example, $a_1,a_2\Rightarrow a_3$, means if $a_1,a_2$ are true, then $a_3$ is true). I want to find a subset of the propositions to be defined as axioms, in the sense that, these propositions being true imply t...
algorithms sets propositional logic
1
How to find a minimum set of axioms within a set of propositions? -- (algorithms sets propositional logic) <p>I have a set of propositions, for example $\{a_1,a_2,\dots,a_n\}$. Some propositions depend on others (for example, $a_1,a_2\Rightarrow a_3$, means if $a_1,a_2$ are true, then $a_3$ is true). I want to find a s...
habedi/stack-exchange-dataset
51,031
Genetic Algorithm Neural Network- Inputs for evolving creatures
<p>I made a GANN program for evolving creatures. The genes that get put into the GA for each ind are the weights that go into the neural net for each creature. The NN is a basic 1 hidden layer NN with bias neurons and it uses TANH so the weights are from -1 to 1. The GA uses .8 crossover rate (.3 elitism) and .003 muta...
neural networks
1
Genetic Algorithm Neural Network- Inputs for evolving creatures -- (neural networks) <p>I made a GANN program for evolving creatures. The genes that get put into the GA for each ind are the weights that go into the neural net for each creature. The NN is a basic 1 hidden layer NN with bias neurons and it uses TANH so t...
habedi/stack-exchange-dataset
51,034
Two's complement Using ONLY Logic Gates
<p>How can a 4-bit two's complement operation be implemented using only boolean logic gates (AND, OR, NOR, NOT, NAND, XOR, and XNOR)?</p>&#xA;&#xA;<p>(This question was redirected to CS from <a href="https://stackoverflow.com/questions/34277093/twos-complement-using-only-logic-gates">Stack Overflow</a>)</p>&#xA;
logic boolean algebra
1
Two's complement Using ONLY Logic Gates -- (logic boolean algebra) <p>How can a 4-bit two's complement operation be implemented using only boolean logic gates (AND, OR, NOR, NOT, NAND, XOR, and XNOR)?</p>&#xA;&#xA;<p>(This question was redirected to CS from <a href="https://stackoverflow.com/questions/34277093/twos-com...
habedi/stack-exchange-dataset
51,036
When proving NP-completeness do I only need one instance of a problem or all of them?
<p>I saw a proof of reduction of hamiltonian path to spanning tree with inner vertices having degree of k.</p>&#xA;&#xA;<p>The person, who proved it, constructed a spanning tree from a hamiltonian path, basically u-x1-...-xi-...-xn-v, and where xi are inner vertices and then appended k-2 leaves to each one of those ver...
algorithms complexity theory np complete
1
When proving NP-completeness do I only need one instance of a problem or all of them? -- (algorithms complexity theory np complete) <p>I saw a proof of reduction of hamiltonian path to spanning tree with inner vertices having degree of k.</p>&#xA;&#xA;<p>The person, who proved it, constructed a spanning tree from a ham...
habedi/stack-exchange-dataset
51,054
Sorting an "almost sorted" array in sub linear time
<p>I am given an "almost sorted" array with the condition that each element is no more than <span class="math-container">$k$</span> places away from its position in the sorted array. I need to show that it is impossible to sort this array in sublinear time asymptotically. </p>&#xA;&#xA;<p>My proof is to suppose a sorte...
algorithms sorting check my answer
1
Sorting an "almost sorted" array in sub linear time -- (algorithms sorting check my answer) <p>I am given an "almost sorted" array with the condition that each element is no more than <span class="math-container">$k$</span> places away from its position in the sorted array. I need to show that it is impossible to sort ...
habedi/stack-exchange-dataset
51,066
Number of states in minimal Non Deterministic Finite Automata
<blockquote>&#xA; <p>What will be the number of states in minimal NFA that can be designed&#xA; to accept the language $L = \left \{ \epsilon \right \}$ having a non&#xA; empty alphabet set?</p>&#xA;</blockquote>&#xA;&#xA;<p>My friends are saying that this can be done using $1$ state, make the only state start stat...
finite automata
1
Number of states in minimal Non Deterministic Finite Automata -- (finite automata) <blockquote>&#xA; <p>What will be the number of states in minimal NFA that can be designed&#xA; to accept the language $L = \left \{ \epsilon \right \}$ having a non&#xA; empty alphabet set?</p>&#xA;</blockquote>&#xA;&#xA;<p>My frien...
habedi/stack-exchange-dataset
51,071
Number of words within Hamming distance $\delta$
<p>This is a problem I'm having reading <a href="https://users.cs.duke.edu/~reif/courses/complectures/books/AB/amphardchap.pdf" rel="nofollow">Arora &amp; Barak's book, page 378-379</a>. They define:</p>&#xA;&#xA;<blockquote>&#xA; <p>For two words $x, y \in \{0, 1\}^m$, the fractional Hamming distance of $x$ and &#xA...
combinatorics coding theory word combinatorics
1
Number of words within Hamming distance $\delta$ -- (combinatorics coding theory word combinatorics) <p>This is a problem I'm having reading <a href="https://users.cs.duke.edu/~reif/courses/complectures/books/AB/amphardchap.pdf" rel="nofollow">Arora &amp; Barak's book, page 378-379</a>. They define:</p>&#xA;&#xA;<bloc...
habedi/stack-exchange-dataset
51,072
Is the terminology of the word optimal substructure same for divide-conquer and dynamic programming technique?
<p>why do we use the word optimal in case of optimal sub-structure , I guess in case of divide and conquer also we have sub-problems and they too when merged together provide the solution for entire problem .So what is the difference in terminology of sub-problems in divide and conquer and dynamic programming except fo...
dynamic programming divide and conquer
1
Is the terminology of the word optimal substructure same for divide-conquer and dynamic programming technique? -- (dynamic programming divide and conquer) <p>why do we use the word optimal in case of optimal sub-structure , I guess in case of divide and conquer also we have sub-problems and they too when merged togethe...
habedi/stack-exchange-dataset
51,077
How Splitting Summation method works
<p>I'm reading Cormen, Leiserson, Rivest and Stein, <em>Introduction to Algorithms</em>, Appendix&nbsp;A, page&nbsp;1152. They discuss a method called "Splitting Summations", where they split the summation and bound each term separately. For example,</p>&#xA;&#xA;<p>$$\begin{align*}&#xA;\sum_{k=1}^{n} k &amp;= \sum_{k=...
algorithm analysis proof techniques approximation
1
How Splitting Summation method works -- (algorithm analysis proof techniques approximation) <p>I'm reading Cormen, Leiserson, Rivest and Stein, <em>Introduction to Algorithms</em>, Appendix&nbsp;A, page&nbsp;1152. They discuss a method called "Splitting Summations", where they split the summation and bound each term se...
habedi/stack-exchange-dataset
51,090
Can an artificial neural network convert from cartesian coordinates to polar coordinates?
<p>Given cartesian coordinates $x$ and $y$ as input, can a neural network output $r$ and $\theta$, the equivalent polar coordinates?</p>&#xA;&#xA;<p>This would seem to require an approximation of the pythagorean theorem (which requires approximations of $x^2$ and $\sqrt{x}$) and $\sin$, $\cos$, or $\tan$ approximations...
machine learning artificial intelligence neural networks
1
Can an artificial neural network convert from cartesian coordinates to polar coordinates? -- (machine learning artificial intelligence neural networks) <p>Given cartesian coordinates $x$ and $y$ as input, can a neural network output $r$ and $\theta$, the equivalent polar coordinates?</p>&#xA;&#xA;<p>This would seem to ...
habedi/stack-exchange-dataset
51,096
How is $\emptyset^* = \{\epsilon\}$?
<p>I know that <span class="math-container">$\emptyset$</span> is a an empty language, i.e. language containing no string. </p>&#xA;&#xA;<p>A law involving empty language is:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$\emptyset L = L\emptyset = \emptyset$</span></p>&#xA;</blockquote>&#xA;&#xA;<p>I...
automata finite automata regular expressions
1
How is $\emptyset^* = \{\epsilon\}$? -- (automata finite automata regular expressions) <p>I know that <span class="math-container">$\emptyset$</span> is a an empty language, i.e. language containing no string. </p>&#xA;&#xA;<p>A law involving empty language is:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-conta...
habedi/stack-exchange-dataset
51,107
Anatomy of a production rule
<p>Production <a href="https://en.wikipedia.org/wiki/Production_(computer_science)" rel="nofollow">is said to be</a> of the form $u \to v$. I want to know if you distinguish $u$ from $v$ giving them some distinguishing names, like LHS/RHS or something alike.</p>&#xA;
terminology formal grammars
1
Anatomy of a production rule -- (terminology formal grammars) <p>Production <a href="https://en.wikipedia.org/wiki/Production_(computer_science)" rel="nofollow">is said to be</a> of the form $u \to v$. I want to know if you distinguish $u$ from $v$ giving them some distinguishing names, like LHS/RHS or something alike....
habedi/stack-exchange-dataset
51,113
How to parse data in a text file?
<p>I had a question about altering a text file. I have data in the following format.</p>&#xA;&#xA;<pre><code>1 a,b,c&#xA;2 d,e&#xA;3 a, l, m,n&#xA;</code></pre>&#xA;&#xA;<p><strong>Note that some of them have spaces after the coma</strong></p>&#xA;&#xA;<p>Now I have to resort the data in the following format</p>&#xA;&#...
data sets filesystems
1
How to parse data in a text file? -- (data sets filesystems) <p>I had a question about altering a text file. I have data in the following format.</p>&#xA;&#xA;<pre><code>1 a,b,c&#xA;2 d,e&#xA;3 a, l, m,n&#xA;</code></pre>&#xA;&#xA;<p><strong>Note that some of them have spaces after the coma</strong></p>&#xA;&#xA;<p>Now...
habedi/stack-exchange-dataset
51,127
Duplicating the quotation marks in in the quotation-mark enclosed strings
<p>There is such a grammar</p>&#xA;&#xA;<pre><code>string_literal ::= " { graphic_character } "&#xA;</code></pre>&#xA;&#xA;<p>The double-quotes that you see must appear in the user program and curly braces mean "any number of graphic characters in the string". The characters are defined further </p>&#xA;&#xA;<pre><code...
formal grammars parsers ambiguity
1
Duplicating the quotation marks in in the quotation-mark enclosed strings -- (formal grammars parsers ambiguity) <p>There is such a grammar</p>&#xA;&#xA;<pre><code>string_literal ::= " { graphic_character } "&#xA;</code></pre>&#xA;&#xA;<p>The double-quotes that you see must appear in the user program and curly braces m...
habedi/stack-exchange-dataset
51,138
Find a source-sink-path that touches a subset of edges
<p>I have a directed graph that has a source node and a sink node and a subset of marked edges.</p>&#xA;&#xA;<p>I need to find a path from source to sink that contains at least one marked edge and is cycle-free.</p>&#xA;
algorithms graphs
1
Find a source-sink-path that touches a subset of edges -- (algorithms graphs) <p>I have a directed graph that has a source node and a sink node and a subset of marked edges.</p>&#xA;&#xA;<p>I need to find a path from source to sink that contains at least one marked edge and is cycle-free.</p>&#xA;
habedi/stack-exchange-dataset
51,145
Proving a sorting operation in type system
<p>I want to know how far a type system in a programming language can be beneficial. For example, I know that in a dependently typed programming language, we can create a <code>Vector</code> class incorporating size of the vector in the type signature. It is like a de-facto example. We can also write a function <code>a...
type theory functional programming dependent types
1
Proving a sorting operation in type system -- (type theory functional programming dependent types) <p>I want to know how far a type system in a programming language can be beneficial. For example, I know that in a dependently typed programming language, we can create a <code>Vector</code> class incorporating size of th...
habedi/stack-exchange-dataset
51,150
Are there any specific problems known to be undecidable for reasons other than diagonalization, self-reference, or reducibility?
<p>Every undecidable problem that I know of falls into one of the following categories:</p>&#xA;&#xA;<ol>&#xA;<li><p>Problems that are undecidable because of diagonalization (indirect self-reference). These problems, like the halting problem, are undecidable because you could use a purported decider for the language to...
computability proof techniques undecidability
1
Are there any specific problems known to be undecidable for reasons other than diagonalization, self-reference, or reducibility? -- (computability proof techniques undecidability) <p>Every undecidable problem that I know of falls into one of the following categories:</p>&#xA;&#xA;<ol>&#xA;<li><p>Problems that are undec...
habedi/stack-exchange-dataset
51,163
How does the NFA decide in a state where there are multiple equally valid "next states"?
<p>How does the NFA decide in a state where there are multiple equally valid "next states"?</p>&#xA;&#xA;<p>Such as here:<br><br>&#xA;<a href="https://i.stack.imgur.com/njBQX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/njBQX.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>How does it...
automata nondeterminism
1
How does the NFA decide in a state where there are multiple equally valid "next states"? -- (automata nondeterminism) <p>How does the NFA decide in a state where there are multiple equally valid "next states"?</p>&#xA;&#xA;<p>Such as here:<br><br>&#xA;<a href="https://i.stack.imgur.com/njBQX.png" rel="nofollow noreferr...
habedi/stack-exchange-dataset
51,174
Difference between $\mathsf{SIZE}(n^k)$ vs $\mathsf{P/poly}$ and $\mathsf{SIZE}(n)$ vs linear size circuit?
<p>In the <a href="https://en.wikipedia.org/wiki/Karp%E2%80%93Lipton_theorem#Application_to_circuit_lower_bounds_.E2.80.93_Kannan.27s_theorem" rel="nofollow noreferrer">Wikipedia page on the Karp&ndash;Lipton theorem</a> it is mentioned that $$\Sigma_2\not\subseteq\mathsf{SIZE}(n^k)$$ (which is known) is not same as $$...
complexity theory circuits
1
Difference between $\mathsf{SIZE}(n^k)$ vs $\mathsf{P/poly}$ and $\mathsf{SIZE}(n)$ vs linear size circuit? -- (complexity theory circuits) <p>In the <a href="https://en.wikipedia.org/wiki/Karp%E2%80%93Lipton_theorem#Application_to_circuit_lower_bounds_.E2.80.93_Kannan.27s_theorem" rel="nofollow noreferrer">Wikipedia p...
habedi/stack-exchange-dataset
51,186
Analysing a context-free grammar
<p>Let:</p>&#xA;&#xA;<p>$$S \to AC \mid BC\\&#xA;A \to aAb \mid aA \mid a\\&#xA;B \to aBb \mid Bb \mid b\\&#xA;C \to Cc \mid c$$ </p>&#xA;&#xA;<p>I need to find if: </p>&#xA;&#xA;<ol>&#xA;<li><p>the word $aabbbcc $ is in the grammer, and if so to write a very left series, and the tree.</p></li>&#xA;<li><p>what is the l...
formal grammars
1
Analysing a context-free grammar -- (formal grammars) <p>Let:</p>&#xA;&#xA;<p>$$S \to AC \mid BC\\&#xA;A \to aAb \mid aA \mid a\\&#xA;B \to aBb \mid Bb \mid b\\&#xA;C \to Cc \mid c$$ </p>&#xA;&#xA;<p>I need to find if: </p>&#xA;&#xA;<ol>&#xA;<li><p>the word $aabbbcc $ is in the grammer, and if so to write a very left s...
habedi/stack-exchange-dataset
51,194
How are HOGs calculated?
<p><a href="http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1467360" rel="nofollow">Histograms of oriented gradients for human detection</a> seems to be the paper from which all other papers cite when they use HOG features. However, this was the only description I could find in it:</p>&#xA;&#xA;<blockquote>&#xA; ...
computer vision books features
1
How are HOGs calculated? -- (computer vision books features) <p><a href="http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1467360" rel="nofollow">Histograms of oriented gradients for human detection</a> seems to be the paper from which all other papers cite when they use HOG features. However, this was the only des...
habedi/stack-exchange-dataset
51,204
How to extract best illustrative sentences from documents for a given word?
<p>I want to extract "best" sentences from the given (html) documents. Let me illustrate this with an example. I have a word "determine". Now I have hundreds of html files having paragraphs and sentences that contain this word. Out of those sentences, I want to collect and score only those that are capable of describin...
algorithms natural language processing
1
How to extract best illustrative sentences from documents for a given word? -- (algorithms natural language processing) <p>I want to extract "best" sentences from the given (html) documents. Let me illustrate this with an example. I have a word "determine". Now I have hundreds of html files having paragraphs and senten...
habedi/stack-exchange-dataset
51,217
P is closed under power of integer
<p>I'm new in this area of complexity and I'm trying to get into it by understanding basic proofs.</p>&#xA;&#xA;<p>I want to prove that if $L\in P$, so $L^k\in P$, where $k$ is non-negative integer.</p>&#xA;&#xA;<p>How to prove it in the "official" way?</p>&#xA;
complexity theory closure properties polynomial time
1
P is closed under power of integer -- (complexity theory closure properties polynomial time) <p>I'm new in this area of complexity and I'm trying to get into it by understanding basic proofs.</p>&#xA;&#xA;<p>I want to prove that if $L\in P$, so $L^k\in P$, where $k$ is non-negative integer.</p>&#xA;&#xA;<p>How to prove...
habedi/stack-exchange-dataset
51,220
Connection between NAND gates and Turing completeness
<p>I know that NAND gates can be used to create circuits that implement every truth table, and modern computers are built up of NAND gates. What is the theoretical link between NAND gates and Turing completeness? It seems to me that NAND gate circuits are closer to finite automata than Turing machines. My intuition is ...
turing machines turing completeness digital circuits
1
Connection between NAND gates and Turing completeness -- (turing machines turing completeness digital circuits) <p>I know that NAND gates can be used to create circuits that implement every truth table, and modern computers are built up of NAND gates. What is the theoretical link between NAND gates and Turing completen...
habedi/stack-exchange-dataset
51,240
Problem on finite state machines in the feynman textbook
<p>I'm currently reading Feynman Lectures on Computation and got stuck in problem 3.1 which says</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose we feed a sequence of 1's and 0's - a binary number -&#xA; into a machine. Design a machine which performs a pairwise sum &#xA; of the digits, that is, one which takes the incomi...
automata finite automata
1
Problem on finite state machines in the feynman textbook -- (automata finite automata) <p>I'm currently reading Feynman Lectures on Computation and got stuck in problem 3.1 which says</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose we feed a sequence of 1's and 0's - a binary number -&#xA; into a machine. Design a machine ...
habedi/stack-exchange-dataset
51,243
Context-free grammar for"not-at-all" palindromes
<p>I need to bulid a context-free grammar for </p>&#xA;&#xA;<p>$\qquad \mathscr{L_4}=\{w\in\{a,b,c\}^* \mid w\text{ is not palindrome at all}\}$ </p>&#xA;&#xA;<p><strong>Not palindrom at all:</strong>&#xA;We will say that a word $w$ is <em>not palindrome at all</em> if <strong>for all</strong> $i$ such that $1\leq i\le...
formal languages context free formal grammars
1
Context-free grammar for"not-at-all" palindromes -- (formal languages context free formal grammars) <p>I need to bulid a context-free grammar for </p>&#xA;&#xA;<p>$\qquad \mathscr{L_4}=\{w\in\{a,b,c\}^* \mid w\text{ is not palindrome at all}\}$ </p>&#xA;&#xA;<p><strong>Not palindrom at all:</strong>&#xA;We will say tha...
habedi/stack-exchange-dataset
51,267
Why is the distinction between linear and context-free grammars useful?
<p>The linear grammar is a grammar that's either left, right or left and right linear.</p>&#xA;&#xA;<p>The context-free grammar can contain any kind of productions of non-terminals and terminals.</p>&#xA;&#xA;<p>All linear grammars are context-free grammars.</p>&#xA;&#xA;<p>But what is useful about distinguishing linea...
context free formal grammars linear languages
1
Why is the distinction between linear and context-free grammars useful? -- (context free formal grammars linear languages) <p>The linear grammar is a grammar that's either left, right or left and right linear.</p>&#xA;&#xA;<p>The context-free grammar can contain any kind of productions of non-terminals and terminals.</...
habedi/stack-exchange-dataset
51,269
Are parser combinators equivalent to scannerless parsing?
<p>From what I can see, parser combinators are equivalent to scannerless parsing. I do not see this stated in <a href="https://en.wikipedia.org/wiki/Scannerless_parsing#Implementations" rel="nofollow">implementations of scannerless parsing</a> page, nor in the <a href="https://en.wikipedia.org/wiki/Parser_combinator" ...
terminology parsers
1
Are parser combinators equivalent to scannerless parsing? -- (terminology parsers) <p>From what I can see, parser combinators are equivalent to scannerless parsing. I do not see this stated in <a href="https://en.wikipedia.org/wiki/Scannerless_parsing#Implementations" rel="nofollow">implementations of scannerless pars...
habedi/stack-exchange-dataset
51,274
Query on consequences of $\mathsf{P=BPP}$
<p>We know $\mathsf{P=BPP} \implies \mathsf{NEXP\not\subseteq P/Poly}$ or permanent does not have polynomial sized circuits. However permanent needs superpoly circuits imply $\mathsf{NEXP\not\subseteq P/Poly}$ since $\mathsf{P^{\#P}\subseteq PSPACE\subseteq NEXP}$. So why dont we just say $\mathsf{P=BPP} \implies \mat...
complexity theory
1
Query on consequences of $\mathsf{P=BPP}$ -- (complexity theory) <p>We know $\mathsf{P=BPP} \implies \mathsf{NEXP\not\subseteq P/Poly}$ or permanent does not have polynomial sized circuits. However permanent needs superpoly circuits imply $\mathsf{NEXP\not\subseteq P/Poly}$ since $\mathsf{P^{\#P}\subseteq PSPACE\subse...
habedi/stack-exchange-dataset
51,277
What does up arrow ($\uparrow$) mean in pseudocode?
<p>I'm learning vantage point trees, and I met this while reading the paper <em>Data Structures and Algorithms for Nearest Neighbor Search in General Metric Spaces</em> by Peter Yianilos (<em>Proceedings of SODA 1993</em>, SIAM, pages 311&ndash;321; <a href="http://pnylab.com/pny/papers/vptree/vptree.pdf">PDF</a>). Th...
notation
1
What does up arrow ($\uparrow$) mean in pseudocode? -- (notation) <p>I'm learning vantage point trees, and I met this while reading the paper <em>Data Structures and Algorithms for Nearest Neighbor Search in General Metric Spaces</em> by Peter Yianilos (<em>Proceedings of SODA 1993</em>, SIAM, pages 311&ndash;321; <a h...
habedi/stack-exchange-dataset
51,282
On $SUBEXP$, $PP$ and $P/poly$
<p>Complexity zoo <a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:D#dtime" rel="nofollow">https://complexityzoo.uwaterloo.ca/Complexity_Zoo:D#dtime</a> states $DTIME(f(n))$ with $PP$ oracle is not in $P/Poly$ if $f(n)$ is superpolynomial.</p>&#xA;&#xA;<p>We know $SUBEXP=\cap_{\epsilon&gt;0}DTIME(2^{n^\epsilo...
complexity theory oracle machines
1
On $SUBEXP$, $PP$ and $P/poly$ -- (complexity theory oracle machines) <p>Complexity zoo <a href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo:D#dtime" rel="nofollow">https://complexityzoo.uwaterloo.ca/Complexity_Zoo:D#dtime</a> states $DTIME(f(n))$ with $PP$ oracle is not in $P/Poly$ if $f(n)$ is superpolynomial.<...
habedi/stack-exchange-dataset
51,287
How should I show that a grammar is not LL(1) and convert grammar to LL(1)
<p>I'm trying to find the ambiguity in this grammar so I can remove it and convert it to LL(1), however for the life of me, I can't find the ambiguity. Moreover, I think there is cycle between X and Y and I could not find a solution to solve this. </p>&#xA;&#xA;<blockquote>&#xA; <p>1) X -->YX|$ </p>&#xA; &#xA; <...
formal grammars parsers ll k
1
How should I show that a grammar is not LL(1) and convert grammar to LL(1) -- (formal grammars parsers ll k) <p>I'm trying to find the ambiguity in this grammar so I can remove it and convert it to LL(1), however for the life of me, I can't find the ambiguity. Moreover, I think there is cycle between X and Y and I cou...
habedi/stack-exchange-dataset
51,292
Prove that if you can derive w from α in n steps, it's possible with n left-derivations as well
<p>My university's automata theory book claims that the following claim can be proved by induction but it doesn't bother showing the proof. </p>&#xA;&#xA;<p>I've tried to prove it myself but I got stuck at the Inductive Step.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Let $G=(V,T,P,S)$ be a context free grammar.</p>&#xA;&#xA;<p>Pro...
formal languages context free formal grammars
1
Prove that if you can derive w from α in n steps, it's possible with n left-derivations as well -- (formal languages context free formal grammars) <p>My university's automata theory book claims that the following claim can be proved by induction but it doesn't bother showing the proof. </p>&#xA;&#xA;<p>I've tried to pr...
habedi/stack-exchange-dataset
51,302
How to do last step of Krom's algorithm for solving 2SAT problems
<p>I was making a program for solving 2 SAT problems, using Krom's algorithm. I did not found a lot of information searching in Google, so I used <a href="https://en.wikipedia.org/wiki/2-satisfiability#Resolution_and_transitive_closure" rel="nofollow">Wikipedia's description of Krom's algorithm</a> to implement it but ...
algorithms 2 sat
1
How to do last step of Krom's algorithm for solving 2SAT problems -- (algorithms 2 sat) <p>I was making a program for solving 2 SAT problems, using Krom's algorithm. I did not found a lot of information searching in Google, so I used <a href="https://en.wikipedia.org/wiki/2-satisfiability#Resolution_and_transitive_clos...
habedi/stack-exchange-dataset
51,309
Choosing nonzero entries from an array so no pair in same row or column
<p>Suppose we have an $n\times n$ array&nbsp;$A$ of non-negative real numbers in which the sum of each row and each column is&nbsp;$1$. We want to find $n$&nbsp;entries of the array $(x_1,y_1), \dots, (x_n,y_n)$ such that</p>&#xA;&#xA;<ul>&#xA;<li>each $A[x_i,y_i]&gt;0$ and</li>&#xA;<li>no pair $(x_i,y_i),(x_j,y_j)$ a...
proof techniques matrices search problem
1
Choosing nonzero entries from an array so no pair in same row or column -- (proof techniques matrices search problem) <p>Suppose we have an $n\times n$ array&nbsp;$A$ of non-negative real numbers in which the sum of each row and each column is&nbsp;$1$. We want to find $n$&nbsp;entries of the array $(x_1,y_1), \dots, ...
habedi/stack-exchange-dataset
51,311
Lower bound for number of nonterminals in a CFG
<p>Let's say we have a context-free grammar for the language $a\mbox{*}b\mbox{*}c\mbox{*}$. Is there a way to determine a lower bound for the number of nonterminals in this grammar? I'm pretty sure you need at least 2, but I haven't been able to prove it.</p>&#xA;
formal languages context free formal grammars lower bounds
1
Lower bound for number of nonterminals in a CFG -- (formal languages context free formal grammars lower bounds) <p>Let's say we have a context-free grammar for the language $a\mbox{*}b\mbox{*}c\mbox{*}$. Is there a way to determine a lower bound for the number of nonterminals in this grammar? I'm pretty sure you need...
habedi/stack-exchange-dataset
51,314
*non-uniform* $ACC^0$ and above classes
<p>$NEXP$ smallest class above $ACC^0$ that we know is separated from $ACC^0$. </p>&#xA;&#xA;<p>We do not know if either $NP$ or $P/poly$ is in $ACC^0$.</p>&#xA;&#xA;<p>Suppose every problem in $NP$ can be solved in polynomial time with polynomial sized advice string (that is $NP\subseteq P/poly$ holds) however the cir...
complexity theory circuits
1
*non-uniform* $ACC^0$ and above classes -- (complexity theory circuits) <p>$NEXP$ smallest class above $ACC^0$ that we know is separated from $ACC^0$. </p>&#xA;&#xA;<p>We do not know if either $NP$ or $P/poly$ is in $ACC^0$.</p>&#xA;&#xA;<p>Suppose every problem in $NP$ can be solved in polynomial time with polynomial ...
habedi/stack-exchange-dataset
51,319
Number of finite strings over a countably infinite alphabet
<p>If the alphabet is countably infinite, then is the number of finite-length strings over this alphabet countably or uncountably infinite?</p>&#xA;
combinatorics sets uncountability
1
Number of finite strings over a countably infinite alphabet -- (combinatorics sets uncountability) <p>If the alphabet is countably infinite, then is the number of finite-length strings over this alphabet countably or uncountably infinite?</p>&#xA;
habedi/stack-exchange-dataset
51,328
Cocke-Younger-Kasami (CYK) algorithem for the word $baabb$
<p>With the context-free grammar in Chomsky's form:$$S\to BA|AC|b\\A\to AA|AB|CC|a\\B\to AS|BB|CA\\C\to AB|SS|b$$ </p>&#xA;&#xA;<p>I need to:</p>&#xA;&#xA;<blockquote>&#xA; <ol>&#xA; <li><p>run the CYK (Cocke-Younger-Kasami) algorithm and decide if I can derive the word $baabb$ from the context.</p></li>&#xA; <li>...
algorithms context free formal grammars parsers
1
Cocke-Younger-Kasami (CYK) algorithem for the word $baabb$ -- (algorithms context free formal grammars parsers) <p>With the context-free grammar in Chomsky's form:$$S\to BA|AC|b\\A\to AA|AB|CC|a\\B\to AS|BB|CA\\C\to AB|SS|b$$ </p>&#xA;&#xA;<p>I need to:</p>&#xA;&#xA;<blockquote>&#xA; <ol>&#xA; <li><p>run the CYK (C...
habedi/stack-exchange-dataset
51,332
Why does the proof of undecidability of $A_{TM}$ require the universal TM to take input $\langle M,\langle M\rangle\rangle$?
<p>I've read a proof explaining why $A_{\mathrm{TM}}$ is undecidable, and I don't seem to understand why we need to give the opposite of $H$ function $D$ itself as input.</p>&#xA;&#xA;<p>Here's the copy-paste of that proof (link: <a href="https://courses.cs.washington.edu/courses/cse322/04au/Lect10.pdf" rel="nofollow">...
computability proof techniques undecidability halting problem
1
Why does the proof of undecidability of $A_{TM}$ require the universal TM to take input $\langle M,\langle M\rangle\rangle$? -- (computability proof techniques undecidability halting problem) <p>I've read a proof explaining why $A_{\mathrm{TM}}$ is undecidable, and I don't seem to understand why we need to give the opp...
habedi/stack-exchange-dataset
51,355
How to prove that 3-coloring is decidable?
<p>In order to prove that 3-coloring is decidable, is it sufficient to say: </p>&#xA;&#xA;<ul>&#xA;<li>Each node in the graph has 3 possible colors</li>&#xA;<li>Therefore we can enumerate over all $3^n$ possibilities and then check that no two edges connect nodes with the same color</li>&#xA;</ul>&#xA;&#xA;<p>Does that...
computability turing machines colorings
1
How to prove that 3-coloring is decidable? -- (computability turing machines colorings) <p>In order to prove that 3-coloring is decidable, is it sufficient to say: </p>&#xA;&#xA;<ul>&#xA;<li>Each node in the graph has 3 possible colors</li>&#xA;<li>Therefore we can enumerate over all $3^n$ possibilities and then check ...
habedi/stack-exchange-dataset
51,357
Every AVL tree may be red black tree
<p>I proved by induction that every AVL tree may be colored such that it will be red black tree. The problem is that I can't see an error in my proof. Look at my proof.</p>&#xA;&#xA;<p>Induction for height.<br>&#xA;Let's assume that it is truth for each AVL tree of height at most $h$.<br>&#xA;Let's consider AVL tree $...
data structures binary trees search trees balanced search trees check my answer
1
Every AVL tree may be red black tree -- (data structures binary trees search trees balanced search trees check my answer) <p>I proved by induction that every AVL tree may be colored such that it will be red black tree. The problem is that I can't see an error in my proof. Look at my proof.</p>&#xA;&#xA;<p>Induction fo...
habedi/stack-exchange-dataset
51,362
Are there any problems that get easier as they increase in size?
<p>This may be a ridiculous question, but is it possible to have a problem that actually gets easier as the inputs grow in size? I doubt any practical problems are like this, but maybe we can invent a degenerate problem that has this property. For instance, perhaps it begins to "solve itself" as it gets larger, or be...
algorithms asymptotics
1
Are there any problems that get easier as they increase in size? -- (algorithms asymptotics) <p>This may be a ridiculous question, but is it possible to have a problem that actually gets easier as the inputs grow in size? I doubt any practical problems are like this, but maybe we can invent a degenerate problem that h...
habedi/stack-exchange-dataset
51,376
Partial polygon matching
<p>I am looking for fast procedures for polygon matching, i.e. checking polygon similarity under different transforms</p>&#xA;&#xA;<ul>&#xA;<li>translation only,</li>&#xA;<li>translation + rotation,</li>&#xA;<li>translation + scaling,</li>&#xA;<li>translation + rotation + scaling (= similarity).</li>&#xA;</ul>&#xA;&#xA...
algorithms computational geometry pattern recognition polygons
1
Partial polygon matching -- (algorithms computational geometry pattern recognition polygons) <p>I am looking for fast procedures for polygon matching, i.e. checking polygon similarity under different transforms</p>&#xA;&#xA;<ul>&#xA;<li>translation only,</li>&#xA;<li>translation + rotation,</li>&#xA;<li>translation + s...
habedi/stack-exchange-dataset
51,380
Ripple Carry Adder
<p>I'm new to computer science and came across an issue while learning about ripple carry adders. I'm trying to add binary 1+1+1 below (excuse the poor photoshopping). I know the answer should be binary 11, but my sums were 0 and 0 with a carry of 1. Shouldn't my sums be 1 and 1 with a carry of 0? What am I doing w...
computer architecture arithmetic digital circuits cpu
1
Ripple Carry Adder -- (computer architecture arithmetic digital circuits cpu) <p>I'm new to computer science and came across an issue while learning about ripple carry adders. I'm trying to add binary 1+1+1 below (excuse the poor photoshopping). I know the answer should be binary 11, but my sums were 0 and 0 with a c...
habedi/stack-exchange-dataset
51,384
Algorithm for a list of best solutions to the Assignment problem
<p>I am trying to brute force a classical substitution cipher. The problem is that there are $26!$ possible keys. So, I'd like to do frequency analysis to try likely keys first. Then, on the first $n$ tries I will use a dictionary to see if there are actual words in the decryption. That way, I don't need to try all pos...
algorithms assignment problem
1
Algorithm for a list of best solutions to the Assignment problem -- (algorithms assignment problem) <p>I am trying to brute force a classical substitution cipher. The problem is that there are $26!$ possible keys. So, I'd like to do frequency analysis to try likely keys first. Then, on the first $n$ tries I will use a ...
habedi/stack-exchange-dataset
51,385
Prove that every thin AVL tree may be converted to red-black tree
<p>Let's define thin AVL tree as AVL tree $t'$ such that contains minimal possible number of nodes among all AVL tree $t$ such that $height(t)=height(t')$. </p>&#xA;&#xA;<p>I am trying to prove that every thin AVL tree may be colored to be red-black tree. I would like to use induction. I tried to do induction by heig...
proof techniques binary trees
1
Prove that every thin AVL tree may be converted to red-black tree -- (proof techniques binary trees) <p>Let's define thin AVL tree as AVL tree $t'$ such that contains minimal possible number of nodes among all AVL tree $t$ such that $height(t)=height(t')$. </p>&#xA;&#xA;<p>I am trying to prove that every thin AVL tre...
habedi/stack-exchange-dataset
51,402
Relations between statements involving universal quantifier, conditional and biconditional
<p>If we consider two predicates:</p>&#xA;&#xA;<p>$b(x)$: x is a boy</p>&#xA;&#xA;<p>$c(x)$: x is clever</p>&#xA;&#xA;<p>Then, there are four statements involving $∀, b(x), c(x), →$ and $↔$ . These are below along with my interpretation of their meaning. Correct me if I am wrong in any of these interpretations.</p>&#x...
logic first order logic propositional logic
1
Relations between statements involving universal quantifier, conditional and biconditional -- (logic first order logic propositional logic) <p>If we consider two predicates:</p>&#xA;&#xA;<p>$b(x)$: x is a boy</p>&#xA;&#xA;<p>$c(x)$: x is clever</p>&#xA;&#xA;<p>Then, there are four statements involving $∀, b(x), c(x), →...
habedi/stack-exchange-dataset
51,403
What is a proper way of solving a multibody nonlinear problem?
<p>I encountered some system of ~5000 random nodes connected by ~8000 non-hookean springs, with ~1300 nodes at the boundary fixed as the "wall", the potential of the springs are of the form $dx*e^{(dx/a)}$ where $a$ is a constant and $dx$ the strain (displacement/original length) of the spring, I am using Monte Carlo m...
monte carlo
1
What is a proper way of solving a multibody nonlinear problem? -- (monte carlo) <p>I encountered some system of ~5000 random nodes connected by ~8000 non-hookean springs, with ~1300 nodes at the boundary fixed as the "wall", the potential of the springs are of the form $dx*e^{(dx/a)}$ where $a$ is a constant and $dx$ t...
habedi/stack-exchange-dataset
51,427
Are all non-terminals of the CFG given by the LHS of productions?
<p>A definition for terminals and non-terminals of a CFG says that</p>&#xA;&#xA;<blockquote>&#xA; <p>terminals: The symbols that do not appear at the LHS of productions.</p>&#xA;</blockquote>&#xA;&#xA;<p>Therefore,</p>&#xA;&#xA;<p><strong>Are all non-terminals of the CFG given by the LHS of productions?</strong></p>&#...
context free
1
Are all non-terminals of the CFG given by the LHS of productions? -- (context free) <p>A definition for terminals and non-terminals of a CFG says that</p>&#xA;&#xA;<blockquote>&#xA; <p>terminals: The symbols that do not appear at the LHS of productions.</p>&#xA;</blockquote>&#xA;&#xA;<p>Therefore,</p>&#xA;&#xA;<p><str...
habedi/stack-exchange-dataset
51,432
Operating system processes
<p>I'm a bit confused about this question:</p>&#xA;&#xA;<blockquote>&#xA; <p>"Multiple jobs can run in parallel and finish faster than if they had run sequentially. Suppose that two jobs, each needing 10 minutes of CPU time, start simultaneously. How long will the last one take to complete if they run sequentially? Ho...
operating systems process scheduling
1
Operating system processes -- (operating systems process scheduling) <p>I'm a bit confused about this question:</p>&#xA;&#xA;<blockquote>&#xA; <p>"Multiple jobs can run in parallel and finish faster than if they had run sequentially. Suppose that two jobs, each needing 10 minutes of CPU time, start simultaneously. How...
habedi/stack-exchange-dataset
51,443
Depth first or breadth first ordering in binary search trees?
<p>Let's say that I make a binary search tree and store it in an array so that I end up with an array that is more cache friendly to binary search compared to a sorted array.</p>&#xA;&#xA;<p>The binary tree is full on all levels except possibly the last level, where it is filled from left to right.</p>&#xA;&#xA;<p>Spec...
binary trees search trees cpu cache
1
Depth first or breadth first ordering in binary search trees? -- (binary trees search trees cpu cache) <p>Let's say that I make a binary search tree and store it in an array so that I end up with an array that is more cache friendly to binary search compared to a sorted array.</p>&#xA;&#xA;<p>The binary tree is full on...
habedi/stack-exchange-dataset
51,444
Explanation for indirect addressing
<p>While reading about minimal instruction set computer I found out that one needs at least (for example) the ability to increment or decrement the value stored in register, a test for zero and a jump.</p>&#xA;<p>A machine with such instruction set would be Turing-complete, correct? Is this called &quot;Counter machine...
computer architecture computation models turing completeness
1
Explanation for indirect addressing -- (computer architecture computation models turing completeness) <p>While reading about minimal instruction set computer I found out that one needs at least (for example) the ability to increment or decrement the value stored in register, a test for zero and a jump.</p>&#xA;<p>A mac...
habedi/stack-exchange-dataset
51,450
Is C → A B C | A left-factorizable?
<p>$$C \to A B C \mid A$$</p>&#xA;&#xA;<p>Obviously has the same FIRST(C) for the both productions.</p>&#xA;&#xA;<p>But how can this be left-factorised?</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Tried:</p>&#xA;&#xA;<p>$$C \to A B C'$$&#xA;$$C' \to A C \mid \varepsilon$$</p>&#xA;&#xA;<p>The FIRST sets are disjoint, but is this corr...
formal grammars parsers
1
Is C → A B C | A left-factorizable? -- (formal grammars parsers) <p>$$C \to A B C \mid A$$</p>&#xA;&#xA;<p>Obviously has the same FIRST(C) for the both productions.</p>&#xA;&#xA;<p>But how can this be left-factorised?</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>Tried:</p>&#xA;&#xA;<p>$$C \to A B C'$$&#xA;$$C' \to A C \mid \varepsilo...
habedi/stack-exchange-dataset
51,458
Deriving from a terminal word in a context free grammar
<p>Just to make it clear.&#xA;(since my book doesn't mention anything like this)</p>&#xA;&#xA;<p>Suppose we have a context free grammar $G=(V,T,P,S)$.&#xA;where $T=\{a,b\}$ (The other sets doesn't really matter).</p>&#xA;&#xA;<p>Since $\Rightarrow^*$ is the reflexive transitive closure of the relation $\Rightarrow$ on ...
formal languages context free formal grammars tree grammars
1
Deriving from a terminal word in a context free grammar -- (formal languages context free formal grammars tree grammars) <p>Just to make it clear.&#xA;(since my book doesn't mention anything like this)</p>&#xA;&#xA;<p>Suppose we have a context free grammar $G=(V,T,P,S)$.&#xA;where $T=\{a,b\}$ (The other sets doesn't re...
habedi/stack-exchange-dataset
51,462
Deterministic linear time algorithm to check if one array is a sorted version of the other
<p>Consider the following problem:</p>&#xA;&#xA;<p><strong>Input:</strong> two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order. </p>&#xA;&#xA;<p><strong>Query:</strong> do $A$ and $B$ contain the same items (with their multiplicity)?</p>&#xA;&#xA;<p>What is the fastest <a href="https://en.wikipedia.org/w...
algorithms reference request sorting
1
Deterministic linear time algorithm to check if one array is a sorted version of the other -- (algorithms reference request sorting) <p>Consider the following problem:</p>&#xA;&#xA;<p><strong>Input:</strong> two arrays $A$ and $B$ of length $n$, where $B$ is in sorted order. </p>&#xA;&#xA;<p><strong>Query:</strong> do ...
habedi/stack-exchange-dataset