CSCI 301 L24 Worksheet

Lecture 24 - Exercises

Part A - The Language Accepted by an NFA

Consider the following NFA over alphabet \(\Sigma = \{a,b\}\):

nfa

Which of the following strings are accepted by this machine?

  1. aab
  2. bbb
  3. bab
  4. aaa
  5. abaa
  6. abbb
  7. aaaab
  8. Describe (informally, in English) the language accepted by this machine.

Part B - NFA Design

Draw a diagram for an NFA that accepts each of the following languages over the alphabet \(\{a, b\}\).

  1. \(L = \{a\}\)
  2. \(L = \{w : w \text{ ends with } ab\}\)
  3. \(L = \{w : w \text{ contains an odd number of $a$'s or exactly two $b$'s}\}\)