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
103,530
Search on Conformant Problem: solution for subset of a belief state
<p>I am having trouble understanding the following statement.</p>&#xA;&#xA;<p>I have understood why in a sensorless/conformant problem, if there exists a solution (a sequence of actions) for a belief state <span class="math-container">$b$</span>, then it is also a solution for any <span class="math-container">$b'$</spa...
artificial intelligence search trees search problem
1
Search on Conformant Problem: solution for subset of a belief state -- (artificial intelligence search trees search problem) <p>I am having trouble understanding the following statement.</p>&#xA;&#xA;<p>I have understood why in a sensorless/conformant problem, if there exists a solution (a sequence of actions) for a be...
habedi/stack-exchange-dataset
103,531
Computing number of ways to make change
<blockquote>&#xA;<p>Given a list <span class="math-container">$C=[c_1,c_2,\dots,c_k]$</span> of positive integers, representing the values of <span class="math-container">$k$</span> varieties of coins, and a positive integer <span class="math-container">$n$</span>, let <span class="math-container">$f(n,C)$</span> be t...
time complexity dynamic programming recurrence relation
1
Computing number of ways to make change -- (time complexity dynamic programming recurrence relation) <blockquote>&#xA;<p>Given a list <span class="math-container">$C=[c_1,c_2,\dots,c_k]$</span> of positive integers, representing the values of <span class="math-container">$k$</span> varieties of coins, and a positive i...
habedi/stack-exchange-dataset
103,548
Running Time of Sorting Algorithm
<p>Determine the asymptotic running time of the sorting algorithm maxSort.</p>&#xA;&#xA;<p><em>Algorithm maxSort(A)</em><br>&#xA;<em>Input: An integer array A</em><br>&#xA;<em>Output: Array A sorted in non-decreasing order</em> </p>&#xA;&#xA;<pre><code>1. for j &lt;- n-1 down to 1 do&#xA;2. m &lt;- 0 &#xA;3. ...
algorithms algorithm analysis time complexity asymptotics runtime analysis
1
Running Time of Sorting Algorithm -- (algorithms algorithm analysis time complexity asymptotics runtime analysis) <p>Determine the asymptotic running time of the sorting algorithm maxSort.</p>&#xA;&#xA;<p><em>Algorithm maxSort(A)</em><br>&#xA;<em>Input: An integer array A</em><br>&#xA;<em>Output: Array A sorted in non-...
habedi/stack-exchange-dataset
103,555
Why proving that two languages used to merge into a regular language are not necessarily regular isn't possible with closure properties?
<blockquote>&#xA; <p>Let <span class="math-container">$L$</span> be a regular language over alphabet <span class="math-container">$\Sigma$</span>. <span class="math-container">$L$</span> is the result of merging <span class="math-container">$2$</span> languages letter by letter that is for <span class="math-container"...
formal languages regular languages closure properties
1
Why proving that two languages used to merge into a regular language are not necessarily regular isn't possible with closure properties? -- (formal languages regular languages closure properties) <blockquote>&#xA; <p>Let <span class="math-container">$L$</span> be a regular language over alphabet <span class="math-cont...
habedi/stack-exchange-dataset
103,559
Is there an algorithm to find the minimal number of dimensions, given the distances between points?
<p>Given some finite set <span class="math-container">$S := \{x_1,x_2,\ldots,x_k\} \subset \mathbb R^n$</span> we can define a distance matrix <span class="math-container">$D = (d(i,j))_{ij}$</span> with <span class="math-container">$$d(i,j) = \Vert{x_i - x_j}\Vert$$</span></p>&#xA;&#xA;<p>where <span class="math-conta...
algorithms graphs computational geometry
1
Is there an algorithm to find the minimal number of dimensions, given the distances between points? -- (algorithms graphs computational geometry) <p>Given some finite set <span class="math-container">$S := \{x_1,x_2,\ldots,x_k\} \subset \mathbb R^n$</span> we can define a distance matrix <span class="math-container">$D...
habedi/stack-exchange-dataset
103,561
How to build a finite automaton for right quotient of a regular language?
<blockquote>&#xA; <p>Let <span class="math-container">$L$</span> be a regular language over <span class="math-container">$\Sigma=\{a,b,c\}$</span>. Build a finite automaton for <span class="math-container">$L/\{a\}$</span>.</p>&#xA;</blockquote>&#xA;&#xA;<p>Because <span class="math-container">$L$</span> is regular th...
formal languages automata regular languages finite automata
1
How to build a finite automaton for right quotient of a regular language? -- (formal languages automata regular languages finite automata) <blockquote>&#xA; <p>Let <span class="math-container">$L$</span> be a regular language over <span class="math-container">$\Sigma=\{a,b,c\}$</span>. Build a finite automaton for <sp...
habedi/stack-exchange-dataset
103,567
Poly-time reductions for proving EXPTIME-hardness are _not_ enough?
<p>Wikipedia <a href="https://en.wikipedia.org/wiki/EXPTIME" rel="nofollow noreferrer">says</a> that in order to prove EXPTIME-hardness of our problem, we need to prove that every EXPTIME problem can be poly-time reduced to our problem. Here is a "counter-example" that bugs me.</p>&#xA;&#xA;<p>Suppose our problem can b...
complexity theory time complexity reductions
1
Poly-time reductions for proving EXPTIME-hardness are _not_ enough? -- (complexity theory time complexity reductions) <p>Wikipedia <a href="https://en.wikipedia.org/wiki/EXPTIME" rel="nofollow noreferrer">says</a> that in order to prove EXPTIME-hardness of our problem, we need to prove that every EXPTIME problem can be...
habedi/stack-exchange-dataset
103,569
Prove that the following algorithm has STOP property (number of steps is finite)
<p>Prove that the following algorithm has STOP property. I am not sure if this term is widely know, so the definition of STOP property that I got during classes looks as follows:</p>&#xA;&#xA;<blockquote>&#xA; <p>STOP property (for all input data satisfying <span class="math-container">$ \alpha $</span> the computatio...
algorithms algorithm analysis correctness proof
1
Prove that the following algorithm has STOP property (number of steps is finite) -- (algorithms algorithm analysis correctness proof) <p>Prove that the following algorithm has STOP property. I am not sure if this term is widely know, so the definition of STOP property that I got during classes looks as follows:</p>&#xA...
habedi/stack-exchange-dataset
103,584
Constructing a new graph. G'. What does it mean v ∈ S_{i+1}?
<blockquote>&#xA; <p>John lives in a city whose streets has the same length. His apartment is located at a specified node H. John need to do his errands where he visits each of k different shop in order. However, each store have more than one location in his city. More particularly, for each 1 ≤ i ≤ k there is a set ...
algorithms graphs notation
1
Constructing a new graph. G'. What does it mean v ∈ S_{i+1}? -- (algorithms graphs notation) <blockquote>&#xA; <p>John lives in a city whose streets has the same length. His apartment is located at a specified node H. John need to do his errands where he visits each of k different shop in order. However, each store h...
habedi/stack-exchange-dataset
103,593
Meaning of $ e^x = 1 + x + Θ(x^2)$?
<p>In the CLRS chapter 3: When <span class="math-container">$x → 0$</span>, the approximation of <span class="math-container">$e^x$</span> by <span class="math-container">$1+x$</span> is quite good:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$$e^x = 1 + x + Θ(x^2).$$</span></p>&#xA;</blockquote>&#x...
asymptotics
1
Meaning of $ e^x = 1 + x + Θ(x^2)$? -- (asymptotics) <p>In the CLRS chapter 3: When <span class="math-container">$x → 0$</span>, the approximation of <span class="math-container">$e^x$</span> by <span class="math-container">$1+x$</span> is quite good:</p>&#xA;&#xA;<blockquote>&#xA; <p><span class="math-container">$$e^...
habedi/stack-exchange-dataset
103,602
Prove that a sequence of increasing find operations on a splay tree takes $\mathcal{O}(n)$ time
<p>When studying about splay trees, I found the following statement:</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose we have a splay tree and a sequence of Find operations, where the elements we are searching for are in increasing order. Then the total time necessary to run the sequence is <span class="math-container">$\mat...
data structures splay trees
1
Prove that a sequence of increasing find operations on a splay tree takes $\mathcal{O}(n)$ time -- (data structures splay trees) <p>When studying about splay trees, I found the following statement:</p>&#xA;&#xA;<blockquote>&#xA; <p>Suppose we have a splay tree and a sequence of Find operations, where the elements we a...
habedi/stack-exchange-dataset
103,603
Topological sorting colored tree
<p>EDIT: The most general case I need is not a tree but any Directed Acyclic Graph.</p>&#xA;&#xA;<p>I have a directed acyclic graph.</p>&#xA;&#xA;<p>I need to sort it in a list so that in the list every node comes after any node it can walk to in the graph.</p>&#xA;&#xA;<p>So far so good, just use a topological sorting...
graphs sorting
1
Topological sorting colored tree -- (graphs sorting) <p>EDIT: The most general case I need is not a tree but any Directed Acyclic Graph.</p>&#xA;&#xA;<p>I have a directed acyclic graph.</p>&#xA;&#xA;<p>I need to sort it in a list so that in the list every node comes after any node it can walk to in the graph.</p>&#xA;&...
habedi/stack-exchange-dataset
103,618
If graph isomorphism is in P, is then P = NP?
<p>I think that, since graph isomorphism is not known to be <span class="math-container">$\textbf{NP}$</span>-complete, we can not reduce all problems in <span class="math-container">$\textbf{NP}$</span> to it, and therefore the implication does not hold.</p>&#xA;&#xA;<p>Additionally, <a href="https://stackoverflow.com...
complexity theory np complete p vs np graph isomorphism
1
If graph isomorphism is in P, is then P = NP? -- (complexity theory np complete p vs np graph isomorphism) <p>I think that, since graph isomorphism is not known to be <span class="math-container">$\textbf{NP}$</span>-complete, we can not reduce all problems in <span class="math-container">$\textbf{NP}$</span> to it, an...
habedi/stack-exchange-dataset
103,628
Proving a LL(1) equivalent grammar doesn't exist
<p>Consider the following CFG</p>&#xA;&#xA;<p><span class="math-container">$S \rightarrow \epsilon\ |\ aSbS\ |\ bSaS$</span></p>&#xA;&#xA;<p>How can we prove formally that an equivalent <span class="math-container">$LL(1)$</span> grammar does not exist. I feel that intuitively an equivalent <span class="math-container"...
formal languages
1
Proving a LL(1) equivalent grammar doesn't exist -- (formal languages) <p>Consider the following CFG</p>&#xA;&#xA;<p><span class="math-container">$S \rightarrow \epsilon\ |\ aSbS\ |\ bSaS$</span></p>&#xA;&#xA;<p>How can we prove formally that an equivalent <span class="math-container">$LL(1)$</span> grammar does not ex...
habedi/stack-exchange-dataset
103,634
PDA for the language of strings containing the same number of a and b
<p>Need idea for solving the following pushdown automata:</p>&#xA;&#xA;<p><span class="math-container">$\mathcal{L}=\{w\in\sum ^* | \#a(w)=\#b(w),|w|\geqslant 0\} \,\,\,\, \sum=\{a,b\}$</span></p>&#xA;&#xA;<p>In the beginning I thought to PUSH <em>A</em> for input <em>a</em>, and then to POP <em>A</em> for input <em>b...
pushdown automata
1
PDA for the language of strings containing the same number of a and b -- (pushdown automata) <p>Need idea for solving the following pushdown automata:</p>&#xA;&#xA;<p><span class="math-container">$\mathcal{L}=\{w\in\sum ^* | \#a(w)=\#b(w),|w|\geqslant 0\} \,\,\,\, \sum=\{a,b\}$</span></p>&#xA;&#xA;<p>In the beginning ...
habedi/stack-exchange-dataset
103,648
Prove Halting on all Inputs is not in RE simulation
<p>I don't understand why when proving if Halting on all inputs problem si not in RE using the complement of the halting problem, I have to take a turing machine and simulate the machine M(the machine that the halting problem receives as input) on w(the word received as input) for n steps.</p>&#xA;&#xA;<p>Can somebody ...
turing machines computability proof techniques semi decidability simulation
1
Prove Halting on all Inputs is not in RE simulation -- (turing machines computability proof techniques semi decidability simulation) <p>I don't understand why when proving if Halting on all inputs problem si not in RE using the complement of the halting problem, I have to take a turing machine and simulate the machine ...
habedi/stack-exchange-dataset
103,686
Determine if there exists a line that intersects all horizontal segments. Better than $O(n^2 \lg n)$?
<p>Suppose I have <span class="math-container">$n$</span> horizontal segments in the plane (i.e. their end points share the same <span class="math-container">$y$</span> value). I want to determine if there exists a line that intersects all such segments.</p>&#xA;&#xA;<p>I think I can assert that (by some argument based...
algorithms computational geometry
1
Determine if there exists a line that intersects all horizontal segments. Better than $O(n^2 \lg n)$? -- (algorithms computational geometry) <p>Suppose I have <span class="math-container">$n$</span> horizontal segments in the plane (i.e. their end points share the same <span class="math-container">$y$</span> value). I ...
habedi/stack-exchange-dataset
103,695
Unbiased random number generator
<p>we have a six-sided dice numbered from 1 to 6, and each has the probability <span class="math-container">$p =\frac{1}{6}$</span>. My task is to create a unbiased method to generate a random number from 1 to 10 using the given dice.&#xA;I am aware that the method should maps the following set <span class="math-con...
random number generator
1
Unbiased random number generator -- (random number generator) <p>we have a six-sided dice numbered from 1 to 6, and each has the probability <span class="math-container">$p =\frac{1}{6}$</span>. My task is to create a unbiased method to generate a random number from 1 to 10 using the given dice.&#xA;I am aware that ...
habedi/stack-exchange-dataset
103,714
Dynamic Programming Problem on Tree
<p>Given a tree <span class="math-container">$T$</span> rooted at <span class="math-container">$1$</span>. Each node might have more than 2 children. You want to create a tree <span class="math-container">$S$</span> where each node have <span class="math-container">$2$</span> or less children or a binary tree. For each...
data structures trees dynamic programming
1
Dynamic Programming Problem on Tree -- (data structures trees dynamic programming) <p>Given a tree <span class="math-container">$T$</span> rooted at <span class="math-container">$1$</span>. Each node might have more than 2 children. You want to create a tree <span class="math-container">$S$</span> where each node have ...
habedi/stack-exchange-dataset
103,722
Why we treat sentence letter $Q$ as conclusion in one form and premise in other?
<p>Sorry for asking such a dumb question.</p>&#xA;&#xA;<p>I am CS student and I am trying to understand the basic tenets of Logic. I am new to the subject and I am lost understanding Implication. </p>&#xA;&#xA;<p>In formal logic, <span class="math-container">$(P\rightarrow Q)$</span>, The sentence letter <span class="m...
logic propositional logic
1
Why we treat sentence letter $Q$ as conclusion in one form and premise in other? -- (logic propositional logic) <p>Sorry for asking such a dumb question.</p>&#xA;&#xA;<p>I am CS student and I am trying to understand the basic tenets of Logic. I am new to the subject and I am lost understanding Implication. </p>&#xA;&#x...
habedi/stack-exchange-dataset
103,724
Allowing an empty (epsilon) transition in a PDA
<p>I'm trying to allow an empty transition in a PDA for the following language:</p>&#xA;&#xA;<ul>&#xA;<li>Alphabet: <span class="math-container">$Σ = \{a, b, c\}$</span></li>&#xA;<li>Language: <span class="math-container">$L = \{ a^ib^j \mid i \neq j \} \cdot \{ c \}^\ast$</span></li>&#xA;</ul>&#xA;&#xA;<p>Examples of ...
formal languages pushdown automata
1
Allowing an empty (epsilon) transition in a PDA -- (formal languages pushdown automata) <p>I'm trying to allow an empty transition in a PDA for the following language:</p>&#xA;&#xA;<ul>&#xA;<li>Alphabet: <span class="math-container">$Σ = \{a, b, c\}$</span></li>&#xA;<li>Language: <span class="math-container">$L = \{ a^...
habedi/stack-exchange-dataset
103,728
Decidability of language of TMs which accept only their Gödel number
<p>I am trying to prove that <span class="math-container">$L = \{\langle M \rangle \mid L(M) = \{\langle M \rangle \}\}$</span> is undecidable, where <span class="math-container">$\langle M \rangle$</span> is the code of the TM <span class="math-container">$M$</span>, and <span class="math-container">$L(M)$</span> the...
turing machines undecidability
1
Decidability of language of TMs which accept only their Gödel number -- (turing machines undecidability) <p>I am trying to prove that <span class="math-container">$L = \{\langle M \rangle \mid L(M) = \{\langle M \rangle \}\}$</span> is undecidable, where <span class="math-container">$\langle M \rangle$</span> is the c...
habedi/stack-exchange-dataset
103,730
What kind of operations can we do with bits?
<p>I wonder if there are more things we can do with bits aside from NOT, AND, OR, XOR operations? I got this question from my teacher and I'm not really sure. How about bit shifting ">>"? Could we count this?&#xA;Thanks for replying.</p>&#xA;
bit manipulation
1
What kind of operations can we do with bits? -- (bit manipulation) <p>I wonder if there are more things we can do with bits aside from NOT, AND, OR, XOR operations? I got this question from my teacher and I'm not really sure. How about bit shifting ">>"? Could we count this?&#xA;Thanks for replying.</p>&#xA;
habedi/stack-exchange-dataset
103,735
Approach to find minimum set in one table consisting of all items in second table
<p>wondering if you can help me with the following problem.</p>&#xA;&#xA;<p>I have one table consisting of items in each person's bag:</p>&#xA;&#xA;<pre><code>name | item1 | item2 | item3&#xA;____________________________________&#xA;jack | pen | pencil | eraser&#xA;____________________________________&#xA;j...
algorithms graphs
1
Approach to find minimum set in one table consisting of all items in second table -- (algorithms graphs) <p>wondering if you can help me with the following problem.</p>&#xA;&#xA;<p>I have one table consisting of items in each person's bag:</p>&#xA;&#xA;<pre><code>name | item1 | item2 | item3&#xA;_________________...
habedi/stack-exchange-dataset
103,743
Subset on boolean cube with largest sum of biases
<p>On the boolean cube <span class="math-container">$\mathcal{B}=\{0,1\}^n$</span>, we assign each vertex a value by <span class="math-container">$p:\mathcal{B}\rightarrow[0,1]$</span>. Let&#xA;<span class="math-container">$$\tilde{p}_i=\sum_{x\in\mathcal{B}}(-1)^{x_i}p(x).$$</span>&#xA;What is the value of <span class...
combinatorics
1
Subset on boolean cube with largest sum of biases -- (combinatorics) <p>On the boolean cube <span class="math-container">$\mathcal{B}=\{0,1\}^n$</span>, we assign each vertex a value by <span class="math-container">$p:\mathcal{B}\rightarrow[0,1]$</span>. Let&#xA;<span class="math-container">$$\tilde{p}_i=\sum_{x\in\mat...
habedi/stack-exchange-dataset
103,745
The Church-Turing Thesis (Hello World tester) contradiction and randomized algorithms
<p>The Church-Turing thesis proves that there is no algorithm (or program) <span class="math-container">$H$</span> that says whether a program <span class="math-container">$P$</span> written in a language, say <span class="math-container">$C$</span>, on an input <span class="math-container">$I$</span> outputs the sente...
complexity theory church turing thesis
1
The Church-Turing Thesis (Hello World tester) contradiction and randomized algorithms -- (complexity theory church turing thesis) <p>The Church-Turing thesis proves that there is no algorithm (or program) <span class="math-container">$H$</span> that says whether a program <span class="math-container">$P$</span> written...
habedi/stack-exchange-dataset
103,746
Is this partitioning problem NP-complete?
<p>I have a sequence of points <span class="math-container">$(x_1, \ldots, x_n)$</span> and a function <span class="math-container">$f$</span> that maps every <em>consecutive</em> subsequence (ie. of the form <span class="math-container">$(x_i, x_{i+1}, \ldots, x_j)$</span>) to a real number. I want to split this seque...
algorithms np complete reductions np approximation
1
Is this partitioning problem NP-complete? -- (algorithms np complete reductions np approximation) <p>I have a sequence of points <span class="math-container">$(x_1, \ldots, x_n)$</span> and a function <span class="math-container">$f$</span> that maps every <em>consecutive</em> subsequence (ie. of the form <span class="...
habedi/stack-exchange-dataset
103,758
Greedy Solution for Selecting Prefix Sum
<p>Given <span class="math-container">$n$</span> arrays. Each has size of <span class="math-container">$h$</span>. Let <span class="math-container">$a_{i, j} \in \mathbb{I}$</span> be the <span class="math-container">$i$</span>-th element of <span class="math-container">$j$</span>-th array. You can select at most <span...
algorithms sorting greedy algorithms
1
Greedy Solution for Selecting Prefix Sum -- (algorithms sorting greedy algorithms) <p>Given <span class="math-container">$n$</span> arrays. Each has size of <span class="math-container">$h$</span>. Let <span class="math-container">$a_{i, j} \in \mathbb{I}$</span> be the <span class="math-container">$i$</span>-th elemen...
habedi/stack-exchange-dataset
103,782
Number Theory Problem from Local Selection Contest EPFL | ETHZ
<p>This was a question from the 2016 local (selection) contest in ETHZ, You have a high-precision alarm clock with three operations:</p>&#xA;&#xA;<p>1) reset wake-up time to midnight (00:00:00.000000)</p>&#xA;&#xA;<p>2) modify the wake-up time by  ± 1 microsecond (wrapping around at midnight).</p>&#xA;&#xA;<p>You know ...
greedy algorithms number theory
1
Number Theory Problem from Local Selection Contest EPFL | ETHZ -- (greedy algorithms number theory) <p>This was a question from the 2016 local (selection) contest in ETHZ, You have a high-precision alarm clock with three operations:</p>&#xA;&#xA;<p>1) reset wake-up time to midnight (00:00:00.000000)</p>&#xA;&#xA;<p>2) ...
habedi/stack-exchange-dataset
103,786
Find the Most Frequent Ordered Word Pair In a Document
<p>This is a problem from Skiena's excellent book <a href="https://rads.stackoverflow.com/amzn/click/com/1849967202" rel="nofollow noreferrer" rel="nofollow noreferrer">The Algorithm Design Manual</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>Give an algorithm for finding an ordered word pair(e.g."New York")&#xA; occurring ...
algorithms strings information retrieval
1
Find the Most Frequent Ordered Word Pair In a Document -- (algorithms strings information retrieval) <p>This is a problem from Skiena's excellent book <a href="https://rads.stackoverflow.com/amzn/click/com/1849967202" rel="nofollow noreferrer" rel="nofollow noreferrer">The Algorithm Design Manual</a>:</p>&#xA;&#xA;<blo...
habedi/stack-exchange-dataset
103,796
Refutation in first order logic
<p>Consider the following statement</p>&#xA;&#xA;<blockquote>&#xA; <p>In FOL, we can reduce entailment checking to satisfiability checking:</p>&#xA; &#xA; <p><span class="math-container">$S \models S' \iff S \land \neg S'$</span> is satisfiable (This proof&#xA; strategy is called refutation).</p>&#xA;</blockquote...
satisfiability first order logic
1
Refutation in first order logic -- (satisfiability first order logic) <p>Consider the following statement</p>&#xA;&#xA;<blockquote>&#xA; <p>In FOL, we can reduce entailment checking to satisfiability checking:</p>&#xA; &#xA; <p><span class="math-container">$S \models S' \iff S \land \neg S'$</span> is satisfiable ...
habedi/stack-exchange-dataset
103,806
Maximum Expected Fishing Day (Recurrence Relation)
<blockquote>&#xA; <p>John joined a meetup where organize day long fishing trip once a&#xA; month. The organizers are vary poor at planning, so will organize&#xA; fishing on a random day of the month without any advance notice.&#xA; Sadly, John needs to inform his boss in order to get time off from&#xA; work at lea...
recurrence relation recursion
1
Maximum Expected Fishing Day (Recurrence Relation) -- (recurrence relation recursion) <blockquote>&#xA; <p>John joined a meetup where organize day long fishing trip once a&#xA; month. The organizers are vary poor at planning, so will organize&#xA; fishing on a random day of the month without any advance notice.&#xA;...
habedi/stack-exchange-dataset
103,809
Is there a recommended process for designing CSGs (other than intuition)?
<p>I understand the differences between Regular, Context-Free, and Context-Sensitive languages. Designing a Regular Grammar can be easier if you have a DFA. Designing a CFG isn't too hard for the palindromic strings, but not easy per say for other combinations. But when asked to produce a CSG for Context-Sensitive lang...
formal languages formal grammars context sensitive
1
Is there a recommended process for designing CSGs (other than intuition)? -- (formal languages formal grammars context sensitive) <p>I understand the differences between Regular, Context-Free, and Context-Sensitive languages. Designing a Regular Grammar can be easier if you have a DFA. Designing a CFG isn't too hard fo...
habedi/stack-exchange-dataset
103,813
Finding a suitable NP-complete problem for reduction
<p>We are given a set of names and a set of papers with names written on each side of the paper (not necessarily different ones and either side of the paper can be empty). Can we place the sheets on a table such that every name shows up? Show that this problem is NP-complete.</p>&#xA;&#xA;<p>I have difficulty in findin...
np complete reductions np hard np
1
Finding a suitable NP-complete problem for reduction -- (np complete reductions np hard np) <p>We are given a set of names and a set of papers with names written on each side of the paper (not necessarily different ones and either side of the paper can be empty). Can we place the sheets on a table such that every name ...
habedi/stack-exchange-dataset
103,821
Is maximum edge-weighted triangle-free graph NP-hard?
<p>Given a graph <span class="math-container">$G$</span> with weights <span class="math-container">$w_e$</span> on the edges, choose a subset <span class="math-container">$S$</span> of the ''edges'' such that <span class="math-container">$S$</span> doesn't contain any 3-cycles, maximizing <span class="math-container">$...
complexity theory graphs np complete reductions weighted graphs
1
Is maximum edge-weighted triangle-free graph NP-hard? -- (complexity theory graphs np complete reductions weighted graphs) <p>Given a graph <span class="math-container">$G$</span> with weights <span class="math-container">$w_e$</span> on the edges, choose a subset <span class="math-container">$S$</span> of the ''edges'...
habedi/stack-exchange-dataset
103,824
What is the fastest algorithm of generating all possible permutations (within a given set of constraints) of a multidimensional array?
<p>There is <em>D</em>-dimensional array <strong>A</strong>. The number <em>D</em> and the size <em>Sd</em> of every dimension <em>d</em>=1..D is input from keyboard. There is also 1-dimensional array <strong>E</strong> of size <em>N</em>. It consists of unique integer numbers 0..N-1. <em>N</em> is also input from keyb...
algorithms combinatorics pseudocode
1
What is the fastest algorithm of generating all possible permutations (within a given set of constraints) of a multidimensional array? -- (algorithms combinatorics pseudocode) <p>There is <em>D</em>-dimensional array <strong>A</strong>. The number <em>D</em> and the size <em>Sd</em> of every dimension <em>d</em>=1..D i...
habedi/stack-exchange-dataset
103,831
Dependent type system with different computation model
<p>There exist various Turing-equivalent models of computation, such as lambda calculus, Turing machines, or register machines.</p>&#xA;&#xA;<p>It seems that dependent type systems (like Coq, Agda, Idris, homotopy type theory) all have a lambda-calculus-based model of computation at their core. That's because they use ...
reference request type theory dependent types
1
Dependent type system with different computation model -- (reference request type theory dependent types) <p>There exist various Turing-equivalent models of computation, such as lambda calculus, Turing machines, or register machines.</p>&#xA;&#xA;<p>It seems that dependent type systems (like Coq, Agda, Idris, homotopy ...
habedi/stack-exchange-dataset
103,835
Is it possible to denote "any single alphabet symbol" in an FSA state diagram?
<p>This is a possible duplicate of the following (but not sure it answered my question):<br>&#xA;<a href="https://cs.stackexchange.com/questions/18446/is-it-possible-to-support-any-symbol-or-d-w-w-in-dfa">Is it possible to support .(any symbol) or \d, \w, \W in DFA</a></p>&#xA;&#xA;<p>My professor is asking for a finit...
finite automata discrete mathematics
1
Is it possible to denote "any single alphabet symbol" in an FSA state diagram? -- (finite automata discrete mathematics) <p>This is a possible duplicate of the following (but not sure it answered my question):<br>&#xA;<a href="https://cs.stackexchange.com/questions/18446/is-it-possible-to-support-any-symbol-or-d-w-w-in...
habedi/stack-exchange-dataset
103,838
How I can find all equivalence classes by Myhill-Nerode?
<p>first of all I'm sorry for my bad English and second I'm sorry for my mistakes of understanding the following topic, I still going to school and learning this for interest.</p>&#xA;&#xA;<p>The topic is Myhill-Nerode and the equivalence classes of a regular or non regular language.</p>&#xA;&#xA;<p>I know that every e...
formal languages regular languages notation
1
How I can find all equivalence classes by Myhill-Nerode? -- (formal languages regular languages notation) <p>first of all I'm sorry for my bad English and second I'm sorry for my mistakes of understanding the following topic, I still going to school and learning this for interest.</p>&#xA;&#xA;<p>The topic is Myhill-Ne...
habedi/stack-exchange-dataset
103,839
What is a counterexample for Lamport's distributed mutual exclusion algorithm with non-FIFO message queues?
<p><a href="https://en.wikipedia.org/wiki/Lamport%27s_distributed_mutual_exclusion_algorithm" rel="nofollow noreferrer">Lamport's distributed mutual exclusion algorithm</a> (also described <a href="http://www.cs.fsu.edu/~xyuan/cop5611/lecture8.html" rel="nofollow noreferrer">here</a>) solves mutual exclusion problem fo...
algorithms distributed systems concurrency mutual exclusion
1
What is a counterexample for Lamport's distributed mutual exclusion algorithm with non-FIFO message queues? -- (algorithms distributed systems concurrency mutual exclusion) <p><a href="https://en.wikipedia.org/wiki/Lamport%27s_distributed_mutual_exclusion_algorithm" rel="nofollow noreferrer">Lamport's distributed mutua...
habedi/stack-exchange-dataset
103,844
Is a language that sits between two regular languages also regular?
<pre><code>Suppose that L0, L1, L2 are languages over the same alphabet and that&#xA;&#xA;L0 ⊆ L1 ⊆ L2.&#xA;&#xA;Is it true that if L0 and L2 are regular, then L1 must be regular as well?&#xA;</code></pre>&#xA;&#xA;<p>By regular = the set of words accepted by a finite automaton. </p>&#xA;&#xA;<p>Suppose </p>&#xA;&#xA;<...
regular languages finite automata
1
Is a language that sits between two regular languages also regular? -- (regular languages finite automata) <pre><code>Suppose that L0, L1, L2 are languages over the same alphabet and that&#xA;&#xA;L0 ⊆ L1 ⊆ L2.&#xA;&#xA;Is it true that if L0 and L2 are regular, then L1 must be regular as well?&#xA;</code></pre>&#xA;&#x...
habedi/stack-exchange-dataset
103,849
Proof of an Infinite Binary Sequence
<p>I have a problem where given an infinite binary sequence S ∈ {0, 1}∞ to be "prefix-repetitive" if there are infinitely many strings w ∈ {0, 1}*&#xA;such that ww is a prefix of S.</p>&#xA;&#xA;<p>I need to prove that if the bits of a sequence S ∈ {0, 1}∞ are chosen by independent tosses of a fair coin, then &#xA;Prob...
proof techniques probability theory sets
1
Proof of an Infinite Binary Sequence -- (proof techniques probability theory sets) <p>I have a problem where given an infinite binary sequence S ∈ {0, 1}∞ to be "prefix-repetitive" if there are infinitely many strings w ∈ {0, 1}*&#xA;such that ww is a prefix of S.</p>&#xA;&#xA;<p>I need to prove that if the bits of a s...
habedi/stack-exchange-dataset
103,855
Recurrence relation of quicksort depending on its pivot
<p>I understand how the recurrence relation of quicksort is</p>&#xA;&#xA;<p><span class="math-container">$T(n) = 2T(n/2)+\mathcal{O}(n)$</span>,</p>&#xA;&#xA;<p>but if we are guaranteed a certain pivot, for example <span class="math-container">$n/4$</span>th smallest element to be the pivot every time, how would it aff...
recurrence relation quicksort
1
Recurrence relation of quicksort depending on its pivot -- (recurrence relation quicksort) <p>I understand how the recurrence relation of quicksort is</p>&#xA;&#xA;<p><span class="math-container">$T(n) = 2T(n/2)+\mathcal{O}(n)$</span>,</p>&#xA;&#xA;<p>but if we are guaranteed a certain pivot, for example <span class="m...
habedi/stack-exchange-dataset
103,857
Complexity of forming a min heap out of a given array with k inversions
<p>If a given heap has <span class="math-container">$k$</span> inversions, what is the complexity of making it into a valid min heap? We could define an inversion as a tuple (node, descendant), where the node has a key value strictly higher than its descendant (all nodes have distinct key values).</p>&#xA;&#xA;<p>This ...
time complexity heaps
1
Complexity of forming a min heap out of a given array with k inversions -- (time complexity heaps) <p>If a given heap has <span class="math-container">$k$</span> inversions, what is the complexity of making it into a valid min heap? We could define an inversion as a tuple (node, descendant), where the node has a key va...
habedi/stack-exchange-dataset
103,859
How to use homomophism in closure proofs?
<p>I am having a hard time understanding homomorphism. All I seem to understand is that it is a substitution. When I look at examples of proving closure of a particular operation over a regular language, I don't understand how people come up with the substitution strings that they choose, and how they use them to produ...
formal languages regular expressions closure properties
1
How to use homomophism in closure proofs? -- (formal languages regular expressions closure properties) <p>I am having a hard time understanding homomorphism. All I seem to understand is that it is a substitution. When I look at examples of proving closure of a particular operation over a regular language, I don't under...
habedi/stack-exchange-dataset
103,865
Maximum product of contiguous subsequence over $\mathbb{R}$
<p>For the problem of a subsequence of maximum product with negative, zero and positive integers, I have the following working solution (inspiration from <a href="https://stackoverflow.com/a/16801146/258462">here</a>).</p>&#xA;&#xA;<p>Let us first show how to solve the problem when the array contains no zeroes:</p>&#xA...
algorithms dynamic programming subsequences
1
Maximum product of contiguous subsequence over $\mathbb{R}$ -- (algorithms dynamic programming subsequences) <p>For the problem of a subsequence of maximum product with negative, zero and positive integers, I have the following working solution (inspiration from <a href="https://stackoverflow.com/a/16801146/258462">her...
habedi/stack-exchange-dataset
103,866
Hash table open addressing without dummy
<p>If a hash table is using open addressing as the collision resolution strategy, then during deletion, we mark that slot as <code>dummy</code>.&#xA;I understand the reason behind that is because while probing, a <code>dummy</code> would indicate there are still used slots further down the chain to search for.</p>&#xA...
algorithms hash hash tables
1
Hash table open addressing without dummy -- (algorithms hash hash tables) <p>If a hash table is using open addressing as the collision resolution strategy, then during deletion, we mark that slot as <code>dummy</code>.&#xA;I understand the reason behind that is because while probing, a <code>dummy</code> would indicat...
habedi/stack-exchange-dataset
103,874
How "add" could be implemented in only bitshift operations
<p>Typically, add/subtract/multiply/divide are primitive operations in an Instruction Set Architecture (ISA). I am interested to know if they can instead be implemented efficiently using only bitshift operators. I'm interested to know what sequence of bitshift operations can reproduce the addition operation.</p>&#xA;
computer architecture logic circuits bit manipulation
1
How "add" could be implemented in only bitshift operations -- (computer architecture logic circuits bit manipulation) <p>Typically, add/subtract/multiply/divide are primitive operations in an Instruction Set Architecture (ISA). I am interested to know if they can instead be implemented efficiently using only bitshift o...
habedi/stack-exchange-dataset
103,877
If the MOVE instruction in a Transport Triggered Architecture can implement a NAND gate (as a Functional Unit)
<h1>Background</h1>&#xA;&#xA;<p>I'm looking at <a href="https://en.wikipedia.org/wiki/Transport_triggered_architecture" rel="nofollow noreferrer">Transport Triggered Architectures</a> (also <a href="https://en.wikipedia.org/wiki/One_instruction_set_computer#Transport_triggered_architecture_2" rel="nofollow noreferrer">...
computer architecture
1
If the MOVE instruction in a Transport Triggered Architecture can implement a NAND gate (as a Functional Unit) -- (computer architecture) <h1>Background</h1>&#xA;&#xA;<p>I'm looking at <a href="https://en.wikipedia.org/wiki/Transport_triggered_architecture" rel="nofollow noreferrer">Transport Triggered Architectures</a...
habedi/stack-exchange-dataset
103,880
Proving that A(B ∩ C) ⊆ AB ∩ AC
<p>A(B ∩ C) = { UV | U ∈ A, V ∈ B and V ∈ C } for the left part.</p>&#xA;&#xA;<p>ΑΒ = { UV | U ∈ A, V ∈ B },</p>&#xA;&#xA;<p>ΑC = { UV | U ∈ A, V ∈ c },</p>&#xA;&#xA;<p>AB ∩ AC = { UV | U ∈ AB and AC, V ∈ AB and AC } for the right part.</p>&#xA;&#xA;<p>How can I continue further into the proof?</p>&#xA;
formal languages proof techniques
1
Proving that A(B ∩ C) ⊆ AB ∩ AC -- (formal languages proof techniques) <p>A(B ∩ C) = { UV | U ∈ A, V ∈ B and V ∈ C } for the left part.</p>&#xA;&#xA;<p>ΑΒ = { UV | U ∈ A, V ∈ B },</p>&#xA;&#xA;<p>ΑC = { UV | U ∈ A, V ∈ c },</p>&#xA;&#xA;<p>AB ∩ AC = { UV | U ∈ AB and AC, V ∈ AB and AC } for the right part.</p>&#xA;&#xA...
habedi/stack-exchange-dataset
103,885
Intuition for “run” function of monads
<p>I'm learning about monads, I understood why they are useful, I understood in general what bind, join, return do.</p>&#xA;&#xA;<p>I also looked at basic usage examples for the basic reader / writer / state / list / maybe monads.</p>&#xA;&#xA;<p>Still, being a beginner, I still don't feel I have a grip on what the "ru...
functional programming
1
Intuition for “run” function of monads -- (functional programming) <p>I'm learning about monads, I understood why they are useful, I understood in general what bind, join, return do.</p>&#xA;&#xA;<p>I also looked at basic usage examples for the basic reader / writer / state / list / maybe monads.</p>&#xA;&#xA;<p>Still,...
habedi/stack-exchange-dataset
103,890
Proof of proposition between Precise Turing Machine and Proper Complexity function
<p>In "Computational Complexity" textbook by C. H. Papadimitriou, p. 141, he proved the following claim.</p>&#xA;&#xA;<blockquote>&#xA; <p>Proposition 7.1: Let there be a DTM/NDTM M that decides a language L within time/space <span class="math-container">$f(n)$</span>, where <span class="math-container">$f$</span> is ...
turing machines complexity classes
1
Proof of proposition between Precise Turing Machine and Proper Complexity function -- (turing machines complexity classes) <p>In "Computational Complexity" textbook by C. H. Papadimitriou, p. 141, he proved the following claim.</p>&#xA;&#xA;<blockquote>&#xA; <p>Proposition 7.1: Let there be a DTM/NDTM M that decides a...
habedi/stack-exchange-dataset
103,892
What's the true meaning of $(a + b)^\omega$ in regular expression
<p>I'm starting to dabble in language theory, regular expression &amp; infinite words.</p>&#xA;&#xA;<p>I'm not quite sure I completely get the meaning of this expression: </p>&#xA;&#xA;<p><span class="math-container">$(a + b)^\omega$</span></p>&#xA;&#xA;<p><span class="math-container">$^w$</span> meaning infinite repet...
regular languages
1
What's the true meaning of $(a + b)^\omega$ in regular expression -- (regular languages) <p>I'm starting to dabble in language theory, regular expression &amp; infinite words.</p>&#xA;&#xA;<p>I'm not quite sure I completely get the meaning of this expression: </p>&#xA;&#xA;<p><span class="math-container">$(a + b)^\omeg...
habedi/stack-exchange-dataset
103,903
If you can represent/model a Conditional IF statement with AND + NOT or OR + NOT
<p>I am still trying to wrap my head around <a href="https://softwareengineering.stackexchange.com/questions/373704/how-to-simulate-control-flow-without-using-control-flow-primitives/373708#373708">this</a>, which shows how to simulate control-flow without using an <code>if</code>-statement.</p>&#xA;&#xA;<p>I've been l...
computer architecture logic
1
If you can represent/model a Conditional IF statement with AND + NOT or OR + NOT -- (computer architecture logic) <p>I am still trying to wrap my head around <a href="https://softwareengineering.stackexchange.com/questions/373704/how-to-simulate-control-flow-without-using-control-flow-primitives/373708#373708">this</a>...
habedi/stack-exchange-dataset
103,904
Absorption rule in Boolean algebra
<p>I am confused regarding the absorption rule which states: A OR (A AND B) = A.</p>&#xA;&#xA;<p>I do not completely understand how the expression simplifies to A and while i have seen proofs for this question, i still feel that i don't completely grasp it.</p>&#xA;&#xA;<p>I will outline my working out below:</p>&#xA;&...
logic boolean algebra
1
Absorption rule in Boolean algebra -- (logic boolean algebra) <p>I am confused regarding the absorption rule which states: A OR (A AND B) = A.</p>&#xA;&#xA;<p>I do not completely understand how the expression simplifies to A and while i have seen proofs for this question, i still feel that i don't completely grasp it.<...
habedi/stack-exchange-dataset
103,920
Is my proof of my greedy algorithm to find subsequence correct?
<p>Credit to KleinBerg and Taros Book</p>&#xA;&#xA;<p>Some of your friends have gotten into the burgeoning field of time-series data mining, in which one looks for patterns in sequences of events that occur over time. Purchases at stock exchanges—what’s being bought— are one source of data with a natural ordering in ti...
algorithm analysis correctness proof greedy algorithms induction
1
Is my proof of my greedy algorithm to find subsequence correct? -- (algorithm analysis correctness proof greedy algorithms induction) <p>Credit to KleinBerg and Taros Book</p>&#xA;&#xA;<p>Some of your friends have gotten into the burgeoning field of time-series data mining, in which one looks for patterns in sequences ...
habedi/stack-exchange-dataset
103,923
Show Resource Allocation Problem is NP-Complete
<p>We are given <span class="math-container">$n$</span> tasks and <span class="math-container">$m$</span> resources. Each task <span class="math-container">$i$</span> requires a set <span class="math-container">$S_i$</span> of resources to be active, and each resource can be used by at most one task. The Resource Allo...
complexity theory np complete reductions np hard np
1
Show Resource Allocation Problem is NP-Complete -- (complexity theory np complete reductions np hard np) <p>We are given <span class="math-container">$n$</span> tasks and <span class="math-container">$m$</span> resources. Each task <span class="math-container">$i$</span> requires a set <span class="math-container">$S_i...
habedi/stack-exchange-dataset
103,929
How to create a cellular automata rule to achieve a desired pattern?
<p>Normally, to find the rule that is suitable to our need, we have to generate all possible rules and apply each rule on a seed and check whether a rule produces a desired pattern. This method is exhaustive and computationaly intensive.</p>&#xA;&#xA;<p>Is there a way to derive the rule that would generate the desired ...
automata cellular automata
1
How to create a cellular automata rule to achieve a desired pattern? -- (automata cellular automata) <p>Normally, to find the rule that is suitable to our need, we have to generate all possible rules and apply each rule on a seed and check whether a rule produces a desired pattern. This method is exhaustive and computa...
habedi/stack-exchange-dataset
103,933
SLR parse table and unambiguity
<p>If it is possible to construct an SLR parse table with no conflicts for a particular grammar does that mean that the grammar is unambiguous? </p>&#xA;&#xA;<p>I think that since we have constructed the parse table which means for every sentence we would be able to decide whether the string will be accepted or not. Bu...
compilers parsers
1
SLR parse table and unambiguity -- (compilers parsers) <p>If it is possible to construct an SLR parse table with no conflicts for a particular grammar does that mean that the grammar is unambiguous? </p>&#xA;&#xA;<p>I think that since we have constructed the parse table which means for every sentence we would be able t...
habedi/stack-exchange-dataset
103,941
Add lines to star with fixed coordinates maximizing smallest angle
<p>I have the following problem:</p>&#xA;&#xA;<p>There are existing stars (as in graph-theory stars) with a fixed representation in a 2D coordinate space, meaning that angles between the edges are not allowed to change.</p>&#xA;&#xA;<p>Now I want to add additional edges from the star center. Both the amount of existing...
algorithms graphs computational geometry
1
Add lines to star with fixed coordinates maximizing smallest angle -- (algorithms graphs computational geometry) <p>I have the following problem:</p>&#xA;&#xA;<p>There are existing stars (as in graph-theory stars) with a fixed representation in a 2D coordinate space, meaning that angles between the edges are not allowe...
habedi/stack-exchange-dataset
103,943
I don't understand the case 4 of red-black tree deletion
<p>I don't know why case 4 will resolve the issue of the double black of <span class="math-container">$x$</span> described in Introduction to algorithm p.329. I know case 1 is transformed into one of {2,3,4} case, and case 2 re-point <span class="math-container">$x$</span> to its parent node so it's approaching the roo...
balanced search trees
1
I don't understand the case 4 of red-black tree deletion -- (balanced search trees) <p>I don't know why case 4 will resolve the issue of the double black of <span class="math-container">$x$</span> described in Introduction to algorithm p.329. I know case 1 is transformed into one of {2,3,4} case, and case 2 re-point <s...
habedi/stack-exchange-dataset
103,944
Showing party invitation problem is np-complete
<p>Suppose you and your <span class="math-container">$k - 1$</span> housemates decide to throw a party. Each housemate <span class="math-container">$i$</span> gives you a list <span class="math-container">$P_i$</span> of people she would like to have invited to the party. Depending on how much you like housemate <span...
complexity theory np complete reductions np hard np
1
Showing party invitation problem is np-complete -- (complexity theory np complete reductions np hard np) <p>Suppose you and your <span class="math-container">$k - 1$</span> housemates decide to throw a party. Each housemate <span class="math-container">$i$</span> gives you a list <span class="math-container">$P_i$</spa...
habedi/stack-exchange-dataset
103,949
Pseudo Code optimization
<p><strong>Summary:</strong></p>&#xA;&#xA;<p>I am struggling with the Pseudo code for an that algorithm assigns "least filled slot first" to a tasks on multi-core chip. </p>&#xA;&#xA;<p><strong>Detail</strong></p>&#xA;&#xA;<p>So far I have written following: </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/ePFAE.png...
algorithms time complexity
1
Pseudo Code optimization -- (algorithms time complexity) <p><strong>Summary:</strong></p>&#xA;&#xA;<p>I am struggling with the Pseudo code for an that algorithm assigns "least filled slot first" to a tasks on multi-core chip. </p>&#xA;&#xA;<p><strong>Detail</strong></p>&#xA;&#xA;<p>So far I have written following: </p>...
habedi/stack-exchange-dataset
103,954
NPDA transitions to different states by taking same input and popping same top element of a stack
<p>Suppose i have some NPDA and there is some transition functions defined as:</p>&#xA;&#xA;<p><span class="math-container">$\delta(q_{1},a,A) = (q_{2}, A)$</span></p>&#xA;&#xA;<p><span class="math-container">$\delta(q_{1},a,A) = (q_{3}, Z)$</span></p>&#xA;&#xA;<p>Is it allowed?&#xA;I understand, that since the NPDA is...
automata context free pushdown automata
1
NPDA transitions to different states by taking same input and popping same top element of a stack -- (automata context free pushdown automata) <p>Suppose i have some NPDA and there is some transition functions defined as:</p>&#xA;&#xA;<p><span class="math-container">$\delta(q_{1},a,A) = (q_{2}, A)$</span></p>&#xA;&#xA;...
habedi/stack-exchange-dataset
103,958
How to efficiently specify a MILP constraint with nested AND and ORs
<p>Let's say I want to set <code>x1=1 if (x2=1 AND x3=1 AND x4=1) or (x5=1 and x6=1) or (x7=1) else x1=0</code></p>&#xA;&#xA;<p>All of the <code>x</code>s are binary variables.</p>&#xA;&#xA;<p>My first thought is I have to add 3 additional variables, let's say <code>y1, y2, y3</code> and 12 constraints like this</p>&#...
linear programming integer programming
1
How to efficiently specify a MILP constraint with nested AND and ORs -- (linear programming integer programming) <p>Let's say I want to set <code>x1=1 if (x2=1 AND x3=1 AND x4=1) or (x5=1 and x6=1) or (x7=1) else x1=0</code></p>&#xA;&#xA;<p>All of the <code>x</code>s are binary variables.</p>&#xA;&#xA;<p>My first thou...
habedi/stack-exchange-dataset
103,964
List of algorithm problems in term of ideals
<p>I am new in algorithm and studied about some problems in algorithm related to graph theory. These problems we can transform to some polynomials and if for each set of polynomials related to a problem we have a solution then it means the problem has a question. For example we can transform the problem of MAx-Clique t...
algorithms graphs optimization integer programming
1
List of algorithm problems in term of ideals -- (algorithms graphs optimization integer programming) <p>I am new in algorithm and studied about some problems in algorithm related to graph theory. These problems we can transform to some polynomials and if for each set of polynomials related to a problem we have a soluti...
habedi/stack-exchange-dataset
103,968
Finding the maximum of a bitonic sequence
<p>Given to us is an array <span class="math-container">$B[1],\ldots,B[n]$</span> as input, which satisfies the following property: there exists a special index <span class="math-container">$i^* ∈ \{1, \dots , n\}$</span> such that <span class="math-container">$$B[1] &lt; B[2] &lt; \dots &lt; B[i^*− 1] &lt; B[i^*] &gt;...
algorithms arrays discrete mathematics
1
Finding the maximum of a bitonic sequence -- (algorithms arrays discrete mathematics) <p>Given to us is an array <span class="math-container">$B[1],\ldots,B[n]$</span> as input, which satisfies the following property: there exists a special index <span class="math-container">$i^* ∈ \{1, \dots , n\}$</span> such that <s...
habedi/stack-exchange-dataset
103,971
Learning a perceptron from stream data
<p>I want to train a Perceptron using stochastic gradient rulefrom the stream data. I have very limited amount of memory and i can store only <span class="math-container">$N$</span> examples. </p>&#xA;&#xA;<p>Suppose my population consist of point as show in the following picture:&#xA;<a href="https://i.stack.imgur.com...
artificial intelligence neural networks big data perceptron
1
Learning a perceptron from stream data -- (artificial intelligence neural networks big data perceptron) <p>I want to train a Perceptron using stochastic gradient rulefrom the stream data. I have very limited amount of memory and i can store only <span class="math-container">$N$</span> examples. </p>&#xA;&#xA;<p>Suppose...
habedi/stack-exchange-dataset
103,975
2-opt vs 3-opt comparison
<p>I have a question regarding performance of <a href="https://en.wikipedia.org/wiki/2-opt" rel="nofollow noreferrer">2-opt</a> and <a href="https://en.wikipedia.org/wiki/3-opt" rel="nofollow noreferrer">3-opt</a> algorithms. </p>&#xA;&#xA;<p>I tried implementing the 3-opt and 2-opt algorithms and most of the time 3-op...
algorithms traveling salesman
1
2-opt vs 3-opt comparison -- (algorithms traveling salesman) <p>I have a question regarding performance of <a href="https://en.wikipedia.org/wiki/2-opt" rel="nofollow noreferrer">2-opt</a> and <a href="https://en.wikipedia.org/wiki/3-opt" rel="nofollow noreferrer">3-opt</a> algorithms. </p>&#xA;&#xA;<p>I tried implemen...
habedi/stack-exchange-dataset
103,977
How to prove the equivalence of two CFG for balanced parentheses?
<p>Given two CFGs for balanced parentheses.</p>&#xA;&#xA;<ol>&#xA;<li><p><span class="math-container">$S \rightarrow SS \mid (S) \mid \epsilon$</span></p></li>&#xA;<li><p><span class="math-container">$S \rightarrow S(S)S \mid \epsilon$</span></p></li>&#xA;</ol>&#xA;&#xA;<p>How do I show that they are equivalent?</p>&#...
formal languages context free formal grammars
1
How to prove the equivalence of two CFG for balanced parentheses? -- (formal languages context free formal grammars) <p>Given two CFGs for balanced parentheses.</p>&#xA;&#xA;<ol>&#xA;<li><p><span class="math-container">$S \rightarrow SS \mid (S) \mid \epsilon$</span></p></li>&#xA;<li><p><span class="math-container">$S...
habedi/stack-exchange-dataset
103,985
Find the Pumping Length for Language L of (2+3k) a's or (10+12k) b's
<p>The following question on the theory of computation is <a href="https://www.geeksforgeeks.org/gate-gate-cs-2019-question-24/" rel="nofollow noreferrer">GATE 2019 CS question 24</a>:</p>&#xA;<blockquote>&#xA;<p>For <span class="math-container">$Σ = \{a, b\}$</span>, let us consider the regular language: <span class="...
formal languages regular languages pumping lemma discrete mathematics
1
Find the Pumping Length for Language L of (2+3k) a's or (10+12k) b's -- (formal languages regular languages pumping lemma discrete mathematics) <p>The following question on the theory of computation is <a href="https://www.geeksforgeeks.org/gate-gate-cs-2019-question-24/" rel="nofollow noreferrer">GATE 2019 CS question...
habedi/stack-exchange-dataset
103,999
Uniformly random iteration of subtrees
<p>I want to iterate through the first <span class="math-container">$k$</span> elements of a randomly ordered list containing all subtrees for a given tree. The definition of subtrees that I'm using is: "A subtree of <span class="math-container">$T$</span> is a subgraph of <span class="math-container">$T$</span> that i...
trees randomness subtree
1
Uniformly random iteration of subtrees -- (trees randomness subtree) <p>I want to iterate through the first <span class="math-container">$k$</span> elements of a randomly ordered list containing all subtrees for a given tree. The definition of subtrees that I'm using is: "A subtree of <span class="math-container">$T$</...
habedi/stack-exchange-dataset
104,016
How to evaluate dynamical conditioning/pseudo code
<p>I am having a hard time even to formulate my question, so here it is:</p>&#xA;&#xA;<p>I have an application that the user can go in and define on a webpage the logic one wants to evaluate for the student to comply with:</p>&#xA;&#xA;<blockquote>&#xA; <p>Student must take classes (MATH111 OR (MATH101 AND MATH103))</...
logic
1
How to evaluate dynamical conditioning/pseudo code -- (logic) <p>I am having a hard time even to formulate my question, so here it is:</p>&#xA;&#xA;<p>I have an application that the user can go in and define on a webpage the logic one wants to evaluate for the student to comply with:</p>&#xA;&#xA;<blockquote>&#xA; <p>...
habedi/stack-exchange-dataset
104,017
Maximum matching using linear programming
<p>In a bipartite graph <span class="math-container">$G = (V,E)$</span>, there is a neat algorithm for finding a maximum matching (or even a maximum-weight matching) using linear programming. It is explained <a href="https://en.wikipedia.org/wiki/Assignment_problem#Solution%20by%20linear%20programming" rel="noreferrer"...
graphs linear programming matching
1
Maximum matching using linear programming -- (graphs linear programming matching) <p>In a bipartite graph <span class="math-container">$G = (V,E)$</span>, there is a neat algorithm for finding a maximum matching (or even a maximum-weight matching) using linear programming. It is explained <a href="https://en.wikipedia....
habedi/stack-exchange-dataset
104,029
State-elimination on FSA, after epsilon-removal construction
<p>I want to define the language of this FSA with a regular expression. I have learned that by state-elimination, I would be able to find a regular expression.</p>&#xA;&#xA;<p>But there are already some epsilon transitions in this FSA.</p>&#xA;&#xA;<p>My question is:</p>&#xA;&#xA;<p>Should I first follow the epsilon-re...
finite automata regular expressions
1
State-elimination on FSA, after epsilon-removal construction -- (finite automata regular expressions) <p>I want to define the language of this FSA with a regular expression. I have learned that by state-elimination, I would be able to find a regular expression.</p>&#xA;&#xA;<p>But there are already some epsilon transit...
habedi/stack-exchange-dataset
104,033
Why is the running cost of SQUARE-MATRIX-MULTIPLY-RECURSIVE in CLRS $\Theta(n^3)$ instead of $\Theta(n^2)$?
<p>I am reading Introduction to Algorithm CLRS (3rd ed.), Chapter 4 (Divide and Conquer), page 78, and am not sure why the explanation of why SQUARE-MATRIX-RECURSIVE algorithm takes <span class="math-container">$Θ(n^3)$</span>.</p>&#xA;&#xA;<blockquote>&#xA; <p>Combining equations (4.15) and (4.16) gives us the recurr...
algorithms complexity theory
1
Why is the running cost of SQUARE-MATRIX-MULTIPLY-RECURSIVE in CLRS $\Theta(n^3)$ instead of $\Theta(n^2)$? -- (algorithms complexity theory) <p>I am reading Introduction to Algorithm CLRS (3rd ed.), Chapter 4 (Divide and Conquer), page 78, and am not sure why the explanation of why SQUARE-MATRIX-RECURSIVE algorithm ta...
habedi/stack-exchange-dataset
104,037
How to show that in noiseless coding theorem, the bound $\mathrm{MinACL}<H(P)+1$ is tight?
<p>The theorem states that</p>&#xA;&#xA;<p><span class="math-container">$$&#xA;H(P)\leq\mathrm{MinACL}(P)&lt;H(P)+1&#xA;$$</span></p>&#xA;&#xA;<p>where, <span class="math-container">$\mathrm{MinACL}$</span> means the minimum average code word length of a given information source, i.e. the average code word length of an...
information theory coding theory encoding scheme
1
How to show that in noiseless coding theorem, the bound $\mathrm{MinACL}<H(P)+1$ is tight? -- (information theory coding theory encoding scheme) <p>The theorem states that</p>&#xA;&#xA;<p><span class="math-container">$$&#xA;H(P)\leq\mathrm{MinACL}(P)&lt;H(P)+1&#xA;$$</span></p>&#xA;&#xA;<p>where, <span class="math-cont...
habedi/stack-exchange-dataset
104,038
Is Language $ L = \{ww^{R} \in \{a,b,c\}^{*} : |w|_{a} \not\equiv |w|_{b} $ and $ |w|_{b} \not\equiv |w|_{c} \} $ context free?
<p><span class="math-container">$ L = \{ww^{R} \in \{a,b,c\}^{*} : |w|_{a} \not\equiv |w|_{b} $</span> and <span class="math-container">$ |w|_{b} \not\equiv |w|_{c} \} $</span></p>&#xA;&#xA;<p>I would use the Ogden pumping lemma. Assumption <span class="math-container">$n &lt; m$</span> where <span class="math-contai...
complexity theory formal languages regular languages context free pumping lemma
1
Is Language $ L = \{ww^{R} \in \{a,b,c\}^{*} : |w|_{a} \not\equiv |w|_{b} $ and $ |w|_{b} \not\equiv |w|_{c} \} $ context free? -- (complexity theory formal languages regular languages context free pumping lemma) <p><span class="math-container">$ L = \{ww^{R} \in \{a,b,c\}^{*} : |w|_{a} \not\equiv |w|_{b} $</span> an...
habedi/stack-exchange-dataset
104,044
Find a minimum-weight perfect b-matching, where b is even
<p>How would one find a minimum-weight perfect b-matching of a general graph, where the number of edges incident on each vertex is a positive even number not greater than b?</p>&#xA;&#xA;<p>A minimum-weight perfect b-matching of a graph G is a subgraph M of minimal total edge weight, such that each vertex in G is incid...
matching
1
Find a minimum-weight perfect b-matching, where b is even -- (matching) <p>How would one find a minimum-weight perfect b-matching of a general graph, where the number of edges incident on each vertex is a positive even number not greater than b?</p>&#xA;&#xA;<p>A minimum-weight perfect b-matching of a graph G is a subg...
habedi/stack-exchange-dataset
104,062
Sorting lower bounds for almost sorted array
<p>Can't find a good way to tackle the problem. Would appreciate any help.</p>&#xA;&#xA;<p><span class="math-container">$A$</span> is an <span class="math-container">$n$</span> items array from an ordered set, in which every item is at most &#xA; <span class="math-container">$\log n $</span> indices away from its posit...
data structures time complexity sorting comparison
1
Sorting lower bounds for almost sorted array -- (data structures time complexity sorting comparison) <p>Can't find a good way to tackle the problem. Would appreciate any help.</p>&#xA;&#xA;<p><span class="math-container">$A$</span> is an <span class="math-container">$n$</span> items array from an ordered set, in which ...
habedi/stack-exchange-dataset
104,069
Type system with subtyping on abstract data types?
<p>Consider this example on binary trees in some ML-like language:</p>&#xA;&#xA;<pre><code>type tree =&#xA; | Null&#xA; | Node of tree * tree&#xA;&#xA;let rotate_left p =&#xA; match p with&#xA; | Null -&gt; p&#xA; | Node (a, q) -&gt;&#xA; match q with&#xA; | Null -&gt; p&#xA; | Node (b, c) -&gt;&#xA; ...
reference request programming languages type checking
1
Type system with subtyping on abstract data types? -- (reference request programming languages type checking) <p>Consider this example on binary trees in some ML-like language:</p>&#xA;&#xA;<pre><code>type tree =&#xA; | Null&#xA; | Node of tree * tree&#xA;&#xA;let rotate_left p =&#xA; match p with&#xA; | Null -&gt;...
habedi/stack-exchange-dataset
104,071
Prove $ L = \{ww^{R} \in \{a, b\}^{*} : |w|_{a} \equiv |w|_{b} \equiv 0$ $ (mod$ $13) \} $ is regular or context-free or neither
<p><span class="math-container">$ L = \{ww^{R} \in \{a, b\}^{*} : |w|_{a} \equiv |w|_{b} \equiv 0$</span> <span class="math-container">$ (mod$</span> <span class="math-container">$13) \} $</span></p>&#xA;&#xA;<p>Exercises: If the language L is regular (build a DFA or regular expression) &#xA;else if the language L is...
regular languages context free finite automata pushdown automata pumping lemma
1
Prove $ L = \{ww^{R} \in \{a, b\}^{*} : |w|_{a} \equiv |w|_{b} \equiv 0$ $ (mod$ $13) \} $ is regular or context-free or neither -- (regular languages context free finite automata pushdown automata pumping lemma) <p><span class="math-container">$ L = \{ww^{R} \in \{a, b\}^{*} : |w|_{a} \equiv |w|_{b} \equiv 0$</span> <...
habedi/stack-exchange-dataset
104,072
Algorithm comparison
<p>I am learning Big O and Big theta notation and confused the certain case.<br/>&#xA;I have two functions,<br/><br/>&#xA;function 1(f1)&#xA;<span class="math-container">$$ n * n^{1/2} $$</span>&#xA;function 2(f2)&#xA;<span class="math-container">$$ 1.001^n $$</span></p>&#xA;&#xA;<p>in smaller cases (10,000) f1 is much...
asymptotics
1
Algorithm comparison -- (asymptotics) <p>I am learning Big O and Big theta notation and confused the certain case.<br/>&#xA;I have two functions,<br/><br/>&#xA;function 1(f1)&#xA;<span class="math-container">$$ n * n^{1/2} $$</span>&#xA;function 2(f2)&#xA;<span class="math-container">$$ 1.001^n $$</span></p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
104,081
First half of context-free palindromes
<p>If <span class="math-container">$L\subseteq\Sigma^*$</span> is a regular language, then <span class="math-container">$\text{mir}(L) = \{ww^R \mid w\in L\}$</span> is context-free. This is a nice exercise.</p>&#xA;&#xA;<p>Question: does the reverse hold? Thus, if <span class="math-container">$\text{mir}(L)$</span> is...
regular languages context free closure properties
1
First half of context-free palindromes -- (regular languages context free closure properties) <p>If <span class="math-container">$L\subseteq\Sigma^*$</span> is a regular language, then <span class="math-container">$\text{mir}(L) = \{ww^R \mid w\in L\}$</span> is context-free. This is a nice exercise.</p>&#xA;&#xA;<p>Qu...
habedi/stack-exchange-dataset
104,082
$O(n\log n)$ algorithm for minimizing number of inversions in leaves of complete binary tree
<p>I'm having trouble making an algorithm to fit these specs:</p>&#xA;&#xA;<ul>&#xA;<li>Given a complete binary tree (<span class="math-container">$n = 2^d$</span> leaves) with integers in leaves.</li>&#xA;<li>Reading the leaves from left to right makes a sequence of integers (we can assume we have an array)</li>&#xA;<...
algorithms sorting binary trees divide and conquer
1
$O(n\log n)$ algorithm for minimizing number of inversions in leaves of complete binary tree -- (algorithms sorting binary trees divide and conquer) <p>I'm having trouble making an algorithm to fit these specs:</p>&#xA;&#xA;<ul>&#xA;<li>Given a complete binary tree (<span class="math-container">$n = 2^d$</span> leaves)...
habedi/stack-exchange-dataset
104,088
Is complement $L = \{ w : |w|_{a} \equiv |w|_{b} \vee |w|_{c} \equiv |w|_{d} \}$ context-free
<p><span class="math-container">$L = \{ w : |w|_{a} \equiv |w|_{b} \vee |w|_{c} \equiv |w|_{d} \}$</span></p>&#xA;&#xA;<p>In my opinion complement of the L language is</p>&#xA;&#xA;<p><span class="math-container">$L^{C} = \{ w : |w|_{a} \neq |w|_{b} \wedge |w|_{c} \neq |w|_{d} \}$</span></p>&#xA;&#xA;<p>I choose to O...
regular languages context free formal grammars pumping lemma check my answer
1
Is complement $L = \{ w : |w|_{a} \equiv |w|_{b} \vee |w|_{c} \equiv |w|_{d} \}$ context-free -- (regular languages context free formal grammars pumping lemma check my answer) <p><span class="math-container">$L = \{ w : |w|_{a} \equiv |w|_{b} \vee |w|_{c} \equiv |w|_{d} \}$</span></p>&#xA;&#xA;<p>In my opinion compleme...
habedi/stack-exchange-dataset
104,092
Prove number of nodes in heap
<p>Consider a variation of the normal heap which we will call the <strong>x-heap</strong></p>&#xA;&#xA;<p>The <strong>x-heap</strong> of height <span class="math-container">$h$</span> has the following properties:</p>&#xA;&#xA;<ul>&#xA;<li><p>It will have <span class="math-container">$2^h$</span> nodes</p></li>&#xA;<li...
binary trees heaps
1
Prove number of nodes in heap -- (binary trees heaps) <p>Consider a variation of the normal heap which we will call the <strong>x-heap</strong></p>&#xA;&#xA;<p>The <strong>x-heap</strong> of height <span class="math-container">$h$</span> has the following properties:</p>&#xA;&#xA;<ul>&#xA;<li><p>It will have <span clas...
habedi/stack-exchange-dataset
104,094
How does a computer "wait" time?
<p>Me and a friend were discussing how programming languages can perform asynchronous tasks, like waiting 15 seconds before performing another task, and we started a debate.</p>&#xA;&#xA;<p>I know that computers have an internal clock that uses the CMOS battery that can keep track of time, but how does it know it has b...
computer architecture programming languages
1
How does a computer "wait" time? -- (computer architecture programming languages) <p>Me and a friend were discussing how programming languages can perform asynchronous tasks, like waiting 15 seconds before performing another task, and we started a debate.</p>&#xA;&#xA;<p>I know that computers have an internal clock tha...
habedi/stack-exchange-dataset
104,098
For a given k-DNF formula, what is the size of the formula for the purpose of complexity?
<p>I am currently in the process of proving some complexity bounds about k-DNF. However I am confused what the <span class="math-container">$n$</span> in the time complexity would refer to in this case (that is that I don't know how the "size" of a k-DNF is defined, nor was it defined in the assignment). Is it the numb...
satisfiability
1
For a given k-DNF formula, what is the size of the formula for the purpose of complexity? -- (satisfiability) <p>I am currently in the process of proving some complexity bounds about k-DNF. However I am confused what the <span class="math-container">$n$</span> in the time complexity would refer to in this case (that is...
habedi/stack-exchange-dataset
104,103
Identity types and universes
<p>Let us consider Martin-Löf type theory with a cumulative hierarchy of universes&#xA;<span class="math-container">$$&#xA;\mathcal{U}_0\colon\mathcal{U}_1\colon\ldots&#xA;$$</span>&#xA;If <span class="math-container">$A, B\colon \mathcal{U}_i$</span>, we can form an identity type <span class="math-container">$A=_{\mat...
type theory dependent types homotopy type theory
1
Identity types and universes -- (type theory dependent types homotopy type theory) <p>Let us consider Martin-Löf type theory with a cumulative hierarchy of universes&#xA;<span class="math-container">$$&#xA;\mathcal{U}_0\colon\mathcal{U}_1\colon\ldots&#xA;$$</span>&#xA;If <span class="math-container">$A, B\colon \mathca...
habedi/stack-exchange-dataset
104,110
Bottom up chart parser adding active arc step
<p>I am following Bottom up chart parsing algorithm from Natural Language Understanding book by James Allen. It is </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/W35hb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W35hb.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>I couldn't u...
parsers natural language processing
1
Bottom up chart parser adding active arc step -- (parsers natural language processing) <p>I am following Bottom up chart parsing algorithm from Natural Language Understanding book by James Allen. It is </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/W35hb.png" rel="nofollow noreferrer"><img src="https://i.stack.im...
habedi/stack-exchange-dataset
104,111
Shortest path from source to all vertices, but with some wildcards
<p>Here is problem in <a href="https://www.geeksforgeeks.org/sprinklr-interview-experience-set-5-on-campus-fte-for-product-engineer/" rel="nofollow noreferrer">Sprinklr Interview Experience | Set 5 (On campus – FTE for Product Engineer)</a>.</p>&#xA;<blockquote>&#xA;<p>You are given a graph of <span class="math-contain...
algorithms graphs dynamic programming shortest path
1
Shortest path from source to all vertices, but with some wildcards -- (algorithms graphs dynamic programming shortest path) <p>Here is problem in <a href="https://www.geeksforgeeks.org/sprinklr-interview-experience-set-5-on-campus-fte-for-product-engineer/" rel="nofollow noreferrer">Sprinklr Interview Experience | Set ...
habedi/stack-exchange-dataset
104,112
Why databases make the distinction between basic logical operations and functions
<p>It just occurred to me that things like "greater than or equal to" and other "logical operators" are also just simple functions, such as <code>gte(a, b) == a &gt;= b</code>. This makes me wonder why these are treated as "special" in databases and why they are not just functions like SQL functions. Wondering if there...
database theory
1
Why databases make the distinction between basic logical operations and functions -- (database theory) <p>It just occurred to me that things like "greater than or equal to" and other "logical operators" are also just simple functions, such as <code>gte(a, b) == a &gt;= b</code>. This makes me wonder why these are treat...
habedi/stack-exchange-dataset
104,122
Master Method: $T(n) = 10T\Big(\frac{n}{2}\Big) + \frac{n^4}{\log(n)}$
<p>I'm having a hard time trying to understand how to solve this recurrence relation using the Master Method:</p>&#xA;&#xA;<p><span class="math-container">$$T(n) = 10T\Big(\frac{n}{2}\Big) + \frac{n^4}{\log(n)}$$</span></p>&#xA;&#xA;<p>First, we have:</p>&#xA;&#xA;<p><span class="math-container">$a = 10,\ b = 2$</span>...
asymptotics recurrence relation
1
Master Method: $T(n) = 10T\Big(\frac{n}{2}\Big) + \frac{n^4}{\log(n)}$ -- (asymptotics recurrence relation) <p>I'm having a hard time trying to understand how to solve this recurrence relation using the Master Method:</p>&#xA;&#xA;<p><span class="math-container">$$T(n) = 10T\Big(\frac{n}{2}\Big) + \frac{n^4}{\log(n)}$$...
habedi/stack-exchange-dataset
104,137
How do I know which direction I should rotate a node in an AVL Tree?
<p>I'm studying AVL Trees in my programming class and we got this exercise dealing with right, left, left-right and right-left rotations as a way to check if we understand the theoretical concept of AVL Trees. We're given the numbers <span class="math-container">$100,50,25,10,37,32,200$</span>. Creating an AVL Tree unt...
algorithms data structures search trees balanced search trees avl trees
1
How do I know which direction I should rotate a node in an AVL Tree? -- (algorithms data structures search trees balanced search trees avl trees) <p>I'm studying AVL Trees in my programming class and we got this exercise dealing with right, left, left-right and right-left rotations as a way to check if we understand th...
habedi/stack-exchange-dataset
104,138
$ L = \{xyyz\in\{0,1,2\}^{*} : y \neq \epsilon \wedge \exists_{a \in \{0,1,2\}} |y|_a \equiv 0 \}$
<p><span class="math-container">$ L = \{xyyz\in\{0,1,2\}^{*} : y \neq \epsilon \wedge \exists_{a \in \{0,1,2\}} |y|_a \equiv 0 \}$</span></p>&#xA;&#xA;<p>I think this languages is regular. I write regular expression:&#xA; <span class="math-container">$(1 + 2 + 0) ^ {*} (11 + 22 + 1212 + 2121) (1 + 2 + 0) ^ ...
regular languages regular expressions check my answer
1
$ L = \{xyyz\in\{0,1,2\}^{*} : y \neq \epsilon \wedge \exists_{a \in \{0,1,2\}} |y|_a \equiv 0 \}$ -- (regular languages regular expressions check my answer) <p><span class="math-container">$ L = \{xyyz\in\{0,1,2\}^{*} : y \neq \epsilon \wedge \exists_{a \in \{0,1,2\}} |y|_a \equiv 0 \}$</span></p>&#xA;&#xA;<p>I think...
habedi/stack-exchange-dataset
104,140
Fast multiplication with a full binary $n \times 2^n$ matrix
<p>Let <span class="math-container">$A$</span> a <span class="math-container">$n\times n$</span> matrix, and X the full matrix of <span class="math-container">$n\times 2^n$</span> binary vectors (you can choose the order of the columns of X).</p>&#xA;&#xA;<p>What is the fastest way to compute the product AX?</p>&#xA;
algorithms
1
Fast multiplication with a full binary $n \times 2^n$ matrix -- (algorithms) <p>Let <span class="math-container">$A$</span> a <span class="math-container">$n\times n$</span> matrix, and X the full matrix of <span class="math-container">$n\times 2^n$</span> binary vectors (you can choose the order of the columns of X).<...
habedi/stack-exchange-dataset
104,142
Why are regular expression used in lexical analysis instead of grammars?
<p>Even though grammars can do what regular expressions do, why are regular expression employed instead of grammars in lexical analysis? </p>&#xA;
compilers lexical analysis
1
Why are regular expression used in lexical analysis instead of grammars? -- (compilers lexical analysis) <p>Even though grammars can do what regular expressions do, why are regular expression employed instead of grammars in lexical analysis? </p>&#xA;
habedi/stack-exchange-dataset
104,148
If there is any sense of an optimal set of instructions in an ISA
<p>So there are <a href="https://en.wikipedia.org/wiki/One_instruction_set_computer" rel="nofollow noreferrer">One Instruction Set Computers</a>, having only one (complicated) instruction like <code>addleq</code>, "add and branch if less than or equal to zero". And then there are extremely complicated <a href="https://...
reference request computer architecture
1
If there is any sense of an optimal set of instructions in an ISA -- (reference request computer architecture) <p>So there are <a href="https://en.wikipedia.org/wiki/One_instruction_set_computer" rel="nofollow noreferrer">One Instruction Set Computers</a>, having only one (complicated) instruction like <code>addleq</co...
habedi/stack-exchange-dataset
104,169
Difference between sequential and parallel divide and conquer
<p>In the textbook <em>Introduction to Algorithm</em>, third edition, by Coremen et al. (CLRS), the following introduction has been given about divide and conquer algorithm strategy</p>&#xA;&#xA;<blockquote>&#xA; <p>In divide and conquer, we solve a problem recursively, applying three&#xA; steps at each level of recu...
algorithms parallel computing divide and conquer
1
Difference between sequential and parallel divide and conquer -- (algorithms parallel computing divide and conquer) <p>In the textbook <em>Introduction to Algorithm</em>, third edition, by Coremen et al. (CLRS), the following introduction has been given about divide and conquer algorithm strategy</p>&#xA;&#xA;<blockquo...
habedi/stack-exchange-dataset