Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

28. Design TM subroutine (i.e., a fragment of a Turing Machine), shown as a state diagram, that returns the tape head from its current position

image text in transcribed

28. Design TM subroutine (i.e., a fragment of a Turing Machine), shown as a state diagram, that returns the tape head from its current position to the beginning of the tape, regardless of the contents of the tape or where the tape head was originally located. When finished, the contents of the tape must be identical to the contents when the subroutine is called. A subroutine can be shown as a machine that leaves the start symbol, performs some processing, and ends up at a single End symbol (which, when used in a larger implementation, would have an epsilon transition to the state that follows the call to the subroutine). As a subroutine, it is not required to have a halting state (though it is not prevented from having them, either). Assume that the tape alphabet includes marked and unmarked versions of every symbol and that no marked symbols are on the tape at the time this subroutine is called. Let x represent an unmarked symbol and x' represent the corresponding marked symbol. Hence a transition rule such as "x, x' > R" means that if any unmarked symbol is under the tape head, replace it with its marked counterpart and move the tape head to the right. Similarly, "X", x-> R" means that if the symbol under the tape head is marked, replace it with its unmarked version and then move the tape head to the right. Keep in mind that there is no special marker symbol at the left end of the tape - this subroutine has to function without relying on any such marker. 28. Design TM subroutine (i.e., a fragment of a Turing Machine), shown as a state diagram, that returns the tape head from its current position to the beginning of the tape, regardless of the contents of the tape or where the tape head was originally located. When finished, the contents of the tape must be identical to the contents when the subroutine is called. A subroutine can be shown as a machine that leaves the start symbol, performs some processing, and ends up at a single End symbol (which, when used in a larger implementation, would have an epsilon transition to the state that follows the call to the subroutine). As a subroutine, it is not required to have a halting state (though it is not prevented from having them, either). Assume that the tape alphabet includes marked and unmarked versions of every symbol and that no marked symbols are on the tape at the time this subroutine is called. Let x represent an unmarked symbol and x' represent the corresponding marked symbol. Hence a transition rule such as "x, x' > R" means that if any unmarked symbol is under the tape head, replace it with its marked counterpart and move the tape head to the right. Similarly, "X", x-> R" means that if the symbol under the tape head is marked, replace it with its unmarked version and then move the tape head to the right. Keep in mind that there is no special marker symbol at the left end of the tape - this subroutine has to function without relying on any such marker

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions