COSC 3340: Introduction to Theory of Computation - PowerPoint PPT Presentation

About This Presentation
Title:

COSC 3340: Introduction to Theory of Computation

Description:

Based on (q, ), q current state, symbol scanned by head, in one move, the TM ... using special states accept/reject or by writing Y/N on tape. ... – PowerPoint PPT presentation

Number of Views:88
Avg rating:3.0/5.0
Slides: 30
Provided by: Duke9
Learn more at: https://www2.cs.uh.edu
Category:

less

Transcript and Presenter's Notes

Title: COSC 3340: Introduction to Theory of Computation


1
COSC 3340 Introduction to Theory of Computation
  • University of Houston
  • Dr. Verma
  • Lecture 16

2
Turing Machine (TM)
. . .
Bi-direction Read/Write
Finite State control
3
Turing Machine (contd.)
  • Based on (q, ?), q current state, ? symbol
    scanned by head, in one move, the TM can
  • (i) change state
  • (ii) write a symbol in the scanned cell
  • (iii) move the head one cell to the left or
    right
  • Some (q, ?) combinations may not have any moves.
    In this case the machine halts.

4
Turing Machine (contd.)
  • We can design TMs for computing functions from
    strings to strings
  • We can design TMs to decide languages
  • using special states accept/reject or by writing
    Y/N on tape.
  • We can design TMs to accept languages.
  • if TM halts string is accepted
  • Note there is a big difference between language
    decision and acceptance!

5
Example of TM for 0n1n n gt 0
  • English description of how the machine works
  • Look for 0s
  • If 0 found, change it to x and move right, else
    reject
  • Scan past 0s and ys until you reach 1
  • If 1 found, change it to y and move left, else
    reject.
  • Move left scanning past 0s and ys
  • If x found move right
  • If 0 found, loop back to step 2.
  • If 0 not found, scan past ys and accept.

Head is on the left or start of the string.
x and y are just variables to keep track of
equality
6
Example of TM for 0n1n n gt 0 contd.
Head is on the left or start of the string.
State Symbol Next state action
q0 0 (q1, x, R)
q0 1 halt/reject
q0 x halt/reject
q0 y (q3, y, R)
7
Example of TM for 0n1n n gt 0 contd.
Head is on the left or start of the string.
State Symbol Next state action
q1 0 (q1, 0, R)
q1 1 (q2, y, L)
q1 x halt/reject
q1 y (q1, y, R)
8
Example of TM for 0n1n n gt 0 contd.
Head is on the left or start of the string.
State Symbol Next state action
q2 0 (q2, 0, L)
q2 1 halt/reject
q2 x (q0, x, R)
q2 y (q2, y, L)
9
Example of TM for 0n1n n gt 0 contd.
Head is on the left or start of the string.
State Symbol Next state action
q3 0 halt/reject
q3 1 halt/reject
q3 x halt/reject
q3 y (q3, y, R)
q3 ? (q4, ?, R)
10
Example of TM for 0n1n n gt 0 contd.
Head is on the left or start of the string.
State Symbol Next state action
q4 0 illegal i/p
q4 1 illegal i/p
q4 x illegal i/p
q4 y illegal i/p
q4 ? halt/accept
11
Example of TM for 0n1n n gt 0 contd.
12
JFLAP SIMULATION
13
JFLAP SIMULATION
14
JFLAP SIMULATION
15
JFLAP SIMULATION
16
JFLAP SIMULATION
17
JFLAP SIMULATION
18
JFLAP SIMULATION
19
JFLAP SIMULATION
20
JFLAP SIMULATION
21
JFLAP SIMULATION
22
JFLAP SIMULATION
23
JFLAP SIMULATION
24
JFLAP SIMULATION
25
JFLAP SIMULATION
26
JFLAP SIMULATION
27
JFLAP SIMULATION
28
JFLAP SIMULATION
29
Formal Definition of TM
  • Formally a TM M (Q, ?, ?, ?, s) where,
  • Q a finite set of states
  • ? input alphabet not containing the blank symbol
  • ? the tape alphabet of M
  • s in Q is the start state
  • ? Q X ? ? Q X ? X L, R is the (partial)
    transition function.
  • Note
  • (i) We leave out special states.
  • (ii) The model is deterministic but we just say
    TM instead of DTM.
Write a Comment
User Comments (0)
About PowerShow.com