Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
제 9장. Turing Machines
학습목표
Turing Machine의 작동원리와 일반적인계산모형으로서의 가능성 이해
Welcome to 현실세계의 계산모형
개요
•표준 튜링 머신
– 가장 강력한 오토메타
– 계산 한계 규명의 도구
• 튜링 머신의 결합
• Turing Thesis
철저한 증명보다는 개념적인 이해 및 응용 예 숙지 필요
왜? 너무 자세히 하기에 너무 복잡해서리…하지만, 기본 방법은 이미 알고있는…
기본 구성 및 왔다리 갔다리 방식의작동원리 이해
실제 컴퓨터 언어에서 처럼 복잡한문제를 해결하는데는 단순한 모듈의결합이 제격!
튜링 머신의 power를 보여주는 명제
Standard TM
),,(),(Ex 10 Rdqaq =δ0q
a b c
states final :state initial :
blank },{:fn. transition :
alphabet tape :alphabetinput :
states internal :),,,,,,(:Def.
0
0
QFQq
RLQQ
QFqQM
⊆∈Γ∈
×Γ×→Γ×ΓΣ
ΓΣ=⋅
: □
□
δδ
δ
1q
d b c
cu
R/W head
Tape
여러 가지 정의의 TM에 대한 표준정의
TM의 정의: Halt
a a
0q
b b
0q
b b
1q),,(),(),,(),(),,(),(
10
00
00
LqqRbqbqRbqaq
□□ ===
δδδ
),,(),(),,(),(),,(),(),,(),(),,(),(),,(),(
01
01
01
10
10
10
LqqLbqbqLaqaqRqqRbqbqRaqaq
□□
□□
======
δδδδδδ
b
0q
a
⇒ infinite loop
• Def A TM is to halt iff it reaches a configuration for which δ is not defined
.Ex
.Ex
이제까지 우리가 알고 있는 계산기의프로그래밍과 유사하지요.
Standard TM
TM의 정의: 기계의 상태 표현
nkkk aaaqaaaxqx LL 112121 or +−
dabeqcdabqReqcqδ
21
21 ),,(),(├
=
bbqaaq
bbqbbqabqaaq
1
*
0
1000
├
├├├ □
: ├⋅
• Def instantaneous description
.Ex
q
ka 1+ka1−ka⋅ na1a 2a
1x 2x
⋅⋅ ⋅ ⋅ ⋅
Standard TM
TM의 정의: Computation
undefined is),(,y 21*
21 aqayqxqx jji δ├
∞*
21 ├xqx
• Def computation
• cf infinite loop
= sequence of configurations leading to a halt state
Standard TM
cf. if w L(M)
1. machine can halt in a nonfinal state2. it can enter an infinite loop & never halt
TM as Language Accepters
},, somefor :{)(
),,,,,,{.Def
*2121
*
0
0
Γ∈∈Σ∈=
ΓΣ=
+
⋅xxFqxqxwqwML
FqQM
ff├
□δ
*00accept toTM adesign },1,0{.Ex =Σ
∉
),,(),(),0,(0),(
10
00
RqqRqq
□□ ==
δδ
right movingby continue0 is read symbol theifcheck :idea⋅
TM as Language Accepters: 예
210 qqq
}1:{accept toTM adesign },,{Ex. ≥==Σ nbaLba nn
ybxa
→→
firstleftmost anext
),,(),(),,(),(),,(),(),,(),(
21
11
11
10
LyqbqRyqyqRaqaqRxqaq
====
δδδδ
),,(),(),,(),(),,(),(
02
22
22
RxqxqLaqaqLyqyq
===
δδδ
),,(),(),,(),(),,(),(
43
33
30
RqqRyqyqRyqyq
□□ ===
δδδ
ybxa →→⋅ :idea
좀 복잡해 보이지만 상식적인 문제해결 방식과 같죠!
TM as Language Accepters: 예2
□□
□
├
├├├
├├├
├├├
├├├
4
330
221
102
2110
qxxyyxxyyqyxxyqyyxxq
xyyxqyyxxqbxxyqybxxqaybxqxaybq
aybxqbbxaqabbxqaabbq
}1:{accept toTMaDesign Ex. ≥= ncbaL nnn
zyxcba ,,,, →
실제 계산기를 흉내 내려면 accepter만으로는…
TM as Transducers
Fqwfqwq
FqQMDf
ffM ∈
∋ΓΣ=∃⋅
),(
),,,,,,( TM some e)(computabl computable-Turing :on Def.
*0
0
├
□δ
yx + compute toTM aDesign Ex.
• purpose of computation = transform input into output
xxw =⋅
|)(|integers positive oftion representa :idea
0)()(0)(*
0 yxwqywxwq f +├
TM as Transducers: 예
wwqwq f*
0 ├
Ex design a TM to copy strings of 1’s
),,(),(),1,()1,(
31
11
RqqLqq
□□ ==
δδ
),1,(),(),1,()1,(),1,(),(
12
22
21
LqqRqqRqxq
===
□δδδ
),,(),(),,()1,(
10
00
LqqRxqq
□□ ==
δδ
1createend,rightnextforback1rightmost1every ⎯→⎯→⎯→⎯→ xx
TM as Transducers: 예2
⎩⎨⎧
<
≥
yxq
yxq
n
y
ifstatenonfinalain
ifstatefinalainhalttoTMaDesignEx.
yxywxwqywxwq
yxywxwqywxwq
n
y
<
≥
if),(0)()(0)(
if),(0)()(0)(*
0
*
0
├
├
n
y
qxxxxxxx
qxxxxx
⎯→⎯
⎯→⎯
□
□
110
110
LL
LL
Standard TM: Exercises 9.1
• 5 : 간단한 문제로 답도 간단합니다.
• 8 : 좀 지루한 작업을 필요로 합니다. 만, 대부분의 TM과 관련된 문제가이와 같은 작업을 필요로 하기 때문에 한번 해봅시다. 어쨌든, pda가할 수 없는 일을 TM이 한다는 사실에 유의할 것.
Combining TM for Complicated Tasks
yxyxyxyxf
fn.
Combining TM for Complicated Tasks: 예
Ex
0)()(0)(
if),(0)()(0)(
,
*
0,
0,
*
0,
yxwqywxwq
yxywxwqywxwq
fAA
Ac
+
≥
├
├
kj qqa elsethen ifuctionmacroinstr thefor TM aDesign
0)(0)(
if),(0)()(0)(
,
*
0,
0,
*
0,
fEE
Ec
qywxwq
yxywxwqywxwq
├
├ <
QqRaqaq iji ∈= allfor),,(),( 0δ
}{allandallfor),,(),( 0 abQqRbqbq iki −Γ∈∈=δ
Γ∈= cLcqcq jj allfor),,(),( 0δ
Γ∈= cLcqcq kk allfor),,(),( 0δ
Region separator
##
Workspace for A Workspace for BT
• Subprogram manipulation in TM
– divide the tape into several regions
• Idea : repeated copying of the multiplicand yfor each 1 in the multiplier x
Ex Design a TM to multiply two positive integers
1. Repeat the following steps until x contains no more 1’sFind a 1 in x and replace it with another symbol aReplace the leftmost 0 by 0y
2. Replace all a’s with 1’s
Combining TM for Complicated Tasks: 예2
• 개념적으로는 어려운 문제가 아니지만, 대부분 일반적인 프로그래밍과
관련된 지루한 코딩이 필요합니다.
• 2번과 4번 정도를 한번 시도해 봅시다.
Combining TM: Exercises 9.2
Turing’s Thesis
DdFqdfqdq
RdfDdMRDf
ffM ∈∀∈
∈→∈∋→⋅
),(
)(answer correct halt with input TM ,:for algorithm :Def
*0 ├
• TM > pda
• TM ? = digital computer
Anything that can be done on any existing digital computer can also by a TM
No one has yet been able to suggest a problem, solvable by what we consider an algorithm, for which a TM cannot be written
Alternative models have been proposed, but none of them are more powerful than TM model
1.
2.
3.
• Any computation by mechanical means by some TM
Turing’s Thesis: Exercises 9.3
• 따로 연습하기 어려운 부분이기는 한데…
• 3문제 모두 한번 생각은 해봅시다.