Formal Definition - PowerPoint PPT Presentation

About This Presentation
Title:

Formal Definition

Description:

S is a set of states. is an alphabet It must contain and . It ... The 'Eraser' TM ... Examples: - Initial configuration with 3 a's for the eraser TM: (s,e ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 15
Provided by: leh71
Category:

less

Transcript and Presenter's Notes

Title: Formal Definition


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 a ? ? ? such
    that ?(p, a) (q, ?)

Very simple definition but very useful precisely
because of its simplicity!
3
The Eraser TM
Construct a Turing machine that receives as input
a substring of as and replace each a for a blank
space, ?
4
Another Example
  • ((s, ?),(s,?)),
  • ((s,a),(q, ?)),
  • ((q, ?),(s, ?)),
  • ((s, ?),(h, ?)),
  • ((q,a),(q,a)),
  • ((q, ?), (q, a))

5
The Turing Machines M1 and M0
The Turing Machine M1
6
The Turing Machine Mx
7
Configuration for Previous Machines
Configuration
Machine
Explanation
Finite automata
Pushdown automata
8
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 as 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
Computation in Turing Machines
A configuration C1 (q1,LS1h1RS1) yields a
configuration C2 (q2,LS2h2RS2) in one step,
written C1 C2, if
?
  1. There is a transition ((q1, h1),(q2,A)) in ?
  2. 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
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 courses 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)
Write a Comment
User Comments (0)
About PowerShow.com