Similar questions 4 more →
Finite Automata


Answer & solution
Answer: Start q0, accept q3. On (a,b): q0→(q1,q0); q1→(q1,q2); q2→(q1,q3); q3→(q1,q0). (no official key was published)
Step through it (2 parts)
Use state qj to record the length j of the longest suffix of the input seen so far that is also a prefix of abb. The four represented suffixes are empty, a, ab, abb. Start at q0 and accept only q3. The transition table is:
State | a | b
q0 | q1 | q0
q1 | q1 | q2
q2 | q1 | q3
q3 | q1 | q0
For example, reading a after ab or abb leaves suffix a, while reading b after abb leaves no nonempty suffix that begins abb. This invariant proves that q3 is reached at end exactly for strings ending in abb. All transitions are defined and exactly four states are used.