410 likes | 570 Views
COSC 3340: Introduction to Theory of Computation. University of Houston Dr. Verma Lecture 17. Definitions . A configuration is a snapshot of the machine written u q v .
E N D
COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 17 UofH - COSC 3340 - Dr. Verma
Definitions • A configuration is a snapshot of the machine written uqv. • Configuration C1yields configuration C2if 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. • uaqibvyieldsuqjacv if (qi, b) = (qj, c, L). • handles the case where the TM moves leftward. • For a rightward move, uaqibvyieldsuacqjv if (qi, b) = (qj,c,R). UofH - COSC 3340 - Dr. Verma
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 yieldsqjcv 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 handend. UofH - COSC 3340 - Dr. Verma
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 UofH - COSC 3340 - Dr. Verma
More Definitions • A TMMaccepts 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 Ci+1, and • Ck is an accepting configuration. • The collection of strings that M accepts is the language of M, denoted L(M). UofH - COSC 3340 - Dr. Verma
More Definitions • - Turing-recognizable/acceptable TMMaccepts/recognizes language L if L = {w | M accepts w}. Note: 3 outcomes possible, either TMaccepts, 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. UofH - COSC 3340 - Dr. Verma
Example of TM for {0n1n2n | n> 0} • English description of how the machine works: • Look for 0’s • If 0 found, change it to x and move right, else reject • Scan past 0’s and y’s until you reach 1 • If 1 found, change it to y and move right, else reject. • Scan past 1’s and z’s until you reach 2 • If 2 found, change it to z and move left, else reject. • Move left scanning past 0’s, y’s, z’s and 1’s • If x found move right • If 0 found, loop back to step 2. • If 0 not found, scan past y’sand z’s and accept. Head is on the left or start of the string. x, y and zare just variables to keep track of equality UofH - COSC 3340 - Dr. Verma
Example of TM for {0n1n2n | n > 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. UofH - COSC 3340 - Dr. Verma
Example of TM for {0n1n2n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma
Example of TM for {0n1n2n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma
Example of TM for {0n1n2n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma
Example of TM for {0n1n2n | n > 0} contd. Head is on the left or start of the string. UofH - COSC 3340 - Dr. Verma
Example of TM for {0n1n2n | n > 0} contd. UofH - COSC 3340 - Dr. Verma
Example of TM for {0n1n2n | n > 0} contd. UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
JFLAP SIMULATION UofH - COSC 3340 - Dr. Verma
Different way of making {0n1n2n | n 0} UofH - COSC 3340 - Dr. Verma