Consider the set of strings on in which, every substring of symbols has at most two zeros. For example, and are in the language, but is not. All strings of length less than are also in the language. A partially completed DFA that accepts this language is shown below.

The missing arcs in the DFA are:
View worked solution
Answer: D
In this DFA, each non-trap state represents the last two symbols read from the input string. The state acts as the dead (trap) state, which is reached if three consecutive zeros () are detected.
We can determine the missing transitions by tracking the last two symbols after reading a new input symbol:
- From state :
- Reading results in (invalid), so it must transition to the trap state . Thus, .
- Reading results in the last two symbols being , so it transitions to state . Thus, .
- From state :
- Reading results in the last two symbols being , so it transitions to state . Thus, .
- From state :
- Reading results in the last two symbols being , so it transitions to state . Thus, .
- From state :
- Reading results in the last two symbols being , so it transitions to state . Thus, .
Matching these transitions with the given tables where rows represent the source states, columns represent the destination states, and cell values represent the input symbols, we find that Option D is the correct transition table.
Free practice · Your answers on this page are not saved.
