<p>DFA demonstrating a finite automaton based search for the word "mommy". Whenever the final state (double-circled) is reached a match has been found. All transitions that are not specified return to the initial state in the upper left.
</p>
To see why it needs to be so complicated, just trace its behavior for the string "MMOMOMMOMMY".
No machine-readable author provided. <a href="//commons.wikimedia.org/wiki/User:Dcoetzee" title="User:Dcoetzee">Dcoetzee</a> assumed (based on copyright claims).
No machine-readable source provided. Own work assumed (based on copyright claims).