This exercise comes from Introduction to Automata Theory, Languages, and Computation, Second Edition, by Hopcroft, Motwani and Ullman.

Exercise Description

Give DFA's accepting the following languages over the alphabet latex2png equation.

  1. The set of all strings ending in 00.
  2. The set of all strings with three consecutive 0's (not necessarily at the end).
  3. The set of strings with 011 as a substring.

Solution

1)

The finite automaton implementing this language is defined by:

latex2png equation

where,

  • latex2png equation
  • latex2png equation
  • latex2png equation

The transition function latex2png equation is defined by the following transition diagram:

latex2png equation

2)

The finite automaton implementing this language is defined by:

latex2png equation

where,

  • latex2png equation
  • latex2png equation
  • latex2png equation

The transition function latex2png equation is defined by the following transition diagram:

latex2png equation

3)

The finite automaton implementing this language is defined by:

latex2png equation

where,

  • latex2png equation
  • latex2png equation
  • latex2png equation

The transition function latex2png equation is defined by the following transition diagram:

latex2png equation