1 / 14

Formal Definition

Formal Definition. Definition . A Turing machine is a 5-tuple (S, , , s, H), where:. S is a set of states  is an alphabet It must contain  and . It cannot contain  or  s  S is the initial state H  S is the set of halting states. Formal Definition (II).

joy
Download Presentation

Formal Definition

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. Formal Definition Definition. A Turing machine is a 5-tuple (S, , , s, H), where: • S is a set of states •  is an alphabet It must contain  and . It cannot contain  or  • s  S is the initial state • H  S is the set of halting states

  2. Formal Definition (II) •  is a collection of transitions defined by the function: •  maps ((S-H)  ) into (S  (  (, })) • such that: • For any q  S – H, then for some p  S • 1.1 (q, ) = (p,), or • 1.2 (q, ) = (p, ) • There cannot be any p, q  S and α   – {} such that (p, α) = (q, ) Very simple definition but very useful precisely because of its simplicity!

  3. a a   a      • S = {s,q,h} • ={a, , } H = {h} (S, , , s, H) The “Eraser” TM Construct a Turing machine that receives as input a substring of a’s and replace each a for a blank space, 

  4. ((s, ),(q,)) What does this Turing machine do? Another Example • = { ((s, ),(s,)), ((s,a),(q, )), ((q, ),(s, )), ((s, ),(h, )), ((q,a),(q,a)), ((q, ), (q, a)) }

  5. ? ? ? ?   ? ? ? ? 1 0 ? ?   ? ? ? ? The Turing Machine M0 The Turing Machines M1 and M0 The Turing Machine M1

  6. ? ? ? ?   ? ? 1 0 0 1 ? ?   ? ? ? ? The Turing Machine Mx

  7. q: state, w: word (q,w) q: state, w: word : stack (q,w,) Configuration for Previous Machines Machine Configuration Explanation Finite automata Pushdown automata

  8. (q,h,LS,RS) • The current state, q • The symbol pointed by the head, h • The string left of the head, LS • The string right of the head, RS Configuration for Turing Machines Configuration:

  9. Configuration for Turing Machines (2) Instead of writing: (q,h,LS,RS), we write: (q,LShRS) If q  H, then (q,LShRS) is called a halting configuration Examples: - Initial configuration with 3 a’s for the eraser TM: (s,eaaa) - Final configuration starting with (s,eaaa): (s,) - Final configuration of M1with (s,aab): (s,1ab)

  10. C yields C’, written C * C’: There is a sequence of configurations:     C C0 C1 … C’ Computation in Turing Machines A configuration C1 = (q1,LS1h1RS1) yields a configuration C2 = (q2,LS2h2RS2) in one step, written C1 C2, if:  • There is a transition ((q1, h1),(q2,A)) in  • C2 is obtained after applying ((q, h1),(q2,A)) to C1 (there are 3 cases for A: a in ∑, , or )

  11. Example of Computation (s,eaaa) yields (h,e) written (s,eaaa) * (h,e) 

  12. Example of Computation (2) Consider the following Turing machine: ((s, ),(h, )) ((s,a),(q,b)) ((s,b),(q,a)) ((q,a),(s,)) ((q,b),(s,)) ((q, ),(q, )) ((s, ),(s,)) ((q, ),(s,)) - Trace the machine when starting with configuration (s,abbabba) - Describe what this machine does

  13. 1 ?  ? ? 0 ?  ? ? Another Turing Machine The (ab)* Turing Machine: a b  a b a b  a a

  14. Homework • Please provide a secret nickname so we can post your grades on the course’s web site • 4.1 a), b) • 4.2 • Construct a Turing machine that “reads” the character in the current cell and copies it into the contiguous cell immediately to the right of the current one (if the character in the current cell is , the machine does not terminate). For example if the starting configuration is: (s, abaa), then the halting configuration is: (h, abba), where h is a halting state • Construct the Turing machine that recognizes (ab)* (See Slide # 13)

More Related