简体   繁体   中英

Describing the action of a Turing Machine

I'm trying to answer the third part to the following question:

在此处输入图片说明

I have drawn the following state diagram:

在此处输入图片说明

According to the solution, the machine "adds 1 to a binary number with its least significant bit in the leftmost position on the tape". I am unsure what this means and can't see why it is the case.

With input 111, the Turing machine outputs 0001. In this case, the solution mentioned above would imply that the machine adds 1 to 111 since its least significant bit, 1 (?), is in the leftmost position on the tape. However this would give 1000. If the solution is correct then it must imply 000 +1 but I don't see how this is the case?

How do I reason about this Turing machine?

The turning machine performs binary addition. The numbers are just written with the LSB in the left most position (Ie backwards). So 111 == 1110 not 0111, and 111 + 1 == 0001 not 1000.

In q0 tape head is on 0 (or is empty) then it simply replaces the 0 with a 1 goes to the end of tape and accepts. This clearly adds 1.

In q0 if tape contains a 1 we replace that 1 with a 0. The transition from q2 to q2 carries the 1. The transitions from q2 to q3 and q2 to q1 "end" the carrying operation (your diagram is missing a transition from q2 to q3 of the form _;1,R).

So the answer is correct.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM