1 / 88

Turing Machine

Turing Machine. CSE-501 Formal Language & Automata Theory Aug-Dec,2010. ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala. The Language Hierarchy. ?. ?. Context-Free Languages. Regular Languages. Languages accepted by Turing Machines. Context-Free Languages.

roddy
Télécharger la présentation

Turing Machine

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 Machine CSE-501 Formal Language & Automata Theory Aug-Dec,2010 ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala

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

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

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

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

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

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

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

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

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

  11. States & Transitions Write Read Move Left Move Right

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

  13. Time 1 ...... ...... Time 2 ...... ......

  14. Example: Time 1 ...... ...... Time 2 ...... ......

  15. Example: Time 1 ...... ...... Time 2 ...... ......

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

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

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

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

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

  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

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

  23. Time 0

  24. Time 1

  25. Time 2

  26. Time 3

  27. Time 4 Halt & Accept

  28. Rejection Example Time 0

  29. Time 1 No possible Transition Halt & Reject

  30. Infinite Loop Example A Turing machine for language

  31. Time 0

  32. Time 1

  33. Time 2

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

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

  36. Formal Definitionsfor Turing Machines

  37. Transition Function

  38. Transition Function

  39. Turing Machine: Input alphabet Tape alphabet States Transition function Final states Initial state blank

  40. Configuration Instantaneous description:

  41. Time 4 Time 5 A Move:

  42. Time 4 Time 5 Time 6 Time 7

  43. Equivalent notation:

  44. Initial configuration: Input string

  45. The Accepted Language For any Turing Machine Initial state Final state

  46. Standard Turing Machine The machine we described is the standard: • Deterministic • Infinite tape in both directions • Tape is the input/output file

  47. Computing FunctionswithTuring Machines

  48. A function has: Result Region: Domain:

  49. A function may have many parameters: Example: Addition function

  50. We prefer unary representation: easier to manipulate with Turing machines Integer Domain Decimal: 5 Binary: 101 Unary: 11111

More Related