CS 154 (Section 1): Formal Languages and Computability, Spring 2008

Homework for 3/22, due 4/3

This homework should be done individually! Here, I want you to get familiar with the JFLAP software. I believe that it is a useful tool for learning the material, but it does have some quirks: for instance, a machine is considered a DFA as long as a machine can never be in more than one state. That is, there can be a state with no outgoing arrow for some character in the alphabet, where a string could "fall off" the machine if it gets that character in that state, rather than requiring a trap/garbage state. Anyway, I still think it is useful, especially later in the course for Turing machines, and it is better to get familiar with it now.

I will probably assign additional homework on the first day after spring break. We are quite far behind in material, and I would like to make sure that we still have time to get to the most interesting parts of the course. If possible, you should basically try to have this assignment completed by 4/1, to be ready for the next assignment, but I didn't want to force people over the break to have something the first day back. Instead, if you decide to do this work the last days before it is due, you may have to "double up" with another homework, also due 4/3. I give you this option, but of course doing one at a time would be easier.

  1. Email me, with subject line "CS154Spring2008 enroll". In the body of your email should be your name, and preferred email address.
  2. Download JFLAP from the link at the bottom of our main page, if you haven't already. You should get JFLAP 6.2.
  3. Download this machine. Run your JFLAP file, and then open this file from JFLAP, and minimize the given machine using JFLAP. The notation here is a bit different than the marking algorithm of the book. Of course, you can force JFLAP to just give you the final answer, but it is more useful to step through, breaking the groups of nodes apart as you find characters which distinguish the nodes. Give a screen shot of the partitioned states, as well as the final machine.
  4. Do Problem 3.2: 1 from the book, again using JFLAP. (You write the regular expression into JFLAP, and then Convert/Convert to NFA.) Rather than JFLAP building up from small parts as we did in class, it starts with one big part and breaks it down into smaller parts. Again, here you can have JFLAP do the problem for you, but it is only helpful if you do the problem yourself. Also, use the leftmost tool to move states around so that all transitions are visible. Again, include a screen shot of your solution.
  5. Problem 3.2: 9, again using JFLAP. Here, be sure to enter multiple transitions over one link as multiple links, which will then be combined by JFLAP. You can enter the * just as text. JFLAP will give some directions on what to do at each point in time, follow them. As usual, JFLAP will just do it all for you if you like, but you won't gain any knowledge from that. The biggest difference between JFLAP and what we saw in class: JFLAP expects you to have transitions from every vertex (including the final state) to every vertex (including the start state), which will result in the final machine requiring one more step to get to a regular expression.

    Pay special attention to when you get to the "collapse state" phase, which will allow you to highlight, in your diagram, which of the in/out transitions to the collapsed state are being eliminated. Give a printout of (a) the final machine and (b) the regular expression. Also: taking the final machine that you get, if you replace the empty set link by a link labeled "c", what regular expression would you get?

  6. Problem 3.3: 1, with JFLAP. Note, JFLAP allows strings on transitions, rather than just letters (not standard), so here, there will be just one string per transition, with no extra states needed to cover strings of length more than one. THIS IS NOT STANDARD, and makes the process slightly easier, but I still think it is helpful for the exercise. Print out your final machine.
  7. Give a right linear grammar for the machine in the 3rd problem.