GATE Computer ScienceHardGATE CS (PYQ pattern)
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}*)?
- A. 1024
- B. 55
- C. 144
- D. 89
Correct answer: D. 89
The image consists of binary strings that start with 0 and contain no 11 (every 1 is preceded by a 0). Those of length 10 number 89 (Fibonacci).
More Theory of Computation questions
- 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 | ε?
- Let L be the set of binary strings of length at least 3 whose third symbol from the right end is 1. What is the number of states in the…
- Consider I. {aⁿbᵐcⁿdᵐ | n, m ≥ 1}, II. {aⁿbᵐcᵐdⁿ | n, m ≥ 1}, III. {wwᴿ | w ∈ {a,b}}, IV. {ww | w ∈ {a,b}}. Which of these languages are…
- Which regular expression over {0,1} denotes exactly the set of strings that do not contain two consecutive 1s?