Presentation is loading. Please wait.

Presentation is loading. Please wait.

Turing machines Sipser 2.3 and 3.1 (pages 123-144)

Similar presentations


Presentation on theme: "Turing machines Sipser 2.3 and 3.1 (pages 123-144)"— Presentation transcript:

1 Turing machines Sipser 2.3 and 3.1 (pages 123-144)

2 CS 311 Fall 2008 2 A Context-free Grammar for {a n b n c n | n ≥ 0} ? Theorem 2.34 (Pumping lemma for CFLs): If A is a CFL, then there is a number p where, if s is any string in A of length ≥ p, then s = uvxyz such that: 1.For each i ≥ 0, uv i xy i z ∈ A, 2.|vy| > 0, and 3.|vxy| ≤ p

3 CS 311 Fall 2008 3 Proof idea Surgery on parse trees

4 CS 311 Fall 2008 4 So… Is {a n b n c n | n ≥ 0} a CFL?

5 CS 311 Fall 2008 5 Chomsky hierarchy Context-free languages Regular languages 0n1n0n1n anbncnanbncn

6 CS 311 Fall 2008 6 Introducing… Turing machines a a b b a a b b Finite control Bi-directional read/write head Infinite tape

7 CS 311 Fall 2008 7 Formally… A Turing machine is a 7-tuple (Q, Σ, Γ, δ, q 0, q accept, q reject ), where – Q is a finite set called the states – Σ is a finite set not containing the blank symbol called the input alphabet – Γ is a finite set called the tape alphabet with ∈ Γ and Σ ⊆ Γ – δ:Q ×Γ → Q ×Γ ×{L,R} – q 0 ∈ Q is the start state – q accept ∈ Q is the accept state – q accept ∈ Q is the reject state

8 CS 311 Fall 2008 8 Recognizing {a n b n c n | n ≥ 0} b b b b c c c c Finite control Infinite tape a a a a

9 CS 311 Fall 2008 9 Configurations A configuration is –Current state –Current tape contents –Current head location u q v means –Current state is q –Current tape contents is uv –Current head points at first symbol of v Example – âaq 1 bbcc –In state q 1 –Tape contents are âabbcc –Tape head is on first b

10 CS 311 Fall 2008 10 Yields A configuration C 1 yields configuration C 2 if the Turing machine can legally go from C 1 to C 2 in a single step yields Written ⊢

11 CS 311 Fall 2008 11 Turing-recognizable languages A Turing machine accepts input w if a sequence of configurations C 1,C 2,...,C k exists where 1.C 1 is the start configuration of M on input w 2.Each C i yields C i+1 3.C k is an accepting configuration Defn 3.5: A language is Turing-recognizable if it is accepted by some Turing machine.

12 CS 311 Fall 2008 12 Recognizing.


Download ppt "Turing machines Sipser 2.3 and 3.1 (pages 123-144)"

Similar presentations


Ads by Google