CSCI 301 L26 Worksheet

Lecture 26 - Exercises

Part A - Closure Proof Sketch

  1. Given two DFAs \(M_A\) and \(M_B\) accepting languages \(A\) and \(B\), respectively, describe how to construct an NFA \(N\) for which \(L(N) = AB\).
  2. Given a DFA \(M_A\) accepting language \(A\), describe how to construct an NFA \(N\) for which \(L(N) = A^*\).
  3. Given a DFA \(M_A\), accepting language \(A\), describe how to construct an NFA \(N\) for which \(L(N) = \overline{A}\).
  4. Given two DFAs \(M_A\) and \(M_B\) accepting languages \(A\) and \(B\), respectively, describe how to construct an NFA \(N\) for which \(L(N) = A \cap B\).

Part B - Regular Expressions

  1. What language does each of the following regular expressions represent?

    1. \(ab\)
    2. \((a \cup b \cup \epsilon)\)
    3. \((ab \cup a)b\)
    4. \(a(a \cup b) \cup b(b \cup a)\)
    5. \(ab^*\)
    6. \((aa)^*\)
    7. \((ab)^* \cup b^*\)
    8. \((a^*b^*)^*\)
  2. Write a regular expression that describes each of the following languages over \(\Sigma = \{0, 1\}\):

    1. \(\{w : w \text{ contains at least three $1$'s}\}\)
    2. \(\{w : |w| \text{ is odd}\}\)
    3. \(\{w : \text{ every odd position in $w$ is $1$}\}\)
  3. Give a regular expression that describes the language accepted by the following DFA: