[25 Points]
Build a Turing Machine to accept the language from the previous problem:
L = { w | w contains only 0's and the length of w is a power of 2 }.
Although it is not regular, it is decidable. That is to say, there is a Turing machine that accepts it.
We highly recommend spending some time thinking
about this problem and sketching a solution on paper before using JFLAP.
If you design the Turing Machine carefully, you can build it using fewer
than nine states.
Save your Turing Machine in a file called
part1_2.jff.
- To create a turing machine, when you start JFLAP (by typing java JFLAP) you should
select Turing Machine from the JFLAP window.
Make sure to read the instructions on Turing Machines
in the Help menu.
- Notice that the transitions are of the form Read, Write,
Move. If you leave the Read or Write value alone (it will show a lambda
initially) it will mean read or write a blank (which is what the
tape is made up of, with the exception of the input). The
lambda will disappear and the blank will be displayed by a square.
-
You can assume that the input will be a single, contiguous block of all 0s.
Also, you may assume that
if there are any 0s on the turing machine's tape, that
the read/write head starts at the leftmost zero. Remember that there may be zero 0s!
- Remember that Turing Machines can write any symbols they like
on the tape. Your Turing Machine may need to write symbols other
than 0. Any symbol on your keyboard is a valid symbol to
write. Try not to use too many different types of symbols as this gets
confusing.
- JFLAP allows you to specify
multiple states as accepting states and doesn't have an explicit
rejecting state. However, your machine should have exactly one accepting
state. In order to have a rejecting state, simply make a state
that doesn't have any transition rules coming out of it. If you
end up in this state, JFLAP will reject the input.