
Correct : c
Labelling the states left to right as q0 (start), q1, q2, q3 (accepting), the transitions from the image are:
q0: a→q0, b→q1
q1: b→q1, a→q2
q2: a→q0, b→q3
q3: a→q2, b→q1
Option A — False
"bb" has 2 b''s (even) but traces q0→q1→q1, ending in q1 which is not accepting. DFA does not accept all strings with even number of b''s.
Option B — False
"babb" contains "bab" but traces q0→q1→q2→q3→q1, ending in q1 which is not accepting. DFA does not accept all strings containing "bab".
Option C — True
The DFA precisely tracks whether the last three characters form "bab". State q1 means the suffix so far ends in b, q2 means it ends in ba, q3 means it ends in bab (accepting). The DFA resets appropriately on mismatches. All strings ending with "bab" are accepted and nothing else is — the accepting state q3 is only reached when the last three characters read were exactly b, a, b.
Option D — False
"b" does not contain "aba" but traces q0→q1, not accepting. The DFA rejects "b" so it cannot be accepting all strings not containing "aba".
Correct answer: C
Similar Questions
Total Unique Visitors