Problem: Comments
Problem: Comments
Give implementation-level descriptions of Turing machines that decide the following languages over the alphabet {0,1}.
Step-by-step solution
Step 1 of 3
Turing decidable: If some Turing machine decides the language then it is said to be Turing decidable.
a.
Given language is { contains an equal number of 0’s and 1’s} over the alphabet .
Let be the Turing machine that decides the language L. The implementation level description of is as follows:
” on input string :
Step 1:
Mark the first unmarked 0 by scanning the tape and mark it. If there are no unmarked 0, go to step 4. Else, move the head back to the front of the tape.
Step 2:
Mark the first unmarked 1 by scanning the tape and mark it. If there is no unmarked 1, then reject.
Step 3:
Place the head back to the front of the tape and repeat step 1.
Step 4:
Place the head back to the front of the tape and check if any unmarked 0’s or 1’s remain by scanning the tape. If there are none, accept else it is
unacceptable.
Comments (1)
Step 2 of 3
b.
Given language is { Contains twice as many 0’s as 1’s} over the alphabet .
Let be the machine that decides the language L. The implementation level description of M2 is as follows:
” on input w:
Step 1:
Scan the tape for the first unmarked 1, mark it. If there are no unmarked 1’s, and go to step 5. Else place the head at the start of the tape.
Step 2:
Scan the unmarked 0 is found in the tape and mark it. If there are no 0’s, reject.
Step 3:
Scan the tape again till the unmarked 0’s is said to be found and mark them. If there is no unmarked 0’s, reject.
Step 4:
Move the head back to the front of the tape and repeat step 1.
Step 5:
Place the head back to the front of the tape scan the tape to see if there are any unmarked 0’s are found. If none are found, then accept. Else, reject.
Comments (1)
Step 3 of 3
c.
Given language is { does not contain twice as many 0’s as 1’s} over the alphabet .
Let be the machine that decides the language L. The implementation level description of is as follows.
” on input w:
Step 1:
Scan the tape and mark the first unmarked 1, mark it. If there is no unmarked 1’s, go to stage 5. Else, place the head at the start of the tape.
Step 2:
Scan the tape till the unmarked 0’s are found and mark it. If there are no 0’s accept.
Step 3:
Scan the tape once again and marks the unmarked 0’s are found. If there are no 0’s, accept.
Step 4:
Place the head back to the front of the tape and repeat step 1.
Step 5:
Place the head back to the front of the tape. Scan the tape to see if there are unmarked 0’s. If there are none, reject. Else, accept.
Comments (3)