Given the language A w w contains twice as many 0s as 1s
Given the language A = { w | w contains twice as many 0s as 1s}:
a. What are the set definitions of and for the TM?
b. What is the Turing machine, M, that decides A? (i.e., sketch it.) [Hint: Before sketching the TM, it is best practice to write the implementationlevel description of it.]
Solution
Answer:
There are numerous approaches to make this thought exact. Here is one way. An enumerator is a 5-tuple (Q, , , , q introductory ), where , are generally limited sets and
1. Q is the arrangement of states
2. is the main tape letters in order; it contains clear however not #
3. is the letters in order, containing neither # nor clear, finished which the dialect to be .
created is characterized, and the second tape letters in order is \', which is together with # and clear
4. : Q x - >Q x x {L,R} x ((\' x {R}) U({} x {S})) is the change work
b) Qinitial Q is the begin state
At first the two tapes are clear and the machine is in state q beginning . Whenever (q,x) = (q\',y,D,z,M), if the machine is in state q and the primary tape head is perusing image x, at that point the machine enters state q\'; composes a y under the primary tape head; moves the first tape head left or ideal as indicated by bearing D; and if M=R it composes a z under the second tape head and moves the second tape head right. (Whenever M=R, no compose is performed on the second tape and the tape head does not move.)
A string w over the letter set is said to be produced by the machine if after a limited (however, subjectively substantial) number of steps the string #w# shows up on the second tape. The dialect produced by the machine is the arrangement of all strings created by the machine.