GATE CS 2025, set 1 · Question 50 · Theory of Computation · Multiple select (MSQ) · 2 marks · no negative marks

Consider the following deterministic finite automaton (DFA) defined over the alphabet, Σ = {a, b}. Identify which of the following language(s) is/are accepted by the given DFA.

DFA with four unlabelled states drawn left to right; call them S1, S2, S3, S4. S1 is the start state (incoming arrow from the left). S4 is the only accepting state (double circle). Transitions: S1 on a loops to S1; S1 on b goes to S2. S2 on b loops to S2; S2 on a goes to S3. S3 on b goes to S4; S3 on a goes back to S1 (curved arc below the states). S4 on a goes back to S3 (curved arc above the states); S4 on b goes back to S2 (curved arc below the states).
  1. (A) The set of all strings containing an even number of b's.
  2. (B) The set of all strings containing the pattern bab.
  3. (C) The set of all strings ending with the pattern bab.
  4. (D) The set of all strings not containing the pattern aba.
Answer

Answer (C)

Answer from the official GATE CS 2025 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes