GATE Computer ScienceHardGATE CSE
A DFA reads 12-bit strings (MSB first) and accepts exactly those whose binary value is divisible by 7 (the all-zeros string included). How many of the 4096 strings of length 12 are accepted?
- A. 585
- B. 593
- C. 579
- D. 586
Correct answer: D. 586
The values 0, 7, 14, …, 4095 − (4095 mod 7) = 4095 are multiples of 7: ⌊4095/7⌋ + 1 = 585 + 1 = 586.
More Theory of Computation questions
- Which one of the following languages over {0, 1} is regular?
- Let L = { w ∈ {a, b} : (na(w) − 2·nb(w)) mod 6 ∈ {0, 3} }, where na and nb count the a's and b's. How many states does the minimal…
- Let L = { w ∈ {a, b} : (2·na(w) + 4·nb(w)) mod 6 = 2 }. How many strings of length exactly 7 belong to L?
- A DFA reads ternary numerals over {0, 1, 2}, most significant digit first (leading zeros allowed; ε has value 0 and is accepted), and…
- Binary strings are read LSB first (the leftmost symbol is the least significant bit; ε has value 0 and is accepted). How many states does…
- Binary strings are read LSB first (the leftmost symbol is the least significant bit; ε has value 0 and is accepted). The minimal DFA for…