GATE Computer ScienceVery hardGATE CSE
A DFA over {a, b} has states 0–3, start 0 and accepting state 3. Transitions: 0 –a→ 1, 0 –b→ 0; 1 –a→ 2, 1 –b→ 0; 2 –a→ 2, 2 –b→ 3; 3 –a→ 1, 3 –b→ 3. How many strings of length 10 does it accept?
- A. 263
- B. 243
- C. 255
- D. 285
Correct answer: C. 255
Run the transition-count recurrence (matrix power) from state 0 for 10 steps and sum the counts in state 3: 255.
More Theory of Computation questions
- A TM (blank B) has rules: δ(q0,a) = (q1,X,R); δ(q0,Y) = (q3,Y,R); δ(q0,B) = (qa,B,S); δ(q1,a) = (q1,a,R); δ(q1,Y) = (q1,Y,R); δ(q1,b) =…
- Which regular expression (over {a, b}, + means union) generates exactly the strings with an even number of b's?
- The pumping lemma for regular languages states that some length p exists such that every w ∈ L with |w| ≥ p can be split w = xyz with |xy|…
- For a context-free grammar G given as input, how many of the following problems are undecidable? (a) Is L(G) = Σ? (b) Is L(G) regular? (c)…
- A DFA reads a binary string most-significant bit first (leading zeros allowed) and tracks the value so far modulo 12, accepting exactly…
- Let L be the set of strings over {a, b} in which the third symbol from the right is a, or the last symbol is b (strings shorter than 3…