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 |
|---|---|---|---|---|---|---|
104,189 | Path of maximum value with bounded cost in DAG | <p>Consider a Directed Acyclic Graph in which every node has a value and a cost and edges do not have any weight. I need to find a path containing nodes such that sum of values of these nodes is maximized, but sum of cost over all these nodes must be at most C.</p>

<p>I am thinking of some modification of Dijk... | algorithms graphs data structures | 1 | Path of maximum value with bounded cost in DAG -- (algorithms graphs data structures)
<p>Consider a Directed Acyclic Graph in which every node has a value and a cost and edges do not have any weight. I need to find a path containing nodes such that sum of values of these nodes is maximized, but sum of cost over all the... | habedi/stack-exchange-dataset |
104,194 | Replace queries on string | <p>Let's define a replace query on some string <span class="math-container">$s$</span>.</p>

<p>Consider a string <span class="math-container">$s$</span> of length <span class="math-container">$n$</span> over alphabet <span class="math-container">$C = \{ c_{0}, c_{1}, c_{2}, \dots, c_{k}\}$</span>. Also conside... | data structures strings | 1 | Replace queries on string -- (data structures strings)
<p>Let's define a replace query on some string <span class="math-container">$s$</span>.</p>

<p>Consider a string <span class="math-container">$s$</span> of length <span class="math-container">$n$</span> over alphabet <span class="math-container">$C = \{ c_... | habedi/stack-exchange-dataset |
104,198 | DFA for $L = \{y \in (a+b)^* \mid ||y|_a - |y|_b| \leq 10 \}$ | <p><span class="math-container">$L = \{y \in (a+b)^* \mid ||y|_a - |y|_b| \leq 10 \}$</span></p>

<p>Any idea? I have problem with this kind of task. </p>
 | formal languages context free finite automata | 1 | DFA for $L = \{y \in (a+b)^* \mid ||y|_a - |y|_b| \leq 10 \}$ -- (formal languages context free finite automata)
<p><span class="math-container">$L = \{y \in (a+b)^* \mid ||y|_a - |y|_b| \leq 10 \}$</span></p>

<p>Any idea? I have problem with this kind of task. </p>
 | habedi/stack-exchange-dataset |
104,199 | Is the reverse of a closed under operation maintainable? | <p>I'm looking at the following question from this <a href="https://www.eecs.yorku.ca/course_archive/2006-07/F/2001/handouts/lect18.pdf" rel="nofollow noreferrer">handout</a>:</p>

<blockquote>
 <p>The class of decidable languages is closed under union</p>
</blockquote>

<p>My question is, does... | formal languages turing machines automata undecidability | 1 | Is the reverse of a closed under operation maintainable? -- (formal languages turing machines automata undecidability)
<p>I'm looking at the following question from this <a href="https://www.eecs.yorku.ca/course_archive/2006-07/F/2001/handouts/lect18.pdf" rel="nofollow noreferrer">handout</a>:</p>

<blockquote>... | habedi/stack-exchange-dataset |
104,200 | Sorting on non-linear topology | <p><strong>Disclaimer.</strong> What I'm going to ask about below may seem to be "Topological sorting". To my understanding, it is not. The latter runs in linear time, while I'm looking for a modification of the regular sort, which is at <span class="math-container">$N\log N$</span>.</p>

<p><strong>Remark.</st... | graphs sorting search algorithms | 1 | Sorting on non-linear topology -- (graphs sorting search algorithms)
<p><strong>Disclaimer.</strong> What I'm going to ask about below may seem to be "Topological sorting". To my understanding, it is not. The latter runs in linear time, while I'm looking for a modification of the regular sort, which is at <span class="... | habedi/stack-exchange-dataset |
104,216 | Lexicographically smallest down-right path in matrix | <p>Here is the problem which I thought was simple dynamic programming, which is however not the case.</p>

<p>Given an <span class="math-container">$N \times M$</span> matrix of numbers from 1 to <span class="math-container">$NM$</span> (each number occurs only once), find a path from top left to right bottom ... | algorithms dynamic programming lexical analysis matrix | 1 | Lexicographically smallest down-right path in matrix -- (algorithms dynamic programming lexical analysis matrix)
<p>Here is the problem which I thought was simple dynamic programming, which is however not the case.</p>

<p>Given an <span class="math-container">$N \times M$</span> matrix of numbers from 1 to <sp... | habedi/stack-exchange-dataset |
104,225 | Must the champion of an entire tournament beat the champion of a possible tournament among other players? | <p>I have a list of "players" of a "tournament". Any two <em>adjacent</em> players may "compete", which results in the loser being thrown out of the tournament. Winning is not transitive. The winner of a given competition between two players is known, but the order of competitions is not. Suppose that I have some tourn... | correctness proof game theory | 1 | Must the champion of an entire tournament beat the champion of a possible tournament among other players? -- (correctness proof game theory)
<p>I have a list of "players" of a "tournament". Any two <em>adjacent</em> players may "compete", which results in the loser being thrown out of the tournament. Winning is not tra... | habedi/stack-exchange-dataset |
104,235 | heap pop creates unbalanced tree? | <p>say you have a min-heap. Popping removes the root and replaces it with the value of one of the leaves and then heapifies. couldnt this last heapify result in an unbalanced tree? is there something you have to do to maintain the balance of the tree?</p>
 | data structures heaps | 1 | heap pop creates unbalanced tree? -- (data structures heaps)
<p>say you have a min-heap. Popping removes the root and replaces it with the value of one of the leaves and then heapifies. couldnt this last heapify result in an unbalanced tree? is there something you have to do to maintain the balance of the tree?</p>&#x... | habedi/stack-exchange-dataset |
104,257 | Logic behind O(n) solution for 'Maximum length sub-array having given sum' | <p>I am unable to understand the logic behind <code>O(n)</code> solution of this classical problem- <code>Maximum length sub-array having given sum</code> (negative numbers included),</p>

<p>I read that it can be solved in <code>O(n) time complexity and O(n) space complexity</code>, but the logic behind it is ... | algorithms time complexity space complexity | 1 | Logic behind O(n) solution for 'Maximum length sub-array having given sum' -- (algorithms time complexity space complexity)
<p>I am unable to understand the logic behind <code>O(n)</code> solution of this classical problem- <code>Maximum length sub-array having given sum</code> (negative numbers included),</p>

... | habedi/stack-exchange-dataset |
104,266 | Trying to understand the question(well spaced points ?) better | <p>Let us have a sorted array of n numbers and we would like to find a well spaced set of C of them, More specifically, we want to get a subset <span class="math-container">$ S\subset T$</span> with |S| = C and with <span class="math-container">$min_{i,j \in S,i\ne j} |i-j|$</span> as large as possible. Come up an alg... | algorithms dynamic programming greedy algorithms | 1 | Trying to understand the question(well spaced points ?) better -- (algorithms dynamic programming greedy algorithms)
<p>Let us have a sorted array of n numbers and we would like to find a well spaced set of C of them, More specifically, we want to get a subset <span class="math-container">$ S\subset T$</span> with |S| ... | habedi/stack-exchange-dataset |
104,272 | Can maximum matching algorithms be used for maximum weight matching? | <p>There are two fast algorithms for maximum matching on general graphs:</p>

<ul>
<li><p>Micali and Vazirani in <span class="math-container">$O(E\sqrt{V})$</span>.</p></li>
<li><p>Mucha and Sankowski in <span class="math-container">$O(V^{2.376})$</span>.</p></li>
</ul>

<p>Can these be also... | algorithms matching | 1 | Can maximum matching algorithms be used for maximum weight matching? -- (algorithms matching)
<p>There are two fast algorithms for maximum matching on general graphs:</p>

<ul>
<li><p>Micali and Vazirani in <span class="math-container">$O(E\sqrt{V})$</span>.</p></li>
<li><p>Mucha and Sankowski in <span ... | habedi/stack-exchange-dataset |
104,279 | Does there exist a context-free language $L$ such that $L\cap L^2$ is not context-free? | <p>I can see that <span class="math-container">$L$</span> has to be context-free but not regular here as regular languages are closed under concatenation and intersection. But <span class="math-container">$L\cap L^2$</span> looks too weird. I couldn't think of any <span class="math-container">$L$</span> that gives rise... | regular languages context free regular expressions | 1 | Does there exist a context-free language $L$ such that $L\cap L^2$ is not context-free? -- (regular languages context free regular expressions)
<p>I can see that <span class="math-container">$L$</span> has to be context-free but not regular here as regular languages are closed under concatenation and intersection. But ... | habedi/stack-exchange-dataset |
104,289 | Decidability of equivalence to existential formulas | <p>I'm looking for an algorithm to decide if a given first order formula over a fixed vocabulary admits a logically equivalent existential one (i.e. a formula in prenex form where all quantifiers are existentials).</p>

<p>Is it known if such an algorithm exists or does not exist? At least when no functions sym... | formal languages time complexity logic first order logic | 1 | Decidability of equivalence to existential formulas -- (formal languages time complexity logic first order logic)
<p>I'm looking for an algorithm to decide if a given first order formula over a fixed vocabulary admits a logically equivalent existential one (i.e. a formula in prenex form where all quantifiers are existe... | habedi/stack-exchange-dataset |
104,291 | Given a sorted array with n elements and element x that is inside the array at position k, find k in O(min(logk, log(n-k))) | <blockquote>
 <p>Given a sorted array <span class="math-container">$A[1,\ldots,n]$</span> and element <span class="math-container">$x$</span> that located at
 position <span class="math-container">$k$</span>. We know <span class="math-container">$x$</span>, we don't know <span class="math-container">$k$</span... | algorithms time complexity binary search | 1 | Given a sorted array with n elements and element x that is inside the array at position k, find k in O(min(logk, log(n-k))) -- (algorithms time complexity binary search)
<blockquote>
 <p>Given a sorted array <span class="math-container">$A[1,\ldots,n]$</span> and element <span class="math-container">$x$</span> tha... | habedi/stack-exchange-dataset |
104,297 | Defining Local Search stopping criteria | <p>When performing a local search, for example, a 2-node exchange in a metaheuristic (like GRASP), what is the usual stopping criteria for that procedure?
Some bibliography says that the local search stops when no further improvement can be found in the neighboorhoud of the current solution. My question is: whether... | algorithms heuristics | 1 | Defining Local Search stopping criteria -- (algorithms heuristics)
<p>When performing a local search, for example, a 2-node exchange in a metaheuristic (like GRASP), what is the usual stopping criteria for that procedure?
Some bibliography says that the local search stops when no further improvement can be found in... | habedi/stack-exchange-dataset |
104,307 | Minimizing the maximum Manhattan distance | <p>Given N points on a grid, find the number of points, such that the smallest maximal Manhattan distance from these points to any point on the grid is minimized. Also, determine the distance itself.</p>

<p>The points are inside a grid, –10000 ≤ Xi ≤ 10000 ; –10000 ≤ Yi ≤ 10000, N<=100000.</p>

<p>... | computational geometry | 1 | Minimizing the maximum Manhattan distance -- (computational geometry)
<p>Given N points on a grid, find the number of points, such that the smallest maximal Manhattan distance from these points to any point on the grid is minimized. Also, determine the distance itself.</p>

<p>The points are inside a grid, –100... | habedi/stack-exchange-dataset |
104,318 | Proving a set is at a certain level of the arithmetical hierarchy | <p>I'm interested in methods for proving a set is at some level <span class="math-container">$\Sigma^0_n$</span> (or <span class="math-container">$\Pi^0_n$</span>) in the arithmetical hierarchy, and in particular, proving it is at the level with the smallest <span class="math-container">$n$</span> possible.</p>
&#x... | complexity theory computability | 1 | Proving a set is at a certain level of the arithmetical hierarchy -- (complexity theory computability)
<p>I'm interested in methods for proving a set is at some level <span class="math-container">$\Sigma^0_n$</span> (or <span class="math-container">$\Pi^0_n$</span>) in the arithmetical hierarchy, and in particular, pro... | habedi/stack-exchange-dataset |
104,320 | Is the infinite language unrecognizable in a Turing machine? | <p>This question is building up on an older one, <a href="https://cs.stackexchange.com/questions/48381/can-input-to-a-turing-machine-be-of-infinite-length?rq=1">here</a>.</p>

<p>But now let's say we keep <span class="math-container">$Σ=\{0,1\}$</span>. Is the TM that accept anys (<span class="math-container">$... | formal languages turing machines automata undecidability | 1 | Is the infinite language unrecognizable in a Turing machine? -- (formal languages turing machines automata undecidability)
<p>This question is building up on an older one, <a href="https://cs.stackexchange.com/questions/48381/can-input-to-a-turing-machine-be-of-infinite-length?rq=1">here</a>.</p>

<p>But now le... | habedi/stack-exchange-dataset |
104,328 | Why is EXACT-CLIQUE not in co-NP? | <p>In my lecture I saw the problem of 
<span class="math-container">$\text{EXACT-CLIQUE} = \{\langle G,k\rangle : \text{the largest clique in $G$ is of order $k$}\}$</span></p>

<p>I understand this problem is obviously not in NP as we would need to check all cliques, but if we consider the complement of th... | complexity theory decision problem clique | 1 | Why is EXACT-CLIQUE not in co-NP? -- (complexity theory decision problem clique)
<p>In my lecture I saw the problem of 
<span class="math-container">$\text{EXACT-CLIQUE} = \{\langle G,k\rangle : \text{the largest clique in $G$ is of order $k$}\}$</span></p>

<p>I understand this problem is obviously not in ... | habedi/stack-exchange-dataset |
104,337 | Prove the MinAveCodeLen of a product information source is less than the sum of that of the multiplicand and multiplier source? | <p>The product of 2 independent sources <span class="math-container">$(S_A,P_A)$</span> and <span class="math-container">$(S_B,P_B)$</span> is defined as</p>

<p><span class="math-container">$$
(S,P)\text{ s.t. }S = \{s_As_B|s_A\in S_A,s_B\in B\}\text{ and }\ P(s_As_B) = P_A(s_A)\cdot P_B(s_B)\,\forall s_A\... | information theory coding theory encoding scheme huffman coding | 1 | Prove the MinAveCodeLen of a product information source is less than the sum of that of the multiplicand and multiplier source? -- (information theory coding theory encoding scheme huffman coding)
<p>The product of 2 independent sources <span class="math-container">$(S_A,P_A)$</span> and <span class="math-container">$(... | habedi/stack-exchange-dataset |
104,349 | Language of all sequences of permutations whose product is the identity | <p>Let <span class="math-container">$\Sigma$</span> be the set of all permutations in <span class="math-container">$S_n$</span>. What is the minimum number of states in a DFA accepting the language of all words over <span class="math-container">$\Sigma$</span> which multiply to the identity permutation?</p>

<p... | automata finite automata | 1 | Language of all sequences of permutations whose product is the identity -- (automata finite automata)
<p>Let <span class="math-container">$\Sigma$</span> be the set of all permutations in <span class="math-container">$S_n$</span>. What is the minimum number of states in a DFA accepting the language of all words over <s... | habedi/stack-exchange-dataset |
104,354 | Name of a tree with arbitrary number of branches at each fork point? | <p>A binary tree is a rooted tree with the root having an indegree of 0 and all other nodes of 1. The outdegree is 0, 1 or 2 for all nodes.</p>

<p><a href="https://i.stack.imgur.com/KPimm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KPimm.png" alt="Binary tree - root with 2 branches, whic... | graphs terminology | 1 | Name of a tree with arbitrary number of branches at each fork point? -- (graphs terminology)
<p>A binary tree is a rooted tree with the root having an indegree of 0 and all other nodes of 1. The outdegree is 0, 1 or 2 for all nodes.</p>

<p><a href="https://i.stack.imgur.com/KPimm.png" rel="nofollow noreferrer"... | habedi/stack-exchange-dataset |
104,361 | What is an example of a weakly universal hash function that is not pairwise independent? | <p>A family of hash functions <span class="math-container">$H_w$</span> is said to be <em>weakly universal</em> if for all <span class="math-container">$x \ne y$</span> :</p>

<p><span class="math-container">$$P_{h \in H_w}(h(x) = h(y)) \leq 1/m$$</span></p>

<p>Here the function <span class="math-conta... | hash hash tables probabilistic algorithms | 1 | What is an example of a weakly universal hash function that is not pairwise independent? -- (hash hash tables probabilistic algorithms)
<p>A family of hash functions <span class="math-container">$H_w$</span> is said to be <em>weakly universal</em> if for all <span class="math-container">$x \ne y$</span> :</p>

... | habedi/stack-exchange-dataset |
104,374 | Merging balls interview problem | <p>Here is an interview problem about balls rolling towards buckets from <a href="https://www.geeksforgeeks.org/sprinklr-interview-experience/" rel="nofollow noreferrer">Sprinklr Interview Experience at GeekforGeeks</a>.</p>

<blockquote>
 <p>You are given <span class="math-container">$n$</span> balls on t... | algorithms dynamic programming greedy algorithms stacks | 1 | Merging balls interview problem -- (algorithms dynamic programming greedy algorithms stacks)
<p>Here is an interview problem about balls rolling towards buckets from <a href="https://www.geeksforgeeks.org/sprinklr-interview-experience/" rel="nofollow noreferrer">Sprinklr Interview Experience at GeekforGeeks</a>.</p>&#x... | habedi/stack-exchange-dataset |
104,375 | Quicksort T(n)=2T(n/2)+n | <p>In <a href="http://fileadmin.cs.lth.se/cs/Personal/Rolf_Karlsson/lect1.pdf" rel="nofollow noreferrer">Quicksort</a> we devide the array in to about an half (not worst case) and we have left and right sides so it is 2T(n/2), now why in the end it is T(n)=2T(n/2)+n as we may need to go over all the array to arrange it... | complexity theory sorting | 1 | Quicksort T(n)=2T(n/2)+n -- (complexity theory sorting)
<p>In <a href="http://fileadmin.cs.lth.se/cs/Personal/Rolf_Karlsson/lect1.pdf" rel="nofollow noreferrer">Quicksort</a> we devide the array in to about an half (not worst case) and we have left and right sides so it is 2T(n/2), now why in the end it is T(n)=2T(n/2)... | habedi/stack-exchange-dataset |
104,383 | D flip flop : How does it work in depth | <p>I'm coming to you today because I have some trouble to understand how works <strong>D flip flop</strong> in depth. Two weeks ago we started at school learning sequential logic and so register and everything that come with. We saw how to build a <strong>D flip flop</strong> using <strong>RS Asynchronous flip flop</st... | logic sequential circuit | 1 | D flip flop : How does it work in depth -- (logic sequential circuit)
<p>I'm coming to you today because I have some trouble to understand how works <strong>D flip flop</strong> in depth. Two weeks ago we started at school learning sequential logic and so register and everything that come with. We saw how to build a <s... | habedi/stack-exchange-dataset |
104,390 | What is the intuition behind the way of reading off a dual optimal solution from simplex primal tabular in CLRS? | <p>Section 29.4 "Duality" of CLRS (3rd Edition) describes the way of reading off an optimal dual solution from the last slack form of the primal as follows:</p>

<blockquote>
 <p>Suppose that the last slack form of the primal is
 <span class="math-container">$$
\begin{align}
z &= v' + \sum... | algorithms linear programming linear algebra duality | 1 | What is the intuition behind the way of reading off a dual optimal solution from simplex primal tabular in CLRS? -- (algorithms linear programming linear algebra duality)
<p>Section 29.4 "Duality" of CLRS (3rd Edition) describes the way of reading off an optimal dual solution from the last slack form of the primal as f... | habedi/stack-exchange-dataset |
104,407 | Find all edges in a tree whose removal doesn't separate color classes | <p>Given a tree of <span class="math-container">$N$</span> vertices, each colored in one of the colors <span class="math-container">$1,\dots,N$</span>. </p>

<p>Let’s call an edge a <em>separator</em> if when the edge is removed from the tree, all vertices of each color stay connected. </p>

<p>The goal... | algorithms graphs | 1 | Find all edges in a tree whose removal doesn't separate color classes -- (algorithms graphs)
<p>Given a tree of <span class="math-container">$N$</span> vertices, each colored in one of the colors <span class="math-container">$1,\dots,N$</span>. </p>

<p>Let’s call an edge a <em>separator</em> if when the edge i... | habedi/stack-exchange-dataset |
104,415 | Minimum spanning tree such that one edge can be minimised | <p>During a computer coding exam, I have encountered such a problem. </p>

<p>Given a list of vertexes and edges between the vertexes,and a positive number, D, what is the minimum spanning tree between the vertexes such that the sum of the lengths of the edges is minimal, provided that you may subtract any one ... | graphs greedy algorithms minimum spanning tree prims algorithm | 1 | Minimum spanning tree such that one edge can be minimised -- (graphs greedy algorithms minimum spanning tree prims algorithm)
<p>During a computer coding exam, I have encountered such a problem. </p>

<p>Given a list of vertexes and edges between the vertexes,and a positive number, D, what is the minimum spanni... | habedi/stack-exchange-dataset |
104,421 | Recursively edit 2-D array using backtracking | <p>I have a 2-D array which contain 3 types of elements: </p>

<ul>
<li><strong>C (Contaminant)</strong> </li>
<li><strong>R (Rock)</strong> </li>
<li><strong>W (Water)</strong></li>
</ul>

<p>The rule is that: </p>

<blockquote>
 <p><strong>contaminant can seep through wate... | recursion backtracking | 1 | Recursively edit 2-D array using backtracking -- (recursion backtracking)
<p>I have a 2-D array which contain 3 types of elements: </p>

<ul>
<li><strong>C (Contaminant)</strong> </li>
<li><strong>R (Rock)</strong> </li>
<li><strong>W (Water)</strong></li>
</ul>

<p>The rule is that: </p... | habedi/stack-exchange-dataset |
104,423 | Converting CFG from GNF to CNF | <p>I am working with grammars that need to be in Greibach Normal Form. I want to check whether a grammar recognises a string. In order to perform CYK the grammar would have to be converted into CNF. Is there an established way of carrying out such conversion?</p>
 | formal languages context free formal grammars | 1 | Converting CFG from GNF to CNF -- (formal languages context free formal grammars)
<p>I am working with grammars that need to be in Greibach Normal Form. I want to check whether a grammar recognises a string. In order to perform CYK the grammar would have to be converted into CNF. Is there an established way of carrying... | habedi/stack-exchange-dataset |
104,428 | Minimum Spanning Tree with one particular edge minimised(continued) | <p>I have recently encountered a coding problem, specifically, the <a href="https://cemc.uwaterloo.ca/contests/computing/2017/stage%201/seniorEF.pdf" rel="nofollow noreferrer">CCC problem S4</a>. </p>

<p>In the problem, it states that you are given a spanning tree, or otherwise a "valid plan of pipes", that co... | graphs greedy algorithms minimum spanning tree prims algorithm | 1 | Minimum Spanning Tree with one particular edge minimised(continued) -- (graphs greedy algorithms minimum spanning tree prims algorithm)
<p>I have recently encountered a coding problem, specifically, the <a href="https://cemc.uwaterloo.ca/contests/computing/2017/stage%201/seniorEF.pdf" rel="nofollow noreferrer">CCC prob... | habedi/stack-exchange-dataset |
104,431 | Small space hash functions that are weakly but not strongly universal | <p>This is a follow up to this <a href="https://cs.stackexchange.com/questions/104361/what-is-an-example-of-a-weakly-universal-hash-function-that-is-not-pairwise-inde">this question about weakly universal hash functions</a></p>

<p>A family of hash functions <span class="math-container">$H_w$</span> is said to ... | hash hash tables probabilistic algorithms hashing | 1 | Small space hash functions that are weakly but not strongly universal -- (hash hash tables probabilistic algorithms hashing)
<p>This is a follow up to this <a href="https://cs.stackexchange.com/questions/104361/what-is-an-example-of-a-weakly-universal-hash-function-that-is-not-pairwise-inde">this question about weakly ... | habedi/stack-exchange-dataset |
104,439 | Is this problem hard? Finding all the subsets of size k from a sequence of n numbers | <p>I want to know the hardness of finding all subsets of size k from a sequence of n numbers. There is an algorithm based on recursion: <a href="https://www.geeksforgeeks.org/print-all-possible-combinations-of-r-elements-in-a-given-array-of-size-n/" rel="nofollow noreferrer">Print all possible combinations of r element... | algorithms time complexity np hard | 1 | Is this problem hard? Finding all the subsets of size k from a sequence of n numbers -- (algorithms time complexity np hard)
<p>I want to know the hardness of finding all subsets of size k from a sequence of n numbers. There is an algorithm based on recursion: <a href="https://www.geeksforgeeks.org/print-all-possible-c... | habedi/stack-exchange-dataset |
104,453 | Recognizer to check if the language of a Turing machine contains a finite subset | <p>Let <span class="math-container">$B = \{ 123 \}$</span>. </p>

<p>Note that <span class="math-container">$B$</span> is finite.</p>

<p>Let <span class="math-container">$L = \left \{ \left\langle M \right\rangle | M \text{ is a Turing machine such that } B \subseteq L(M) \right\}$</span>.</p>
&#x... | turing machines computability | 1 | Recognizer to check if the language of a Turing machine contains a finite subset -- (turing machines computability)
<p>Let <span class="math-container">$B = \{ 123 \}$</span>. </p>

<p>Note that <span class="math-container">$B$</span> is finite.</p>

<p>Let <span class="math-container">$L = \left \{ \le... | habedi/stack-exchange-dataset |
104,459 | When is a root node an articulation point in a graph? | <p>I am trying to find the articulation points in a connected undirected graph and I'm finding it difficult to figure out if the root node of the DFS is an articulation point.<br>
Based on the literature I've read the root node is considered an articulation point if it has more than one child <a href="http://cp-alg... | algorithms graphs | 1 | When is a root node an articulation point in a graph? -- (algorithms graphs)
<p>I am trying to find the articulation points in a connected undirected graph and I'm finding it difficult to figure out if the root node of the DFS is an articulation point.<br>
Based on the literature I've read the root node is consider... | habedi/stack-exchange-dataset |
104,463 | Appreciation of the 5 state process model | <p>I'm starting out in an Operating Systems module. I have a few understanding questions to think about, which will not be gone through in class.</p>

<p>A process state model is an abstraction (or model) which is used to explain what can happen to a process. Give a state of the process, it tells you what is th... | terminology operating systems process scheduling | 1 | Appreciation of the 5 state process model -- (terminology operating systems process scheduling)
<p>I'm starting out in an Operating Systems module. I have a few understanding questions to think about, which will not be gone through in class.</p>

<p>A process state model is an abstraction (or model) which is us... | habedi/stack-exchange-dataset |
104,467 | How does treewidth behave under graph minor operations? | <p>It is a well-known fact that for any minor H of a graph G (commonly written as <span class="math-container">$H \leq_m G$</span>), the treewidth of H is smaller than or equal to that of G.</p>

<p>Minors of a graph are created through the operations of (1) vertex deletion, (2) edge deletion and (3) edge contr... | graphs discrete mathematics treewidth | 1 | How does treewidth behave under graph minor operations? -- (graphs discrete mathematics treewidth)
<p>It is a well-known fact that for any minor H of a graph G (commonly written as <span class="math-container">$H \leq_m G$</span>), the treewidth of H is smaller than or equal to that of G.</p>

<p>Minors of a gr... | habedi/stack-exchange-dataset |
104,494 | Proof of undecideability that one state is reached before another | <p>I'm trying to show that, for a deterministic Turing machine <span class="math-container">$M=(Q,\Gamma,\Sigma,\delta,q_0)$</span>, the language <span class="math-container">$K$</span>, which includes all of the words <span class="math-container">$w \in \Sigma^\ast$</span> where the calculation of <span class="math-co... | reductions undecidability | 1 | Proof of undecideability that one state is reached before another -- (reductions undecidability)
<p>I'm trying to show that, for a deterministic Turing machine <span class="math-container">$M=(Q,\Gamma,\Sigma,\delta,q_0)$</span>, the language <span class="math-container">$K$</span>, which includes all of the words <spa... | habedi/stack-exchange-dataset |
104,509 | How to train this neural network? | <p>I seek the neural network (NN) which satisfies the 100 equations (i=1,2...100) </p>

<p><span class="math-container">$\sum_{j=1}^{2000} NN(A_{ij},B_{ij},C_{ij})=Q_i$</span>.</p>

<p>Where A,B,C are 100x2000 matrices</p>

<p>So I know Q, A, B and C
How can one find the NN? (ie train it u... | neural networks | 1 | How to train this neural network? -- (neural networks)
<p>I seek the neural network (NN) which satisfies the 100 equations (i=1,2...100) </p>

<p><span class="math-container">$\sum_{j=1}^{2000} NN(A_{ij},B_{ij},C_{ij})=Q_i$</span>.</p>

<p>Where A,B,C are 100x2000 matrices</p>

<p>So I know Q,... | habedi/stack-exchange-dataset |
104,512 | Length of shortest codeword in Huffman encoding | <p>Under Huffman Encoding, if one character occurs more than 1/3rd of the time, is it guaranteed that there will be at least one character whose codeword is of length 1?</p>

<p>I thought of 2 cases where this might be true, but they're not exactly proofs - </p>

<p>Case 1: There is only one character w... | greedy algorithms huffman coding | 1 | Length of shortest codeword in Huffman encoding -- (greedy algorithms huffman coding)
<p>Under Huffman Encoding, if one character occurs more than 1/3rd of the time, is it guaranteed that there will be at least one character whose codeword is of length 1?</p>

<p>I thought of 2 cases where this might be true, b... | habedi/stack-exchange-dataset |
104,513 | Difference between present - absent bit and valid - invalid bit in a page table? | <p>while reading I found this:</p>

<blockquote>
 <p>Present/Absent bit – Present or absent bit says whether a particular page you are looking for is present or absent. In case if it is not present, that is called Page Fault. It is set to 0 if the corresponding page is not in memory. </p>
</blockquote>... | operating systems paging | 1 | Difference between present - absent bit and valid - invalid bit in a page table? -- (operating systems paging)
<p>while reading I found this:</p>

<blockquote>
 <p>Present/Absent bit – Present or absent bit says whether a particular page you are looking for is present or absent. In case if it is not presen... | habedi/stack-exchange-dataset |
104,514 | Computing Nash equilibria in discrete auctions | <p>I am trying to compute the (pure strategy) Nash equilibria of some discrete auctions.</p>

<p>More precisely, let us define the strategy of each player as a function mapping from every valuation that they might have to their bid (i.e. the 'bidding function'). Let us suppose that each player's valuation is dr... | game theory | 1 | Computing Nash equilibria in discrete auctions -- (game theory)
<p>I am trying to compute the (pure strategy) Nash equilibria of some discrete auctions.</p>

<p>More precisely, let us define the strategy of each player as a function mapping from every valuation that they might have to their bid (i.e. the 'biddi... | habedi/stack-exchange-dataset |
104,522 | Finding the cheapest buy order with fixed inflation for each product | <p>Let's say we have a set of products <span class="math-container">$M$</span>, a total of <span class="math-container">$|M|=n$</span> that we want to buy. However, we can only buy one product at a time, so that we need a total of <span class="math-container">$n$</span> time-units to buy all items.</p>

<p>Each... | algorithms discrete mathematics | 1 | Finding the cheapest buy order with fixed inflation for each product -- (algorithms discrete mathematics)
<p>Let's say we have a set of products <span class="math-container">$M$</span>, a total of <span class="math-container">$|M|=n$</span> that we want to buy. However, we can only buy one product at a time, so that we... | habedi/stack-exchange-dataset |
104,534 | Why c_f (u, v) = f (v, u) if f (v, u) not in E? | <p>From <a href="http://www.vincentmaccio.com/csc373_2018/docs/week89.pdf" rel="nofollow noreferrer">page8 of the slide</a>, I think <span class="math-container">$E$</span> is all the edges in the graph <span class="math-container">$G$</span>. But why is <span class="math-container">$c_f (u, v) = f (v, u)$</span> if <s... | algorithms network flow | 1 | Why c_f (u, v) = f (v, u) if f (v, u) not in E? -- (algorithms network flow)
<p>From <a href="http://www.vincentmaccio.com/csc373_2018/docs/week89.pdf" rel="nofollow noreferrer">page8 of the slide</a>, I think <span class="math-container">$E$</span> is all the edges in the graph <span class="math-container">$G$</span>.... | habedi/stack-exchange-dataset |
104,548 | Number of computations for multiplication | <p>I just read <a href="https://web.media.mit.edu/~minsky/papers/TuringLecture/TuringLecture.html" rel="nofollow noreferrer">Marvin Minskys' "Form and Content in Computer Science"</a> and found myself confused with the following paragraph:</p>

<blockquote>
 <p>A startling discovery was made about multipli... | complexity theory multiplication | 1 | Number of computations for multiplication -- (complexity theory multiplication)
<p>I just read <a href="https://web.media.mit.edu/~minsky/papers/TuringLecture/TuringLecture.html" rel="nofollow noreferrer">Marvin Minskys' "Form and Content in Computer Science"</a> and found myself confused with the following paragraph:<... | habedi/stack-exchange-dataset |
104,554 | How get the permutation of two lists but the elements of each list remain in the same order? | <p>So if I have <code>lst1 = [a, b]</code> and <code>lst2 = [x, y]</code> the result would be:</p>

<pre><code>[x, y, a, b]
[x, a, y, b]
[x, a, b, y]
[a, x, y, b]
[a, x, b, y]
[a, b, x, y]
</code></pre>

<p>I'm thinking about doing something recursive where I take the first eleme... | algorithms | 1 | How get the permutation of two lists but the elements of each list remain in the same order? -- (algorithms)
<p>So if I have <code>lst1 = [a, b]</code> and <code>lst2 = [x, y]</code> the result would be:</p>

<pre><code>[x, y, a, b]
[x, a, y, b]
[x, a, b, y]
[a, x, y, b]
[a, x, b, y]
[a, b, ... | habedi/stack-exchange-dataset |
104,557 | Is a particular string regular (e.g is '010') regular? | <p>If the alphabet is <span class="math-container">$\{0,1\}$</span>, then is the string '010' regular? </p>

<p>I think it is regular because DFA and regular languages are equivalent and this string has a DFA but at the same time it seems to contradict pumping lemma which implies not regular. Here is what I mea... | formal languages regular languages finite automata | 1 | Is a particular string regular (e.g is '010') regular? -- (formal languages regular languages finite automata)
<p>If the alphabet is <span class="math-container">$\{0,1\}$</span>, then is the string '010' regular? </p>

<p>I think it is regular because DFA and regular languages are equivalent and this string ha... | habedi/stack-exchange-dataset |
104,560 | Why " every non-prime attribute of R is non-transitively dependent on every key of R" in the original def of 3NF? | <p>I have read the definition in of Third_normal_form <a href="https://en.wikipedia.org/wiki/Third_normal_form" rel="nofollow noreferrer">here</a>
, which shows</p>

<blockquote>
 <p>The third normal form (3NF) is a normal form used in database normalization. 3NF was originally defined by E.F. Codd in ... | database theory databases normal forms relational algebra | 1 | Why " every non-prime attribute of R is non-transitively dependent on every key of R" in the original def of 3NF? -- (database theory databases normal forms relational algebra)
<p>I have read the definition in of Third_normal_form <a href="https://en.wikipedia.org/wiki/Third_normal_form" rel="nofollow noreferrer">here<... | habedi/stack-exchange-dataset |
104,561 | Max number of configurations of a Turing Machine | <p>I was wondering about a result in the Sipser book which states that any <span class="math-container">$f(n)$</span> space bounded Turing machine also runs in time <span class="math-container">$2^{O(f(n))}$</span>.</p>

<p>Is this because a configuration consists of a state, a position of the head and the cont... | turing machines time complexity space complexity | 1 | Max number of configurations of a Turing Machine -- (turing machines time complexity space complexity)
<p>I was wondering about a result in the Sipser book which states that any <span class="math-container">$f(n)$</span> space bounded Turing machine also runs in time <span class="math-container">$2^{O(f(n))}$</span>.</... | habedi/stack-exchange-dataset |
104,565 | The idea behind the state of Imperative languages | <p>I was <a href="https://en.wikipedia.org/wiki/Programming_paradigm" rel="nofollow noreferrer">reading</a> about programming paradigms and I have a question about the state when speaking about Imperative languages. What does it mean to change the program's state? Is it just an abstract idea? I know that <code>C</code>... | programming languages programming paradigms imperative programming | 1 | The idea behind the state of Imperative languages -- (programming languages programming paradigms imperative programming)
<p>I was <a href="https://en.wikipedia.org/wiki/Programming_paradigm" rel="nofollow noreferrer">reading</a> about programming paradigms and I have a question about the state when speaking about Impe... | habedi/stack-exchange-dataset |
104,570 | Algorithm: Calculate every number in a given list using addition and numbers you've created | <p>I'm creating an algorithm to calculate every number in an array using only addition and numbers we've created - in the shortest amount of steps. That's confusing so here is an example:</p>

<pre><code>input: [5, 11], used numbers (start with 1): [1]
1+1=2, used: [1, 2]
2+2=4, used: [1, 2, 4]
1+4=... | algorithms | 1 | Algorithm: Calculate every number in a given list using addition and numbers you've created -- (algorithms)
<p>I'm creating an algorithm to calculate every number in an array using only addition and numbers we've created - in the shortest amount of steps. That's confusing so here is an example:</p>

<pre><code>... | habedi/stack-exchange-dataset |
104,571 | How does one use the Nerode-Myhill theorem to prove that a language is regular? | <p>Showing that a language is not regular is straight-forward, because all one needs to do is find an infinite set of inputs which has an injective mapping to the set of equivalence classes which compose that language.</p>

<p>How does one show that the set of equivalence classes of <span class="math-container"... | complexity theory computability regular languages | 1 | How does one use the Nerode-Myhill theorem to prove that a language is regular? -- (complexity theory computability regular languages)
<p>Showing that a language is not regular is straight-forward, because all one needs to do is find an infinite set of inputs which has an injective mapping to the set of equivalence cla... | habedi/stack-exchange-dataset |
104,577 | How can I create a language using set operation to prove a language is not regular? | <p>My goal is to show, that a given language is not a regular one by using the Properties of Regular Languages.</p>

<p>The language is <span class="math-container">$ A \triangleq\left\{w \in \Sigma^{*} \mid |\left.w\right|_{b} \neq|w|_{c} \wedge|w|>0\right\} $</span> with <span class="math-container">$ \... | regular languages | 1 | How can I create a language using set operation to prove a language is not regular? -- (regular languages)
<p>My goal is to show, that a given language is not a regular one by using the Properties of Regular Languages.</p>

<p>The language is <span class="math-container">$ A \triangleq\left\{w \in \Sigma^{*} \... | habedi/stack-exchange-dataset |
104,578 | Chess pieces placement algorithm | <p>I've got the following problem:</p>

<ul>
<li>I've got chessboard with fixed size <strong>N x M</strong></li>
<li>I've got list of pieces, like 2 queens, 2 rooks (It can be any piece with exception of pawn).</li>
<li>I need to find every combination where none of the pieces is in a position to ta... | algorithms | 1 | Chess pieces placement algorithm -- (algorithms)
<p>I've got the following problem:</p>

<ul>
<li>I've got chessboard with fixed size <strong>N x M</strong></li>
<li>I've got list of pieces, like 2 queens, 2 rooks (It can be any piece with exception of pawn).</li>
<li>I need to find every combinatio... | habedi/stack-exchange-dataset |
104,581 | Does a binary code with length 6, size 32 and distance 2 exist? | <p>The problem is to prove or disprove the existence of <span class="math-container">$C$</span>, s.t., <span class="math-container">$|c| = 6,\forall c\in C$</span>; <span class="math-container">$|C| = 32$</span>; <span class="math-container">$d(c_i,c_j)\geq2,1\leq i<j\leq32$</span>. (<span class="math-container">$d$... | information theory coding theory encoding scheme | 1 | Does a binary code with length 6, size 32 and distance 2 exist? -- (information theory coding theory encoding scheme)
<p>The problem is to prove or disprove the existence of <span class="math-container">$C$</span>, s.t., <span class="math-container">$|c| = 6,\forall c\in C$</span>; <span class="math-container">$|C| = 3... | habedi/stack-exchange-dataset |
104,583 | What is a flow through the cut in the Ford-Fulkerson algorithm? | <p>In page 12 of the <a href="http://www.vincentmaccio.com/csc373_2018/docs/week89.pdf" rel="nofollow noreferrer">slide</a>, it states flow across a cut <span class="math-container">$(S, T)$</span> is <span class="math-container">$f(S, T) = \sum_{u\in S} \sum_{v\in T} f(u,v) - \sum_{u\in S} \sum_{v\in T} f(v,u)$</span>... | algorithms network flow ford fulkerson | 1 | What is a flow through the cut in the Ford-Fulkerson algorithm? -- (algorithms network flow ford fulkerson)
<p>In page 12 of the <a href="http://www.vincentmaccio.com/csc373_2018/docs/week89.pdf" rel="nofollow noreferrer">slide</a>, it states flow across a cut <span class="math-container">$(S, T)$</span> is <span class... | habedi/stack-exchange-dataset |
104,594 | Merge sort: sorting and merging complexity $\Theta(n)$ | <p>So this is the Master theorem for Merge Sort:</p>

<p><span class="math-container">$$ T(n) = 2T(n/2) + \Theta(n). $$</span></p>

<p>I am not able to understand why is the time complexity for sorting and merging <span class="math-container">$\Theta(n)$</span>.</p>

<p>Is sorting <span class="m... | algorithms time complexity master theorem mergesort | 1 | Merge sort: sorting and merging complexity $\Theta(n)$ -- (algorithms time complexity master theorem mergesort)
<p>So this is the Master theorem for Merge Sort:</p>

<p><span class="math-container">$$ T(n) = 2T(n/2) + \Theta(n). $$</span></p>

<p>I am not able to understand why is the time complexity fo... | habedi/stack-exchange-dataset |
104,595 | Calculating the number of assignments satisfying a general propositional formula | <p>I know, for a disjunctive clause of the form <span class="math-container">$x_1 \vee ... \vee x_i$</span>, the number of assignments satisfying it is simply <span class="math-container">$2^i - 1$</span>, but what about for a general formula? Is the number of satisfying assignments be calculated polynomially?</p>
... | time complexity satisfiability polynomial time | 1 | Calculating the number of assignments satisfying a general propositional formula -- (time complexity satisfiability polynomial time)
<p>I know, for a disjunctive clause of the form <span class="math-container">$x_1 \vee ... \vee x_i$</span>, the number of assignments satisfying it is simply <span class="math-container"... | habedi/stack-exchange-dataset |
104,598 | Euclidean algorithm and well define ness on the underlying set | <p>Euclidean algorithm is given below:</p>

<blockquote>
 <p>gcd(<span class="math-container">$a$</span>,<span class="math-container">$b$</span>):</p>
 
 <p> if <span class="math-container">$a=0$</span>, return <span class="math-container">$b$</span></p>
 
 <p> otherwise, re... | algorithms runtime analysis | 1 | Euclidean algorithm and well define ness on the underlying set -- (algorithms runtime analysis)
<p>Euclidean algorithm is given below:</p>

<blockquote>
 <p>gcd(<span class="math-container">$a$</span>,<span class="math-container">$b$</span>):</p>
 
 <p> if <span class="math-container">$a=0$... | habedi/stack-exchange-dataset |
104,603 | Sorting "almost sorted" array in $O(n\log\log n)$ | <blockquote>
<p>Given array <span class="math-container">$A$</span> of length <span class="math-container">$n$</span>, we call it <em>almost sorted</em> if there are at most <span class="math-container">$\log n$</span> indices satisfying <span class="math-container">$A[i] > A[i+1]$</span>.</p>
<p>Find an alg... | sorting | 1 | Sorting "almost sorted" array in $O(n\log\log n)$ -- (sorting)
<blockquote>
<p>Given array <span class="math-container">$A$</span> of length <span class="math-container">$n$</span>, we call it <em>almost sorted</em> if there are at most <span class="math-container">$\log n$</span> indices satisfying <span class="ma... | habedi/stack-exchange-dataset |
104,621 | Static type analysis with dynamic scoping? | <p>Both in school and out, I have only ever encountered dynamic scoping paired with dynamic typing. Is there any published work (even if just academic, not yet implemented in a "real" programming language) on doing static type verification with dynamic scoping?</p>

<p>It seems to me that it should be possible ... | programming languages type checking | 1 | Static type analysis with dynamic scoping? -- (programming languages type checking)
<p>Both in school and out, I have only ever encountered dynamic scoping paired with dynamic typing. Is there any published work (even if just academic, not yet implemented in a "real" programming language) on doing static type verificat... | habedi/stack-exchange-dataset |
104,622 | For sorting 10^9 unique 9-digit numbers, would radix sort or counting sort be faster, and why? | <blockquote>
 <p>For sorting <span class="math-container">$10^9$</span> unique 9-digit numbers, would radix sort or counting sort be faster, and why?</p>
</blockquote>

<p>I know that radix sort is <span class="math-container">$O(nk)$</span> and counting sort is <span class="math-container">$O(n+k)$</s... | algorithms sorting radix sort | 1 | For sorting 10^9 unique 9-digit numbers, would radix sort or counting sort be faster, and why? -- (algorithms sorting radix sort)
<blockquote>
 <p>For sorting <span class="math-container">$10^9$</span> unique 9-digit numbers, would radix sort or counting sort be faster, and why?</p>
</blockquote>

<p>I... | habedi/stack-exchange-dataset |
104,630 | Solving T(n) = T(n-1)*T(n-2) | <p>So, this is how I solved</p>

<p><span class="math-container">$\displaystyle
 T(n-1) \approx{} T(n-2)
 $</span></p>

<p><span class="math-container">$\displaystyle
 T(n) = T(n-1)^2
 $</span></p>

<p>Add log in both sides</p>

<p><span class="math-c... | asymptotics recurrence relation | 1 | Solving T(n) = T(n-1)*T(n-2) -- (asymptotics recurrence relation)
<p>So, this is how I solved</p>

<p><span class="math-container">$\displaystyle
 T(n-1) \approx{} T(n-2)
 $</span></p>

<p><span class="math-container">$\displaystyle
 T(n) = T(n-1)^2
 $</span></p>
... | habedi/stack-exchange-dataset |
104,632 | Carpet into Box | <p>Given a carpet of size a * b [length * breadth] and a box of size c * d, one has to fit the carpet in the box in the minimum number of moves. A move is to fold the carpet in half, either by length or breadth.</p>

<p>One can even turn the carpet by 90 degrees any number of times, won’t be counted as a move.<... | algorithms dynamic programming greedy algorithms number theory | 1 | Carpet into Box -- (algorithms dynamic programming greedy algorithms number theory)
<p>Given a carpet of size a * b [length * breadth] and a box of size c * d, one has to fit the carpet in the box in the minimum number of moves. A move is to fold the carpet in half, either by length or breadth.</p>

<p>One can ... | habedi/stack-exchange-dataset |
104,633 | Proving a language as undecidable without using reductions | <p>Let's say our Σ is 0 and 1. I want to disprove the following:</p>

<blockquote>
 <p>There can be Turing Machines that accept only 1's, i.e. 1, 11, 111,
 etc. Therefore, all languages that have strings of 1's are
 recognizable.</p>
</blockquote>

<p>My first step to proving this is ... | turing machines computability undecidability | 1 | Proving a language as undecidable without using reductions -- (turing machines computability undecidability)
<p>Let's say our Σ is 0 and 1. I want to disprove the following:</p>

<blockquote>
 <p>There can be Turing Machines that accept only 1's, i.e. 1, 11, 111,
 etc. Therefore, all languages that ha... | habedi/stack-exchange-dataset |
104,642 | Why more and more languages do not have link stage when compiling? | <p>As far as I know, only C, C++, and Objective-C (in most used languages) need a linker when compiling, languages like Java and C# don't have one, and it seems more and more modern languages do not have a linking stage nowadays.</p>

<ol>
<li>Why?</li>
<li>If there's no linker, the code cannot turn int... | compilers | 1 | Why more and more languages do not have link stage when compiling? -- (compilers)
<p>As far as I know, only C, C++, and Objective-C (in most used languages) need a linker when compiling, languages like Java and C# don't have one, and it seems more and more modern languages do not have a linking stage nowadays.</p>
... | habedi/stack-exchange-dataset |
104,643 | DCEL operations on quad-edges, Twin, Next, and Prev | <p>Suppose I have a quad-edge data-structure, and I want to be able to perform the operations of DCEL (<code>twin</code>, <code>next</code>, <code>prev</code>) on the quad-edge data structure. Let the current edge I am operating on be <code>e</code>. I know that <code>e.twin</code> would simply be <code>e.rot.rot</code... | computational geometry doubly connected edge list | 1 | DCEL operations on quad-edges, Twin, Next, and Prev -- (computational geometry doubly connected edge list)
<p>Suppose I have a quad-edge data-structure, and I want to be able to perform the operations of DCEL (<code>twin</code>, <code>next</code>, <code>prev</code>) on the quad-edge data structure. Let the current edge... | habedi/stack-exchange-dataset |
104,660 | In which category is the supercomputer SUMMIT according to Flynn's taxonomy? | <p>I have read that the POWER9 processor is an SIMD processor.
I have also read that most supercomputers are MIMD based.</p>

<p>So is the SUMMIT supercomputer SIMD? And if it is can you name a supercomputer that is MIMD?</p>
 | computer architecture | 1 | In which category is the supercomputer SUMMIT according to Flynn's taxonomy? -- (computer architecture)
<p>I have read that the POWER9 processor is an SIMD processor.
I have also read that most supercomputers are MIMD based.</p>

<p>So is the SUMMIT supercomputer SIMD? And if it is can you name a supercompu... | habedi/stack-exchange-dataset |
104,664 | Why are we interested in square-free words? | <p>There is wikipedia page about <a href="https://en.wikipedia.org/wiki/Square-free_word" rel="nofollow noreferrer">square-free words</a>, and there are a lot of theorems about these words, and examples of infinite square-free words.</p>

<p>I am wondering: why are we interested in these words? </p>

<p... | word combinatorics | 1 | Why are we interested in square-free words? -- (word combinatorics)
<p>There is wikipedia page about <a href="https://en.wikipedia.org/wiki/Square-free_word" rel="nofollow noreferrer">square-free words</a>, and there are a lot of theorems about these words, and examples of infinite square-free words.</p>

<p>I ... | habedi/stack-exchange-dataset |
104,679 | Union of a regular and a non-regular language | <p>Let's say we have <span class="math-container">$L_1$</span> which is a regular language and <span class="math-container">$L_2$</span> which is not.</p>

<p>I understand that if <span class="math-container">$L_1 \cup L_2 = \Sigma^*$</span> then <span class="math-container">$L_1 \cup L_2$</span> is a regular l... | formal languages regular languages | 1 | Union of a regular and a non-regular language -- (formal languages regular languages)
<p>Let's say we have <span class="math-container">$L_1$</span> which is a regular language and <span class="math-container">$L_2$</span> which is not.</p>

<p>I understand that if <span class="math-container">$L_1 \cup L_2 = \... | habedi/stack-exchange-dataset |
104,684 | Negative simple path NP-Complete | <p>Given a graph <span class="math-container">$G=(V,E)$</span>, and positive and negative edge weights, negative path problem asks if there is a simple path with negative total weight from <span class="math-container">$s$</span> to <span class="math-container">$t$</span> where <span class="math-container">$s,t \in V$</... | complexity theory graphs np complete np hard np | 1 | Negative simple path NP-Complete -- (complexity theory graphs np complete np hard np)
<p>Given a graph <span class="math-container">$G=(V,E)$</span>, and positive and negative edge weights, negative path problem asks if there is a simple path with negative total weight from <span class="math-container">$s$</span> to <s... | habedi/stack-exchange-dataset |
104,686 | Random observations of a total ordering, how much they tell us? | <p>Suppose we have a total ordering over elements <span class="math-container">$a_1,a_2, ..., a_n$</span>, meaning there is permutation <span class="math-container">$\pi$</span> such that <span class="math-container">$a_{\pi(1)}<a_{\pi(2)}<...<a_{\pi(n)}$</span>. But we don't know <span class="math-container">... | sorting randomized algorithms randomness order theory ordering | 1 | Random observations of a total ordering, how much they tell us? -- (sorting randomized algorithms randomness order theory ordering)
<p>Suppose we have a total ordering over elements <span class="math-container">$a_1,a_2, ..., a_n$</span>, meaning there is permutation <span class="math-container">$\pi$</span> such that ... | habedi/stack-exchange-dataset |
104,688 | The recursion $T(n) = T(n/2)+T(n/3)+n$ | <p>I'm looking at the reccurrence
<span class="math-container">$$T(n) = T(n/2) + T(n/3) + n,$$</span>
which describes the running time of some unspecified algorithm (base cases are not supplied).</p>

<p>Using induction, I found that <span class="math-container">$T(n) = O(n\log n)$</span>, but have been... | asymptotics recurrence relation | 1 | The recursion $T(n) = T(n/2)+T(n/3)+n$ -- (asymptotics recurrence relation)
<p>I'm looking at the reccurrence
<span class="math-container">$$T(n) = T(n/2) + T(n/3) + n,$$</span>
which describes the running time of some unspecified algorithm (base cases are not supplied).</p>

<p>Using induction, I found... | habedi/stack-exchange-dataset |
104,689 | Which word could I use for the Pumping Lemma proof? | <p>I have the language </p>

<p><span class="math-container">$ A_{1} \triangleq\left\{a w c^{l} d^{m}\mid l \in \mathbb{N} \wedge m \in \mathbb{N}^{+} \wedge w \in\{a, b\}^{*} \wedge |\left.w\right|_{a}=l+m\right\} \operatorname{with} \Sigma \triangleq\{a, b, c, d\} $</span></p>

<p>and I have no idea w... | regular languages pumping lemma | 1 | Which word could I use for the Pumping Lemma proof? -- (regular languages pumping lemma)
<p>I have the language </p>

<p><span class="math-container">$ A_{1} \triangleq\left\{a w c^{l} d^{m}\mid l \in \mathbb{N} \wedge m \in \mathbb{N}^{+} \wedge w \in\{a, b\}^{*} \wedge |\left.w\right|_{a}=l+m\right\} \operato... | habedi/stack-exchange-dataset |
104,691 | Constructing CFG | <p>How to generate CFG for this language?</p>

<p><span class="math-container">$ L = \{ w \mid w \in \{ (, [, ], ) \}^* \text{ s.t. } $</span></p>

<ul>
<li>In any prefix of <span class="math-container">$w$</span>, no. of ( is more than no. of ), and</li>
<li>no. of [ is more than no. of ].</li... | turing machines automata context free formal grammars | 1 | Constructing CFG -- (turing machines automata context free formal grammars)
<p>How to generate CFG for this language?</p>

<p><span class="math-container">$ L = \{ w \mid w \in \{ (, [, ], ) \}^* \text{ s.t. } $</span></p>

<ul>
<li>In any prefix of <span class="math-container">$w$</span>, no. of (... | habedi/stack-exchange-dataset |
104,708 | What time complexity (big o) is this specific web crawler implementation? | <blockquote>
 <p>Note: this question was marked as a duplicate in favor of <a href="https://cs.stackexchange.com/questions/23593/is-there-a-system-behind-the-magic-of-algorithm-analysis">this question/answer</a> which attempts to provide a generic formula for translating code to mathematics. </p>
 
 <p>U... | time complexity asymptotics | 1 | What time complexity (big o) is this specific web crawler implementation? -- (time complexity asymptotics)
<blockquote>
 <p>Note: this question was marked as a duplicate in favor of <a href="https://cs.stackexchange.com/questions/23593/is-there-a-system-behind-the-magic-of-algorithm-analysis">this question/answer<... | habedi/stack-exchange-dataset |
104,711 | What do the symbols M and N mean in this definition of lambda terms? | <p>I am learning lambda calculus from the book <a href="https://www.irif.fr/~mellies/mpri/mpri-ens/biblio/Selinger-Lambda-Calculus-Notes.pdf" rel="nofollow noreferrer">https://www.irif.fr/~mellies/mpri/mpri-ens/biblio/Selinger-Lambda-Calculus-Notes.pdf</a> and do not understand the meaning of the following symbols.</p>... | lambda calculus | 1 | What do the symbols M and N mean in this definition of lambda terms? -- (lambda calculus)
<p>I am learning lambda calculus from the book <a href="https://www.irif.fr/~mellies/mpri/mpri-ens/biblio/Selinger-Lambda-Calculus-Notes.pdf" rel="nofollow noreferrer">https://www.irif.fr/~mellies/mpri/mpri-ens/biblio/Selinger-Lam... | habedi/stack-exchange-dataset |
104,718 | Interesting logic problems | <p>I've just began a course on logic and learned the following :</p>
<blockquote>
<ul>
<li><p>De Morgan's laws</p>
</li>
<li><p>Normal forms</p>
</li>
<li><p>How to represent a logical formula (using or, and, not operators) using binary trees</p>
</li>
<li><p>How to get the conjuncti... | logic decision problem search problem | 1 | Interesting logic problems -- (logic decision problem search problem)
<p>I've just began a course on logic and learned the following :</p>
<blockquote>
<ul>
<li><p>De Morgan's laws</p>
</li>
<li><p>Normal forms</p>
</li>
<li><p>How to represent a logical formula (using or, and, not operators... | habedi/stack-exchange-dataset |
104,726 | Can the pumping lemma for context free languages be extended to any subword? | <p>It is known that in the case of a Regular Language <span class="math-container">$L$</span> , the pumping lemma can be extended to apply to any sufficiently long subword of the language, ie, if <span class="math-container">$uwv \in L$</span> and <span class="math-container">$|w| \ge p$</span> then we can perform the ... | context free finite automata pumping lemma | 1 | Can the pumping lemma for context free languages be extended to any subword? -- (context free finite automata pumping lemma)
<p>It is known that in the case of a Regular Language <span class="math-container">$L$</span> , the pumping lemma can be extended to apply to any sufficiently long subword of the language, ie, if... | habedi/stack-exchange-dataset |
104,729 | Can there still be infinite recursion if I remove all left recursion? | <p>I have to transform the following grammar into a non left recursive grammar:</p>

<p>S → aSb | bAS</p>

<p>A → AaA | bAA | AAa | bAb</p>

<p>This is what I came up with:</p>

<p>A → bAAA’| bAbA’</p>

<p>A’ → aAA’| AaA’| ε</p>

<p>S → aSb | bAS</p>

<p>As far... | formal grammars compilers left recursion | 1 | Can there still be infinite recursion if I remove all left recursion? -- (formal grammars compilers left recursion)
<p>I have to transform the following grammar into a non left recursive grammar:</p>

<p>S → aSb | bAS</p>

<p>A → AaA | bAA | AAa | bAb</p>

<p>This is what I came up with:</p>&#... | habedi/stack-exchange-dataset |
104,730 | All pair shortest path in a tripartite graph | <p>I have a tri-partite graph with three sets of vertices source, bridge and destination nodes. I want to find the shortest path between every vertex in the source set to every vertex in the destination vertex. Also, all vertices in the source set are connected to all vertices in the bridge set, and all the vertices in... | graphs asymptotics dynamic programming shortest path | 1 | All pair shortest path in a tripartite graph -- (graphs asymptotics dynamic programming shortest path)
<p>I have a tri-partite graph with three sets of vertices source, bridge and destination nodes. I want to find the shortest path between every vertex in the source set to every vertex in the destination vertex. Also, ... | habedi/stack-exchange-dataset |
104,731 | Is the Shakespeare Programming Language Turing complete? | <p>I was reading about tge Turing machine. I also came across with <a href="https://en.wikipedia.org/wiki/Shakespeare_Programming_Language" rel="nofollow noreferrer">the <code>Shakespeare</code> programming language</a>. After trying to understand the basics of the PL, I thought that it must be non-Turing complete. On ... | turing machines programming languages | 1 | Is the Shakespeare Programming Language Turing complete? -- (turing machines programming languages)
<p>I was reading about tge Turing machine. I also came across with <a href="https://en.wikipedia.org/wiki/Shakespeare_Programming_Language" rel="nofollow noreferrer">the <code>Shakespeare</code> programming language</a>.... | habedi/stack-exchange-dataset |
104,745 | Can you prevent a man in the middle from reading the message? | <p>I have heard about all these Man-In-The-Middle Attack preventions and I am wondering, how this can possibly work if the man in the middle only listens to your stream and does not want to change the message itself. </p>

<p>Can the man in the middle not just take the keys swapped by the opponents, change the ... | cryptography security | 1 | Can you prevent a man in the middle from reading the message? -- (cryptography security)
<p>I have heard about all these Man-In-The-Middle Attack preventions and I am wondering, how this can possibly work if the man in the middle only listens to your stream and does not want to change the message itself. </p>

... | habedi/stack-exchange-dataset |
104,746 | Bertrand's ballot theorem | <p>I want to understand the dynamic programming equation of <a href="https://en.wikipedia.org/wiki/Bertrand%27s_ballot_theorem" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Bertrand%27s_ballot_theorem</a> theorem.
it is this </p>

<p>If i number of people voted for A and j number of people voted ... | algorithms dynamic programming probability theory number theory game theory | 1 | Bertrand's ballot theorem -- (algorithms dynamic programming probability theory number theory game theory)
<p>I want to understand the dynamic programming equation of <a href="https://en.wikipedia.org/wiki/Bertrand%27s_ballot_theorem" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Bertrand%27s_ballot_theorem</... | habedi/stack-exchange-dataset |
104,759 | Simple algorithm to generate a linear extension from partial order set | <p>I usually do it via topological sort and wonder if there is a simpler way to generate a linear extension from partial orders without consider the graph of the relation. </p>
 | algorithms graphs data structures | 1 | Simple algorithm to generate a linear extension from partial order set -- (algorithms graphs data structures)
<p>I usually do it via topological sort and wonder if there is a simpler way to generate a linear extension from partial orders without consider the graph of the relation. </p>
 | habedi/stack-exchange-dataset |
104,764 | How do you prove that $A = \{ x \in \mathbb{N} | W_{x} = [0..x]\}$ is a productive set through functional reduction? | <p>As the title states, how do you prove that <span class="math-container">$A$</span> is productive? With <span class="math-container">$W_{x}$</span> I mean the set of points in which the turing machine with index <span class="math-container">$x$</span> halts.</p>

<p>The standard approach that I follow is func... | computability | 1 | How do you prove that $A = \{ x \in \mathbb{N} | W_{x} = [0..x]\}$ is a productive set through functional reduction? -- (computability)
<p>As the title states, how do you prove that <span class="math-container">$A$</span> is productive? With <span class="math-container">$W_{x}$</span> I mean the set of points in which ... | habedi/stack-exchange-dataset |
104,765 | Algorithm notation between two functions | <p>I have two functions,
<span class="math-container">$$ f = n^{1.6} $$</span>
<span class="math-container">$$ g = n^{1.5} $$</span></p>

<p>I thought this is <span class="math-container">$ f=\theta(g) $</span>, since <span class="math-container">$ f $</span> is asymptotically tight bound of <span class... | algorithms asymptotics | 1 | Algorithm notation between two functions -- (algorithms asymptotics)
<p>I have two functions,
<span class="math-container">$$ f = n^{1.6} $$</span>
<span class="math-container">$$ g = n^{1.5} $$</span></p>

<p>I thought this is <span class="math-container">$ f=\theta(g) $</span>, since <span class="math... | habedi/stack-exchange-dataset |
104,771 | What is an efficient data structure for prefix matching? | <p>I'm looking for an data structure that supports efficient random prefix matching queries (pattern) over a previously known set of words (dictionary). The dictionary is expected to contain about 10,000 words of varying length (I haven't calculated average word length, but I don't expect any word to be more than 80 ch... | data structures search algorithms strings substrings | 1 | What is an efficient data structure for prefix matching? -- (data structures search algorithms strings substrings)
<p>I'm looking for an data structure that supports efficient random prefix matching queries (pattern) over a previously known set of words (dictionary). The dictionary is expected to contain about 10,000 w... | habedi/stack-exchange-dataset |
104,777 | Autocorrect algorithm - How to implement a decent "apostrophe & elision" feature? | <p><strong>shorter version of the original question</strong> (as requests in comments)</p>

<p>What is the algorithm to handle missing apostrophe as it is done in auto-correct feature of Android virtual keyboard?<br/></p>

<p>(If it helps / makes sense, feel free to give info about how such feature hand... | algorithms program optimization | 1 | Autocorrect algorithm - How to implement a decent "apostrophe & elision" feature? -- (algorithms program optimization)
<p><strong>shorter version of the original question</strong> (as requests in comments)</p>

<p>What is the algorithm to handle missing apostrophe as it is done in auto-correct feature of Androi... | habedi/stack-exchange-dataset |
104,780 | Given a total recursive function, can you always compute its fixed-point? | <p>We know from Kleene's recursion theorem that if <span class="math-container">$f$</span> is total recursive, there must be an integer <span class="math-container">$n$</span> for which <span class="math-container">$\varphi_n=\varphi_{f(n)}$</span>. My question is: for every <span class="math-container">$f$</span> tota... | computability | 1 | Given a total recursive function, can you always compute its fixed-point? -- (computability)
<p>We know from Kleene's recursion theorem that if <span class="math-container">$f$</span> is total recursive, there must be an integer <span class="math-container">$n$</span> for which <span class="math-container">$\varphi_n=\... | habedi/stack-exchange-dataset |
104,782 | How to understand the notion of boolean query via Immerman's definition | <blockquote>
 <p>A <em>query</em> is any mapping <span class="math-container">$I:STRUC[\sigma] \to STRUC[\tau]$</span> that is polynomially bounded. A <em>boolean</em> query is a map <span class="math-container">$I_b: STRUC[\sigma] \to \{0,1\}$</span>. A boolean query can also be thought as the susbset:
 <spa... | complexity theory logic descriptive complexity finite model theory | 1 | How to understand the notion of boolean query via Immerman's definition -- (complexity theory logic descriptive complexity finite model theory)
<blockquote>
 <p>A <em>query</em> is any mapping <span class="math-container">$I:STRUC[\sigma] \to STRUC[\tau]$</span> that is polynomially bounded. A <em>boolean</em> que... | habedi/stack-exchange-dataset |
104,787 | Solving the recurrence $T(n) = n^{3/4}(^{1/4})+ n $ | <p>I need to solve the following recurrence relation: <span class="math-container">$T(n) = n^{3/4}(^{1/4})+ n $</span>. Obviously, the master theorem doesn't apply here so I was using the substitution method. I used <span class="math-container">$x=\log n$</span> and <span class="math-container">$F(x)=T(e^x)$</span>. I ... | asymptotics recurrence relation | 1 | Solving the recurrence $T(n) = n^{3/4}(^{1/4})+ n $ -- (asymptotics recurrence relation)
<p>I need to solve the following recurrence relation: <span class="math-container">$T(n) = n^{3/4}(^{1/4})+ n $</span>. Obviously, the master theorem doesn't apply here so I was using the substitution method. I used <span class="ma... | habedi/stack-exchange-dataset |
104,788 | Generate a random combination in O(k) time and space? | <p>How to generate a random combination of <span class="math-container">$k$</span> numbers from <span class="math-container">$n$</span> choices in <span class="math-container">$O(k)$</span> time and space, if we can generate a random number between 1 and <span class="math-container">$O(n)$</span> in <span class="math-c... | algorithms combinatorics | 1 | Generate a random combination in O(k) time and space? -- (algorithms combinatorics)
<p>How to generate a random combination of <span class="math-container">$k$</span> numbers from <span class="math-container">$n$</span> choices in <span class="math-container">$O(k)$</span> time and space, if we can generate a random nu... | habedi/stack-exchange-dataset |
104,791 | Showing that $\lg(n!)$ is or is not $o(\lg(n^n))$ and $\omega(\lg(n^n))$ | <p>My instructor assigned a problem that asks us to determine which asymptotic bounds apply to a certain <span class="math-container">$f(n)$</span> for a certain <span class="math-container">$g(n)$</span>, in my case <span class="math-container">$f(n) = \lg(n!)$</span> and <span class="math-container">$g(n) = \lg(n^n)$... | asymptotics | 1 | Showing that $\lg(n!)$ is or is not $o(\lg(n^n))$ and $\omega(\lg(n^n))$ -- (asymptotics)
<p>My instructor assigned a problem that asks us to determine which asymptotic bounds apply to a certain <span class="math-container">$f(n)$</span> for a certain <span class="math-container">$g(n)$</span>, in my case <span class="... | habedi/stack-exchange-dataset |
104,799 | Blind sorting an array with a singular sort function? | <p>I am doing some interview prep, and I came across a question that really stumped me, and it didn't provide an answer.</p>

<p>The premise of the question was as follows:</p>

<p>You are given some unsorted array A of size n. You are not allowed to access the array, read values, or compare the values.... | algorithms | 1 | Blind sorting an array with a singular sort function? -- (algorithms)
<p>I am doing some interview prep, and I came across a question that really stumped me, and it didn't provide an answer.</p>

<p>The premise of the question was as follows:</p>

<p>You are given some unsorted array A of size n. You ar... | habedi/stack-exchange-dataset |
104,807 | Is this proof for showing that $EQ_{CFG}$ is co-Turing-recognizable incorrect? | <p>I have been searching for proofs that show that <span class="math-container">$EQ_{CFG}$</span> is co-Turing-recognizable. When searching for proofs I can only find proofs on the following form:</p>

<blockquote>
 <p>Construct a TM <span class="math-container">$M$</span> which recognizes the complement o... | turing machines context free check my answer | 1 | Is this proof for showing that $EQ_{CFG}$ is co-Turing-recognizable incorrect? -- (turing machines context free check my answer)
<p>I have been searching for proofs that show that <span class="math-container">$EQ_{CFG}$</span> is co-Turing-recognizable. When searching for proofs I can only find proofs on the following ... | habedi/stack-exchange-dataset |
104,810 | Is {xy | x, y ∈ Σ∗ and x contains more a’s than y} regular? | <p>I've been asked to write a DFA for:</p>
<p><span class="math-container">$\{xy\mid x, y \in \Sigma^*\text{ and }x\text{ contains more }a\text{’s than }y\}$</span> where <span class="math-container">$\Sigma=\{a,b\}$</span>.</p>
<p>I don't believe this is possible. Can anyone confirm if this is not a regular la... | formal languages regular languages finite automata | 1 | Is {xy | x, y ∈ Σ∗ and x contains more a’s than y} regular? -- (formal languages regular languages finite automata)
<p>I've been asked to write a DFA for:</p>
<p><span class="math-container">$\{xy\mid x, y \in \Sigma^*\text{ and }x\text{ contains more }a\text{’s than }y\}$</span> where <span class="math-container">... | habedi/stack-exchange-dataset |
104,816 | Implementation of QuickSort to handle duplicates | <p>I have this past year question based on the following scenario:</p>

<p>When the list of items to be sorted contains a lot of duplicate values, we can improve QuickSort by grouping all the values that are equal to the pivot to the middle and then we recursively QuickSort those values on the left and those va... | algorithms sorting quicksort algorithm design | 1 | Implementation of QuickSort to handle duplicates -- (algorithms sorting quicksort algorithm design)
<p>I have this past year question based on the following scenario:</p>

<p>When the list of items to be sorted contains a lot of duplicate values, we can improve QuickSort by grouping all the values that are equa... | habedi/stack-exchange-dataset |
104,817 | Computing Cardinality of Sumsets using Convolutions and FFT | <p>I read somewhere that you can compute the cardinality of sumsets by computing the convolutions of the characteristic vectors of the given sets, and that this can be done efficiently using Fast Fourier Transform. How would this work?</p>
 | algorithms | 1 | Computing Cardinality of Sumsets using Convolutions and FFT -- (algorithms)
<p>I read somewhere that you can compute the cardinality of sumsets by computing the convolutions of the characteristic vectors of the given sets, and that this can be done efficiently using Fast Fourier Transform. How would this work?</p>
 | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.