variations of turing machines
play

Variations of Turing Machines We show that changing the model, - PowerPoint PPT Presentation

Variations of Turing Machines We show that changing the model, making it less or more restrictive, does not change the power of a TM. TMs as Transducers A TM that perform calculations is a transducer . It leaves the answer on the tape. For


  1. Variations of Turing Machines We show that changing the model, making it less or more restrictive, does not change the power of a TM.

  2. TMs as Transducers A TM that perform calculations is a transducer . It leaves the answer on the tape. For example, a TM that starts with $ i #$ j on tape and ends with $ ij does multiplication. Goddard 12: 2

  3. Example: Unary Halving A TM that treats input as unary number and divides it by 2. Goddard 12: 3

  4. Example: Unary Halving It changes first symbol to another symbol, and then deletes the last symbol. And repeats. (At end, we should revert new symbol to old.) 0$R q 1 q 2 00R ∆∆ S ∆∆ L h a $$R $ ∆ S q 4 q 3 00L 0 ∆ L Goddard 12: 4

  5. A T-computable Function A function f that converts strings into strings is T-computable if some TM M computes it. That is, M always halts, and on input w , M halts with f ( w ) on its tape. Goddard 12: 5

  6. Variations on the Model The definition of a Turing Machine is robust: Many variations do not alter its power. The general idea is: • If capability is added, then show that stan- dard TM can simulate it. • If capability is removed, then show that crip- pled TM can simulate standard one. Goddard 12: 6

  7. Example: Omitting Stay-In-Place Option For example, suppose we force TM to move its head each time. Well, one can achieve the net effect of stay-in- place by moving the head off the cell and imme- diately moving it back! How does one ensure the head moves back? Goddard 12: 7

  8. How Does One Ensure Head Moves Back? Move to new intermediate state! For example, transition δ ( q, 0 ) = ( r, 1 , S ) becomes δ ( q, 0 ) = ( x, 1 , L ) , and δ ( x, ANY ) = ( r, R, ANY ) , where x is new state: 01S q r becomes 00R , 11R 01L q x r Goddard 12: 8

  9. Example: Medusa Call a multi-headed TM the Medusa . A standard TM can simulate the Medusa by stor- ing the location of the Medusa’s heads. For ex- ample, the standard TM could represent each Medusan head by a new symbol # 1 , # 2 , etc.: 2 1 becomes # 2 # 1 1 0 0 1 0 1 1 1 0 0 1 0 1 1 Goddard 12: 9

  10. Example: Medusa Simulation To simulate a step of the Medusa, the standard TM sweeps along its tape, finds each Medusan head, and updates it. Note that the important thing is simulation, not the number of steps. Goddard 12: 10

  11. Multiple Tracks A 2-track TM is one where there are two sym- bols in each cell, an upper one and a lower one. One way to simulate this, is to create a new al- phabet: each letter of the alphabet represents a pair of symbols. control ∆ ∆ 0 0 1 ∆ ∆ 0 1 ∆ ∆ ∆ ∆ ∆ Goddard 12: 11

  12. Multiple Tapes A TM with multiple tapes has the same power as a standard TM. 0 0 1 ∆ ∆ ∆ ∆ control 0 1 ∆ ∆ ∆ ∆ ∆ One approach is to convert a multitape TM to a multitrack TM, storing the positions of the heads as in the Medusa. Goddard 12: 12

  13. Nondeterminism Nondeterminism means that the TM may have more than one choice of action. As usual, a nondeterministic TM (or NTM ) accepts a string if some choice of actions lead to the accept state. Theorem. A nondeterministic TM has the same power as a standard TM. Goddard 12: 13

  14. Proof Idea We show that the NTM can be simulated by a de- terministic one. Well, we try all possible choices! We need the concept of configuration . This is a record of the complete status of a TM: its state, tape contents, and head position. (Note only fi- nite portion of tape is used at any stage.) Goddard 12: 14

  15. Proof of Theorem We view the calculations of NTM as a tree . The nodes are the configurations of the NTM, and the children of a node are the possible next steps. The NTM accepts the input if there is a branch that leads to an accepting configuration. The simulator does breadth-first-search of tree. Goddard 12: 15

  16. A TM Can Simulate a Computer At first, a TM appears primitive. But one can show that one can use the first tape as random access memory , as in a normal computer, if second tape has address. Further, one can show that one can translate any program for a normal computer into a pro- gram for a TM: Fact. A Turing Machine can simulate a real computer. Goddard 12: 16

  17. Church’s Thesis Several models of computation have been pro- posed over the years, but they have exactly the same power as a TM as recognizers: Church’s “thesis” is the belief/claim that the model is appropriate and has all the power of any computer we might build. Church’s thesis. There is an “effective proce- dure” for a problem if and only if there is a TM for the problem. Goddard 12: 17

  18. Universal TMs A universal TM is a TM that takes another TM as an input. For this, one needs to specify an encoding of a TM. Universal TMs have been de- vised with surprisingly few states. Goddard 12: 18

  19. Related Models The exercises consider connections between TMs and other machines, including ones with multi- ple stacks or ones with a queue. Goddard 12: 19

  20. Practice 1 Draw a TM that erases all instances of a cer- tain symbol from the input. Say the alphabet is { 0 , 1 } and the TM erases all 1 ’s. For example, if input is 10101100 , output is 0000 . Goddard 12: 20

  21. Solutions to Practice 1 The idea is to move each 0 to the left; then erase the 1 ’s. h a 00S , ∆∆ S ∆∆ S 00R 11R ∆∆ L 11R 01L 1 ∆ L 10R 11L 00R , ∆∆ R Goddard 12: 21

  22. Practice 2 A Jittery TM is one that always writes a different symbol to the one it has just read. Show that a Jittery TM can simulate a standard TM. Goddard 12: 22

  23. Solutions to Practice 2 For each symbol in Γ , add a copy. Then for each move of the standard TM, the Jittery TM makes two moves: it first writes the duplicate symbol, staying put but going to a temporary state; then it writes the real symbol and moves to the cor- rect state. For example, the transition δ ( q, 0 ) = ( r, 0 , L ) be- comes δ ( q, 0 ) = ( q ′ , 0 ′ , S ) and δ ( q ′ , 0 ′ ) = ( r, 0 , L ) . Goddard 12: 23

  24. Summary A normal TM can simulate a TM with a one- way infinite tape, with multiple tapes, and so forth. A nondeterministic TM is no more pow- erful than a normal one. Church’s thesis says that there is an algorithm for a problem if and only if there is a TM for it. A TM can simulate a normal computer. A universal TM is one that can execute any other TM as an input. Goddard 12: 24

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend