1 / 99

Turing Machines

Turing Machines. The Language Hierarchy. ?. ?. Context-Free Languages. Regular Languages. Languages accepted by Turing Machines. Context-Free Languages. Regular Languages. A Turing Machine. Tape. Read-Write head. Control Unit. The Tape. No boundaries -- infinite length.

ivab
Download Presentation

Turing Machines

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. Turing Machines COMP 335

  2. The Language Hierarchy ? ? Context-Free Languages Regular Languages COMP 335

  3. Languages accepted by Turing Machines Context-Free Languages Regular Languages COMP 335

  4. A Turing Machine Tape ...... ...... Read-Write head Control Unit COMP 335

  5. The Tape No boundaries -- infinite length ...... ...... Read-Write head The head moves Left or Right COMP 335

  6. ...... ...... Read-Write head The head at each time step: 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right COMP 335

  7. Example: Time 0 ...... ...... Time 1 ...... ...... 1. Reads 2. Writes 3. Moves Left COMP 335

  8. Time 1 ...... ...... Time 2 ...... ...... 1. Reads 2. Writes 3. Moves Right COMP 335

  9. The Input String Input string Blank symbol ...... ...... head Head starts at the leftmost position of the input string COMP 335

  10. Input string Blank symbol ...... ...... head Remark: the input string is never empty COMP 335

  11. States & Transitions Write Read Move Left Move Right COMP 335

  12. Example: Time 1 ...... ...... current state COMP 335

  13. Time 1 ...... ...... Time 2 ...... ...... COMP 335

  14. Example: Time 1 ...... ...... Time 2 ...... ...... COMP 335

  15. Example: Time 1 ...... ...... Time 2 ...... ...... COMP 335

  16. Determinism Turing Machines are deterministic Not Allowed Allowed No lambda transitions allowed COMP 335

  17. Partial Transition Function Example: ...... ...... Allowed: No transition for input symbol COMP 335

  18. Halting The machine haltsif there are no possible transitions to follow COMP 335

  19. Example: ...... ...... No possible transition HALT!!! COMP 335

  20. Final States Allowed Not Allowed • Final states have no outgoing transitions • In a final state the machine halts COMP 335

  21. Acceptance If machine halts in a final state Accept Input If machine halts in a non-final state or If machine enters an infinite loop Reject Input COMP 335

  22. Turing Machine Example A Turing machine that accepts the language: COMP 335

  23. Time 0 COMP 335

  24. Time 1 COMP 335

  25. Time 2 COMP 335

  26. Time 3 COMP 335

  27. Time 4 Halt & Accept COMP 335

  28. Rejection Example Time 0 COMP 335

  29. Time 1 No possible Transition Halt & Reject COMP 335

  30. Infinite Loop Example COMP 335

  31. Time 0 COMP 335

  32. Time 1 COMP 335

  33. Time 2 COMP 335

  34. Time 2 Time 3 Infinite loop Time 4 Time 5 COMP 335

  35. Because of the infinite loop: • The final state cannot be reached • The machine never halts • The input is not accepted COMP 335

  36. Another Turing Machine Example Turing machine for the language COMP 335

  37. Time 0 COMP 335

  38. Time 1 COMP 335

  39. Time 2 COMP 335

  40. Time 3 COMP 335

  41. Time 4 COMP 335

  42. Time 5 COMP 335

  43. Time 6 COMP 335

  44. Time 7 COMP 335

  45. Time 8 COMP 335

  46. Time 9 COMP 335

  47. Time 10 COMP 335

  48. Time 11 COMP 335

  49. Time 12 COMP 335

  50. Time 13 Halt & Accept COMP 335

More Related