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 |
|---|---|---|---|---|---|---|
116,179 | Finding the number of distinct strings in regular expression | <p>Given the regular expression <span class="math-container">$(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )$</span>, how many distinct strings are in the language? How do you determine this from looking at the regular expression? Do I have to generate a table of all possible c... | regular languages finite automata regular expressions parsers lexical analysis | 1 | Finding the number of distinct strings in regular expression -- (regular languages finite automata regular expressions parsers lexical analysis)
<p>Given the regular expression <span class="math-container">$(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )(1 + \varepsilon + 0 )$</span>, how many distin... | habedi/stack-exchange-dataset |
116,180 | motivation and idea of defining non-deterministic Turing machine | <p>This is a very basic question but I spent some time reading and find no answer. I am not computer science majored but have read some basic algorithm stuff, for example, some basic sorting algorithms and I also have some basic knowledge of how computers operate. However, I am really interested in the idea of a Turing... | algorithms turing machines polynomial time nondeterminism | 1 | motivation and idea of defining non-deterministic Turing machine -- (algorithms turing machines polynomial time nondeterminism)
<p>This is a very basic question but I spent some time reading and find no answer. I am not computer science majored but have read some basic algorithm stuff, for example, some basic sorting a... | habedi/stack-exchange-dataset |
116,185 | Bipartite graph minimal amount of vertices required | <p>I have a bipartite graph made of two sets (<code>SET 1</code> and <code>SET 2</code>) and I want to determine how many vertices from the <code>SET 1</code> I can remove while still having 
every vertex of the <code>SET 2</code> connected to at least one vertex of the <code>SET 1</code>.
<a href="https://i.st... | graphs bipartite matching vertex cover bipartite graph | 1 | Bipartite graph minimal amount of vertices required -- (graphs bipartite matching vertex cover bipartite graph)
<p>I have a bipartite graph made of two sets (<code>SET 1</code> and <code>SET 2</code>) and I want to determine how many vertices from the <code>SET 1</code> I can remove while still having 
every vertex... | habedi/stack-exchange-dataset |
116,186 | How to intuitively come up with an example for an ambiguous grammar and how to make that grammar unambiguous? | <p><strong>I don't get how to intuitively come up with an example for an ambiguous grammar.</strong></p>

<p>Let's take as an example this grammar:</p>

<pre><code>Declaration ::= Type D ;
 Type ::= "int" | "char"
 D ::= "*" D
 | D "[" number "]"
 |... | formal grammars programming languages tree grammars | 1 | How to intuitively come up with an example for an ambiguous grammar and how to make that grammar unambiguous? -- (formal grammars programming languages tree grammars)
<p><strong>I don't get how to intuitively come up with an example for an ambiguous grammar.</strong></p>

<p>Let's take as an example this gramma... | habedi/stack-exchange-dataset |
116,197 | Complexity of negation cancellation | <p>Consider propositional logic over the connectives <span class="math-container">$\land$</span>, <span class="math-container">$\lor$</span>, and <span class="math-container">$\lnot$</span>. Notation: <span class="math-container">$| \alpha |$</span> is the length of formula <span class="math-container">$\alpha$</span>.... | complexity theory logic propositional logic | 1 | Complexity of negation cancellation -- (complexity theory logic propositional logic)
<p>Consider propositional logic over the connectives <span class="math-container">$\land$</span>, <span class="math-container">$\lor$</span>, and <span class="math-container">$\lnot$</span>. Notation: <span class="math-container">$| \a... | habedi/stack-exchange-dataset |
116,200 | If a problem is not in NP, prove that every NP problem can be efficiently reduced to it | <p>I understand that an NP-hard problem is a problem X such that any problem in NP can be reduced to X in polynomial time. </p>

<p>Does there exist a problem that is hard to solve but problems in NP cannot be reduced to it in polynomial time i.e. it does not satisfy the definition of NP-hard but is strictly no... | complexity theory np hard | 1 | If a problem is not in NP, prove that every NP problem can be efficiently reduced to it -- (complexity theory np hard)
<p>I understand that an NP-hard problem is a problem X such that any problem in NP can be reduced to X in polynomial time. </p>

<p>Does there exist a problem that is hard to solve but problems... | habedi/stack-exchange-dataset |
116,211 | Proving that a property is k-inductive with an SMT solver (parametric resettable counter) | <p>I'm following the slides at <a href="https://homepage.cs.uiowa.edu/~tinelli/talks/FT-11.pdf" rel="nofollow noreferrer">https://homepage.cs.uiowa.edu/~tinelli/talks/FT-11.pdf</a> where Tinelli explains how k-induction works in the context of SMT based model checking.</p>

<p>A parametric and resettable counte... | induction model checking smt solvers | 1 | Proving that a property is k-inductive with an SMT solver (parametric resettable counter) -- (induction model checking smt solvers)
<p>I'm following the slides at <a href="https://homepage.cs.uiowa.edu/~tinelli/talks/FT-11.pdf" rel="nofollow noreferrer">https://homepage.cs.uiowa.edu/~tinelli/talks/FT-11.pdf</a> where T... | habedi/stack-exchange-dataset |
116,221 | Guidance for Theory of Computation | <p>I have been studying Introduction to Theory of Computation by Micheal Sipser and I just complected it. Now I want to take this a step further what should I do next to increase my skills. I tried looking at some papers from FOCS but they were beyond my understanding. I want to know what should I study next.</p>
 | reference request | 1 | Guidance for Theory of Computation -- (reference request)
<p>I have been studying Introduction to Theory of Computation by Micheal Sipser and I just complected it. Now I want to take this a step further what should I do next to increase my skills. I tried looking at some papers from FOCS but they were beyond my underst... | habedi/stack-exchange-dataset |
116,229 | Are number of states in a NFA same as Pumping length? | <p>So i was reading a post on <a href="https://cs.stackexchange.com/questions/84563/minimum-pumping-length-of-regular-language">Minimum pumping length of regular language</a> where Yuval Filmus has proved that a pumping lemma might have lesser number of states than a minimal DFA. But What about NFA's? Are NFA's able to... | automata finite automata pumping lemma | 1 | Are number of states in a NFA same as Pumping length? -- (automata finite automata pumping lemma)
<p>So i was reading a post on <a href="https://cs.stackexchange.com/questions/84563/minimum-pumping-length-of-regular-language">Minimum pumping length of regular language</a> where Yuval Filmus has proved that a pumping le... | habedi/stack-exchange-dataset |
116,246 | Time complexity of recursive function | <p>I am trying to find out how they calculated the time complexity of this small function .
I am studying for an exam and found this question and the final answer is given, but I am trying to understand how they got to this answer, 
I tried solving this problem using Iterative but when I tried to find the numbe... | time complexity | 1 | Time complexity of recursive function -- (time complexity)
<p>I am trying to find out how they calculated the time complexity of this small function .
I am studying for an exam and found this question and the final answer is given, but I am trying to understand how they got to this answer, 
I tried solving this... | habedi/stack-exchange-dataset |
116,248 | Why is building a heap $\mathcal O(n)$ and not $\theta(n)$? | <p>From what I see online, all seem to suggest that heapifying takes <span class="math-container">$\mathcal O (n)$</span> time, but it seems like it should <em>always</em> takes <span class="math-container">$\theta(n)$</span> time, even in the best case. Is something wrong with my pseudocode? Is there a more optimized ... | asymptotics heaps big o notation | 1 | Why is building a heap $\mathcal O(n)$ and not $\theta(n)$? -- (asymptotics heaps big o notation)
<p>From what I see online, all seem to suggest that heapifying takes <span class="math-container">$\mathcal O (n)$</span> time, but it seems like it should <em>always</em> takes <span class="math-container">$\theta(n)$</sp... | habedi/stack-exchange-dataset |
116,251 | What to consider while proving NP-completeness? | <p>Suppose that a problem <span class="math-container">$P$</span> is known to be NP-hard.<br>
The input to the problem is a set of <span class="math-container">$k$</span> lines in 2D, a set of <span class="math-container">$n$</span> points, and <span class="math-container">$m < n$</span> pairwise distances among... | complexity theory np complete | 1 | What to consider while proving NP-completeness? -- (complexity theory np complete)
<p>Suppose that a problem <span class="math-container">$P$</span> is known to be NP-hard.<br>
The input to the problem is a set of <span class="math-container">$k$</span> lines in 2D, a set of <span class="math-container">$n$</span> ... | habedi/stack-exchange-dataset |
116,261 | Why does cpu benchmark increases faster than cpu frequency? | <p>Since duration of an instruction is just the number of cpu cycles needed times the time of a cycle, which is the inverse of the frequency, I do not get why the ratio of cpu benchmark of a two processors of a same trademark is not exactly the inerse of the ratio of the frequencies. Cpu is supposed not to loose time b... | cpu | 1 | Why does cpu benchmark increases faster than cpu frequency? -- (cpu)
<p>Since duration of an instruction is just the number of cpu cycles needed times the time of a cycle, which is the inverse of the frequency, I do not get why the ratio of cpu benchmark of a two processors of a same trademark is not exactly the inerse... | habedi/stack-exchange-dataset |
116,267 | Solve SUBSET SUM for Reciprocals of Primes | <p>Let <span class="math-container">$p_1, ..., p_n$</span> distinct prime numbers with <span class="math-container">$P = \prod_{i=1}^{n}{p_i}$</span> and <span class="math-container">$A=(a_1, ..., a_n)$</span> with <span class="math-container">$a_i = P/p_i$</span>.</p>

