1 / 29

COSC 3340: Introduction to Theory of Computation

COSC 3340: Introduction to Theory of Computation. University of Houston Dr. Verma Lecture 16. Turing Machine ( TM ). Bi-direction Read/Write. Finite State control. Turing Machine (contd.).

hafwen
Download Presentation

COSC 3340: Introduction to Theory of Computation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 16 UofH - COSC 3340 - Dr. Verma

  2. Turing Machine (TM) . . . Bi-direction Read/Write Finite State control UofH - COSC 3340 - Dr. Verma

  3. Turing Machine (contd.) • Based on (q, ), q – current state, – symbol scanned by head, in one move, the TM can: (i) change state (ii) write a symbol in the scanned cell (iii) move the head one cell to the left or right • Some (q, ) combinations may not have any moves. In this case the machine halts. UofH - COSC 3340 - Dr. Verma

  4. Turing Machine (contd.) • We can design TM’s for computing functions from strings to strings • We can design TM’s to decide languages • using special states accept/reject or by writing Y/N on tape. • We can design TM’s to accept languages. • if TMhalts string is accepted Note: there is a big difference between language decision and acceptance! UofH - COSC 3340 - Dr. Verma

  5. Example of TM for {0n1n | n> 0} • English description of how the machine works: • Look for 0’s • If 0 found, change it to x and move right, else reject • Scan past 0’s and y’s until you reach 1 • If 1 found, change it to y and move left, else reject. • Move left scanning past 0’s and y’s • If x found move right • If 0 found, loop back to step 2. • If 0 not found, scan past y’s and accept. Head is on the left or start of the string. x and yare just variables to keep track of equality UofH - COSC 3340 - Dr. Verma

  6. Example of TM for {0n1n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma

  7. Example of TM for {0n1n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma

  8. Example of TM for {0n1n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma

  9. Example of TM for {0n1n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma

  10. Example of TM for {0n1n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma

  11. Example of TM for {0n1n | n > 0} contd. UofH - COSC 3340 - Dr. Verma

  12. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  13. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  14. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  15. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  16. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  17. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  18. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  19. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  20. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  21. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  22. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  23. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  24. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  25. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  26. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  27. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  28. JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma

  29. Formal Definition of TM • Formally a TMM = (Q, , , , s) where, • Q – a finite set of states • – input alphabet not containing the blank symbol # • – the tape alphabet of M • s in Q is the start state •  : Q X Q X  X {L, R} is the (partial) transition function. • Note: (i) We leave out special states. (ii) The model is deterministic but we just say TM instead of DTM. UofH - COSC 3340 - Dr. Verma

More Related