GATE Computer ScienceVery hardGATE CS (PYQ pattern)
Binary strings are read LSB first (the leftmost symbol is the least significant bit; ε has value 0 and is accepted). How many states does the minimal DFA accepting exactly the multiples of 12 have?
- A. 6
- B. 5
- C. 12
- D. 7
Correct answer: A. 6
Divisible by 12 ⇔ the two lowest bits are 0 and the rest is divisible by 3. Reading LSB first: ε and '0' are accepting but distinct (after ε a 1 is fatal, after 0 the string 01 is fatal but 001 is not); a 1 among the first two bits leads to a dead state. After 00 the remaining bits have weights ≡ 1, 2, 1, 2, … (mod 3), so the core tracks value mod 3 together with position parity, but (r, even) ≡ (2r, odd) and these 6 pairs collapse to 3 classes. Total 2 + 1 + 3 = 6 (MSB first would give 5).
More Theory of Computation questions
- Binary strings are read LSB first (the leftmost symbol is the least significant bit; ε has value 0 and is accepted). The minimal DFA for…
- A DFA over {0, 1} reads a binary numeral MSB first (leading zeros allowed, ε has value 0) and accepts iff the value ≡ 3 (mod 8). How many…
- L = { w ∈ {a, b} : (na(w) − nb(w)) ≡ 0 (mod 3) and |w| is even }. How many states does the minimal complete DFA for L have?
- Let L = { w ∈ {a, b} : |w| ≥ 3 and the 3rd symbol from the right end equals the last symbol }. How many states does the minimal complete…
- L = { w ∈ {a, b} : the 5th symbol from the right is a AND the 3rd symbol from the right is b } (so |w| ≥ 5). How many states does the…
- L = { w ∈ {a, b} : the 4th symbol from the right is a, OR the 2nd symbol from the right is b }. How many ACCEPTING states does the minimal…