GATE Computer ScienceHardGATE CS (PYQ pattern)

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 minimal DFA for L?

  1. A. 4
  2. B. 6
  3. C. 8
  4. D. 16

Correct answer: C. 8

A DFA must remember the last three symbols, and any two different 3-bit suffixes are distinguishable by a suitable continuation (the third-from-last bit after two more symbols is the first of them). Hence 2^3 = 8 states are necessary and sufficient; the NFA has only 4 states.

More Theory of Computation questions

Exams that ask this topic