I Doi vdi may Turing khong tat dinh diing N, quat rinh tinh toan trgn moi t i i vao w duqc dien ra theo mot nhanh nao do ma may lua
1. Loai bo nhiing tif khong c6 dang ÓP (t ,j > 0), bang each
doc ludt qua bang mot va bdc bo neu bat gap ky t u 0 ^ sau ky tU 1.
2. Tren m5i t i t vao dang Ól-', Ian luot doc cdc ky t u 0 cua tijt vao cho den ky t u 1 dau tien tren bang mot va dong
thdi sao chep chiing sang bang haị t 3. D i chuyen dau doc-ghi bang hai theo chieu nguoc lai,
con dau doc-ghi bang mot t i i n g bade doc tiep cac ky t u 1 cho den hgt. K h i moi ky tU 1 ducc doc, mot ky t u 0 tren bang hai dugc x6a bọ
• 4. Neu t a t ca cac ky t u 0 dUdc xoa bo ciing luc moi ky t u 1 duoc doc h^t, t h i chap nhan; ngUOc lai, bdc bọ"
Do qua t r i n h xiJt ly ciia mdy Turing tat dinh hai bang Â"^^ gom 4 budc t i n h toan don gian va tuong doi doc lap nhau, nen viec phan tich may Â^^ kha de dhng. Moi budc t i n h tôn duoc thuc
hien trong thdi gian 0[n]. V i vay may Turing yl^^) I^Q^^ ^^^^^ trong
thdi gian tuyen t i n h .
2.1 Do phixc tap thdi gian cua cac loai may Turing 131
Dg xay dung cu t h i may 71 (2) ^j^^j^ ^j^.^j^
phiic tap thdi gian ciia may, ta c6 thg t r i n h bay tuan t u qua t r i n h tinh toan cua may Ấ^'^ nhu sau: Lan luot doc cac ky t u 0 dau tien cua t i l vao cho den khi gap ky t u 1 va dong thdi sao chep chung sang bang haị Tigp theo, d i chuygn dau doc-ghi bang hai theo hudng ngUOc lai, t t m g budc kiem tra xem phan con lai cua t i i vao c6 gom toan nhflng ky t u 1 va ve so luqng c6 khdp vdi nhOng ky t u 0 tren bang hai hay khong? Ngu viec kigm tra cho ket qua dung, t h i chap nhan t\l vao; ngUOc lai, bdc bọ N h u vay, trong qua t r i n h kigm t r a nay, may Ấ^^ dong thdi loai bo nhung tijt ma chiia ky t u 0 sau ky t u 1. Hon niia, trong suot qua trinh tinh toan, dau doc-ghi bang mot hau n h u luon d i chuyen t i t t r a i qua phai, trir mot vai thdi diem diing yen (ching han n h u khi can danh dau dau bang hai, hoac k h i dau doc-ghi bang hai đi hudng di chuygn). Theo nhiing goi y chi tiet nky, ta dg dkng xay dung mot each cu the may Turing Ấ^\
va khi do do phiic tap thdi gian cua may dUdc xac dinh mot each chinh xac la n + 3. Nhan thay rang, thdi gian tuyen t i n h noi chung la luong thdi gian toi t h i i u ma may can sijt dung k h i doan nhan ngon ngil, bdi v i chi rigng viec doc het t i i vao cung da can d^n n
don v i thdi gian.
Tom lai, vg dO phiic tap thdi gian ciia ngon ngfl L ngu trgn, ta CO mot vai nhan xet va ket luan sau daỵ Thxl nhdt, t a da xay dung may Turing t a t d i n h mot bang A khang dinh L trong thdi gian O n' va may Turing t a t dinh mot bang Á khang dinh L trong thdi gian 0 [ n logs/i]. Ngoai ra, t u y khong chiing m i n h cu thg nhung ta cung luu y rang, khong mot may Turing mot bang nao c6 t h i thuc hign nhanh hdn. ThU hai, ta da de xuat mot may Turing tat dinh hai bang Â^^ khang dinh L trong thdi gian 0[n]. Theo do, luong thdi gian t o i t h i i u can thiet d i k h i n g dinh ngon ngfl L tren may
Turing t a t dinh mot bang la 0[n \0g2n] va tren may Turing t a t dinh
hai bang la 0[n]. N h u vay, t a c6 t h i k h i n g dinh rang "do phiic tap
thdi gian" ciia ngon ngfl L phu thuoc vao mo hinh t i n h toan mk t a
132 Do phijtc tap thdi gian Cac khao sat kidu nhu vay la mot trong nhiing nOi dung quan trong cua ly thuyet do phufc tap tiiih toan. Dong thdi, cung chinh dieu do t h i hien su khac nhau cd ban giua ly thuygt do phiic tap tinh toan va ly thuyet ve kha nang tinh toan. Trong ly thuyet ve kha nSng tinh toan, luan de Church-Turing ham y rang moi mo hinh tinh toan thich hdp deu tUdng duong nhau, va do do chung khang dinh ciing mot Idp ngon ngu:. Trong ly thuyet do philc tap tinh toan, viec lua chon mo hinh tinh toan c6 anh hudng dang kg den viec xac dinh do phutc tap cua ngon ngu;. T h i d u , mot ngon ngu: duac khang dinh bdi mot mo hinh nay trong thdi gian tuygn tinh chang han, khong nhat thiet dudc khang dinh trong thdi gian
tuyen tinh hdi mot mo hinh khac.
Mot trong nhflng muc tieu chinh cua ly thuyet do phiic tap tinh toan la viec phan Idp cac bai toan theo do philc tap thdi gian cua chung. Nhilng do phiic tap thdi gian cua bai toan dudc quy chudn
theo mo hinh tinh toan nao la dieu ckn dudc xac dinh. B5i v i , ciing mot ngon ngu: c6 th& doi hoi nhiing ludng thdi gian khac nhau tren
cac mo hinh tinh toan khac nhaụ
May sao, doi vdi cac mo hinh tinh toan ki6u tat dinh, ludng thdi gian doi hoi tuy c6 khac nhau nhinig khong dang k6. Qua vay, neu each phan Idp khong qua nhay cam vdi nhflng sir khac nhau tudiig doi nho (theo mot nghia nao do) cua do phiic tap, t h i viec lira chon mo hinh tinh toan tat dinh se khong qua quan trong va dam bao tinh 6n dinh cua he thong phan Idp. Dieu nay se dirdc thg hien trong cac phan tiep theọ
2.1.3 Quan he thcfi gian giiJa cac loai may
Ta hay khao sat miic do anh hadng cua vice lira chon mo hinh tinh toan doi vdi do phiic tap thdi gian cua ngon ngfl. Cac mo hinh tinh
toan dudc lira chon d day la nhiing mo hinh cd ban quen thuoc, do
la may Turing tat dinh mot bang, may Turing tat dinh nhieu bang
va may Turing khong tat dinh.
2.1 Do phiic tap thdi gian cua cac loai may Turing 133
Vg kha nang tinh toan, cac Dinh ly 1.2.1 va 1.2.3 chiing to rang ba mo hinh nay tudng dudng nhaụ Sau day ta se xem xet mot each t i m i sir tUdng dUdng nay tren quan digm do phiic tap tinh toan va qua do lam sang to phan nao miic dO anh hirdng cua viec lira chon mo hinh tinh toan doi vdi do phiic tap thdi gian cua ngon ngiị
D i n h ly 2.1.3 Gid sit t : N —> N la mot ham ma t{n) > n.
Khi do moi may Turing tat dinh nhieu bang thdi gian t{n) deu c6 may Turing tat dinh mot bang thdi gian 0[t'^{n)] tuang dicang.
Chiing minh PhiTdng phap chiing minh dinh ly nay kha đn gian.
Theo Dinh ly 1.2.1, mdi may Turing k bang A/^*^^ cho trudc deu
dudc chuygn đi thanh mot may Turing mot bang M tUdng dudng, bang each mo phong qua trinh tinh toan cila may M^'^^ tren m5i tit
vaọ Dg chiing minh dinh ly, ta tien hanh phan tich viec mo phong nay, chu yeu la phan tich qua trinh mo phong mdi budc bien đi
cd ban ciia may M'^''\a nhd do ta xac dinh lirdng thdi gian can
thiet cho may M. Ta se chiing to rang, moi phep bien đi cd ban
cua may Turing nhieu bang A/^'^) dUdc mo phong trgn may Turing
mot bang M bdi khong qua 0[t{n)] phep bien đi, trong do t{n) la do phiic tap thdi gian cua M^^\o do lirdng thdi gian ma may
Turing mot bang M can dung la 0{t^{n) .
Hoat dong ciia may Turing dUdc mo ta trong Dinh ly 1.2.1,
bao goni hai giai doan ke tiep nhaụ Do la viec may M chinh trang
lai bang ciia minh (Budc 1) va tigp dgn la viec mo phong tiTng phep
bign đi cd ban cua may A/^^) (cac Budc 2 va 3).
Giai doan mot. May M tign hanh chinh trang lai bang ciia n6
bang each phan chia khiic dau cua bang thanh k doan bdi k + 1
<Jau thang U kg t i i 6 dau tien, sao cho tren do thg hien dudc nhflng
tbong t i n vg tflng bang ciia may M''^'> vao thdi digm ban dau, bao gom noi dung cua bang va ky tir tren bang do ma may M^^^ dang
(ky tir nay dudc thg hien bang each thgm mot dau cham " ' " ^ ben tren, va thi;c chat day la mot ky tir khac tirdng ling). Theo
134 Do phijfc tap th5i gian
do, bang cua M vdi t i t vac w = 0^02..-On sau k h i duoc chinh trang se CO nOi dung ^0,02.-0^^ • • • »<2)tt vdi dO dai n + 2k. Vice chinh
trang dudc coi la hoan t a t khi dau doc-ghi quay t r d lai v i t r i o dau
tien tren bang. N h u vay, giai doan mot ket thuc nhd 2{n + 2k) phep
n
bien d6i co ban, tutc duoc thuc hien trong thdi gian O
Giai doan haị Viec chinh trang lai bang tao moi trudng thuan
loi dg m o i k h i may A/ bat dau mo phong bat cut m o t phep bign
d6i CO ban nao cua may M'^'^\n bang t h i i i (nkm giiia cac d i u
thang t h i i I va thur i + 1, 1 < i < A; - 1) thg hien duoc nhiing thong
t i n ve bang thuf i vao thdi digm ma may M^^'> bat dau thuc hien phep bien d5i cO ban ( d i viec xiJt ly cua may M dUdc đn gian,
ta CO thg cho taong ilng doan bang t h i l / nay v6i khuc dau bang
i cua may M^'^\g t i i o thiJt nhat den o ma dau doc-ghi cua Af^*^) ttrng d i chuygn den). Ngoai ra, cung vao thdi digm nay, dau doc-ghi cua A/ a o dau tign va may A/ 6 trang thai g( X ' X ) - ( X ' X ) l x . x l tuong
ling vdi trang thai qs cua may A/^'^) vao thdi digm bat dau thitc
hien phep bien d 6 i cd ban mk may A/ mo phong. Nhiing thong t i n
nay the hien hinh thai cua cac may A/, tiTOng ling vdi hinh thai
( ( / „ ( . . . x i , y i 2 i . . . ) , . . . , (...Xfc.j/fcZfc...)) ciia may M^''\k duoc dign
ta n h u trgn H i n h 2.3 sau daỵ ' 1
XiVyAZi
( x , x ) . . . ( x , x ) l x , x l
H i n h 2.3 Hinh thai cua may M k h i hii dau mo phong
phep bien d 6 i co ban cua may A/^*^)
Dg mo phong m5i phep bien doi ca ban ciia mdy M^^'> nhu da t r i n h bay trong D i n h ly 1.2.1, may M d i chuygn dau doc-ghi t i i dau tt
dau tien dgn dau tt cuoi cung, qua k doan bang, va t h u thap kky t\i\ vQ\u cham bgn trgn cl m6i doan. Tiep tuc, d i chuyin dau doc-ghi
2.1 Do phiic tap thdi gian cua cac loaj mMi_Tnrir,rj
135 theo chieu nguoc lai cho dgn dau tt dau tign, may thay titng ky t u vdi dau cham ben tren bang ky t u khac m o i khi bat gap 5 doan bang nao do va dong thdi danh dau cham phia tren ky t u 6 o ben trai hoac ci 6 bgn phai (neu ky t u 5 do khac tt), phu hop vdi viec x i i ly cua dau doc-ghi tren bang tudng Ung cua may
Trong trudng hop hoan toan thuan loị khi m o i ky t u 5 6 bgn
phai viJta neu deu khac ti, viec mo phong moi phep bien d 6 i co ban
cua A/''^^ duoc thuc hien trong thdi gian 0[t,[n). Bdi vi, dau doc- ghi cua may Af d i chuygn qua k doan bang luon luon lien tuc tir
trai qua phai va cung hau n h u j i g n tuc theo chieu ttr phai qua trai,
ngoai trif khong qua k thdi digm can quay lai mot o dg danh dau
cham phia trgn ky t u cl dọ Hdn niia, theo gia thiet, moi doan bang
CO khong qua t{n) + 1 6 .
Xet trudng hdp bat Idi khi ky t u can dudc danh dau cham phia tren lai la dau thang tt t h i i / nao do, 2 < t < fc + 1. Dieu nay c6 nghia la dau doc-ghi bang i - 1 cua may A l'^'^^ d i chuyen den o trang
ma Ian dau tign no tdị Trong trudng hdp nay, may A/ dich chuygn phan duoi noi dung tren bang sang phai mOt 6, kg tir dau thang thii I nay den dau thang cuoi, va ghi 0 vao o vita dUdc giai phong
(0 chiia dau tt t h i i /). Vice dich chuygn dUdc coi la hoan t a t k h i dau
doc-ghi quay t r d lai v i t r i dau thang t h i i i dg tiep tuc tien hanh mo
phong. Cung theo nhan xet ngu trcn ve so o cua m o i doan bang, viec dich chuygn phan npi dung nhu vay doi vdi moi / (2 < i < fc + 1 )
duoc thuc hien trong thdi gian 0[t{n). K e t hdp nhiing phan tich
n^y vdi viec phan tich trudng hdp thuan Idi, t a suy r a rang trong
trudng hdp bat Idi nhat (khi k lan can danh d i u c h i m phia trgn ky
tu t a dgu gap phai dau tt), viec mo phong phep bien dSi cd ban cua
^^^''^ dudc thuc hien trong thdi gian 0 [ i ( n ) ] + kO[t{n)\ 0[i(/t) . Ket qua phan tich tren day chiing to rang, moi phep bien doi cd ban ciia may M^^^ dUdc mo phong trong thdi gian 0 [ f ( n ) ] . V i the, giai doan hai, viec mo phong t[n) phep bign d 6 i cd ban cua may ^^^^^ trgn may M doi hoi ludng thdi gian i ( n ) 0[t{n)] = 0\e{n) .
136 Do phufc tap thdi gian
Vay la viec chinh trang lai bang cua may M dugc thuc hien trong thdi gian 0[n] va qua trinh mo phong can siJt dung luong thdi
gian 0[i^(ri)]. Do do, may Turing mot bang M hoat dong trong thdi gian 0[n] + 0[t'^{7i)], tufc trong thdi gian 0[t'^{n) . •
Cuoi C l i n g , luu y r^ng gia thigt t{n) > n la hoan toan hop lỵ
B6i V I , d i di den mot quygt dinh nao do doi vdi tilt vao d o dai n, rieng viec doc het ttf nay cung da can den n don v i thdi gian, trCr
cac quyet dinh ve nhflng su viec tam thudng (ching han nhu kigm
tra xem hai ky t u dau cua tCt vao c6 giong nhau hay khong).
Dinh ly d U O c chilng minh. •
N h u vay, neu mot ngon ngfl dugc khang dinh trong thdi gian
t{n) bdi may Turing tat dinh nhieu bang t h i dUdc khang dinh trong
thdi gian 0[f{n)] hdi may Turing tat dinh mot bang. Sau day ta se
trinh bay dinh ly tuong tU cho may Turing tat dinh va may Turing khong t a t dinh, va qua do thay dudc mOt su khac biet rat Idn theo tieu chuan do phiic tap tinh toan giflia hai mo hinh tinh toan naỵ D l tien theo doi, ta hay nhac lai doi dieu lien quan den may Turing khong t a t dinh. Do nhiing dac tinh rieng, qua trinh tinh
toan cua may Turing khong tat dinh tren moi tvL vao w dUdc
thg hien dudi dang mot cay tinh toan c6 hudng TN{W), sao cho m5i nhanh xuat phat tit goc cay la mot phiTdng an t i n h toan ma may c6
thg lira chon. Neu Á^ la mot may Turing diing t h i moi nhanh tinh
toan trong TN{W) tven moi til vao w deu hiiu han. Trong trudng
hop nay, theo Dinh nghia 2.1.2, do phiic phiic tap thdi gian cua N chinh la do dai cua nhanh dai nhat trong cay tinh toan Ti^{w) tren moi t i t vao w vdi ciing do dai n, nhu duoc minh hoa bdi Hinh 2.1.
May Turing khong t a t dinh hoan toan khong thich hop vdi bat
c i i mo hinh tinh toan thuc te nao hien c6. Tuy vay, day lai la mot mo hinh tinh toan hinh thiJc dUdc sii dung mOt each rat hiiu ich
trong viec dac t r u n g do philc tap cua mot Idp kha rong rai cac bai
toan quan trong. •• • ' ; v .. ^ =
2.1 Do phiic tap thdi gian cua cac loaj may Turing
1371
Bay gid, tren quan didm do phiic tap tinh toan, ta khao sat moi quan he t U O n g d u o n g giiia may Turing tat dinh mot b a n g va may Turing khong t a t dinh.
D i n h ly 2.1.4 Gia t : n — y n la mot ham ma t{n) > n.
Khi do moi may Turing khong tat dinh thdi gian t{n) din cd may Turing tat dinh mot bang thdi gian 2^t'(")' tUOng duang.
ChUng minh Gia sii Á' la may Turing khong tat dinh thdi gian
t{n). Trong chilng minh Dinh ly 1.2.4 ta da xay dung may Turing
tat dinh ba bang M, mo phong may Á' bang each tinh toan theo
cac nhanh xuat phat t i t goc trong cay tinh toan cua Á', bat dau t i t
nhiing nhanh ngan den nhiing nhanh dai hon. Do moi nhanh tinh
toan dugc ling vdi mot t i t chi d i n trgn bang chii = { 1 , 2 , . . . , c/},
trong do d la so toi da cac kha nang ma may Á' d U d c phep lua chon
tai mdi thdi digm hoat dong. Cho nen dg mo phong Á', may M tien
hanh tinh toan theo sit chi dan cua cac t i t thuoc E j , bat dau theo
nhiing t i t ngan den nhiing i\i dai hon ( E ^ la tap t a t ca cac t i t khac
rong trgn bang chii Ê).
Theo gia thiet ve dO phiic tap thdi gian ciia may N, doi vdi moi
t i i vao w do dai n, mdi nhanh trong cay tinh toan cua Á' tren w d^u CO do dai khong qua t{n). V i vay, trong trudng hop nay may
^1 chi can tien hanh tinh toan theo su chi dan bdi cac t i t thuoc
2t(n) ^ ^ J ( n ) ^^^^^ ^j,gj^ j ^ ^ ^ g ^ j ^ ^ ^^^^
may Turing diing. Cu thg, doi vdi m6i t i t vao w, neu theo mot t i i