instruction
stringlengths
0
29.8k
⌀
My problem with CFG is, I am to generally create ones that don't have requirements such as: $\qquad \{a^m b^n \mid m \le n \le 2m \}$ I have no clue where to begin, and how to approach it. I was wondering if you can provide some hints for such daunting problems, along with how to solve that problem. This is no...
|formal-languages|context-free|formal-grammars|
|encoding-scheme|
Suppose we have a function based on two inputs of length $m,n$. Therefore the time complexity of the function is calculated by $T(m,n)$. Suppose that we have: * $T(m,c)\in O(m^2)$ for any constant $c$. * $T(c',n)\in O(n^2)$ for any constant $c'$. What can we say about $T(m,n)$?
|asymptotics|landau-notation|
|algorithms|sorting|
|terminology|integers|encoding-scheme|
Can someone explain in plain English what "two's complement integer" means? I read this: > in Java long is a 64-bit signed two's complement integer
What are two's complement integers?
This question is on the GRE Computer Science test booklet (not homework). I tried applying closure properties of regular languages but no success. Suppose $L$ is a regular language over $\Sigma = \{0, 1\}$. Show that the language $\qquad L' = \{w \in L \mid |w| \in 2\mathbb{N}\}$ is also regular. What I f...
Proof that regular languages are closed against taking the even-length subset
|formal-languages|regular-languages|closure-properties|
Yes, if you can come up with any of the following: * [deterministic finite automaton](https://en.wikipedia.org/wiki/Deterministic_finite_automaton) (DFA), * [nondeterministic finite automaton](https://en.wikipedia.org/wiki/Finite_automaton) (NFA), * [regular expression](https://en.wikipedia.org/wiki/Regular_exp...
null
Here's how to get started (since you wanted a hint). Compare the first and second keys, and the third and fourth keys. Now, we can assume that we have $a\leq b$ and $c \leq d$. Compare $a$ and $c$. We can assume without loss of generality that $a \leq c$, so we have $a \leq b$ and $a \leq c \leq d$. You have fo...
You can find this in The Art of Computer Programming vol III, by D.Knuth, but the strategy is as this (I'll assume you have array $\{a,b,c,d,e\}$): If you want hint read just first two lines of my answer - First group pairs of numbers: $(a,b), (c,d)$. - Compare pairs to sort them e.g: $a<b, c<d$. - Compare sma...
I have a problem similar to the interval scheduling algorithm. The differences are: - The jobs have the same length. - There are several categories of jobs and only one job from each category can be chosen. - There can be no overlap in time between different categories. I have illustrated the problem with a ...
Variation of interval scheduling algorithm with several job categories, only one from each can be used
|algorithms|optimization|
**Minimum $k$-Multiway Cut** Given a graph $G =(V,E)$ and a set of terminals $S=\{s_1, s_2, \dotsc, s_k\} \subseteq V$ find a minimum set of edges $E' \subseteq E$ whose removal separates each pair of terminals in $S$. **Case when $k=2$** For the case when $k=2$ Minimum $k$-Multiway cut is exactly the Minimum ...
I know every regular language is turing-acceptable, but does that imply it is turing-decidable?
Is every regular language turing-decidable?
|turing-machines|decision-problem|
null
In the multiway cut problem, the input is an undirected graph $G= (V, E)$ and set of terminal nodes $s_1, s_2,\ldots s_k$ are in $V$. The goal is to find a minimum set of edges in $E$ whose removal leaves all terminals in different components. 1. How do we show that this problem can be solved exactly in polynomial ...
2OPT Approximation Algorithm for Multiway Cut Problem
I am reading Computer Architecture & Organization by William Stallings to understand I/O operations. Stallings pretty well explains why Programmed I/O (CPU keeps checking the I/O module register status) & Interrupt I/O (CPU still has to over look data transfer between I/O module & memory) are not efficient & introduces...
Every regular language is Turing-decidable and therefore Turing acceptable / recognisable (but note that Turing acceptable does not imply Turing decidable). Suppose you are given a DFA D such that L = L(D). One can construct a Turing Machine T that simulates D. T's states will be similar to D's. On reaching the end ...
|algorithms|optimization|scheduling|
I am reading Computer Architecture & Organization by William Stallings to understand I/O operations. Stallings pretty well explains why Programmed I/O (CPU keeps checking the I/O module register status) & Interrupt I/O (CPU still has to over look data transfer between I/O module & memory) are not efficient & introduces...
|computer-architecture|memory-hardware|memory-access|
|computability|regular-languages|decision-problem|
{"Voters":[{"Id":98,"DisplayName":"Raphael"}]}
Is every regular language turing-decidable, and how can we prove this?
The pumping lemma for regular languages can be used to prove that certain languages are not regular, and the pumping lemma for context-free languages (along with Ogden's lemma) can be used to prove that certain languages are not context-free. Is there a pumping lemma for *deterministic* context-free languages? That...
A pumping lemma for deterministic context-free languages?
|context-free|pumping-lemma|
**Minimum $k$-Multiway Cut** Given a graph $G =(V,E)$ and a set of terminals $S=\{s_1, s_2, \dotsc, s_k\} \subseteq V$ find a minimum set of edges $E' \subseteq E$ whose removal separates each pair of terminals in $S$. **Case when $k=2$** For the case when $k=2$ Minimum $k$-Multiway cut is exactly the Minimum ...
|context-free|proof-techniques|pumping-lemma|
I was wondering since randomness is embeedded in genetic algorithms at almost every level.,is there a really fine line between genetic aalgorithms and pure randomness? Sometime I feel that getting answers out of implemented genetic algorithms , is like randomness playing a mean joke.
genetic algorithm and randomness
|randomness|genetic-algorithms|
I was wondering since randomness is embedded in genetic algorithms at almost every level, is there a really fine line between genetic algorithms and pure randomness? Sometime I feel that getting answers out of implemented genetic algorithms, is like randomness playing a mean joke.
Genetic algorithm and randomness
I know every regular language is Turing-acceptable, but does that imply it is Turing-decidable?
Is every regular language Turing-decidable, and how can we prove this?
null
Following method is explained by my senior. I want to know whether I can use it in all cases or not. When I solve it manually, I come to same answer. $T(n)= 4T(n/2) + \frac{n^2}{lgn}$ In above recurrence master theorem fails. But he gave me this solution, when for $T(n) = aT(n/b) + \Theta(n^d lg^kn)$ if ...
Finding recurrence when Master Theorem fails
|asymptotics|recurrence-relation|master-theorem|
Following method is explained by my senior. I want to know whether I can use it in all cases or not. When I solve it manually, I come to same answer. $T(n)= 4T(n/2) + \frac{n^2}{\lg n}$ In above recurrence master theorem fails. But he gave me this solution, when for $T(n) = aT(n/b) + \Theta(n^d \lg^kn)$ ...
|search-algorithms|efficiency|randomness|evolutionary-computing|genetic-algorithms|
I was wondering since randomness is embedded in genetic algorithms at almost every level, is there a really fine line between genetic algorithms and pure random search? Sometimes I feel that getting answers out of implemented genetic algorithms, is like randomness playing a mean joke.
Are genetic algorithms superior to random search?
null
I was wondering since randomness is embedded in genetic algorithms at almost every level, is there a really fine line between genetic algorithms and pure random search? Ever since I finished my implementation of a GA , since randomness is present in the mutation function,the initialization part (as well as the reini...
Are genetic algorithms special instances of random search done in an unexpectedly short run-time?
$A$ is undecidable because of [Rice's Theorem][1], which states non trivial properties of partial functions are not decidable. 1. There is a TM which doesn't accept any language. (Which directly goes to the reject state). 2. There is a TM which accepts every language. (Which directly goes to the accept state). ...
I guess the easiest way to reason it (this is after thinking about what user:vzn said > a genetic algorithm exploits the gradient in the fitness function due > to crossbreeding. if there is no gradient to exploit, it is indeed > roughly the same as a random search over the search space. , um that the chromsom...
A graph $G$ is chordal if it doesn't have induced cycles of length $4$ or more. A clique tree $T$ of $G$ is a tree in which the vertices of the tree are the maximal cliques of $G$. An edge in $T$ corresponds to a minimal separator. The number of distinct clique trees can be exponential in the number of vertices in a ch...
Given a chordal graph $G$, what is the complexity of computing the reduced clique graph $C_r(G)$?
|algorithms|graphs|reference-request|
#The Akra-Bazzi method# The [Akra-Bazzi method][1] gives asymptotics for recurrences of the form: $$ T(x) = \sum_{1 \le i \le k} a_i T(b_i x + h_i(x)) + g(x) \quad \text{for $x \ge x_0$} $$ This covers the usual divide-and-conquer recurrences, but also cases in which the division is unequal. The "fudge terms" $h...
OK, try Akra-Bazzi (even if Raphael thinks it doesn't apply...) $$ T(n) = 4 T(n / 2) + n^2 / \lg n $$ We have $g(n) = n^2 / \ln n = O(n^2)$, check. We have that there is a single $a_1 = 4$, $b_1 = 1 / 2$, which checks out. Assuming that the $n / 2$ is really $\lfloor n / 2 \rfloor$ and/or $\lceil n / 2 \rceil$, the...
Wikipedia states the subset sum problem as finding a subset of a given set of integers, whose sum is zero. Further it describes it as equivalent to finding a subset with sum $s$ for any given $s$. So I believe as they are equivalent, there must be a reduction in either side. The one from $s$ to zero is trivial by se...
Subset Sum: reduce special to general case
|complexity-theory|reductions|np-hard|
{"Voters":[{"Id":4249,"DisplayName":"Pål GD"},{"Id":6447,"DisplayName":"vonbrand"},{"Id":472,"DisplayName":"Juho"},{"Id":19,"DisplayName":"Nicholas Mancuso"},{"Id":98,"DisplayName":"Raphael"}]}
{"Voters":[{"Id":2131,"DisplayName":"templatetypedef"},{"Id":6447,"DisplayName":"vonbrand"},{"Id":39,"DisplayName":"Gilles"}]}
{"Voters":[{"Id":472,"DisplayName":"Juho"}]}
[Wikipedia][1] states the subset sum problem as finding a subset of a given set of integers, whose sum is zero. Further it describes it as equivalent to finding a subset with sum $s$ for any given $s$. So I believe as they are equivalent, there must be a reduction in either side. The one from $s$ to zero is trivial ...
{"Voters":[{"Id":472,"DisplayName":"Juho"}]}
null
I have to write a regular expression that accepts any odd binary number not preceded by a 0. the best I can come up with is $1(0\cup1)*1$, but that doesn't match just 1. The best it matches is 11.
Regular expressions and finite automata
|finite-automata|regular-expressions|
The answer by Ran G. give a fairly extensive listing of the equivalent models that can be used to specify regular languages (and the list goes on, two-way automata, MSO logic, but that is covered by the link under 'more equivalent models'). And as Raphael stresses, we need an argument to convince the audience that the ...
I have to write a regular expression that accepts any odd binary number not preceded by a 0. the best I can come up with is $1(0\cup1)^*1$, but that doesn't match just 1. The best it matches is 11.
null
I am working on a homework problem: Given that L1 is a linear grammar and L2 is a regular language, show that L=L1L2 is linear language. Recall that a linear grammar $G=(\Sigma, V, P, \sigma)$ has productions $x\in P, x = yBz$ for some $y,z \in \Sigma^*$ and $B \in V$. I use the theorem that every regular lang...
How can I show a particular construction is linear?
|context-free|check-my-proof|
null
this is roughly an open problem subject to ongoing research with various different strategies/heuristics known. a key word is "neural network _architecture_". the most basic strategy is to iterate through various network topologies and retrain for each one. another strategy is to start with a relatively larger network ...
You actually already have a reduction from special to general. By setting $s=0$, you are basically using the general algorithm to solve the special problem. For the other way round (i.e. a reduction from general to special): Suppose you are given a set $S = \{x_1, \dots, x_n\}$ and a number $K$ and you have to de...
Let $$L_\emptyset = \{\langle M\rangle \mid M \text{ is a Turing Machine and }L(M)=\emptyset\}.$$ Is there a Turing machine R that decides (I don't mean recognizes) the language $L_\emptyset$? It seems that the same technique used to show that $\{A \mid A \text{ is a DFA and } L(A)=\emptyset\}$ should work here a...
null
null
null
null
{"Voters":[{"Id":98,"DisplayName":"Raphael"}]}
|terminology|computability|regular-languages|decision-problem|
|formal-languages|regular-languages|regular-expressions|
Regular expression for odd binary numbers without leading zeros
The piece of the puzzle is to *first* generate the regular suffix (in $L_2$ using a set of nonterminals, then (when the left-linear grammar finishes) continue with the linear prefix $L_1$. This means that "final" productions $B\to a$ for $L_2$ should be replaced by $B\to Sa$, where $S$ is the axiom for the grammar for...
I am working on a homework problem: Given that $L_1$ is a linear language and $L_2$ is a regular language, show that $L=L_1L_2$ is a linear language. Recall that a linear grammar $G=(\Sigma, V, P, \sigma)$ has productions $x\in P, x = yBz$ for some $y,z \in \Sigma^*$ and $B \in V$. I use the theorem that every...
How can I show a linear languages are closes against concatenating regular ones?
|formal-languages|context-free|closure-properties|check-my-proof|
You can find this in The Art of Computer Programming vol III, by D.Knuth, but the strategy is as this (I'll assume you have array $\{a,b,c,d,e\}$): If you want hint read just first two lines of my answer - First group pairs of numbers: $(a,b), (c,d)$. - Compare pairs to sort them e.g: $a<b, c<d$. - Compare sma...
First you might just add that single $1$ to your expression as an alternative to what you already have. One obtains $1 \cup 1(0\cup 1)^*1$. An alternative is $1(0^*1)^*$. That one is shorter, but not necessarily better. Actually that expression I obtained by starting with the FSA below, and realizing that the ri...