Question: We want to construct a Turing machine M = { , , Q , , q , q a c c e p t ,

We want to construct a Turing machine M={,,Q,,q,qaccept,qreject} with one tape, that accepts the language L={0n12n|n0}sube{0,1}** over the alphabet ={0,1}.
We assume that, at the start of the computation, the tape head is on the leftmost symbol of the input string.
The idea is as follows.
We check whether the leftmost symbol on the tape is 0. If so, we delete it and move the tape head to the rightmost symbol on the tape. If the leftmost symbol is 1, we
3/7
CS3240 Assignment 2
Yiming Zhao
reject.
We check whether the rightmost symbol is 1. If so, we delete it and move the tape head left by one cell. If this cell contains 1, we delete it and move the tape head back to the leftmost symbol and continue the above step. Otherwise, we reject.
We have tape alphabet ={0,1,} and set of states Q={q,qaccept,qreject,q0,q1,q2,q3}. Definitions of states are listed below.
q, the start state, the tape head is on the leftmost symbol of the input string.
qaccept, the accept state.
qreject, the reject state.
q0, we have deleted the leftmost 0 of the current string; the tape head is moving to the right.
q1, the tape head is at the rightmost symbol, and delete it if it is 1.
q2, we have deleted one symbol 1 from the right. The tape head is at the left neighbor of the original rightmost 1. We delete it if it is 1.
q3, we are moving the tape head to the leftmost symbol after deleting two 1 s from the right end of the current string on the tape.
The transition function is specified by the following instructions. But some instructions are missing. Please complete this machine by adding those missing transitions. Please just use the notation defined above.
q0q0R
q1qreject
q00q00R
q01q01R
q0q1L
q10qreject
q11q2L
q20qreject
q2qreject
q30q30L
q31q31L
q3qR
We want to construct a Turing machine M = { , , Q

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!