Consider the following language:
Which one of the following deterministic finite automata accepts
View worked solution
Answer: D
To construct a Deterministic Finite Automaton (DFA) that accepts the language , we define states based on the longest suffix of the input processed so far that is also a prefix of :
- (Initial state): Suffix is (no progress towards ).
- : Suffix is .
- : Suffix is .
- (Final state): Suffix is .
Let us determine the transitions for each state:
- From : On , go to (progresses to ). On , stay at .
- From : On , stay at (the suffix is still ). On , go to (progresses to ).
- From : On , go to (the suffix becomes , whose longest matching prefix is ). On , go to (progresses to ).
- From : On , go to (the suffix becomes , whose longest matching prefix is ). On , go to (the suffix becomes , which has no prefix match).
This exact transition behavior is correctly represented by the DFA in Option D.
Free practice · Your answers on this page are not saved.
