Similar questions 4 more →
Finite Automata

Answer & solution
Official answer: D
Label the four states by the longest suffix matching a prefix of 011: ε, 0, 01, 011. Their transitions on(0, 1) are respectively(0,ε),(0, 01),(0, 011),(0,ε). Only the 011 state accepts. These transitions are exactly D. A wrongly accepts 0111, B keeps accepting after arbitrary suffixes, and C accepts 01111 despite its final three symbols being 111.
The invariant is that the state remembers the longest suffix of the input that is also a prefix of the target 011. After reading 0111 there is no nonempty suffix that is such a prefix, so the accepting state's 1-transition must return to q0. After reading 0110, the suffix 0 remains useful, so its 0-transition must go to q1. These two checks distinguish D from the three other diagrams while the invariant proves correctness for arbitrary input lengths.