1 / 4

80 likes | 325 Vues

Turing Machine Example. 2 n. A TM M that recognizes the language: L = {0 | n ≥ 0 } PSEUDOCODE Sweep the input string from left to right, cross out every other 0 (cuts the number of 0s in half). If in step 1, the tape had only one 0 , accept .

Télécharger la présentation
## Turing Machine Example

**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

**Turing Machine Example**2n • A TM M that recognizes the language: L = {0 | n ≥ 0 } PSEUDOCODE • Sweep the input string from left to right, cross out every other 0 (cuts the number of 0s in half). • If in step 1, the tape had only one 0, accept. • Else if the tape had an odd number of 0’s, reject. • Move the head back to the first input symbol. • Go to step 1.**Formal description of the M recognize L**• M = (Q, Σ, Γ, , q0, qaccept, qreject) where: • Q = {q0, q1, q2, q3, q4, qaccept, qreject } • Σ = {0} • Γ = {0, x} • is described by the diagram in the next slides • The start , accept, reject states are q0, qaccept, and qreject respectively**State transition diagram of M**x/x, L 0/0, L The symbol “x” is used to cross out symbols. q2 /,R /,L x/x, R x/x, R q0 q1 q3 0/x, R 0/, R x/x, R /, R 0/x, R 0/0, R /, R qaccept qreject q4 x/x, R /, R**Example run on input “0000”:**q00000 q1000 xq300 x0q40x0xq3 x0q2xxq20xq2x0x q2x0x q1x0xxq10xxxq3x xxxq3 xxq2xxq2xxq2xxx q2xxx q1xxxxq1xxxxq1xxxxq1xxxqaccept References: http://www.cs.sunysb.edu/~cse350/slides/turing2.pdf http://www.cs.cmu.edu/~emc/flac09/lectures/Lecture8x.ppt http://www.cs.cmu.edu/~emc/flac09/lectures/Lecture9x.ppt

More Related