Consider the Finite Automaton The above FA:

 Consider the Finite Automaton

{D6CA4F18-607E-4701-98CC-E3717CF3B003}.png

The above FA:

Answer: D. None of theseState q0 is the start and accepting state, representing an even count of 'a's seen so far. State q1 represents an odd count. Transitions on 'b' loop back to…

  1. A.

    Accepts language in which all the strings end with “a”.

  2. B.

    Rejects the string “aaabaaa”

  3. C.

     Rejects all the strings that has an odd number of a’s.

  4. D.

    None of these

Attempted by 65 students.

Show answer & explanation

Correct answer: D

State q0 is the start and accepting state, representing an even count of 'a's seen so far. State q1 represents an odd count. Transitions on 'b' loop back to the current state, so they do not affect the parity of 'a's but we can also loop on q1 after reading 'a'.

  • String "ab": q0 -(a)-> q1 -(b)-> q1 (Rejected).

  • String "aaabaaa": Contains 6 'a's. The path returns to q0 (Accepted).

  • String "aaba": Contains 3 'a's. The path ends in q0 (accepted).

This NFA accepts every single possible string over {a, b}* except for strings that contain exactly one a.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…