M tai mot thdi diem ndo do trong qud trinh tinh todn Id mot tH
2. Thuc hien cac bir6c lap tiep theo
S{q4, 0 ) = {q'o, 0 . R) ^ ( ^ 0 , 0) = 0 . R)-
3. Ket thuc:
3ạ Bac bo nhiing tit vao c6 dang Ól^ \di j > i > I
Siq'oA) = {%Ạsy,
3b. Bac bo nhflng t i l vko c6 dang Ól^ vdi i > j > 0
'5(91,0) = ( ^ N , 0, S ) ;
3 c . Chap nhan nhiing t i i vao c6 dang 0*1' v6i i > 1
<5Uo-0) = ( 9 v, 0, S ) .
•
• M a y T u r i n g t i n h cac h a m
Cho ham / : E* —> E*. (Khong mat t i n h t6ng quat, doi v6i moi
ham f : X' —> V*, t a c6 th6 gia thiet rang X = Y hdi v i noi chung
/ la ham bo phan.) Ta hinh dung rang, may T u r i n g t i n h ham /
bang each x i i ly m5i t i i vao it; e E* sao cho, neu t a i w ham / xac
dinh t h i may diing 6 trang thai chap nhan v^ noi dung t r c n bang
la t i i f{w) e E*; ngiidc lai, may diing 6 trang t h a i bac bọ
Triidc k h i dinh nghia mot each hinh thiic khai niem ham t i n h dtfoc, t a hay xem xet mot quan he ham diiOc xac dinh bdi may I Turing cho trudc.
1.1 May Turing 55
Gia sii Af = {Q,T.,r,5,q^,q^,q^) Ih mQt may Turing. Ham
tuang ring vdi may Turing A M a ham tut E* vao F*, duoc ky hỉu la
va diidc d i n h nghia nha sau:
p (^yj-^ _ I uq^v,
I khong xdc dinh, neu ngugc laị
D i n h n g h i a 1.1.8 Ham f : E* — y E* dicac goi la tinh dtCdc
{computable), hay cy, thihan Id tinh dvCdc theo Turing {Turing-
computable), neu ton tai mot mdy Turing diing M sao cho ham
tuang ling vdi no FM trung vdi ham f, tUc FM — f theo nghia, doi
vdi moi to G E*, neu mot trong hai ham xdc dinh thi ham kia cung xdc dinh vd chung nhan cung mot gid trị Khi do ta noi ring "mdy
Turing diing M tinh ham f" hay "ham f tinh dU0c bdi mdy Turing diing M". • '
N h i i vay, doi vdi may Turing M t i n h ham /, tap E khong chi 1^ bang chii vao ma con la bang chU ra cua maỵ Hdn niia, khong
mat tinh t6ng quat, t a luon luon c6 thg gia thiet r^ng moi hinh t h a i
chap nhan cua may M deu c6 dang q^w' vdi w' - f{w) 6 E*. Dieu
nay de dang c6 diidc bang each, triidc k h i dCtng 5 trang thai chap
nhan q^, may Turing ;U di chuyin dau doc-ghi den o chtia ky t i i t h i i nhat cua w' roi mdi diing chinh thiic. Do do, doi vdi mgi dau
vko 6 E*, t a GO:
qow M f xdc dinh tai w vd nhan gid tri f{w).
V f d u 1.1.4 Cho ham / : { 0 , 1 } * { 0 , 1 } * , trong do
j.^ ^ fó*^, n i u w = ÓlO*^ vdi moi i . A; > 1,
\kh6ng xdc dinh, neu ngiroe laị
56 May Turing va Thuat toan That vay, d i tinh ham / ta c6 t h i xay dung mot may Turing
dirng Af theo y tudng sau day: Trirdc tien, loai bo cac til vao khong CO dang ÓlÓ^ {i,k > 1) va ngSn each phan dii lieu dau vao vdi ket
qua tinh toan bdi dau tt; dong thdi, tien hanh chuyin xau Ó^ sang ben phai dau tj bang each Ian luot chuyin tiJtng ky tU mot (ky t u
nao chuyin di thi duac danh dau bdi <S>). Qua trinh chuyin xau
0*^ duoc di§n ra t Ian, moi Ian chuyin nhu vay mot ky tU 0 trong
xau 0' (ben trai ky tU 1) duoc xoa d i . Qua trinh nay ket thiic khi khong con ky tU 0 nao ben trai ky t u 1. Cuoi ciing, trudc khi ket
thtic qua trinh tinh toan, xoa cac ky tU bat dau tiir 1 cho den dau [t,
va khi do tren bang chi con lai dung ik ky tU 0.
Vdi y tudng neu tren, may Turing A f duoc xay dung hdi
M = {Q, {0, 1}, {0, 1,1 0 , 0 } , 6, q,,qy,q^),
trong do g = {^ọ 9o> 9i> ^2, • • •, 99, 9Y, 9N} ham chuyin 6 duqc
xac dinh nhu saụ