CS3102 Theory of Computation
www.cs.virginia.edu/~njb2b/cstheory/s2020
Warm up: How might we try to show that this language is not computable: ๐ฝ๐๐๐๐๐๐ข๐ = ๐ฅ ๐ โณ ๐ฅ is infinite}
CS3102 Theory of Computation - - PowerPoint PPT Presentation
CS3102 Theory of Computation www.cs.virginia.edu/~njb2b/cstheory/s2020 Warm up: How might we try to show that this language is not computable: = is infinite} How to show things arent
Warm up: How might we try to show that this language is not computable: ๐ฝ๐๐๐๐๐๐ข๐ = ๐ฅ ๐ โณ ๐ฅ is infinite}
2
How do we know a machine is impossible? Option 1: It contradicts itself (e.g. ๐๐๐) Option 2: Someone has done this before (e.g. ๐๐๐๐)
3
4
5
Opening a door Problem know is impossible Lighting a fire Problem we think is impossible Alcohol, wood, matches Solution for ๐ช
Keg cannon battering ram Solution for ๐ฉ
Aim duct at door, insert keg
If
Put fire under the Keg
Reduction
6
7
๐ผ๐ต๐๐
Problem know is impossible
๐บ๐ฝ๐๐ฝ๐๐น
Problem we think is impossible ๐
๐๐๐๐๐ข๐ computes ๐บ๐ฝ๐๐ฝ๐๐น
Build (but donโt run) ๐๐ฅ๐ฆ
Assume Reduction Does โณ(๐ฅ) halt on input ๐ฆ? Is L โณ ๐ฅ finite? ๐๐ผ๐ต๐๐ computes ๐ผ๐ต๐๐ Give ๐๐ฅ๐ฆ as input to ๐
๐๐๐๐๐ข๐ answer opposite
8
Build this machine: ๐๐ฅ๐ฆ: 1) run โณ(๐ฅ)(๐ฆ) 2) return 1
9
Is L โณ ๐ฅ finite? ๐ต๐ฎ๐ฑ๐ถ๐ฑ๐ผ๐ญ ๐ฅ ๐ โณ ๐ฅ is/isnโt finite ๐ต๐ฐ๐ฉ๐ด๐ผ Does โณ ๐ฅ ๐ฆ halt? โณ ๐ฅ 1 ! = 1 Assume we have ๐๐บ๐ฝ๐๐ฝ๐๐น which computes ๐บ๐ฝ๐๐ฝ๐๐น: We could then build ๐๐ผ๐ต๐๐ which computes ๐ผ๐ต๐๐like this: ๐ฅ ๐ฆ
Build this machine: ๐๐ฅ๐ฆ: 1) run โณ(๐ฅ)(๐ฆ) 2) return 1
Is L ๐๐ฅ๐ฆ finite? ๐ต๐ฎ๐ฑ๐ถ๐ฑ๐ผ๐ญ
10
11
๐บ๐ฝ๐๐ฝ๐๐น ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น
๐โ computes ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น
Assume Reduction Is L โณ ๐ฅ finite? Is L โณ ๐ฅ infinite? ๐๐บ๐ฝ๐๐ฝ๐๐น computes ๐บ๐ฝ๐๐ฝ๐๐น
12
๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น ๐บ๐ฝ๐๐ฝ๐๐น
๐๐บ๐ฝ๐๐ฝ๐๐น computes ๐บ๐ฝ๐๐ฝ๐๐น
Assume Reduction Is L โณ ๐ฅ infinite? Is L โณ ๐ฅ finite? ๐โ computes ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น
13
Is L โณ ๐ฅ infinite? ๐ตโ ๐ฅ ๐ โณ ๐ฅ is/isnโt infinite ๐ต๐ฎ๐ฑ๐ถ๐ฑ๐ผ๐ญ Is L โณ ๐ฅ finite? ๐ โณ ๐ฅ is/isnโt finite Assume we have ๐โ which computes ๐ฝ๐๐บ๐ฝ๐๐ฝ๐๐น: We could then build ๐๐บ๐ฝ๐๐ฝ๐๐น which computes ๐บ๐ฝ๐๐ฝ๐๐น like this: ๐ฅ ๐ฆ Is L โณ ๐ฅ infinite? ๐ตโ
14
15
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐๐๐(๐ง)
16
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 ๐๐๐(๐ง)
Is L ๐๐ฅ๐ฆ non- regular? ๐ต๐ถ๐บ
17
18
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐ง == 101
19
Does โณ(๐ฅ) reject 101? ๐ต๐บ๐๐๐ ๐ฅ โณ(๐ฅ) does/doesnโt reject 101 ๐ต๐ฐ๐ฉ๐ด๐ผ Does โณ ๐ฅ ๐ฆ halt? โณ(๐ฅ)(๐ฆ) does/doesnโt halt Assume we have ๐๐101 which computes ๐๐๐๐๐๐: We could then build ๐๐ผ๐ต๐๐ which computes ๐ผ๐ต๐๐like this: ๐ฅ ๐ฆ
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐ง == 101
Does โณ(๐ฅ) reject 101? ๐ต๐บ๐๐๐
โ 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.
20
โ 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?
21
22
๐ is โtrivialโ Return 1 Return 0
substitute ยฌ๐, then answer opposite)
โ If โณ(๐ฅ)(๐ฆ) halts, ๐ ๐๐ฅ๐ฆ = ๐ ๐๐บ๐ต๐๐๐น โ If โณ(๐ฅ)(๐ฆ) doesnโt halt, ๐ ๐๐ฅ๐ฆ = L ๐โ = โ โ ๐(๐๐ฅ๐ฆ) has property ๐ if and only if โณ ๐ฅ ๐ฆ runs forever
23
Build this machine: ๐๐ฅ๐ฆ(๐ง): 1) run โณ(๐ฅ)(๐ฆ) 2) return ๐๐บ๐๐๐ก๐(๐ง)
24
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 ๐? ๐ต๐ธ
25
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 ๐?
26
27
28