Section: Other Models of Turing Mchines Definition: Two utomt re equivlent if they ccept the sme lnguge. Turing Mchines with Sty Option Modify δ, Theorem Clss of stndrd TM s is equivlent to clss of TM s with sty option. Proof: ( ): Given stndrd TM M, then there exists TM M with sty option such tht L(M)=L(M ). 1
( ): Given TM M with sty option, construct stndrd TM M such tht L(M)=L(M ). M=(Q,Σ, Γ,δ,q 0,B,F) M = For ech trnsition in M with move (L or R) put the trnsition in M. So, for put into δ δ(q i,)=(q j,,lorr) For ech trnsition in M with S (sty-option), move right nd move left. So for δ(q i,)=(q j,,s) L(M)=L(M ). QED. 2
Definition: A multiple trck TM divides ech cell of the tpe into k cells, for some constnt k. A 3-trck TM: c 1 1 1 tpe hed A multiple trck TM strts with the input on the first trck, ll other trcks re lnk. δ: 3
Theorem Clss of stndrd TM s is equivlent to clss of TM s with multiple trcks. Proof: (sketch) ( ): Given stndrd TM M there exists TM M with multiple trcks such tht L(M)=L(M ). ( ): Given TM M with multiple trcks there exists stndrd TM M such tht L(M)=L(M ). 4
Definition: A TM with semi-infinite tpe is stndrd TM with left oundry. Theorem Clss of stndrd TM s is equivlent to clss of TM s with semi-infinite tpes. Proof: (sketch) ( ): Given stndrd TM M there exists TM M with semi-infinite tpe such tht L(M)=L(M ). Given M, construct 2-trck semi-infinite TM M 5
TM M... c... TM M # # c... right hlf left hlf ( ): Given TM M with semi-infinite tpe there exists stndrd TM M such tht L(M)=L(M ). 6
Definition: An Multitpe Turing Mchine is stndrd TM with multiple ( finite numer) red/write tpes. Control Unit tpe 2 tpe 1 c tpe 3 For n n-tpe TM, define δ: 7
Theorem Clss of Multitpe TM s is equivlent to clss of stndrd TM s. Proof: (sketch) ( ): Given stndrd TM M, construct multitpe TM M such tht L(M)=L(M ). ( ): Given n-tpe TM M construct stndrd TM M such tht L(M)=L(M ). # c # 1 # # 1 # # 1 8
Definition: An Off-Line Turing Mchine is stndrd TM with 2 tpes: red-only input tpe nd red/write output tpe. Define δ: c input tpe (red only) Control Unit d red/write tpe 9
Theorem Clss of stndrd TM s is equivlent to clss of Off-line TM s. Proof: (sketch) ( ): Given stndrd TM M there exists n off-line TM M such tht L(M)=L(M ). ( ): Given n off-line TM M there exists stndrd TM M such tht L(M)=L(M ). # c # 1 # d # 1 10
Running Time of Turing Mchines Exmple: Given L={ n n c n n>0}. Given w Σ, iswinl? Write 3-tpe TM for this prolem. 11
Definition: An Multidimensionl-tpe Turing Mchine is stndrd TM with multidimensionl tpe c Define δ: 12
Theorem Clss of stndrd TM s is equivlent to clss of 2-dimensionl-tpe TM s. Proof: (sketch) ( ): Given stndrd TM M, construct 2-dim-tpe TM M such tht L(M)=L(M ). ( ): Given 2-dim tpe TM M, construct stndrd TM M such tht L(M)=L(M ). 13
-1,2 1,2 2,2-2,1-1,1 1,1 2,1 c3,1-2,-1-1,-1 1,-1 2,-1 Construct M # # # c # 1 # 1 # 1 1 # 1 # 1 1 1 # 1 14
Definition: A nondeterministic Turing mchine is stndrd TM in which the rnge of the trnsition function is set of possile trnsitions. Define δ: Theorem Clss of deterministic TM s is equivlent to clss of nondeterministic TM s. Proof: (sketch) ( ): Given deterministic TM M, construct nondeterministic TM M such tht L(M)=L(M ). ( ): Given nondeterministic TM M, construct deterministic TM M such tht L(M)=L(M ). Construct M to e 2-dim tpe TM. 15
A step consists of mking one move for ech of the current mchines. For exmple: Consider the following trnsition: δ(q 0,)={(q 1,,R),(q 2,,L),(q 1,c,R)} Being in stte q 0 with input c. # # # # # # c # # q 0 # # # # # # 16
The one move hs three choices, so 2 dditionl mchines re strted. # # # # # # # c # # q 1 # # c # # q 2 # # c c # # q 1 # # # # # # # 17
Definition: A 2-stck NPDA is n NPDA with 2 stcks. Control Unit stck 2 stck 1 Define δ: 18
Consider the following lnguges which could not e ccepted y n NPDA. 1. L={ n n c n n>0} 2. L={ n n n n n>0} 3. L={w Σ numer of s equls numer of s equls numer of c s}, Σ={,, c} 19
Theorem Clss of 2-stck NPDA s is equivlent to clss of stndrd TM s. Proof: (sketch) ( ): Given 2-stck NPDA, construct 3-tpe TM M such tht L(M)=L(M ). 20
( ): Given stndrd TM M, construct 2-stck NPDA M such tht L(M)=L(M ). 21
Universl TM - progrmmle TM Input: n encoded TM M input string w Output: Simulte M on w 22
An encoding of TM Let TM M={Q,Σ, Γ,δ,q 1,B,F} Q={q 1,q 2,...,q n } Designte q 1 s the strt stte. Designte q 2 s the only finl stte. q n will e encoded s n 1 s Moves L will e encoded y 1 R will e encoded y 11 Γ={ 1, 2,..., m } where 1 will lwys represent the B. 23
For exmple, consider the simple TM: ;,R ;,L q 1 q 2 Γ={B,,} which would e encoded s The TM hs 2 trnsitions, δ(q 1,)=(q 1,,R), δ(q 1,)=(q 2,,L) which cn e represented s 5-tuples: (q 1,,q 1,,R),(q 1,,q 2,,L) Thus, the encoding of the TM is: 0101101011011010111011011010 24
For exmple, the encoding of the TM ove with input string would e encoded s: 010110101101101011101101101001101110110 Question: Given w {0,1} +,iswthe encoding of TM? 25
Universl TM The Universl TM (denoted M U )is 3-tpe TM: Control Unit 0 1 1 0... tpe contents of M 0 1 0 encoding of M 1... 1 1 1 current stte of M 26
Progrm for M U 1. Strt with ll input (encoding of TM nd string w) on tpe 1. Verify tht it contins the encoding of TM. 2. Move input w to tpe 2 3. Initilize tpe 3 to 1 (the initil stte) 4. Repet (simulte TM M) () consult tpe 2 nd 3, (suppose current symol on tpe 2 is nd stteontpe3isp) () lookup the move (trnsition) on tpe 1, (suppose δ(p,)=(q,,r).) (c) pply the move writeontpe2(write) move on tpe 2 (move right) write new stte on tpe 3 (write q) 27
Oservtion: Every TM cn e encoded s string of 0 s nd 1 s. Enumertion procedure - process to list ll elements of set in ordered fshion. Definition: An infinite set is countle if its elements hve 1-1 correspondence with the positive integers. Exmples: S ={positive odd integers } S ={rel numers } S={w Σ + },Σ={, } S={TM s } S ={(i,j) i,j>0, re integers} 28
Liner Bounded Automt We plce restrictions on the mount of tpe we cn use, [ c ] Definition: A liner ounded utomton (LBA) is nondeterministic TM M=(Q,Σ, Γ,δ,q 0,B,F) such tht [, ] Σ nd the tpe hed cnnot move out of the confines of [] s. Thus, δ(q i, [) = (q j, [,R), nd δ(q i, ]) = (q j, ],L) Definition: Let M e LBA. L(M)={w (Σ {[,]}) q 0 [w] [x 1 q f x 2 ]} Exmple: L={ n n c n n>0}is ccepted y some LBA 29