Homework 1

Due Date: Feb 16, 2010

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.

  1. State the statement in the proof that is invalid. If the proof contains more than one invalid statement, choose the first one.
  2. The invalid statement shows that the author of the proof is assuming an unstated truth (theorem). State this assumed “truth” precisely.
  3. Show why this assumption is wrong.

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.

  1. Give an example string w satisfying all these properties:
    1. |w| = 5
    2. M rejects w
    3. n(0, w) - n(1, w) = 1 or -1
  2. Draw the transition diagram for M
  3. Give the transition table for M
  4. Compute δ-hat(q0, 0010). Show all steps.

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.