All mock tests are FREE till 31 December — register to save your progress

Consider the following DFA that generates set of Σ = {a, b, c} strings over

Figure

Now identify that which of the followings is the best description of the language for the above DFA

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: D. L = { strings having an even count (including 0) of the substring 'abc' }

Explanation

The start state q0 is the only accepting state. Reading a, b, c in sequence (q0 → q1 → q2 → q3) moves to the non-accepting half of the machine, and a second 'abc' (q3 → q4 → q5 → q0) returns to q0. Other symbols fall back without completing the pattern, so the machine accepts strings with an even number of 'abc' occurrences.

More Theory of Computation and Compilers questions