CSCI 301 L20 Worksheet

Lecture 20 - Exercises

Part 0x40 - From Last Time

Design a DFA that accepts each of the following languages over \(\Sigma = \{0, 1\}\).

  1. \(L = \{w : |w| \text{ is even}\}\)

  2. \(L = \{w : w \text{ ends with a $1$}\}\)

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}\}\)