UX droc quy \ldc la khong bao ham noi dung naọ Noi rieng,

Một phần của tài liệu Lý thuyết độ phức tạp tính toán (Trang 42)

M tai mot thdi diem ndo do trong qud trinh tinh todn Id mot tH

t uX droc quy \ldc la khong bao ham noi dung naọ Noi rieng,

{ x , x ) . . . ( x , x ) [ x , x ] ( x , x ) . . . ( x , x ) [ x , x ] ( x , x ) , . . ( x , x ) [ x , x ] i^jj ^^^^ ^.^^

trang thai ban dau, trang thai chap nhan vh trang thai bac bo cua may A/, tuong u:ng vdi trang thai ban dau q^, trang thai chap

nhan va trang thai bac bo cua may Af^'').

Vai tro ciia cac cSp chi so trong moi trang thai qi^u^l)•••{n,n,)la,^.]

duoc t h i hien nhu saụ Cac cSp chi so (n,7ri)...(rfc,TTfc) duoc sii

dung vdi hai muc dich chinh. Thit nhat, chiing the hien su hoat

dong cua dau doc-ghi dang dign ra 5 doan bang nao, qua do k i i m soat duoc viec thuc hien mot cong doan nao do trong qua trinh mo phong da dat t d i dau va khi nao ket thdc. T h i du, k h i may d trang thai V^''"'^-^^*'"'^^'''''^-^'''''^'^'''' vdi (r*,TT^) 7^ ( x , x ) , 1 < < < t, t h i dieu do chilng to rkng dau doc-ghi cua may dang hoat dong tren

doan bang t h i i i , 1 < i < A;. TM hai, cac cap chi so ( r i , 7ri)...(rfc, TTJ^) con duoc sijt dung dg ghi nh6 nhiing thong t i n thu thap duoc va t h i hien nhiing chi d i n c§,n thiet khi may thttc hien Budc 2, tien hanh

mo phong ph6p bien d6i co ban cua may M'^^^ Dieu nky se duoc

b i i u lo cu the hon d phia dirdị Cuoi ciing, cap chi so [5, //] diioc siS

dung d i chi dan hudng d i chuyin cua dau doc-ghi {d = L, R) va tn

dinh ky t i l (/z 6 F') diing d i thay the cho ky t u ma may dang doc, khi may thuc hien cac Bade 1 va 3.

Bay gid, theo nhiing hudng dan nhu vay, ta c6 the xdc dinh ham

chuyin 6' cua may Turing M nh^m thuc hien tiing budc viec mo phong may Turing k bang A/^''^ Chang han, de thuc hien Budc 1, ta hay xac dinh ham chuyin 6' cua may M sao cho may chuyin

ttf hinh thai ban dau gj^'^)•••(><'^)[^'^Iaicr2...a„ den hinh thai tuong

ling g( ' < ' ^ ) - ( ^ ' ^ ) [ ^ ' ^ l t l^ i a 2. . . a j 0 « . . . ttOtt-

Vdi muc dich nay, t a xac dinh ham 5' nhu sau: Doi vdi moi x, y, z

thuOc E, t a c6:

1.2 Mot vai bien thi cua may Turing

67 5. ( ^ ( x , x ) . . . ( x , x ) [ x, x l^ ^ ) ^ ( ^ ( „ , x ) . . . ( x , x) [ R, . l ^ j j^ j ^ ^ 5. ( ^ ( x , x ) . . . ( x , x ) [ x, x l^ ^ ) ^ ( ^ ( „ , x ) . . . ( x , x) [ R, . l ^ j j^ j ^ ^ ^ / ( ^ ( « , x ) . . . ( x , x) [ R, i ] ^ ^ ) ^ ( ^ ( „ , x ) . . . ( x , x) [ R, , l^ ^ ^ P ^ ) < 5' ( ^ ( B , x ) . . . ( x , x) [ R, , l^ ^ ^ ^ ( ^ a x) . . . ( x . x) [ R, . ) ^ ^ ^ j ^ ^ (5'(^(l),x)(x,x)...(x,x)[R,zJ^ ^ ( ^ « , x ) ( x , x ) , . . ( x , x) [ R, B ] ^ J^) 5'(^(B,x)(x,x)...(x,x)[R,»]^0-j ^ (^ax)(8,x)...{x,x)[R,0]^y^ 5'(^(B,x)...(B,x)(x,x)...[R,0]^ 0^ ^ (^(tt,x)...(B,x)(x,x)...[R,Bj^ y(^(tt,x)...(B,x){x,x).„[R,|i]^ 0^ ^ (^(t),x)...(B,x)(B,x)...[R,0l^ jj ^ (5'(^(B,x)...(t(,x)[R,B]^0-) ^ ( ^ ( B , x ) . . . ( » , x) [ L, x ) j^ L ) J'(^(tt,x)...(B,x){B,x)...(L,x]^ ^ (^(8,x)...(B,x)(a,x)...[L,xl^ g <J'(^ax)...{8,x)(B,x)...[L,xl^ jj-j ^ (^(tt,x).,.(S,x){x,x)..,[L,x]^ jj ^ L) 5 ' ( ^ ( f l, x ) ( x , x ) . . . ( x , x) [ L, x l ^ ^ ) = ( ^ ( « , x ) ( x , x ) . . . ( x , x) [ L, x l^ ^ ^ L ) <5'(g(B,x)(x,x),..(x,x)[L,xJ^^^ ^ ^ ^ ( x , x ) ( x , x ) . . . ( x , x ) [ x , x ] ^ L)

Nhu vay, phan dau bang ciia may Af duoc chia thanh k doan,

va Ian luot trgn moi doan t h i hien duoc noi dung bang tuong Ung cua may A/(*^) k i ca ky t u ma may Af^'^) dang doc. Ta c6 t h i xac

dinh tiep ham chuyin 6' cua may Af sao cho dieu viia neu v l n duoc

dam baọ Cu t h i la vao thdi d i i m ma may A/ bat dau mo phong

mot phep bien d6i co ban cua may M^'^\n doan bang t h i i i (1 < i < fc) cua Af t h i hien noi dung bang t h i i i cua may A/^*^) d

thdi d i i m ma phep bien d6i co ban ay bat dau duoc thuc hien, va

tren doan bang do co diing mot ky t u vdi dau cham ben tren. Hon

khi bat dau viec mo phong nay, dau doc-ghi cua Af d 6 dau ti^n cua bang. B5i v i , sau khi chinh trang bang d Budc 1 va khi bat

d^u cung nhu ket thuc viec mo phong moi phep bien doi co ban ma

May Turing va Thuat toan Bay gid ta gidi thieu each thu;c sii dung cac cap chi so cua trang | thai l<hi may thuc hien Budc 2, tufc thuc hien mo phong mOt phep bien dSi cd ban cua may M^''^.

K h i bat dau mo phong phep bien d5i cO ban cua may M^''\

chang han nhu phep bien d6i

5{qr, {xuX2, Xk)) = {QS, (yi, y2, Vk), ( H i , H j , Hfc)),

may M c6 hinh thai dang

^ ( X , X ) { X , X ) . . . ( X , X ) [ X , X 1 ^ ^ ^ ^ . ^ ^ ^ ^ ^ ^ ^ ^ ^

May M d trang thai ^ ( x . x ) ( x . x ) - ( > < . x ) [ x - ^ l t i l n hanh mo phong phep bien d6i nay bang each di chuygn dau doe-ghi tit t r a i qua phai,

ke tir dau tj dau tien d@n dau tJ cuoi cung. K h i di chuygn qua dau tj

t h i i 1 < i < k, cap ehi so ( x , x ) t h i i i cua trang thai duoc doi

thanh ( j i , x ) , tufc may thay d6i trang thai, va khi qua ky tU vdi dau

cham Xi cap (U, x ) duoc d6i thanh (tl, Xi). NhU vay, khi di chuygn den dau H cu6i cung, may A/ 5 trang thai ^(«.^i)(B,x2)...(tt,x,)[x,x]^ ^ ^ ^ ^ ^

vdi su kien may A/^*^' 5 trang thai qr doc duoc cac ky tU x i , X2, Xk-

K h i do may M chuygn sang trang thai g (H ^ . v >)(H2 , v .)...(H.,ỵ)[x,x] ^

hien su bien d6i cua may Af^*"), va di chuyen dau doc-ghi ve phia trai dg tien hanh xiJt ly cho den khi gap dau tl dau tien. M 5 i khi

gap ky t u X i , may M xiJt ly nhu sau: Ngu Hj ^ S t h i ky t u Xi duoc

thay bang ky tU iji va cap chi so (Hj, yi) duoc d6i t h k n h (tJ, x ) ; neu

Hi = R (H, = L, tuong ling) t h i ky t u duoc thay b^ng ky t u yu

cap chi so (Hi,'(/i) duoc doi thanh ( H i , ) , tiep theo, d i chuygn dau doc-ghi sang phai (sang trai, tUOng ling) mot o roi danh dau cham Ign phia trgn ky t u 6 do (thuc chat la thay ky t u 5 o do b^ng ky

t u tuong ling vdi dau cham phia tren) va cap chi so (Hj,') tiep tuc duoc d5i thanh x ) . Tigp den, khi gap dau Jj t h i i t, cap (tt, x ) nay

duoc doi thanh ( x , x ) . N h u vay, viee x i i ly cua may M phii hop vdi su bign d6i ciia may M^''\c viee mo phong phep bien d6i cd

ban cua AfC') dudc hoan thanh. K h i do may Af c6 hinh thai \

^ ( X , X ) ( X , X ) . . . ( X , X ) [ X , X ] J J . (J ^

1.2 Mot vdi biSn thi cua may Turing 69

n^u H i = L, H2 = R , . . . , Hfc = S.

Tuy nhien, khi bat dau mo phong phep b i l n d6i co ban neu tren vdi H i = L, H2 = R , . . . , H^. = S, gia siJt may A/ c6 hinh thai

( x , x ) ( x , x ) . . . ( x , x ) ( x , x l u - 1 , 1 . ,

K h i do viee x i i ly cua may A A trgn doan bang thut hai bat gap hien tuong can danh dau cham Ign phia trgn ky t u d 6 ben phai nhung

Một phần của tài liệu Lý thuyết độ phức tạp tính toán (Trang 42)

Tải bản đầy đủ (PDF)

(195 trang)