CSCI 301 L18 Worksheet

Lecture 18 - Exercises

Part A - Alphabets, Strings, Languages

Let \(\Sigma = \{0, 1\}\) and \(A = \{a, b\}\) be two alphabets.

  1. \(1 \in \Sigma^*\)
  2. \(10 \in \Sigma^*\)
  3. \(\{1\} \in \Sigma^*\)
  4. \(\{1\}\) is a language over \(\Sigma\)
  5. \(\epsilon \in \Sigma\)
  6. \(\epsilon \in \Sigma^*\)
  7. \(101 \in (\Sigma \cup A)^*\)
  8. \(10ab \in (\Sigma \cup A)^*\)
  9. \(b \in (\Sigma - A)^*\)

Let \(S = \{\epsilon, 0, 1, 01, 11, 001, 011, 101, 111, \ldots\}\).

  1. Is \(S\) a language over \(\Sigma\)?
  2. Is \(S\) a language over \(A\)?
  3. Is \(S\) a language over \((\Sigma \cup A\))?

Part B - The Language Accepted by a FA

Consider again the following DFA over alphabet \(\Sigma = \{0,1\}\):

Which of the following strings are accepted by this machine?

  1. \(1\)

  2. \(00\)

  3. \(001\)

  4. \(10101\)

  5. \(100\)

  6. \(1000\)

  7. Describe (informally, in English) the language accepted by this machine.

Part C - Deterministic vs Nondeterministic

For each of the following FAs, state whether it is a DFA.

Part D - DFA Design

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

  1. \(L = \{ab, abab, ababab, \ldots\}\)
  2. \(L = \varnothing\)
  3. \(L = \{\epsilon\}\)

Draw a diagram for a DFA for each of the following languages over \(\Sigma = \{0, 1\}\):

  1. \(L = \{w : |w| \text{ is divisible by 3}\}\)
  2. \(L = \{w : w \text{ as a binary number is divisible by 4}\}\)