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

2025

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

image.png


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

  1. A.

    L = (a* + b* + c*)*

  2. B.

    L = (a + b + c)(abc)(a + b + c)*

  3. C.

    L = {Set of strings, all starting with ‘a, b, c’ but ending with ‘c’}

  4. D.

    L = {Set of strings, all having even count (including 0) of substring ‘abc’}

Attempted by 51 students.

Show answer & explanation

Correct answer: D

Key idea: the automaton has two mirrored sets of three states that track progress through the substring "abc" and flip parity each time a complete "abc" is seen.

  • Even-parity states (start and accepting): a 3-state chain that represents having seen an even number of complete "abc" occurrences so far.

  • Odd-parity states: a mirrored 3-state chain that represents having seen an odd number of complete "abc" occurrences so far.

How the transitions implement this:

  1. From the even group: the start state (call it even-0) goes to even-1 on 'a' and loops on 'b' and 'c'. even-1 (after seeing 'a') goes to even-2 on 'b' (and stays on 'a'); even-2 (after seeing 'ab') goes to the odd group on 'c' (completing "abc" and toggling parity), while other letters send it to the appropriate partial-match states.

  2. The odd group mirrors these transitions: reading 'c' after the odd group's 'ab' state completes another "abc" and returns to the even group's start state, toggling parity back to even.

Accepting condition and conclusion:

  • Because the accepting states are exactly those in the even-parity group, the DFA accepts precisely those strings that contain an even number (including zero) of occurrences of the substring "abc".

  • Therefore the correct description of the language is the set of strings whose count of the substring "abc" is even (0,2,4,...).

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor