MC 306 Theory of Computation Thursday, 111303 - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

MC 306 Theory of Computation Thursday, 111303

Description:

... alphabet; 0 , must contain the symbols (left end marker) and (blank cell marker) ... The machine never writes the left-end marker. Thursday, 11/13/03, Slide #3 ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 9
Provided by: skid
Category:

less

Transcript and Presenter's Notes

Title: MC 306 Theory of Computation Thursday, 111303


1
MC 306 Theory of ComputationThursday, 11/13/03
  • Last time
  • Using closure properties to prove languages are
    and are not context-free
  • Pumping Lemma for context-free languages
  • Turing Machine Basics
  • QUESTIONS??
  • Todays Class
  • More on TMs formal definitions, examples
  • Church-Turing Thesis
  • Correction Pumping Lemma assignments should have
    referred to p. 116 3.38 (not 3)
  • Exercises 3.38 a b
  • Hand-in 3.38 c d
  • Reading Still 4.1
  • New exercises from text
  • pp. 151-152 4.1, 4.3b
  • From handout sheet
  • Exercises 7ab, 10 (just outline of machine)
  • Hand-in No new ones yet
  • New hand-in HW will be given on Tuesday

2
Definition of a Turing Machine
  • Note My definition is slightly different from
    text definition
  • A Turing Machine is a 6-tuple
  • Q is the set of states
  • ?0 is the input alphabet ?0 must not contain the
    symbols ? or ?
  • ? is the tape alphabet ?0 ? ?, ? must contain
    the symbols ? (left end marker) and ? (blank cell
    marker)
  • Neither ?0 nor ? may contain the symbols ? and ?
  • s ? S is the initial state
  • H?? S is the set of halting states
  • ? is the transition function
  • For every non-halting state, and every tape
    symbol, there is a transition that (1) selects a
    new state, and (2) either writes a new symbol in
    the current tape square or moves left or right.
  • In addition, ?(q, ?) (q,?). The machine always
    moves right when it sees the left-end marker.
  • In addition, if ?(q, x) (q,y), then y ? ?. The
    machine never writes the left-end marker.

3
Variations on the standard TM definition
  • One alphabet for both input and tape (our text)
  • Two-way infinite tape (JFLAP)
  • Machine writes and moves in single transition
    (JFLAP)
  • ? is a partial function, meaning some arrows
    are missing
  • Say the machine stalls if there is no transition
    to apply
  • Can get a total function by adding arrows to a
    dead state
  • May use states to accept or writing to accept.
  • These are all equivalent in power to our
    definition.

4
Church-Turing Thesis
  • Church-Turing Thesis Every computer algorithm
    can be implemented as a Turing Machine.
  • In other words, any program that can be
    implemented in any computer language, on any
    actual computer, can also be implemented as a TM.
  • So TMs can simulate loops, if-thens, function
    calls, data structures, etc.

5
Example
  • Consider a TM with the following transitions
  • (q0, a), (q1, b)
  • (q0, b), (q1, a)
  • (q0, ?), (h, ?)
  • (q1, x), (q0, ?),for any x
  • What does this TM do?
  • See JFLAP file MC306031113.jfl

6
Configurations and Computations
  • A configuration tells us the current state of a
    TM while its computing
  • Current state
  • Current contents of tape
  • Current position of read/write pointer
  • We usually write this C (q, ? x ?), where q is
    the current state, x is the current symbol
    pointed at, and the tape contents comprise the
    string ? x ?
  • We usually begin a computation on string ? x ?
    in the starting configuration C0 (s, ? x ?)
  • Example Do computation of previous machine on ?
    aab.

7
Tasks for TMs
  • Language accepters (recognizers)
  • L set of strings on which machine computation
    goes to a halting state view halting states as
    favorable states
  • Language Deciders
  • Always end in a halting state
  • Give answer by writing 1 (yes) or 0 (no) on tape
  • C0 (s, ??) ? (s, ?1) means ? is in L
  • C0 (s, ??) ? (s, ?0) means ? is not in L
  • Transducers (compute functions)
  • Given function f ?0 ??0, the TM computes f(?)
    ?
  • C0 (s, ??) ? (s, ??)

8
Examples
  • Design a TM to accept (ab)
  • Design a TM to decide L set of strings
    containing at least one a.
  • Design a TM to accept anbn
Write a Comment
User Comments (0)
About PowerShow.com