GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Consider the language L of strings over {a, b} that contain both abab and bb as substrings, have n_a ≡ 1 (mod 3) and have an even number of b's. What is the length of the shortest string in L?
- A. 8
- B. 7
- C. 9
- D. 5
Correct answer: A. 8
The shortest witness found by exhaustive search is aaababbb: it contains aba, has 4 a's and 4 b's.
More Theory of Computation questions
- What is the length of the shortest string over {a, b} that has length divisible by 4, contains both aab and bba, has an odd number of b's…
- L₁ is the set of strings over {a, b} containing aa and L₂ the set containing bb. How many strings of length at most 6 lie in the symmetric…
- Let h be the homomorphism h(a) = 0, h(b) = 01. How many distinct strings of length exactly 10 are in the image h({a, b})?
- Which of the following decision problems can be solved by an algorithm that always halts?
- How many strings of length 10 over {a, b} contain aa as a substring but do not contain bb?
- How many strings of length exactly 9 are generated by the grammar S → aSbb | bSaa | SS | ε?