Language IN๐บ๐ฝ๐๐ฝ๐๐น
- ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น = ๐ฅ ๐ โณ ๐ฅ
is infinite}
- We will show this is not computable by using
๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น to compute ๐ผ๐ต๐๐
1
Language IN = is - - PowerPoint PPT Presentation
Language IN = is infinite} We will show this is not computable by using to compute 1 Halts? It is
1
2
Build this machine: ๐๐ฅ๐ฆ: 1) run โณ(๐ฅ)(๐ฆ) 2) return 1 โณ ๐ฅ ๐ฆ Halts? It is infinite โณ ๐ฅ ๐ฆ Doesnโt Halt? It isnโt infinite
3
Is L โณ ๐ฅ infinite? ๐ตโ ๐ฅ ๐ โณ ๐ฅ is/isnโt infinite ๐ต๐ฐ๐ฉ๐ด๐ผ Does โณ ๐ฅ ๐ฆ halt? โณ ๐ฅ ๐ฆ does/doesnโt halt Assume we have ๐โ which computes ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น: We could then build ๐๐ผ๐ต๐๐ which computes ๐ผ๐ต๐๐like this: ๐ฅ ๐ฆ
Build this machine: ๐๐ฅ๐ฆ: 1) run โณ(๐ฅ)(๐ฆ) 2) return 1
Is L ๐๐ฅ๐ฆ infinite? ๐ตโ
4
๐ผ๐ต๐๐
Problem know is impossible
๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น
Problem we think is impossible ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น solver exists
Build (but donโt run) ๐๐ฅ๐ฆ
Assume Reduction Does โณ(๐ฅ) halt on input ๐ฆ? Is L โณ ๐ฅ infinite? ๐๐ผ๐ต๐๐ computes ๐ผ๐ต๐๐ Give ๐๐ฅ๐ฆ to the ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น solver, then answer the same
5
Is L โณ ๐ฅ finite? ๐ต๐ฎ๐ฑ๐ถ๐ฑ๐ผ๐ญ ๐ฅ ๐ โณ ๐ฅ is/isnโt finite ๐ตโ Is L โณ ๐ฅ infinite? ๐ โณ ๐ฅ is/isnโt infinite Assume we have ๐๐บ๐ฝ๐๐ฝ๐๐น which computes ๐บ๐ฝ๐๐ฝ๐๐น: We could then build ๐โ which computes ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น like this: ๐ฅ Is L โณ ๐ฅ finite? ๐ต๐ฎ๐ฑ๐ถ๐ฑ๐ผ๐ญ
6
7
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return MAJ(๐ง) โณ ๐ฅ ๐ฆ Halts? It is non-regular โณ ๐ฅ ๐ฆ Doesnโt Halt? It isnโt non-regular
8
Is L โณ ๐ฅ non- regular? ๐ต๐ถ๐บ ๐ฅ ๐ โณ ๐ฅ is/isnโt non-regular ๐ต๐ฐ๐ฉ๐ด๐ผ Does โณ ๐ฅ ๐ฆ halt? โณ(๐ฅ)(๐ฆ) does/doesnโt halt Assume we have ๐๐๐ which computes ๐๐๐๐๐๐: We could then build ๐๐ผ๐ต๐๐ which computes ๐ผ๐ต๐๐like this: ๐ฅ ๐ฆ
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return MAJ(๐ง)
Is L โณ ๐ฅ non- regular? ๐ต๐ถ๐บ
9
๐ผ๐ต๐๐ ๐๐๐๐๐๐
Describe that machine ๐๐ฅ๐ฆ
Assume Reduction ๐๐ผ๐ต๐๐ computes ๐ผ๐ต๐๐ Give ๐๐ฅ๐ฆ to the ๐๐๐๐๐๐ solver, then answer the same ๐๐๐๐๐๐ solver exists Does โณ(๐ฅ) halt on input ๐ฆ? Is L โณ ๐ฅ non- regular?
10
Is L โณ ๐ฅ regular? ๐ต๐๐๐ ๐ฅ ๐ โณ ๐ฅ is/isnโt Regular ๐ต๐ถ๐บ Is L โณ ๐ฅ non-regular? ๐ โณ ๐ฅ is/isnโt non- regular Assume we have ๐๐๐๐ which computes ๐๐๐๐๐๐: We could then build ๐๐๐ which computes๐๐๐๐๐๐ like this: ๐ฅ Is L โณ ๐ฅ regular? ๐ต๐๐๐
11
12
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐ง == 101 โณ ๐ฅ ๐ฆ Halts? It does accept 101 โณ ๐ฅ ๐ฆ Doesnโt Halt? It doesnโt accept101
13
Does โณ(๐ฅ) accept 101? ๐ต๐ฉ๐๐๐ ๐ฅ โณ(๐ฅ) does/doesnโt accept 101 ๐ต๐ฐ๐ฉ๐ด๐ผ Does โณ ๐ฅ ๐ฆ halt? โณ(๐ฅ)(๐ฆ) does/doesnโt halt Assume we have ๐
๐ต101
which computes๐ต๐๐๐๐๐ข101: We could then build ๐๐ผ๐ต๐๐ which computes ๐ผ๐ต๐๐like this: ๐ฅ ๐ฆ
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐ง == 101
Does โณ(๐ฅ) accept 101? ๐ต๐ฉ๐๐๐
14
๐ผ๐ต๐๐ ๐ต๐๐๐๐๐ข101
Describe that machine ๐๐ฅ๐ฆ
Assume Reduction ๐๐ผ๐ต๐๐ computes ๐ผ๐ต๐๐ Give ๐๐ฅ๐ฆ to the ๐ต๐๐๐๐๐ข101 solver, then answer the same ๐ต๐๐๐๐๐ข101 solver exists Does โณ(๐ฅ) halt on input ๐ฆ? Is 101 โ L โณ ๐ฅ ?
15
Is 101 โ L โณ ๐ฅ ? ๐ต๐101 ๐ฅ 101 isnโt/is in ๐ โณ ๐ฅ ๐ต๐ต101 Is 101 โ L โณ ๐ฅ ? 101 is/isnโt in ๐ โณ ๐ฅ Assume we have ๐๐101 which computes ๐๐๐๐๐๐ข101: We could then build ๐
๐ต101
which computes ๐ต๐๐๐๐๐ข101 like this: ๐ฅ Is 101 โ L โณ ๐ฅ ? ๐ต๐101
16
Is ๐ฅ โ L? ๐ต๐ด ๐ฅ ๐ฅ is/isnโt in ๐ Assume we have ๐๐ which computes ๐: ๐ต๐๐ Is ๐ฅ โ L? We could then build ๐๐๐ which computes ๐๐ like this: ๐ฅ Is ๐ฅ โ L? ๐ต๐ด ๐ฅ isnโt/is in ๐
17
๐๐ ๐
Donโt change ๐ฅ
If Reduction ๐๐ solver exists Give ๐ฅ to the ๐ solver, then answer the
๐ solver exists ๐ฅ โ ๐? ๐ฅ โ ๐? ๐ solver doesnโt exist ๐๐ solver doesnโt exist
โ i.e. they compute the same function/language
โ Formally, if ๐ is semantic, then for machine ๐, ๐โฒ that are functionally equivalent, ๐ ๐ == ๐ ๐โฒ โ If ๐, ๐โฒ have the same input/output behavior, and ๐ is a semantic property, then either bother ๐ and ๐โฒ have property ๐, or neither of them do.
18
โ Is the language of this machine finite? โ Is the language of this machine Regular? โ Does this machine reject 101? โ Does this machine return 1001 for input 001? โ Does this machine only ever return odd numbers? โ Is the language of this machine computable?
โ Does this machine ever overwrite cell 204 of its tape? โ Does this machine use more than 3102 cells of its tape on input 101? โ Does this machine take at least 2020 transitions for input ๐? โ Does this machine ever overwrite the ๐ผ symbol?
19
20
๐ is โtrivialโ Return 1 Return 0
(otherwise substitute ยฌ๐, then answer opposite)
โ If โณ(๐ฅ)(๐ฆ) halts, ๐ ๐๐ฅ๐ฆ = ๐ ๐โ๐๐ก ๐ โ If โณ(๐ฅ)(๐ฆ) doesnโt halt, ๐ ๐๐ฅ๐ฆ = L ๐โ = โ โ ๐(๐๐ฅ๐ฆ) has property ๐ if and only if โณ ๐ฅ ๐ฆ halts
21
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐โ๐๐ก ๐(๐ง) โณ ๐ฅ ๐ฆ Halts? It has property ๐ โณ ๐ฅ ๐ฆ Doesnโt Halt? It doesnโt have property ๐
22
Does โณ(๐ฅ) have property ๐? ๐ต๐ธ ๐ฅ โณ(๐ฅ) does/doesnโt have property ๐ ๐ต๐ฐ๐ฉ๐ด๐ผ Does โณ ๐ฅ ๐ฆ halt? โณ(๐ฅ) does/doesnโt have property ๐ Assume we have ๐๐ which computes ๐: We could then build ๐๐ผ๐ต๐๐ which computes ๐ผ๐ต๐๐like this: ๐ฅ ๐ฆ
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐โ๐๐ก ๐(๐ง)
Does โณ(๐ฅ) have property ๐? ๐ต๐ธ
23
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐๐ผ๐๐ก ๐(๐ง)
โ Is the language of this machine finite? โ Is the language of this machine Regular? โ Does this machine reject 101? โ Does this machine return 1001 for input 001? โ Does this machine only ever return odd numbers? โ Is the language of this machine computable?
โ Does this machine ever overwrite cell 204 of its tape? โ Does this machine use more than 3102 cells of its tape on input 101? โ Does this machine take at least 2020 transitions for input ๐? โ Does this machine ever overwrite the ๐ผ symbol on input ๐?
24
25
26
Warm up: To measure the โcostโ of computing something, what would units should we use?
28
29
โ NAND-CIRC: answer is YES iff ๐ is finite โ FSA: answer is YES if function doesnโt require โmemoryโ โ TM: Answer is NO for ๐ผ๐ต๐๐๐๐, ๐บ๐ฝ๐๐ฝ๐๐น, โฆ (and many other things)
โ NAND-CIRC: How many gates? โ FSA: (we never talked about this) โ TM: How many transitions are required (time)? How many tape cells are required (space)?
30
31
โ We have an even state and an odd state โ For each bit, move right, switch states if 1 โ Halt when you get to end of input
โ Find a zero, cross it off โ Go to beginning โ Find a one, cross it off โ Go to beginning โ Halt when no more 0s or no more 1s
32
33
๐๐ฝ๐๐น ๐ ๐๐ฝ๐๐น 10๐ ๐๐ฝ๐๐น ๐3 ๐๐ฝ๐๐น 2๐
34
35
A tape was probably a reasonable memory model
36
Can look up two locations without visiting all locations between. โRandomโ access (RAM)
To transition: 1. Have a second tape to keep track of current location (increment each time we move right, decrement for left) 2. Have a third tape to record the target location 3. Move until the two tapes match
1. Maybe we need another tape to do this?
(details not important, but if you want them, see 7.2 in text) Important observation: Tape-machine takes more steps than a RAM machine (if a RAM-TM computes ๐ in ๐(๐) time, a tape TM can compute ๐ in ๐ ๐
4
time, see theorem 12.5 for details)
37
38
39
10 2 6 11 9 5 8 3 7 3 1 8 12 9 A B C D E F G I H
๐ = {๐ต, ๐ถ, ๐ท, ๐ธ, ๐น, ๐บ, ๐ป, ๐ผ, ๐ฝ} ๐น = { ๐ต, ๐ถ , ๐ต, ๐ท , ๐ถ, ๐ท , โฆ }
40
10 2 6 11 9 5 8 3 7 3 1 8 12 9 A B C D E F G I H A B C D E F G H I B C A C E A B D F C E F B D G H C D G E F H I E G I G H
Tradeoffs Space: Time to list neighbors: Time to check edge (๐ต, ๐ถ):
๐ + ๐น ๐ธ๐๐๐ ๐๐(๐ต) ๐ธ๐๐๐ ๐๐(๐ต)
41
10 2 6 11 9 5 8 3 7 3 1 8 12 9 A B C D E F G I H A B C D E F G H I
Tradeoffs Space: Time to list neighbors: Time to check edge (๐ต, ๐ถ):
๐2 ๐ ๐(1) A B C D E F G H I 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
42
10 2 6 11 9 5 8 3 7 3 1 8 12 9 A B C D E F G I H
A sequence of nodes (๐ค1, ๐ค2, โฆ , ๐ค๐) s.t. โ1 โค ๐ โค ๐ โ 1, ๐ค๐, ๐ค๐+1 โ ๐น Simple Path: A path in which each node appears at most once Cycle: A path of > 2 nodes in which ๐ค1 = ๐ค๐
43
A B C D E F G I H Shortest path from A to E has length 2
44
Find a path from ๐ก to ๐ข Keep a queue ๐ of nodes โ๐๐๐ก = 0 ๐ . ๐๐๐๐ฃ๐๐ฃ๐((๐ก, โ๐๐๐ก)) While ๐ is not empty and ๐ค ! = ๐ข: ๐ค, โ๐๐๐ก = ๐ . ๐๐๐๐ฃ๐๐ฃ๐() for each โunvisitedโ ๐ฃ โ ๐ s.t. ๐ค, ๐ฃ โ ๐น: ๐ . ๐๐๐๐ฃ๐๐ฃ๐((๐ฃ, โ๐๐๐ก + 1))
Running time: ๐ ๐ + ๐น
45
46