Note that for any symbol a ∈ Σ and any string w ∈ Σ*, we define n(a, w) to be the number of occurrences of a in w. For problems 2, 4, and 5, assume the alphabet Σ = {0, 1}.
1. [20 points] Do Problem 0.11 on page 27 by following these three steps in order.
2. [20 points] Let M be a DFA that accepts the language { w : string w does not contain 010 as a substring }. Also, let q0 be the start state of M.
3. [20 points] Choose the alpabet Σ = { *, 0, 1, 2 }. Let L be the language over Σ consiststing of words w with property described by this python pseudocode:
for each position i of w:
if i is divisible by 6:
wi = 2
elif i is divisible by 3:
wi = 1
elif i is divisible by 2:
wi = 0
else:
wi = *
Example strings in the language are ε, *, *0, *01, *010, *010*, *010*2.
Design a DFA M that recognizes L.
Your answer should be a transition diagram for M.
4. [20 points] Draw a transition diagram of an NFA that accepts the language { w : w does not begin with 01 }. Your diagram must not qualify as a DFA.
5. [20 points] Draw a transition diagram of an NFA that accepts the language { w : if w begins with 01 then it doesn't end with 10 }.
Extra credit: Problem 1.34 on page 89.