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

About This Presentation
Title:

COSC 3340: Introduction to Theory of Computation

Description:

... and uqjacv are two configurations. uaqibv yields uqjacv ... Scan past 0's and y's until you reach 1. If 1 found, change it to y and move right, else reject. ... – PowerPoint PPT presentation

Number of Views:31
Avg rating:3.0/5.0
Slides: 41
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 17

2
Definitions
  • A configuration is a snapshot of the machine
    written uqv.
  • Configuration C1 yields configuration C2 if the
    Turing machine can legally go from C1 to C2 in a
    single step.
  • Suppose a, b, and c in ?, u and v in ? and
    states qi and qj. Then, uaqibv and uqjacv are two
    configurations.
  • uaqibv yields uqjacv if ?(qi, b) (qj, c, L).
  • handles the case where the TM moves leftward.
  • For a rightward move, uaqibv yields uacqjv if
    ?(qi, b) (qj,c,R).

3
Special Cases
  • Special Cases occur when the head is at one of
    the ends of the configurations.
  • For the left-hand end, the configurations qibv
    yields qjcv if the transition is left moving, and
    it yields cqjv for the right moving transition.
  • For the right-hand end, the configuration uaqi is
    equivalent to uaqi? because we assume that blanks
    follow the part of the tape represented in the
    configuration. Thus we can handle this case as
    before, with the head no longer at the right hand
    end.

4
More Definitions
  • The start configuration of M on input w is the
    configuration q0w, which indicates that the
    machine is in the start state q0 with its head at
    the leftmost position on the tape
  • In an accepting configuration the state of the
    configuration is qaccept
  • In a rejecting configuration the state of the
    configurations is qreject
  • Accepting and rejecting configurations are
    halting configurations and accordingly do not
    yield further configurations

5
More Definitions
  • A TM M accepts input w if a sequence of
    configurations C1,C2,,Ck exists where
  • C1 is the start configuration of M on input w,
  • Each Ci yields Ci1, and
  • Ck is an accepting configuration.
  • The collection of strings that M accepts is the
    language of M, denoted L(M).

6
More Definitions
  • - Turing-recognizable/acceptable
  • TM M accepts/recognizes language L if L w M
    accepts w. Note 3 outcomes possible, either TM
    accepts, rejects, or loops.
  • Turing-decidable TM M decides L if
  • (i) w ? L, M writes a Yes on tape and halts
  • (ii) w ? L, M writes a No on tape and halts.
  • Every decidable language is Turing-recognizable
    but certain Turing-recognizable language are not
    decidable.

7
Example of TM for 0n1n2n 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 right, else
    reject.
  • Scan past 1s and zs until you reach 2
  • If 2 found, change it to z and move left, else
    reject.
  • Move left scanning past 0s, ys, zs and 1s
  • If x found move right
  • If 0 found, loop back to step 2.
  • If 0 not found, scan past ys and zs and accept.

Head is on the left or start of the string.
x, y and z are just variables to keep track of
equality
8
Example of TM for 0n1n2n n gt 0 contd.
In this case we are starting from the right or at
the end of a given string on the tape. Table will
be very similar if we start from the left.
State Symbol Next state action
q0 0 (q1, x, R)
q0 1 halt/reject
q0 2 halt/reject
q0 x halt/reject
q0 y (q4, y, R)
q0 z halt/reject
9
Example of TM for 0n1n2n 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, R)
q1 2 halt/reject
q1 x halt/reject
q1 y (q1, y, R)
q1 z halt/reject
10
Example of TM for 0n1n2n n gt 0 contd.
Head is on the left or start of the string.
State Symbol Next state action
q2 0 halt/reject
q2 1 (q2, 1, R)
q2 2 (q2, z, R)
q2 x halt/reject
q2 y halt/reject
q2 z (q2, z, R)
11
Example of TM for 0n1n2n n gt 0 contd.
Head is on the left or start of the string.
State Symbol Next state action
q3 0 (q3, 0, L)
q3 1 (q3, 1, L)
q3 2 halt/reject
q3 x (q0, x, R)
q3 y (q3, y, L)
q3 z (q3, z, L)
12
Example of TM for 0n1n2n n gt 0 contd.
Head is on the left or start of the string.
State Symbol Next state action
q4 0 halt/reject
q4 1 halt/reject
q4 2 halt/reject
q4 x halt/reject
q4 y (q4, y, L)
q4 z (q4, z, L)
q4 ? (q5, y, L)
13
Example of TM for 0n1n2n n gt 0 contd.
State Symbol Next state action
q5 0 halt/reject
q5 1 halt/reject
q5 2 halt/reject
q5 x halt/reject
q5 y halt/reject
q5 z halt/reject
q5 ? halt/reject
14
Example of TM for 0n1n2n n gt 0 contd.
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
JFLAP SIMULATION
30
JFLAP SIMULATION
31
JFLAP SIMULATION
32
JFLAP SIMULATION
33
JFLAP SIMULATION
34
JFLAP SIMULATION
35
JFLAP SIMULATION
36
JFLAP SIMULATION
37
JFLAP SIMULATION
38
JFLAP SIMULATION
39
JFLAP SIMULATION
40
Different way of making 0n1n2n n gt 0
Write a Comment
User Comments (0)
About PowerShow.com