<h2>Problem</h2>

<p>Show the SUB... | algorithms complexity theory cryptography primes subset sum | 1 | Solve SUBSET SUM for Reciprocals of Primes -- (algorithms complexity theory cryptography primes subset sum)
<p>Let <span class="math-container">$p_1, ..., p_n$</span> distinct prime numbers with <span class="math-container">$P = \prod_{i=1}^{n}{p_i}$</span> and <span class="math-container">$A=(a_1, ..., a_n)$</span> wi... | habedi/stack-exchange-dataset |
116,270 | Find two numbers in sorted array whose product is close to N | <p>Given a sorted array of numbers, is there a good algorithm for finding two numbers in that array whose product is as close as possible to a given number N?</p>

<p>I know that there is a good O(n) (?) algorithm for the related problem of finding two numbers that sum to a given number N. You begin with ptr1 a... | algorithms | 1 | Find two numbers in sorted array whose product is close to N -- (algorithms)
<p>Given a sorted array of numbers, is there a good algorithm for finding two numbers in that array whose product is as close as possible to a given number N?</p>

<p>I know that there is a good O(n) (?) algorithm for the related probl... | habedi/stack-exchange-dataset |
116,278 | Why there is forward chaining inference engine (reasoner) for description logics only and not for other logics? | <p>Reasoner is forward chaining inference engine (<a href="https://en.wikipedia.org/wiki/Semantic_reasoner" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Semantic_reasoner</a>) as opposite to Prolog backward chaining SAT solver (for queries). Why there is reasoner for description logics and not for other logi... | logic semantics reasoning | 1 | Why there is forward chaining inference engine (reasoner) for description logics only and not for other logics? -- (logic semantics reasoning)
<p>Reasoner is forward chaining inference engine (<a href="https://en.wikipedia.org/wiki/Semantic_reasoner" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Semantic_reas... | habedi/stack-exchange-dataset |
116,286 | Fastest algorithm to find all the possible paths of length $n$ from a give node in a directed graph? | <p>I am trying to find the fastest algorithm to find all the possible paths of length <span class="math-container">$N$</span> from a given node in a directed graph. </p>

<p>My solution is to do a modification of breadth first search from the given node for <span class="math-container">$N$</span> iteration. Its... | algorithms graphs counting | 1 | Fastest algorithm to find all the possible paths of length $n$ from a give node in a directed graph? -- (algorithms graphs counting)
<p>I am trying to find the fastest algorithm to find all the possible paths of length <span class="math-container">$N$</span> from a given node in a directed graph. </p>

<p>My so... | habedi/stack-exchange-dataset |
116,299 | Time complexity described by recurrence relation | <p>I need to find the time complexity described by the following recurrence relation.</p>

<p><span class="math-container">$T(n) = T(n/2) + T(n/3) + T(n/6) + n$</span></p>

<p><span class="math-container">$T(1) = \Theta(1)$</span></p>

<p>The solution must be something like <span class="math-con... | complexity theory time complexity | 1 | Time complexity described by recurrence relation -- (complexity theory time complexity)
<p>I need to find the time complexity described by the following recurrence relation.</p>

<p><span class="math-container">$T(n) = T(n/2) + T(n/3) + T(n/6) + n$</span></p>

<p><span class="math-container">$T(1) = \Th... | habedi/stack-exchange-dataset |
116,306 | Arranging Colors in a Grid; Two Dimensional TSP? | <p>I am working on an interesting problem, which I believe can be solved algorithmically. I have a 6x8 on which I am attempting to arrange 48 color swatches, such that the transition from each swatch to its neighbor is as smooth as possible.</p>

<p>I can compute perceptual color differences using LAB-space enc... | graph traversal traveling salesman colorings | 1 | Arranging Colors in a Grid; Two Dimensional TSP? -- (graph traversal traveling salesman colorings)
<p>I am working on an interesting problem, which I believe can be solved algorithmically. I have a 6x8 on which I am attempting to arrange 48 color swatches, such that the transition from each swatch to its neighbor is as... | habedi/stack-exchange-dataset |
116,310 | Is Half - Palindrome subset of a context-free language context-free? | <p>Suppose we have <span class="math-container">$L$</span> being a context-free language. Let <span class="math-container">$L'=\{x \in \Sigma^* | xx^R \in L \}$</span>, is <span class="math-container">$L'$</span> context-free as well? I know that if <span class="math-container">$L$</span> is regular then <span class="m... | formal languages automata regular languages context free pushdown automata | 1 | Is Half - Palindrome subset of a context-free language context-free? -- (formal languages automata regular languages context free pushdown automata)
<p>Suppose we have <span class="math-container">$L$</span> being a context-free language. Let <span class="math-container">$L'=\{x \in \Sigma^* | xx^R \in L \}$</span>, is... | habedi/stack-exchange-dataset |
116,312 | Are Context-Free Grammars with only one Production Rule always Unambiguous? | <p>Consider the following (Context-Free) Grammars with only one production rule (not including the epsilon production):</p>

<ul>
<li><span class="math-container">$S \rightarrow aSb\;|\;\epsilon$</span></li>
<li><span class="math-container">$\require{cancel} \cancel{S \rightarrow aSSb\;|\;\epsilon}$</sp... | formal languages context free formal grammars | 1 | Are Context-Free Grammars with only one Production Rule always Unambiguous? -- (formal languages context free formal grammars)
<p>Consider the following (Context-Free) Grammars with only one production rule (not including the epsilon production):</p>

<ul>
<li><span class="math-container">$S \rightarrow aSb... | habedi/stack-exchange-dataset |
116,318 | Complexity of finding 7th smallest element in a min-heap? | <p>I don't know if it's allowed to traverse nodes in a min-heap.</p>

<p>Because, if traversal is allowed then for finding <span class="math-container">$7^{th}$</span> smallest element, only a constant number of nodes need to be checked, thus giving the complexity of <span class="math-container">$\Theta(1)$</sp... | data structures time complexity | 1 | Complexity of finding 7th smallest element in a min-heap? -- (data structures time complexity)
<p>I don't know if it's allowed to traverse nodes in a min-heap.</p>

<p>Because, if traversal is allowed then for finding <span class="math-container">$7^{th}$</span> smallest element, only a constant number of nodes... | habedi/stack-exchange-dataset |
116,321 | How do I calculate the Nth result of a context-free grammar? | <p>Given a context-free grammar and a maximum depth, how do I directly compute the Nth sentence without calculating or caching intermediary sentences?</p>

<p>Take as an example the following grammar:</p>

<p>(from <a href="http://www.nltk.org/howto/generate.html" rel="nofollow noreferrer">http://www.nl... | formal languages formal grammars | 1 | How do I calculate the Nth result of a context-free grammar? -- (formal languages formal grammars)
<p>Given a context-free grammar and a maximum depth, how do I directly compute the Nth sentence without calculating or caching intermediary sentences?</p>

<p>Take as an example the following grammar:</p>

... | habedi/stack-exchange-dataset |
116,327 | Context-free grammar for $\{a^x b^y : x \neq y\}$ | <p>I am trying to create a context free grammar in <a href="https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form" rel="nofollow noreferrer">Extended Backus–Naur form</a>, which starts with a non-empty sequence of <code>a</code>'s and is followed by a non-empty sequence of <code>b</code>'s. With the special c... | context free formal grammars | 1 | Context-free grammar for $\{a^x b^y : x \neq y\}$ -- (context free formal grammars)
<p>I am trying to create a context free grammar in <a href="https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form" rel="nofollow noreferrer">Extended Backus–Naur form</a>, which starts with a non-empty sequence of <code>a</cod... | habedi/stack-exchange-dataset |
116,328 | Knapsack up to the heaviest item | <p>There are <span class="math-container">$n$</span> items with weights <span class="math-container">$w_1,\ldots,w_n$</span> and values <span class="math-container">$v_1,\ldots,v_n$</span>. There is a knapsack with capacity <span class="math-container">$W$</span>. A subset of items is called <em>feasible up to heaviest... | reference request np hard knapsack problems | 1 | Knapsack up to the heaviest item -- (reference request np hard knapsack problems)
<p>There are <span class="math-container">$n$</span> items with weights <span class="math-container">$w_1,\ldots,w_n$</span> and values <span class="math-container">$v_1,\ldots,v_n$</span>. There is a knapsack with capacity <span class="m... | habedi/stack-exchange-dataset |
116,329 | Is the power of a natural number logspace-computable? | <p>Given a constant <span class="math-container">$n\in\mathbb{N}_+$</span>, is the simple power function
<span class="math-container">$$
λ\,x\in\mathbb{N}_+.\,x^n
$$</span>
logspace computable by a logspace transducer (which has a read-only input tape, a working read-write tape (on which the transducer ... | space complexity transducers | 1 | Is the power of a natural number logspace-computable? -- (space complexity transducers)
<p>Given a constant <span class="math-container">$n\in\mathbb{N}_+$</span>, is the simple power function
<span class="math-container">$$
λ\,x\in\mathbb{N}_+.\,x^n
$$</span>
logspace computable by a logspace transduce... | habedi/stack-exchange-dataset |
116,330 | Finding the hidden treasure | <p>Let's assume I am trying to find a hidden treasure. </p>

<p>The treasure is hidden at an uknown position x. We know that the position x of the treasure is somewhere on the integer axis (in other words x is an integer). In order to find the treasure I have to take with me a detector. The detector can spot th... | algorithms time complexity online algorithms upper bound | 1 | Finding the hidden treasure -- (algorithms time complexity online algorithms upper bound)
<p>Let's assume I am trying to find a hidden treasure. </p>

<p>The treasure is hidden at an uknown position x. We know that the position x of the treasure is somewhere on the integer axis (in other words x is an integer).... | habedi/stack-exchange-dataset |
116,334 | How do I call a system like a grammar, but where a rule has to be applied to all matches at once? | <p>For example, given rules <span class="math-container">$\{ a \to x, a \to y \}$</span> and input <span class="math-container">$aa$</span> , I am usually allowed to derive strings <span class="math-container">$\{ xx, xy, yx, yy \}$</span>. I would like to restrict this to only performing <em>"consistent"</em> rewrites... | formal languages formal grammars | 1 | How do I call a system like a grammar, but where a rule has to be applied to all matches at once? -- (formal languages formal grammars)
<p>For example, given rules <span class="math-container">$\{ a \to x, a \to y \}$</span> and input <span class="math-container">$aa$</span> , I am usually allowed to derive strings <sp... | habedi/stack-exchange-dataset |
116,343 | Is asymptotic ordering preserved when taking log of both functions? | <p>In one of my exercise sheets I have the following question;</p>

<p>Let <span class="math-container">$f,g\colon \mathbb{N}\longrightarrow\mathbb{R}$</span> be positive functions with <span class="math-container">$f(n) \in O(g(n))$</span>. Prove or disprove; <span class="math-container">$\ln(f(n)) \in O(\ln(... | asymptotics correctness proof | 1 | Is asymptotic ordering preserved when taking log of both functions? -- (asymptotics correctness proof)
<p>In one of my exercise sheets I have the following question;</p>

<p>Let <span class="math-container">$f,g\colon \mathbb{N}\longrightarrow\mathbb{R}$</span> be positive functions with <span class="math-conta... | habedi/stack-exchange-dataset |
116,345 | Question about machine epsilon | <p>I am studying over my notes, and there is something I don't understand about <span class="math-container">$e_m$</span>. We represent the floating point numbers as <span class="math-container">$1.d_1d_2...d_t \times \beta^e$</span>. Now, my professor defines <span class="math-container">$\epsilon_m$</span> as the sm... | floating point | 1 | Question about machine epsilon -- (floating point)
<p>I am studying over my notes, and there is something I don't understand about <span class="math-container">$e_m$</span>. We represent the floating point numbers as <span class="math-container">$1.d_1d_2...d_t \times \beta^e$</span>. Now, my professor defines <span c... | habedi/stack-exchange-dataset |
116,365 | How to solve Assigment problem on SPOJ? | <p>Problem Link - <a href="https://www.spoj.com/problems/ASSIGN/" rel="nofollow noreferrer">Assign</a> .This problem is known as assignment problem.</p>

<p>I read few solutions <a href="https://github.com/fazlulkabir94/spoj-problem-solution/blob/master/ASSIGN%20-%20Assignments.cpp" rel="nofollow noreferrer"> H... | algorithms dynamic programming bit manipulation | 1 | How to solve Assigment problem on SPOJ? -- (algorithms dynamic programming bit manipulation)
<p>Problem Link - <a href="https://www.spoj.com/problems/ASSIGN/" rel="nofollow noreferrer">Assign</a> .This problem is known as assignment problem.</p>

<p>I read few solutions <a href="https://github.com/fazlulkabir94... | habedi/stack-exchange-dataset |
116,366 | Polynomial multiplications and counting | <p>I came across the following problem. Given a set of <span class="math-container">$n$</span> positive integers <span class="math-container">$A$</span> and an integer <span class="math-container">$k$</span>. Let <span class="math-container">$S$</span> be the set of integers that are the sum of <span class="math-contai... | algorithms combinatorics polynomials fast fourier transform | 1 | Polynomial multiplications and counting -- (algorithms combinatorics polynomials fast fourier transform)
<p>I came across the following problem. Given a set of <span class="math-container">$n$</span> positive integers <span class="math-container">$A$</span> and an integer <span class="math-container">$k$</span>. Let <s... | habedi/stack-exchange-dataset |
116,378 | What's the least signifcant bit of a mantissa system? | <p>If <em>Mantissa</em> is a 1-dot-<em>M</em> fixed-point number whose most significant bit is always 1 then, how is the least significant bit calculated?</p>

<p>I know the least and most significant bit of the mantissa results in the following range:</p>

<pre><code>1.0 <_ Mantissa <_ (2.0 - 1/... | arithmetic floating point binary | 1 | What's the least signifcant bit of a mantissa system? -- (arithmetic floating point binary)
<p>If <em>Mantissa</em> is a 1-dot-<em>M</em> fixed-point number whose most significant bit is always 1 then, how is the least significant bit calculated?</p>

<p>I know the least and most significant bit of the mantiss... | habedi/stack-exchange-dataset |
116,386 | Simplifying this expression with big O when several variables are involved | <p>I have an algorithm which depends on three variables an where the running time is in <span class="math-container">$\mathcal{O}(m+2 m\cdot n\cdot p+p\cdot(n+m))$</span> and I would like to simplified it. I proceeded as follows :</p>

<p><span class="math-container">\begin{eqnarray}
 \mathcal{O}(3m+2 m\c... | asymptotics big o notation | 1 | Simplifying this expression with big O when several variables are involved -- (asymptotics big o notation)
<p>I have an algorithm which depends on three variables an where the running time is in <span class="math-container">$\mathcal{O}(m+2 m\cdot n\cdot p+p\cdot(n+m))$</span> and I would like to simplified it. I proce... | habedi/stack-exchange-dataset |
116,388 | Prove that the following language is not regular: $\{0^i1^j : i \neq j\}$ | <p>I was trying to approach this proof, after multiple reads and attempts I am getting nowhere. If someone could help me out that would be great. Should I use the pumping lemma, if so how show I start, what word should I choose? Or should I use closure-properties and if so what irregularity should I show? I am genuinel... | formal languages regular languages finite automata proof techniques | 1 | Prove that the following language is not regular: $\{0^i1^j : i \neq j\}$ -- (formal languages regular languages finite automata proof techniques)
<p>I was trying to approach this proof, after multiple reads and attempts I am getting nowhere. If someone could help me out that would be great. Should I use the pumping le... | habedi/stack-exchange-dataset |
116,399 | Is $(\sqrt{n})!=Θ(\sqrt{n}^{\sqrt{n}})$? | <p>I would like to express <span class="math-container">$(\sqrt{n})!$</span> in terms of <span class="math-container">$Θ()$</span> notation.</p>

<p>My approach is the following:</p>

<p><span class="math-container">$$(\sqrt{n})!=f(n)\Leftrightarrow$$</span>
<span class="math-container">$$\log(\sqrt... | asymptotics | 1 | Is $(\sqrt{n})!=Θ(\sqrt{n}^{\sqrt{n}})$? -- (asymptotics)
<p>I would like to express <span class="math-container">$(\sqrt{n})!$</span> in terms of <span class="math-container">$Θ()$</span> notation.</p>

<p>My approach is the following:</p>

<p><span class="math-container">$$(\sqrt{n})!=f(n)\Leftrightar... | habedi/stack-exchange-dataset |
116,411 | Alternatives to Unit Testing? | <p>During a technical interview I was asked about ways to make sure code/software design is functional before deploying to any servers and the only thing I could think of was unit testing. My interviewer pressed me for other ways but I couldn't come up with any alternatives.</p>
 | software verification applications | 1 | Alternatives to Unit Testing? -- (software verification applications)
<p>During a technical interview I was asked about ways to make sure code/software design is functional before deploying to any servers and the only thing I could think of was unit testing. My interviewer pressed me for other ways but I couldn't come ... | habedi/stack-exchange-dataset |
116,423 | All 16 Boolean Logic Gates | <p>I was doing some reseach and I came across a website that had listed 16 different boolean logic operators. I was wondering if all of them were real, and if so, what do they do.</p>

<p><a href="https://www.researchgate.net/figure/Method-for-implementing-all-16-Boolean-logic-functions-in-a-single-MR-unit-with... | boolean algebra | 1 | All 16 Boolean Logic Gates -- (boolean algebra)
<p>I was doing some reseach and I came across a website that had listed 16 different boolean logic operators. I was wondering if all of them were real, and if so, what do they do.</p>

<p><a href="https://www.researchgate.net/figure/Method-for-implementing-all-16-... | habedi/stack-exchange-dataset |
116,429 | Matching Upper Bound for Online Problems | <p>I have an online problem and I want to prove that no deterministic online algorithm is competitive. </p>

<p>Let <span class="math-container">$\texttt{ON}$</span> be an online algorithm and <span class="math-container">$\texttt{OPT}$</span> an optimal offline algorithm (an adversary). Given a sequence of <sp... | online algorithms | 1 | Matching Upper Bound for Online Problems -- (online algorithms)
<p>I have an online problem and I want to prove that no deterministic online algorithm is competitive. </p>

<p>Let <span class="math-container">$\texttt{ON}$</span> be an online algorithm and <span class="math-container">$\texttt{OPT}$</span> an o... | habedi/stack-exchange-dataset |
116,431 | What is the name of this experimental OS? | <p>I am trying to find an OS that had a network to verify it's users. It classified itself in classes going from greatest signifigance to least, and the names were galaxy, system, planet, comet etc.</p>

<p>I can not find the name of this OS or protocol for the life of me.</p>
 | operating systems communication protocols | 1 | What is the name of this experimental OS? -- (operating systems communication protocols)
<p>I am trying to find an OS that had a network to verify it's users. It classified itself in classes going from greatest signifigance to least, and the names were galaxy, system, planet, comet etc.</p>

<p>I can not find ... | habedi/stack-exchange-dataset |
116,434 | Does the "dictionary of stacks" ADT have an accepted name? | <p>With a stack, you can push and you can pop. There's also a generalization, let's call it a <em>foo</em>, in which key-value pairs are involved. The idea is that instead of just pushing a value, we push a key-value pair, as in <code>L.push(key, value)</code>. Similarly, to pop a value, we have to supple a key. As in ... | data structures | 1 | Does the "dictionary of stacks" ADT have an accepted name? -- (data structures)
<p>With a stack, you can push and you can pop. There's also a generalization, let's call it a <em>foo</em>, in which key-value pairs are involved. The idea is that instead of just pushing a value, we push a key-value pair, as in <code>L.pus... | habedi/stack-exchange-dataset |
116,451 | Linear sorting algorithm | <p>I'm trying to understand sorting algorithms. And I'm thinking about a totally different way to tackle sorting: Use array indexes to sort a given set of integers.</p>

<p>Suppose We want to sort a list of positive integers (for now). Let's call it <code>toSortArray</code></p>

<ul>
<li>Create a bo... | time complexity sorting | 1 | Linear sorting algorithm -- (time complexity sorting)
<p>I'm trying to understand sorting algorithms. And I'm thinking about a totally different way to tackle sorting: Use array indexes to sort a given set of integers.</p>

<p>Suppose We want to sort a list of positive integers (for now). Let's call it <code>to... | habedi/stack-exchange-dataset |
116,454 | Why is the lower bound for sorting strings Ω(d + nlogn)? | <p>I'm taking an Advanced Algorithms course. I'm currently studying efficient algorithms for sorting strings. In this chapter, it is provided a lower bound for the time complexity of <span class="math-container">$\Omega(d + n\log{n})$</span>, where d is the sum of the distinguishing prefixes of all the strings in our s... | time complexity sorting strings lower bounds | 1 | Why is the lower bound for sorting strings Ω(d + nlogn)? -- (time complexity sorting strings lower bounds)
<p>I'm taking an Advanced Algorithms course. I'm currently studying efficient algorithms for sorting strings. In this chapter, it is provided a lower bound for the time complexity of <span class="math-container">$... | habedi/stack-exchange-dataset |
116,457 | Find the sum of numbers from an array closest to a number, where repetition of the numbers are allowed | <p>I would like to find the sum of values from a given number array, where the repetition of numbers are allowed, closest to a target but the sum cannot exceed the target. If there are more solution, I'd prefer the one with the minimum element count.</p>

<p><strong><em>Examples:</em></strong></p>

<p><... | algorithms knapsack problems integers | 1 | Find the sum of numbers from an array closest to a number, where repetition of the numbers are allowed -- (algorithms knapsack problems integers)
<p>I would like to find the sum of values from a given number array, where the repetition of numbers are allowed, closest to a target but the sum cannot exceed the target. If... | habedi/stack-exchange-dataset |
116,464 | Does this argument prove CFLs are not closed under union? | <p>Context free languages are not closed under complementation. This follows from their property of non-closure under intersection:</p>

<p><img src="https://chart.googleapis.com/chart?cht=tx&chl=L_%7B1%7D%20%5Ccap%20L_%7B2%7D%20%3D%20%7B%5Coverline%7B%5Coverline%7BL_%7B1%7D%7D%20%5Ccup%5Coverline%7BL_%7B2%... | formal languages automata finite automata context free pushdown automata | 1 | Does this argument prove CFLs are not closed under union? -- (formal languages automata finite automata context free pushdown automata)
<p>Context free languages are not closed under complementation. This follows from their property of non-closure under intersection:</p>

<p><img src="https://chart.googleapis.c... | habedi/stack-exchange-dataset |
116,473 | Why is this grammar ambiguous? | <pre><code>S ::= x
S ::= if E then S
S ::= if E then S else S

</code></pre>

<p>This is example <code>if E then if E then x else x</code> proves that it is ambiguous but I don't see why? Isn't it just an if statement within an if statement.</p>
 | formal languages programming languages | 1 | Why is this grammar ambiguous? -- (formal languages programming languages)
<pre><code>S ::= x
S ::= if E then S
S ::= if E then S else S

</code></pre>

<p>This is example <code>if E then if E then x else x</code> proves that it is ambiguous but I don't see why? Isn't it just an if statement wit... | habedi/stack-exchange-dataset |
116,475 | An algorithm for topological sorting based on depth-first search: why do we need two tags? | <p><a href="https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search" rel="nofollow noreferrer">Wiki</a> gives an alternative algorithm for topological sorting is based on depth-first search, as follows:</p>

<pre><code>L ← Empty list that will contain the sorted nodes
while exists nodes without... | algorithm analysis graph traversal dag | 1 | An algorithm for topological sorting based on depth-first search: why do we need two tags? -- (algorithm analysis graph traversal dag)
<p><a href="https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search" rel="nofollow noreferrer">Wiki</a> gives an alternative algorithm for topological sorting is based on d... | habedi/stack-exchange-dataset |
116,476 | An example where the algorithm of Hopcroft and Karp performs poorly? | <p>I have been trying to construct an example, where Hopcroft and Karp's algorithm for the maximum matching problem performs poorly (say at least <span class="math-container">$\Omega(\log n)$</span> rounds). However, all the examples I came up with where solved on paper in almost constant number of rounds.</p>

... | algorithms graphs lower bounds bipartite matching fine grained analysis | 1 | An example where the algorithm of Hopcroft and Karp performs poorly? -- (algorithms graphs lower bounds bipartite matching fine grained analysis)
<p>I have been trying to construct an example, where Hopcroft and Karp's algorithm for the maximum matching problem performs poorly (say at least <span class="math-container"... | habedi/stack-exchange-dataset |
116,479 | Selecting Columns with Minimum Overlaps | <p>Given a matrix <span class="math-container">$A=[a_{ij}]$</span> of positive number <span class="math-container">$0\leq a_{ij}\leq1$</span> that has <span class="math-container">$m$</span> rows and <span class="math-container">$n$</span> columns. I would like to select, for each row <span class="math-container">$i$</... | algorithms | 1 | Selecting Columns with Minimum Overlaps -- (algorithms)
<p>Given a matrix <span class="math-container">$A=[a_{ij}]$</span> of positive number <span class="math-container">$0\leq a_{ij}\leq1$</span> that has <span class="math-container">$m$</span> rows and <span class="math-container">$n$</span> columns. I would like to... | habedi/stack-exchange-dataset |
116,492 | Stepwise regression | <p>I think that both forward selection and backward selection should give the same results if the evaluation model is deterministic and using the same variables gives the same results. Is this true? If so, what are the reasons for chosing one method over the other?</p>
 | machine learning | 1 | Stepwise regression -- (machine learning)
<p>I think that both forward selection and backward selection should give the same results if the evaluation model is deterministic and using the same variables gives the same results. Is this true? If so, what are the reasons for chosing one method over the other?</p>
 | habedi/stack-exchange-dataset |
116,498 | Checking if a $k$-subset of a graph is a vertex cover in time $O(kn)$ | <p>Given a graph <span class="math-container">$G=(V,E)$</span> with <span class="math-container">$|V|=n,|E|=m$</span>. I am reading a <span class="math-container">$\textit{brute force}$</span> solution to determining whether each candidate vertex cover of size <span class="math-container">$k \leq n$</span> is a vertex ... | graphs vertex cover | 1 | Checking if a $k$-subset of a graph is a vertex cover in time $O(kn)$ -- (graphs vertex cover)
<p>Given a graph <span class="math-container">$G=(V,E)$</span> with <span class="math-container">$|V|=n,|E|=m$</span>. I am reading a <span class="math-container">$\textit{brute force}$</span> solution to determining whether ... | habedi/stack-exchange-dataset |
116,507 | Is my formal definition of programming language correct? | <p>I found this formal definition of a programming language in the 1973 paper <a href="https://dl.acm.org/citation.cfm?doid=986953.986988" rel="nofollow noreferrer">Formal definition of programming languages</a> by Terrence Pratt.</p>

<blockquote>
 <p>PL is a formal language endowed with two structures: a... | formal languages computability | 1 | Is my formal definition of programming language correct? -- (formal languages computability)
<p>I found this formal definition of a programming language in the 1973 paper <a href="https://dl.acm.org/citation.cfm?doid=986953.986988" rel="nofollow noreferrer">Formal definition of programming languages</a> by Terrence Pra... | habedi/stack-exchange-dataset |
116,518 | Given a DCEL, how do you identify the unbounded face | <p>I have constructed a DCEL using the procedure described in <a href="https://cs.stackexchange.com/q/2450/111353">How do I construct a doubly connected edge list given a set of line segments?</a>.</p>

<p>This correctly identifies all faces, however I'm struggling to come up with a way to identify the unbounde... | data structures computational geometry doubly connected edge list | 1 | Given a DCEL, how do you identify the unbounded face -- (data structures computational geometry doubly connected edge list)
<p>I have constructed a DCEL using the procedure described in <a href="https://cs.stackexchange.com/q/2450/111353">How do I construct a doubly connected edge list given a set of line segments?</a>... | habedi/stack-exchange-dataset |
116,538 | Schedule each entree so that all entrees are completed in the shortest amount of time | <p>Lets say we have plenty people to dress up entrees, but only one chef to cook them. Each entree <span class="math-container">$E_i$</span>, takes <span class="math-container">$c_i$</span> time to cook and <span class="math-container">$d_i$</span> time to "dress up". The dressing up of entrees can occur while other en... | greedy algorithms | 1 | Schedule each entree so that all entrees are completed in the shortest amount of time -- (greedy algorithms)
<p>Lets say we have plenty people to dress up entrees, but only one chef to cook them. Each entree <span class="math-container">$E_i$</span>, takes <span class="math-container">$c_i$</span> time to cook and <spa... | habedi/stack-exchange-dataset |
116,540 | Are SAT problems with at most two false clauses NP-complete? | <p>Is the problem of deciding whether a SAT instance, where at most two clauses are false (that is, any given variable assignment will either lead to all clauses being true, all but one, or all but two), is satisfiable solvable in polynomial time?</p>

<p>This is a follow-up from my <a href="https://cs.stackexc... | complexity theory np complete satisfiability | 1 | Are SAT problems with at most two false clauses NP-complete? -- (complexity theory np complete satisfiability)
<p>Is the problem of deciding whether a SAT instance, where at most two clauses are false (that is, any given variable assignment will either lead to all clauses being true, all but one, or all but two), is sa... | habedi/stack-exchange-dataset |
116,546 | Assigning Balls to Bins with Constraints on Which Ball to Go to Which Bin? | <p>Let us say we have <span class="math-container">$m$</span> bins and <span class="math-container">$n$</span> balls. Every bin <span class="math-container">$i$</span> has capacity <span class="math-container">$c_i$</span> which is the number of balls that can be put into bin <span class="math-container">$i$</span>. We... | algorithms np hard | 1 | Assigning Balls to Bins with Constraints on Which Ball to Go to Which Bin? -- (algorithms np hard)
<p>Let us say we have <span class="math-container">$m$</span> bins and <span class="math-container">$n$</span> balls. Every bin <span class="math-container">$i$</span> has capacity <span class="math-container">$c_i$</span... | habedi/stack-exchange-dataset |
116,547 | On satisfiability for 2-variable FOL being NEXPTIME-complete | <p>Let <span class="math-container">$\mathbf{FO^2}$</span> be the fragment of first-order logic consisting of sentences with at most two variables and no function symbols. It is well known that satisfiability for <span class="math-container">$\mathbf{FO}^2$</span> is decidable (see [<a href="https://www.jstor.org/stabl... | complexity theory first order logic | 1 | On satisfiability for 2-variable FOL being NEXPTIME-complete -- (complexity theory first order logic)
<p>Let <span class="math-container">$\mathbf{FO^2}$</span> be the fragment of first-order logic consisting of sentences with at most two variables and no function symbols. It is well known that satisfiability for <span... | habedi/stack-exchange-dataset |
116,554 | What kind of language does the following DFA accept? | <p><a href="https://i.stack.imgur.com/dQkWp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dQkWp.png" alt="enter image description here"></a></p>

<p>can anyone please describe the language this FA accepts? thank you</p>
 | formal languages automata finite automata | 1 | What kind of language does the following DFA accept? -- (formal languages automata finite automata)
<p><a href="https://i.stack.imgur.com/dQkWp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dQkWp.png" alt="enter image description here"></a></p>

<p>can anyone please describe the language th... | habedi/stack-exchange-dataset |
116,556 | How to mathematically prove that a relation T(n)=T($\sqrt{n}$)+c is O(log(log(n))? | <p>following <a href="https://stackoverflow.com/questions/16472012/what-would-cause-an-algorithm-to-have-olog-log-n-complexity">question</a>, I understood the intuition behind how cutting down the size of input by square root on each iteration leads to O(log(log(n))) complexity.</p>

<p>I tried to derive it on ... | algorithm analysis time complexity asymptotics runtime analysis | 1 | How to mathematically prove that a relation T(n)=T($\sqrt{n}$)+c is O(log(log(n))? -- (algorithm analysis time complexity asymptotics runtime analysis)
<p>following <a href="https://stackoverflow.com/questions/16472012/what-would-cause-an-algorithm-to-have-olog-log-n-complexity">question</a>, I understood the intuition... | habedi/stack-exchange-dataset |
116,566 | Is there a O(log n)-time algorithm to find the maximum element of a circular shift of a sorted array? | <p>Consider this <a href="https://www.geeksforgeeks.org/type-array-maximum-element/" rel="nofollow noreferrer">problem</a>: You are given an array <span class="math-container">$A$</span> (of distinct integers) of one out of the following four types:</p>

<ul>
<li>Ascending (e.g., 1,2,4,6);</li>
<li>Desc... | binary search | 1 | Is there a O(log n)-time algorithm to find the maximum element of a circular shift of a sorted array? -- (binary search)
<p>Consider this <a href="https://www.geeksforgeeks.org/type-array-maximum-element/" rel="nofollow noreferrer">problem</a>: You are given an array <span class="math-container">$A$</span> (of distinct... | habedi/stack-exchange-dataset |
116,573 | Can a dfa return only the final state? | <p>I am given an assignment to design a tiny arithmetic unit (from 0 to 15 inclusive) start with 0 and using a DFA. The operations are as follow:</p>

<ul>
<li>increment x+1 and if x+1 is larger than 15 then x+1 goes to 0</li>
<li>decrement x-1 and if x-1 is less than 0 then x-1 goes to 15</li>
<li... | regular languages finite automata logic | 1 | Can a dfa return only the final state? -- (regular languages finite automata logic)
<p>I am given an assignment to design a tiny arithmetic unit (from 0 to 15 inclusive) start with 0 and using a DFA. The operations are as follow:</p>

<ul>
<li>increment x+1 and if x+1 is larger than 15 then x+1 goes to 0</... | habedi/stack-exchange-dataset |
116,579 | Worst Case running time of the Minimum Vertex Cover Approximation algorithm | <p>Considering this factor <span class="math-container">$2$</span> minimum vertex cover approximation algorithm : </p>

<blockquote>
 <p>Repeat while there is an edge:</p>
 
 <p>Arbitrarily pick an uncovered edge <span class="math-container">$e=(u,v)$</span> and add <span class="math-container">$... | algorithms algorithm analysis time complexity vertex cover | 1 | Worst Case running time of the Minimum Vertex Cover Approximation algorithm -- (algorithms algorithm analysis time complexity vertex cover)
<p>Considering this factor <span class="math-container">$2$</span> minimum vertex cover approximation algorithm : </p>

<blockquote>
 <p>Repeat while there is an edge:... | habedi/stack-exchange-dataset |
116,581 | Dividing 2 integers with some constraints | <p>This a problem i came across while practicing binary search. Here is the problem:</p>

<p>Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator.</p>

<p>Return the quotient after dividing dividend by divisor.
The integer division shou... | algorithms time complexity mathematical programming binary search bit manipulation | 1 | Dividing 2 integers with some constraints -- (algorithms time complexity mathematical programming binary search bit manipulation)
<p>This a problem i came across while practicing binary search. Here is the problem:</p>

<p>Given two integers dividend and divisor, divide two integers without using multiplication... | habedi/stack-exchange-dataset |
116,592 | Decoding problem and conditional probabilities | <p>I'm reading the book by MacKay "<a href="http://www.inference.org.uk/itprnn/book.pdf" rel="nofollow noreferrer">Information theory, inference and learning algorithms</a>" and I'm confused by how he introduces the decoding problem for LDPC codes (page 557).</p>
<blockquote>
<p>given a channel output... | coding theory error correcting codes | 1 | Decoding problem and conditional probabilities -- (coding theory error correcting codes)
<p>I'm reading the book by MacKay "<a href="http://www.inference.org.uk/itprnn/book.pdf" rel="nofollow noreferrer">Information theory, inference and learning algorithms</a>" and I'm confused by how he introduces the decod... | habedi/stack-exchange-dataset |
116,594 | Algorithm for mapping objects of list without mapping to itself? | <p>I want to map objects of a list, to objects of that same list, randomly, without ever mapping any given object to itself.</p>

<p>So given a list of objects [a, b, c] valid maps would be, for example:</p>

<pre><code> a -> b,
 b -> c,
 c -> a
</code></pre>

<p>or </... | algorithms | 1 | Algorithm for mapping objects of list without mapping to itself? -- (algorithms)
<p>I want to map objects of a list, to objects of that same list, randomly, without ever mapping any given object to itself.</p>

<p>So given a list of objects [a, b, c] valid maps would be, for example:</p>

<pre><code> ... | habedi/stack-exchange-dataset |
116,639 | Addition, multiplication, and apostrophe used to represent boolean algebra expressions? | <p>I'm looking at a worksheet that expresses boolean logic expressions using multiplication, addition, and apostrophes; something I've never seen before.</p>
<p>I can make a guess that the apostrophe is equivalent to ¬ (except it's suffixed instead of prefixed). But I'm not sure what the addition and multiplication... | logic circuits boolean algebra | 1 | Addition, multiplication, and apostrophe used to represent boolean algebra expressions? -- (logic circuits boolean algebra)
<p>I'm looking at a worksheet that expresses boolean logic expressions using multiplication, addition, and apostrophes; something I've never seen before.</p>
<p>I can make a guess that the apo... | habedi/stack-exchange-dataset |
116,643 | What is the most efficient algorithm to compute polynomial coefficients from its roots? | <p>Given <span class="math-container">$n$</span> roots, <span class="math-container">$x_1, x_2, \dotsc, x_n$</span>, the corresponding monic polynomial is <span class="math-container">$y = (x-x_1)(x-x_2)\dotsm(x-x_n) = \prod_{i}^n (x - x_i)$</span>. To get the coefficients (i.e. <span class="math-container">$y = \sum_{... | algorithms time complexity polynomials | 1 | What is the most efficient algorithm to compute polynomial coefficients from its roots? -- (algorithms time complexity polynomials)
<p>Given <span class="math-container">$n$</span> roots, <span class="math-container">$x_1, x_2, \dotsc, x_n$</span>, the corresponding monic polynomial is <span class="math-container">$y =... | habedi/stack-exchange-dataset |
116,655 | Which Tree traversal String is unique? | <p>Assume we have a tree and we want to serialize it.</p>

<p><strong>Example:</strong> </p>

<pre><code>Tree: 
 1 
 / \ 
 3 2 ... | trees | 1 | Which Tree traversal String is unique? -- (trees)
<p>Assume we have a tree and we want to serialize it.</p>

<p><strong>Example:</strong> </p>

<pre><code>Tree: 
 1 
 / \ ... | habedi/stack-exchange-dataset |
116,656 | What is the time complexity of this nested loop code? | <p><a href="https://i.stack.imgur.com/v11Ah.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v11Ah.png" alt="enter image description here"></a></p>

<p>In this loop <span class="math-container">$j$</span> is dependent on <span class="math-container">$i$</span>, and <span class="math-container"... | time complexity | 1 | What is the time complexity of this nested loop code? -- (time complexity)
<p><a href="https://i.stack.imgur.com/v11Ah.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v11Ah.png" alt="enter image description here"></a></p>

<p>In this loop <span class="math-container">$j$</span> is dependent o... | habedi/stack-exchange-dataset |
116,664 | Complexity of Hamilton path in directed complete bipartite graphs | <p>Finding a Hamiltonian path in a directed bipartite graph is NP-complete. </p>

<blockquote>
 <p><strong>Problem 1</strong> What is the complexity of the problem if we insist that the underlying graph of the digraph be complete bipartite? Is this known? (In other words, what is the complexity if the dig... | complexity theory graphs time complexity np complete | 1 | Complexity of Hamilton path in directed complete bipartite graphs -- (complexity theory graphs time complexity np complete)
<p>Finding a Hamiltonian path in a directed bipartite graph is NP-complete. </p>

<blockquote>
 <p><strong>Problem 1</strong> What is the complexity of the problem if we insist that ... | habedi/stack-exchange-dataset |
116,667 | Solving $T(n) = T(n/2) + T (n/3) + n $ with recurrence tree | <p>I am trying to solve the following recurrence relation:
<span class="math-container">$$T(n) = T(n/2) + T (n/3) + n $$</span> <span class="math-container">$$T(1) = Θ(1) $$</span> </p>

<p>I guess that the time complexity is <span class="math-container">$T(n)=Θ(n)$</span> since <span class="math-container"... | time complexity trees recurrence relation | 1 | Solving $T(n) = T(n/2) + T (n/3) + n $ with recurrence tree -- (time complexity trees recurrence relation)
<p>I am trying to solve the following recurrence relation:
<span class="math-container">$$T(n) = T(n/2) + T (n/3) + n $$</span> <span class="math-container">$$T(1) = Θ(1) $$</span> </p>

<p>I guess tha... | habedi/stack-exchange-dataset |
116,687 | Is log(n) equivalent to (log(n))^x for big-O analysis? | <p>My professor noted that we could treat any logarithmic function with an exponent as equivalent to log(n) for the purposes of big-O analysis. </p>

<p>ie. <span class="math-container">$(n log(n) + 1)^2 + (log(n) + 1)(n^2 + 1)$</span></p>

<p>From the left I would get <span class="math-container">$(n^2... | asymptotics runtime analysis big o notation | 1 | Is log(n) equivalent to (log(n))^x for big-O analysis? -- (asymptotics runtime analysis big o notation)
<p>My professor noted that we could treat any logarithmic function with an exponent as equivalent to log(n) for the purposes of big-O analysis. </p>

<p>ie. <span class="math-container">$(n log(n) + 1)^2 + (l... | habedi/stack-exchange-dataset |
116,689 | Multiple Knapsack Problem with Set of Admissible Balls | <p>We have <span class="math-container">$m$</span> bins and <span class="math-container">$n$</span> balls. </p>

<ol>
<li>Each bin <span class="math-container">$i=1,2,\ldots,m$</span> can contain at most two balls (not any two balls but two balls from some specific set), see 3.</li>
<li>Each ball <span ... | algorithms np complete np hard | 1 | Multiple Knapsack Problem with Set of Admissible Balls -- (algorithms np complete np hard)
<p>We have <span class="math-container">$m$</span> bins and <span class="math-container">$n$</span> balls. </p>

<ol>
<li>Each bin <span class="math-container">$i=1,2,\ldots,m$</span> can contain at most two balls (no... | habedi/stack-exchange-dataset |
116,699 | A problem with the greedy approach to finding a maximal matching | <p>Suppose I have an undirected graph with four vertices <span class="math-container">$a,b,c,d$</span> which are connected as in a simple path from <span class="math-container">$a$</span> to <span class="math-container">$d$</span>, i.e. the edge set <span class="math-container">$\{(a,b), (b,c), (c,d)\}$</span>. Then I ... | graphs matching vertex cover | 1 | A problem with the greedy approach to finding a maximal matching -- (graphs matching vertex cover)
<p>Suppose I have an undirected graph with four vertices <span class="math-container">$a,b,c,d$</span> which are connected as in a simple path from <span class="math-container">$a$</span> to <span class="math-container">$... | habedi/stack-exchange-dataset |
116,704 | Language to define perfectly a programming problem | <h1>Is there any language, which can be used to define <strong>all</strong> programming problems <strong>perfectly</strong>?</h1>

<p>By perfectly, I mean with these two properties:</p>

<ul>
<li>p is the problem.</li>
<li>d is the definition in the language.</li>
<li>P(d, p): "d is the defi... | formal languages logic | 1 | Language to define perfectly a programming problem -- (formal languages logic)
<h1>Is there any language, which can be used to define <strong>all</strong> programming problems <strong>perfectly</strong>?</h1>

<p>By perfectly, I mean with these two properties:</p>

<ul>
<li>p is the problem.</li>&#x... | habedi/stack-exchange-dataset |
116,718 | Divide numbers into fewest groups with each group's sum bounded | <p>We have an integer <span class="math-container">$K$</span> and an array of <span class="math-container">$N$</span> positive integers each smaller than <span class="math-container">$K$</span>. How do we group the numbers into the minimum number of groups where the sum of each group is less than or equal to <span clas... | algorithms | 1 | Divide numbers into fewest groups with each group's sum bounded -- (algorithms)
<p>We have an integer <span class="math-container">$K$</span> and an array of <span class="math-container">$N$</span> positive integers each smaller than <span class="math-container">$K$</span>. How do we group the numbers into the minimum ... | habedi/stack-exchange-dataset |
116,730 | Essential difference between Assembly languages to all other programming languages | <p>I understand that any assembly programming language has so little abstraction, so that one who programms with it (OS creator, hardware driver creator, "hacker" and so on), would have to know the relevant CPU's architecture pattern very well.</p>

<p>For me, this requirement <em>to know the relevant CPU's arc... | terminology assembly | 1 | Essential difference between Assembly languages to all other programming languages -- (terminology assembly)
<p>I understand that any assembly programming language has so little abstraction, so that one who programms with it (OS creator, hardware driver creator, "hacker" and so on), would have to know the relevant CPU'... | habedi/stack-exchange-dataset |
116,735 | Combining Predicate Logic and BigO | <p><a href="https://i.stack.imgur.com/6BxJp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6BxJp.png" alt="" /></a></p>
<p>I am a beginner to predicate logic and BigO and am having though time understanding the definition of BigO in terms of predicate logic in the picture attached. I particularl... | algorithms logic first order logic big o notation predicate logic | 1 | Combining Predicate Logic and BigO -- (algorithms logic first order logic big o notation predicate logic)
<p><a href="https://i.stack.imgur.com/6BxJp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6BxJp.png" alt="" /></a></p>
<p>I am a beginner to predicate logic and BigO and am having though ti... | habedi/stack-exchange-dataset |
116,737 | What does it mean when a dot appears in a logic gate other than the NOT gate? (in logic diagrams) | <p>For example, this gate: <a href="https://i.stack.imgur.com/iD4D0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iD4D0.png" alt="enter image description here"></a></p>

<p>looks like an OR gate, except there's a dot to the right. The dot is reminiscent of the fact that there's a dot in the... | logic circuits | 1 | What does it mean when a dot appears in a logic gate other than the NOT gate? (in logic diagrams) -- (logic circuits)
<p>For example, this gate: <a href="https://i.stack.imgur.com/iD4D0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iD4D0.png" alt="enter image description here"></a></p>

<p>... | habedi/stack-exchange-dataset |
116,751 | Determining whether a change in an memoized algorithm will improve the performance | <p>I have an algorithm that constructs an optimal binary tree using dynamic programming. After introducing what I thought would be an optimization, the algorithm became over 2 times slover. <strong>Question:</strong> Is there an analytical way to determine whether such change will improve the runtime of an algorithm w... | algorithms runtime analysis dynamic programming | 1 | Determining whether a change in an memoized algorithm will improve the performance -- (algorithms runtime analysis dynamic programming)
<p>I have an algorithm that constructs an optimal binary tree using dynamic programming. After introducing what I thought would be an optimization, the algorithm became over 2 times s... | habedi/stack-exchange-dataset |
116,752 | Can a new company make a processor compatible with Windows and current software? | <p>Would anyone apart from Intel and AMD ever be able to make a processor that can be used on a personal computer, or is it impossible? I believe it is due to them owning the x86 instruction set, which means that a company doesn't have the right to produce a processor which could run a personal computer. But what if th... | computer architecture | 1 | Can a new company make a processor compatible with Windows and current software? -- (computer architecture)
<p>Would anyone apart from Intel and AMD ever be able to make a processor that can be used on a personal computer, or is it impossible? I believe it is due to them owning the x86 instruction set, which means that... | habedi/stack-exchange-dataset |
116,764 | Will a vertex present in the set of vertices present in each basis cycle be present in all the cycles? | <p>I read that the XOR of basis cycles can generate all the cycles present in the graph.</p>

<p>I was just wondering if there exists any one vertex which is present in all the basis cycles and is present in all the cycles of the graph.</p>

<p>Can someone point me to something that might help me tackle... | algorithms graphs | 1 | Will a vertex present in the set of vertices present in each basis cycle be present in all the cycles? -- (algorithms graphs)
<p>I read that the XOR of basis cycles can generate all the cycles present in the graph.</p>

<p>I was just wondering if there exists any one vertex which is present in all the basis cyc... | habedi/stack-exchange-dataset |
116,774 | How to handle missing attribute's value with ID3 algorithm? | <p>i am working with ID3 algorithm, and i know that classic ID3 basically can handle missing data. But i am trying to code this algorithm, so what should i do if there is missing attribute's value in training dataset? How can i classify the data point that has missing attribute's value?</p>
 | machine learning decision tree | 1 | How to handle missing attribute's value with ID3 algorithm? -- (machine learning decision tree)
<p>i am working with ID3 algorithm, and i know that classic ID3 basically can handle missing data. But i am trying to code this algorithm, so what should i do if there is missing attribute's value in training dataset? How ca... | habedi/stack-exchange-dataset |
116,775 | How can Turing complete machines exist theoretically if the halting problem is undecidable | <p>As the question says, if I input on the tape of a Turing complete machine a program that solves the halting problem with the correct inputs the program will never end its execution regardless of memory and time. Isn't the halting problem a computational problem that can't be executed by a Turing complete machine so ... | halting problem turing completeness | 1 | How can Turing complete machines exist theoretically if the halting problem is undecidable -- (halting problem turing completeness)
<p>As the question says, if I input on the tape of a Turing complete machine a program that solves the halting problem with the correct inputs the program will never end its execution rega... | habedi/stack-exchange-dataset |
116,776 | Relative vertex capacity in max flow algorithm | <p>I am designing a network for a max flow and would appreciate the following feature:</p>

<p>Say there is a flow incoming to a vertex. I would like to consume some specified amount of that flow and let through the rest. Unlike vertex capacity, which says "let though at most N units of flow", I need to "let th... | network flow | 1 | Relative vertex capacity in max flow algorithm -- (network flow)
<p>I am designing a network for a max flow and would appreciate the following feature:</p>

<p>Say there is a flow incoming to a vertex. I would like to consume some specified amount of that flow and let through the rest. Unlike vertex capacity, w... | habedi/stack-exchange-dataset |
116,789 | Is GAP NP-hard with at most two balls per bins? | <p>The generalized assignment problem (GAP) [1] is given by:</p>

<ul>
<li><p><strong>Instance:</strong> A pair <span class="math-container">$(B,S)$</span> where <span class="math-container">$B$</span> is a set of <span class="math-container">$m$</span> bins (knapsacks) and <span class="math-container">$S$<... | complexity theory np complete np hard | 1 | Is GAP NP-hard with at most two balls per bins? -- (complexity theory np complete np hard)
<p>The generalized assignment problem (GAP) [1] is given by:</p>

<ul>
<li><p><strong>Instance:</strong> A pair <span class="math-container">$(B,S)$</span> where <span class="math-container">$B$</span> is a set of <sp... | habedi/stack-exchange-dataset |
116,793 | Do compilers of high programming languages always compile them directly to machine code? | <p>As an amateur Bash/JavaScript scripter who never wrote one sentence in Assembly, I ask:</p>

<p>Do compilers of high programming languages always compile them directly to machine code, or are there cases when a compiler of some high programming language compiles it to assembly (and then assembler will assemb... | compilers assembly | 1 | Do compilers of high programming languages always compile them directly to machine code? -- (compilers assembly)
<p>As an amateur Bash/JavaScript scripter who never wrote one sentence in Assembly, I ask:</p>

<p>Do compilers of high programming languages always compile them directly to machine code, or are ther... | habedi/stack-exchange-dataset |
116,803 | Algorithm undirected graph to directed strongly connected graph | <p>For an undirected connected graph <span class="math-container">$G=(V,E)$</span> given as adjacency list I want to find a directed strongly connected graph <span class="math-container">$G=(V,E')$</span> where each <span class="math-container">$e' \in E'$</span> is either <span class="math-container">$(u,v)$</span> or... | algorithms graphs | 1 | Algorithm undirected graph to directed strongly connected graph -- (algorithms graphs)
<p>For an undirected connected graph <span class="math-container">$G=(V,E)$</span> given as adjacency list I want to find a directed strongly connected graph <span class="math-container">$G=(V,E')$</span> where each <span class="math... | habedi/stack-exchange-dataset |
116,807 | What is meant by a full abstract model of a lambda-calculus like language? | <blockquote>
 <p>The simply typed lambda-calculus with numbers and fix has long been a favorite experimental subject for programming language researchers, since it is the simplest language in which a range of subtle semantic phenomena such as full abstraction arise. </p>
</blockquote>

<p>I tried to fi... | lambda calculus semantics | 1 | What is meant by a full abstract model of a lambda-calculus like language? -- (lambda calculus semantics)
<blockquote>
 <p>The simply typed lambda-calculus with numbers and fix has long been a favorite experimental subject for programming language researchers, since it is the simplest language in which a range of ... | habedi/stack-exchange-dataset |
116,809 | help to find An efficient algorithm | <p>I'm trying to find An efficient algorithm for the following problem:</p>

<p>I have <span class="math-container">$n$</span> sets of numbers (different sets might have common numbers) and I need to find union combination of <span class="math-container">$k$</span> sets that Will yield the biggest set.</p>
... | algorithms | 1 | help to find An efficient algorithm -- (algorithms)
<p>I'm trying to find An efficient algorithm for the following problem:</p>

<p>I have <span class="math-container">$n$</span> sets of numbers (different sets might have common numbers) and I need to find union combination of <span class="math-container">$k$</... | habedi/stack-exchange-dataset |
116,815 | Clique-or-almost reduction to clique | <p>I saw the posted question <a href="https://cs.stackexchange.com/questions/16325/direct-reduction-from-near-clique-to-clique">here</a> about a direct reduction from near-clique to clique.</p>

<p>Clique-or-almost is like near-clique but with the option for a complete clique of size <span class="math-container... | reductions np hard | 1 | Clique-or-almost reduction to clique -- (reductions np hard)
<p>I saw the posted question <a href="https://cs.stackexchange.com/questions/16325/direct-reduction-from-near-clique-to-clique">here</a> about a direct reduction from near-clique to clique.</p>

<p>Clique-or-almost is like near-clique but with the opt... | habedi/stack-exchange-dataset |
116,823 | Why can’t you simulate a Turing machine with a one-stack PDA by messing with the stack? | <p>I have heard that a matrix can be modeled as just an one array by declaring increasingly large spaces to be from the second array, and that the least you need for a Turing machine is just a PDA with two stacks. I also know that you can’t simulate a Turing machine with a PDA, because a professor challenged a student ... | turing machines pushdown automata simulation chomsky hierarchy | 1 | Why can’t you simulate a Turing machine with a one-stack PDA by messing with the stack? -- (turing machines pushdown automata simulation chomsky hierarchy)
<p>I have heard that a matrix can be modeled as just an one array by declaring increasingly large spaces to be from the second array, and that the least you need fo... | habedi/stack-exchange-dataset |
116,825 | degree distribution | <p>Does anyone know how to compute node degree distribution in a graph ? I am talking about a large graph for example California road network and imagine we have some data such as number of nodes and number of edges and now we want to visualize data by histogram for distribution of nodes degrees.Is there any specific ... | algorithms graphs algorithm analysis | 1 | degree distribution -- (algorithms graphs algorithm analysis)
<p>Does anyone know how to compute node degree distribution in a graph ? I am talking about a large graph for example California road network and imagine we have some data such as number of nodes and number of edges and now we want to visualize data by hist... | habedi/stack-exchange-dataset |
116,836 | Regular expressions with cycles | <p>A knob is used to select one of three positions A, B, C.</p>

<p>The knob can never be turned from A to C, or from C to A, without spending at least one second in position B. The initial position of the knob can be any of A, B, C.</p>

<p>Give a regular expression for this language.</p>

<p>I... | regular expressions | 1 | Regular expressions with cycles -- (regular expressions)
<p>A knob is used to select one of three positions A, B, C.</p>

<p>The knob can never be turned from A to C, or from C to A, without spending at least one second in position B. The initial position of the knob can be any of A, B, C.</p>

<p>Give ... | habedi/stack-exchange-dataset |
116,839 | Equal partition up to one integer | <p>In the partition problem, the task is to partition <span class="math-container">$n$</span> given integers into two subsets <span class="math-container">$A$</span> and <span class="math-container">$B$</span> with equal sum. This problem is known to be NP-hard, but it becomes easy if the "equal sum" requirement is rep... | algorithms discrete mathematics partitions | 1 | Equal partition up to one integer -- (algorithms discrete mathematics partitions)
<p>In the partition problem, the task is to partition <span class="math-container">$n$</span> given integers into two subsets <span class="math-container">$A$</span> and <span class="math-container">$B$</span> with equal sum. This problem... | habedi/stack-exchange-dataset |
116,847 | Add edges to undirected graph to make connected and minimize longest path | <p>I am trying to find an efficient algorithm to solve to following problem: Given an undirected disconnected graph, I want to add as few as possible edges to make to graph connected while minimizing the number of vertices on the longest path in the resulting connected graph. As a result I need the number of vertices o... | algorithms graphs efficiency connected components | 1 | Add edges to undirected graph to make connected and minimize longest path -- (algorithms graphs efficiency connected components)
<p>I am trying to find an efficient algorithm to solve to following problem: Given an undirected disconnected graph, I want to add as few as possible edges to make to graph connected while mi... | habedi/stack-exchange-dataset |
116,861 | If A is polynomial time reducible to B and B is in NP, then A is in NP | <p><em>If <span class="math-container">$A\leq_p B$</span> and <span class="math-container">$B$</span> is in <span class="math-container">$NP$</span>, is it true that <span class="math-container">$A$</span> is in <span class="math-container">$NP$</span></em>? </p>

<p>What about : <em>"if <span class="math-conta... | complexity theory | 1 | If A is polynomial time reducible to B and B is in NP, then A is in NP -- (complexity theory)
<p><em>If <span class="math-container">$A\leq_p B$</span> and <span class="math-container">$B$</span> is in <span class="math-container">$NP$</span>, is it true that <span class="math-container">$A$</span> is in <span class="m... | habedi/stack-exchange-dataset |
116,876 | Regular Expressions to accept strings where every two successive 0s are followed by a 1 | <p>How do I define a Regular Expression for the language L = {w|every two successive 0s are followed by a 1} ?</p>

<p>I don't have any idea on how to even approach this problem, primarily because it says "<strong>every two 0s</strong>".</p>
 | regular expressions | 1 | Regular Expressions to accept strings where every two successive 0s are followed by a 1 -- (regular expressions)
<p>How do I define a Regular Expression for the language L = {w|every two successive 0s are followed by a 1} ?</p>

<p>I don't have any idea on how to even approach this problem, primarily because it... | habedi/stack-exchange-dataset |
116,882 | Maximum number of configurations of Turing machine after $n$ moves | <p>I came across following question:</p>

<blockquote>
 <p>What are maximum number of configuration of Turing Machine after <span class="math-container">$n$</span> moves?</p>
</blockquote>

<p>The answer given was:</p>

<blockquote>
 <p><span class="math-container">$k^n$</span>, wh... | formal languages turing machines automata | 1 | Maximum number of configurations of Turing machine after $n$ moves -- (formal languages turing machines automata)
<p>I came across following question:</p>

<blockquote>
 <p>What are maximum number of configuration of Turing Machine after <span class="math-container">$n$</span> moves?</p>
</blockquote>&... | habedi/stack-exchange-dataset |
116,890 | You have K amoebas and one amoeba can divide into A,B,C amoebas after one instruction then find the minimum no. of instruction to have N amoebas | <p>. You have developed an artificial amoeba, and you can control exactly how it divides.
Each individual amoeba can be instructed to divide into A, B, or C amoebas. That
is, if you instruct an amoeba to divide into A, this amoeba will disappear, and A
different new amoeba will appear.
You start out wit... | dynamic programming greedy algorithms | 1 | You have K amoebas and one amoeba can divide into A,B,C amoebas after one instruction then find the minimum no. of instruction to have N amoebas -- (dynamic programming greedy algorithms)
<p>. You have developed an artificial amoeba, and you can control exactly how it divides.
Each individual amoeba can be instruct... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.