CMPSCI 250: Introduction to Computation

David Mix Barrington

Spring, 2005

Homework #8 Questions and Answers

Question 8.2, 10 May 2005

Problem 9.8.5 makes no sense to me. The construction of the section is to turn a regular expression into a λ-NFA, but you say to use code for the DFA class. How are we supposed to make a λ-NFA?

You are right, the question is not sensible given only what I have given you, so forget about it. I should have defined some sort of NFA and λ-NFA classes, sorry.

Question 8.1, 6 May 2005

In lecture today you identified a mistake in Figure 10-3 on page 10-6, in that state 3 in the DFA has no a-arrow. Where should the a-arrow go?

It should go to state 1. In the next to last bullet on page 10-5, it is explained that the input bba is rejected, but has the same effect as the string ba. So bba should take D to the same state as does state ba, which is state 1. To formally prove that the corrected D has the same language as the 2WDFA M, we would have to verify all eight arrows as is done for the a-arrow for state 1 at the top of tage 10-6. We can verify the a-arrow from state 3 to state 1 as follows. If δ*(1,w) = 3, then on input w, M goes off the right end of the string in state ι. So on input wa, it eventually enters the final a in state ι, whereupon it moves left and stays in state ι. It is now on the last letter of w, which must be a b since only a b could have brought D into state 3. On this b, M moves right (onto the final a) and goes to state p. It then moves off the string to the right, rejecting because it changes to state ι as it does so. Rejected strings wa with final letter a should have δ*(1,wa) = 1, so the arrow to state 1 is correct.

Last modified 10 May 2005