DFA short exercise
Construct a DFA for each of the following languages.
In each case, let the alphabet be {a, b}.
- Strings that have exactly one a
- Strings that have no more than three as.
- Strings that have at least one a and exactly two bs.
- Strings that have an odd number of as and an
even number of bs.
(Remember that 0 is an even number.)
- Strings that have both ab and ba as substrings.
(Make sure that your DFA will accept a string like aaaabaaa;
ab and ba are both substrings, even though they overlap.)
These exercises are taken from Lewis and Papadimitriou,
Elements of the Theory of Computation, Prentice Hall, 1998.
There's a copy in the CSCI 335 library.
Last modified: Thu Mar 31 16:18:12 CDT 2011