M tai mot thdi diem ndo do trong qud trinh tinh todn Id mot tH
1. Loai bo tir rSng va nhflng til hit dau bdi ky tu
(5(gn,(0,0)) = ( ' / N- ( 0 ' 0) ' ( S - S ) )
5(</o,(l,0)) = ( ^ N , ( l' 0) ' ( S > S ) ) . 2. Danh dau dau bang hai bdi ky tir ti
<5(c/o,(O,0)) = (gi,(O,tt),(S,R)).
3. Sao chep khtic dau 0' (i > 1) cua t\i vao, trirac ky t u 1 dau tien (neu c6; n6u khong, bdc bo), len bang t h i i hai
<5(gi,(O,0)) = (gi,(O,O),(R,R)) : ^ ( < / i , ( l, 0) ) - ( g 2, ( l, 0) , ( S , L ) ) ;
(5((/i,(0,0)) = ( g, , ( 0 , 0) , ( S , S ) ) .
4. Kiem t r a khiic cuoi ciia tif vao, kg t\l ky t u 1 dau tien, va so
sanh no v6i khiic dau tren bang hai theo do daị Neu no chiia
toan ky tir 1 va c6 cung do dai v6i khuc dau, t h i chap nhan; ngUdc lai, bdc bo:
4ạ Chap nhan <5((/2,(l,0)) = ( r y 2 , ( l , 0 ) , ( R , L ) ) <5('/2,(0,tt)) = ('^v.(0>«)>(s,s)); 4 b . Bac bo % 2, ( 0 , 0 ) ) = ( g „ ( 0 , 0 ) , ( S , S ) ) • <5(r/2,(0,O)) = (r/„(0,O),(S,S)) <5(r/2,(0,tJ))-(^7N,(0'3)'(S.S)) < 5 ( y 2 , ( l , « ) ) - ( ' 7 N > ( l ' « ) ' ( S . S ) ) . •
1.2 Mot vai bien thi cua may Turing 63
Nhan thay r i n g , do c6 nhieu bang hon, nen may Turing hai
bang A/(2) tinh toan don gian va linh hoat hon so vdi may Turing
mot bang A/a, duqc xay dang trong V i du 1.1.3. Tuy nhien, ve kha nang doan nhan ngon nga noi chung, may Turing tat dinh mot bang va may Turing tat dinh nhieu bang hoan toan tirdng dirong nhaụ Dieu nay diroc chiing to bdi menh d6 sau daỵ
D i n h ly 1.2.1 M6i may Turing tat dinh nhieu bang deu c6 may
Turing tat dinh mot bang tuang duang.
Y tudng chiing minh Gia sii cho trirdc may Turing A/^^) gom k
bang tren bang chii Ẹ Ta se tien hanh xay dung may Turing mot
bang 71/, sao cho qua trinh tinh toan ciia no tren moi tif vao w e E*
dudc mo phong theo cac phep bien d6i cO ban ma may A/^*^^ sijt dung
khi tinh toan tren w.
Muon vay, trudc tien ta can chinh trang lai bang cua may M,
sao cho tren bang do thg hien duoc nhiJng thong t i n lien quan den tiing bang cua may Af^*^). T h i du, each sii dung mot bang de b i l u dign 3 bang diroc minh hoa nhu saụ
F
b a a c a 0 ^
a b c 0
b a a c a B a b c c b 0 <
64 May Turing va Thuat toan
Viec chinh trang duoc thuc hien bang each phan chia phan j
dau bang thanh k doan b6i A; + 1 dau thang tj • Doan bang thut i
(1 < i < k), nam giiia dau thang t i i i vh dau thang thii i + 1,
t h i hien nhflng thong tin Uen quan den bang thii i cua may M^''\
Nhiing thong tin nay bao gom noi dung cua bang thii ; va ky tu
tren bang do ma may A/^^^ dang doc, trong do ky tU may dang doc
duoc danh dau hdi mot dau cham " '" d ben tren. Cung nhu dau tl,
cac ky tu vdi dau cham ben tren thuc chat la cac ky tU mdi, ttTdng ling vdi nhiing ky tU bang cua A/C"), can duoc bo sung dg tao nen
bang chfl bang cua M. Viec chinh trang ket thuc khi dau doc-ghi
quay ve o dau tien. •
Tiep theo, may M lan luot mo phong ttag phep bien d6i cd ban
cua may M'-''\ each di chuyen dau doc-ghi tH dau Jl dau tien
den dau tl cuoi cung d l thu thap cac thong tin can thiet, bao g6m
nhiing ky tU vdi dau cham ben tren, roi quay dau doc-ghi trd lai
dg thay d5i nhiing ky t i i ay va c6 the ca nhiing ky tu ben trai hoac
bgn phai sao cho phu hop vdi phep bien d6i cua may AfC'^
Chiing minh Theo y tirdng neu trgn, may Turing mot bang M
diidc dign ta nhu saụ
M = "Tren moi t i i vao w = cTicr2...cr„:
1. Chinh trang lai bang cua may A/, sao cho no the hien diidc nhflng thong tin ve cac bang cua Af ^''^ tai thdi diim ban daụ
Sau khi duoc chinh trang, bang cua M c6 noi dung
tlc^ia2...antl0tt • •-tiOtt •
2. Mo phong tiing phep bien doi cd ban cua A/^''^ bang each di
chuyen dau doc-ghi cua M tren bang, t i i dau H thii nhat (danh dau dau trai) den dau tJ thii fc+1 (danh dau dau phai),
de thu thap cac ky tU vdi dau cham b ben trgn, tudng ilng vdi
nhiing ky tU ma Af ('^^ dang doc. Tren cO sd nhiing thong tin
thu diidc, may M di chuygn dau doc-ghi ve hudng trai vk ^
thay the moi ky tU vdi dau cham bdi mot ky tU khac (ciing c6
1.2 Mot vai biin thi cua may Turing 65
t h i vdi dau cham) roi neu can dich chuyln dau doc-ghi mOt 6 dg danh dau cham phia trgn ky tu d 5 ben trai hoac ky tu
khdc^ d o bgn phai, phii hop vdi viec xijt ly vk hudng di chuygn dau doc-ghi cua A/C^) tren bang tuong ling.
3. Neu khi A / can danh dau cham phia tren ky tu d S bgn phai
ma d do lai la ky tu tJ, thi hien tuong nay c6 nghia la dau doc-ghi tuong ling cua A/^^) di chuyen den mot o trong ma trudc do no chua tiing den. Trong trudng hop nay, may A/
dich chuygn sang phai mot 6 phan noi dung trgn bang, kg ttt ky tu tl ay dgn ky tu H cuoi ciing, va ghi ky tu 0
vao 6 viia dudc giai phong. Khi dich chuyen xong, viec mo
phong lai dUdc tiep dign."
R6 rang may A/ mo phong M^^\h ly dUdc chiing minh. • Nhu vay, ta da mo ta mky Turing mot bang Af, thuc hien viec
mo phong su hoat dong cua may Turing nhieu bang A/fC") cho trudc.
Dg tim hieu can ke viec tinh toan ciia may M , ta c6 thg xay dung