PowerPoint Presentation - Turing machines - Mount Holyoke College

Document Sample
PowerPoint Presentation - Turing machines - Mount Holyoke College Powered By Docstoc
					Turing machines

 Sipser 2.3 and 3.1
  (pages 123-144)
     A Context-free Grammar for
           {anbncn| 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, uvixyiz ∈ A,
  2. |vy| > 0, and
  3. |vxy| ≤ p

                            CS 311
                                             2
                     Mount Holyoke College
              Proof idea
• Surgery on parse trees




                        CS 311
                                         3
                 Mount Holyoke College
                     So…
• Is {anbncn| n ≥ 0} a CFL?




                          CS 311
                                           4
                   Mount Holyoke College
Chomsky hierarchy


 anbncn

          Context-free languages


                 Regular           0n1n
               languages




                 CS 311
                                          5
          Mount Holyoke College
Introducing… Turing machines

                                           Infinite tape

                                 a     b      a      b   ⨆   ⨆   ⨆

Bi-directional read/write head




                                  Finite
                                 control




                                    CS 311
                                                                     6
                             Mount Holyoke College
                     Formally…
• A Turing machine is a 7-tuple
  (Q, Σ, Γ, δ, q0, qaccept, qreject), 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}
   – q0∈Q is the start state
   – qaccept∈Q is the accept state
   – qaccept∈Q is the reject state

                                CS 311
                                                           7
                         Mount Holyoke College
Recognizing {anbncn| n ≥ 0}

                             Infinite tape

       a   a       b     b      c      c   ⨆   ⨆   ⨆




                    Finite
                   control




                      CS 311
                                                       8
               Mount Holyoke College
                  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
   –   âaq1bbcc
   –   In state q1
   –   Tape contents are âabbcc
   –   Tape head is on first b
                                 CS 311
                                                  9
                          Mount Holyoke College
                      Yields
• A configuration C1 yields configuration C2 if
  the Turing machine can legally go from C1
  to C2 in a single step
•           yields
• Written         ⊢




                             CS 311
                                              10
                      Mount Holyoke College
 Turing-recognizable languages
• A Turing machine accepts input w if a sequence
  of configurations C1,C2,...,Ck exists where
  1. C1 is the start configuration of M on input w
  2. Each Ci yields Ci+1
  3. Ck is an accepting configuration


• Defn 3.5: A language is Turing-recognizable if it
  is accepted by some Turing machine.


                              CS 311
                                                      11
                       Mount Holyoke College
Recognizing                   .




             CS 311
                                  12
      Mount Holyoke College

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:3/25/2013
language:simple
pages:12