language in

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. Language IN๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น โ€ข ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น = ๐‘ฅ ๐‘€ โ„ณ ๐‘ฅ is infinite} โ€ข We will show this is not computable by using ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น to compute ๐ผ๐ต๐‘€๐‘ˆ 1

  2. โ„ณ ๐‘ฅ ๐‘ฆ Halts? It is infinite Language of ๐‘ ๐‘ฅ๐‘ฆ โ„ณ ๐‘ฅ ๐‘ฆ Doesnโ€™t Halt ? It isnโ€™t infinite โ€ข If โ„ณ(๐‘ฅ)(๐‘ฆ) halts: Build this machine: ๐‘ ๐‘ฅ๐‘ฆ : โ€“ ๐‘ ๐‘ฅ๐‘ฆ always returns 1 1) run โ„ณ(๐‘ฅ)(๐‘ฆ) 2) return 1 โ€“ ๐‘€ ๐‘ ๐‘ฅ๐‘ฆ = ฮฃ โˆ— , which is infinite โ€ข If โ„ณ(๐‘ฅ)(๐‘ฆ) doesnโ€™t halt: โ€“ ๐‘ ๐‘ฅ๐‘ฆ gets โ€œstuckโ€ in step 1 and never returns โ€“ ๐‘€ ๐‘ ๐‘ฅ๐‘ฆ = โˆ… , which is finite 2

  3. Using ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น to build ๐ผ๐ต๐‘€๐‘ˆ Assume we have ๐‘ โˆž which ๐‘ต โˆž computes ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น : ๐‘€ โ„ณ ๐‘ฅ is/isnโ€™t ๐‘ฅ Is L โ„ณ ๐‘ฅ infinite? infinite We could then build ๐‘ ๐ผ๐ต๐‘€๐‘ˆ which computes ๐ผ๐ต๐‘€๐‘ˆ like this: ๐‘ต ๐‘ฐ๐‘ฉ๐‘ด๐‘ผ Does โ„ณ ๐‘ฅ ๐‘ฆ halt? ๐‘ฅ โ„ณ ๐‘ฅ ๐‘ฆ ๐‘ต โˆž Build this machine: ๐‘ ๐‘ฅ๐‘ฆ : does/doesnโ€™t Is L ๐‘ ๐‘ฅ๐‘ฆ infinite? 1) run โ„ณ(๐‘ฅ)(๐‘ฆ) ๐‘ฆ halt 2) return 1 3

  4. Reduction Problem we think is impossible Problem know is impossible ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น ๐ผ๐ต๐‘€๐‘ˆ ๐ถ ๐ต Build (but donโ€™t run) ๐‘ ๐‘ฅ๐‘ฆ Is L โ„ณ ๐‘ฅ Does โ„ณ(๐‘ฅ) infinite? halt on input ๐‘ฆ ? Assume Give ๐‘ ๐‘ฅ๐‘ฆ to the ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น solver, then ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น solver exists ๐‘ ๐ผ๐ต๐‘€๐‘ˆ computes ๐ผ๐ต๐‘€๐‘ˆ answer the same Reduction 4

  5. Using ๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น to build ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น Assume we have ๐‘ ๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น ๐‘ต ๐‘ฎ๐‘ฑ๐‘ถ๐‘ฑ๐‘ผ๐‘ญ which computes ๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น : ๐‘€ โ„ณ ๐‘ฅ is/isnโ€™t ๐‘ฅ Is L โ„ณ ๐‘ฅ finite? finite We could then build ๐‘ โˆž which computes ๐ฝ๐‘‚๐บ๐ฝ๐‘‚๐ฝ๐‘ˆ๐น like this: ๐‘ต โˆž Is L โ„ณ ๐‘ฅ infinite? ๐‘ฅ ๐‘ต ๐‘ฎ๐‘ฑ๐‘ถ๐‘ฑ๐‘ผ๐‘ญ ๐‘€ โ„ณ ๐‘ฅ Is L โ„ณ ๐‘ฅ finite? is/isnโ€™t infinite 5

  6. Language ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• โ€ข ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• = ๐‘ฅ ๐‘€ โ„ณ ๐‘ฅ is non โˆ’ regular} โ€ข We will show this is not computable by using ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• to compute ๐ผ๐ต๐‘€๐‘ˆ 6

  7. โ„ณ ๐‘ฅ ๐‘ฆ Halts? It is non-regular โ„ณ ๐‘ฅ ๐‘ฆ Doesnโ€™t Halt ? It isnโ€™t non-regular Language of ๐‘ ๐‘ฅ๐‘ฆ Build this machine: ๐‘ ๐‘ฅ๐‘ฆ (๐‘ง): 1) run โ„ณ(๐‘ฅ)(๐‘ฆ) 2) return MAJ(๐‘ง) โ€ข If โ„ณ(๐‘ฅ)(๐‘ฆ) halts: โ€“ ๐‘ ๐‘ฅ๐‘ฆ returns 1 if MAJ ๐‘ง = 1 โ€“ ๐‘€ ๐‘ ๐‘ฅ๐‘ฆ = ๐‘๐ต๐พ(๐‘ง) , which is non-regular โ€ข If โ„ณ(๐‘ฅ)(๐‘ฆ) doesnโ€™t halt: โ€“ ๐‘ ๐‘ฅ๐‘ฆ gets โ€œstuckโ€ in step 1 and never returns 1 โ€“ ๐‘€ ๐‘ ๐‘ฅ๐‘ฆ = โˆ… , which isnโ€™t non-regular 7

  8. Using ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• to build ๐ผ๐ต๐‘€๐‘ˆ Assume we have ๐‘ ๐‘‚๐‘† which ๐‘ต ๐‘ถ๐‘บ computes ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• : ๐‘€ โ„ณ ๐‘ฅ is/isnโ€™t ๐‘ฅ Is L โ„ณ ๐‘ฅ non- non-regular regular? We could then build ๐‘ ๐ผ๐ต๐‘€๐‘ˆ which computes ๐ผ๐ต๐‘€๐‘ˆ like this: ๐‘ต ๐‘ฐ๐‘ฉ๐‘ด๐‘ผ Does โ„ณ ๐‘ฅ ๐‘ฆ halt? ๐‘ฅ โ„ณ(๐‘ฅ)(๐‘ฆ) ๐‘ต ๐‘ถ๐‘บ Build this machine: ๐‘ ๐‘ฅ๐‘ฆ (๐‘ง): does/doesnโ€™t Is L โ„ณ ๐‘ฅ non- 1) run โ„ณ(๐‘ฅ)(๐‘ฆ) ๐‘ฆ halt regular? 2) return MAJ (๐‘ง) 8

  9. Reduction ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• ๐ผ๐ต๐‘€๐‘ˆ ๐ถ ๐ต Describe that machine ๐‘ ๐‘ฅ๐‘ฆ Is L โ„ณ ๐‘ฅ non- Does โ„ณ(๐‘ฅ) regular? halt on input ๐‘ฆ ? Assume Give ๐‘ ๐‘ฅ๐‘ฆ to the ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• solver, then ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• solver exists ๐‘ ๐ผ๐ต๐‘€๐‘ˆ computes ๐ผ๐ต๐‘€๐‘ˆ answer the same Reduction 9

  10. Using ๐‘†๐‘“๐‘• to build ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• Assume we have ๐‘ ๐‘†๐‘“๐‘• ๐‘ต ๐‘†๐‘“๐‘• which computes ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• : ๐‘€ โ„ณ ๐‘ฅ is/isnโ€™t ๐‘ฅ Is L โ„ณ ๐‘ฅ regular? Regular We could then build ๐‘ ๐‘‚๐‘† which computes ๐‘‚๐‘๐‘œ๐‘†๐‘“๐‘• like this: ๐‘ต ๐‘ถ๐‘บ Is L โ„ณ ๐‘ฅ non-regular? ๐‘ฅ ๐‘ต ๐‘†๐‘“๐‘• ๐‘€ โ„ณ ๐‘ฅ is/isnโ€™t non- Is L โ„ณ ๐‘ฅ regular? regular 10

  11. Language ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 โ€ข ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 = ๐‘ฅ โ„ณ ๐‘ฅ 101 = 1} โ€ข We will show this is not computable by using ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 to compute ๐ผ๐ต๐‘€๐‘ˆ 11

  12. โ„ณ ๐‘ฅ ๐‘ฆ Halts? It does accept 101 โ„ณ ๐‘ฅ ๐‘ฆ Doesnโ€™t Halt ? It doesnโ€™t accept101 Building ๐‘ ๐‘ฅ๐‘ฆ Build this machine: ๐‘ ๐‘ฅ๐‘ฆ (๐‘ง): 1) run โ„ณ(๐‘ฅ)(๐‘ฆ) โ€ข If โ„ณ(๐‘ฅ)(๐‘ฆ) halts: 2) return ๐‘ง == 101 โ€“ ๐‘ ๐‘ฅ๐‘ฆ returns 1 if ๐‘ง == 101 โ€“ ๐‘€ ๐‘ ๐‘ฅ๐‘ฆ = {101} , so it does accept 101 โ€ข If โ„ณ(๐‘ฅ)(๐‘ฆ) doesnโ€™t halt: โ€“ ๐‘ ๐‘ฅ๐‘ฆ gets โ€œstuckโ€ in step 1 and never returns 1 โ€“ ๐‘€ ๐‘ ๐‘ฅ๐‘ฆ = โˆ… , so it doesnโ€™t accept 101 12

  13. Using ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 to build ๐ผ๐ต๐‘€๐‘ˆ Assume we have ๐‘ ๐ต101 ๐‘ต ๐‘ฉ๐Ÿ๐Ÿ๐Ÿ which computes ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 : โ„ณ(๐‘ฅ) does/doesnโ€™t ๐‘ฅ Does โ„ณ(๐‘ฅ) accept accept 101 101? We could then build ๐‘ ๐ผ๐ต๐‘€๐‘ˆ which computes ๐ผ๐ต๐‘€๐‘ˆ like this: ๐‘ต ๐‘ฐ๐‘ฉ๐‘ด๐‘ผ Does โ„ณ ๐‘ฅ ๐‘ฆ halt? ๐‘ฅ โ„ณ(๐‘ฅ)(๐‘ฆ) ๐‘ต ๐‘ฉ๐Ÿ๐Ÿ๐Ÿ Build this machine: ๐‘ ๐‘ฅ๐‘ฆ (๐‘ง): does/doesnโ€™t Does โ„ณ(๐‘ฅ) accept 1) run โ„ณ(๐‘ฅ)(๐‘ฆ) ๐‘ฆ halt 101? 2) return ๐‘ง == 101 13

  14. ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 Reduction ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 ๐ผ๐ต๐‘€๐‘ˆ ๐ถ ๐ต Describe that machine ๐‘ ๐‘ฅ๐‘ฆ Is 101 โˆˆ L โ„ณ ๐‘ฅ ? Does โ„ณ(๐‘ฅ) halt on input ๐‘ฆ ? Assume Give ๐‘ ๐‘ฅ๐‘ฆ to the ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 solver, then ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 solver exists ๐‘ ๐ผ๐ต๐‘€๐‘ˆ computes ๐ผ๐ต๐‘€๐‘ˆ answer the same Reduction 14

  15. Using ๐‘†๐‘“๐‘˜๐‘“๐‘‘๐‘ข101 to build ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 Assume we have ๐‘ ๐‘†101 ๐‘ต ๐‘†101 which computes ๐‘†๐‘“๐‘˜๐‘“๐‘‘๐‘ข 101: 101 isnโ€™t/is in ๐‘ฅ Is 101 โˆ‰ L โ„ณ ๐‘ฅ ๐‘€ โ„ณ ๐‘ฅ ? We could then build ๐‘ ๐ต101 which computes ๐ต๐‘‘๐‘‘๐‘“๐‘ž๐‘ข101 like this: ๐‘ต ๐ต101 Is 101 โˆˆ L โ„ณ ๐‘ฅ ? ๐‘ฅ ๐‘ต ๐‘†101 101 is/isnโ€™t in ๐‘€ โ„ณ ๐‘ฅ Is 101 โˆ‰ L โ„ณ ๐‘ฅ ? 15

  16. Computability and non-computability closed under complement โ€ข If ๐‘€ is computable, then ๐‘€ ๐‘‘ is computable Assume we have ๐‘ ๐‘€ which ๐‘ต ๐‘ด computes ๐‘€ : ๐‘ฅ is/isnโ€™t in ๐‘€ ๐‘ฅ Is ๐‘ฅ โˆˆ L ? We could then build ๐‘ ๐‘€ ๐‘‘ which computes ๐‘€ ๐‘‘ like this: ๐‘ต ๐‘€ ๐‘‘ Is ๐‘ฅ โˆ‰ L ? ๐‘ฅ ๐‘ต ๐‘ด ๐‘ฅ isnโ€™t/is in ๐‘€ Is ๐‘ฅ โˆˆ L ? 16

  17. Complement Reduction ๐‘€ ๐‘€ ๐‘‘ ๐ถ ๐‘ฅ โˆˆ ๐‘€ ? ๐ต Donโ€™t change ๐‘ฅ ๐‘ฅ โˆ‰ ๐‘€ ? If Give ๐‘ฅ to the ๐‘€ solver, ๐‘€ solver exists ๐‘€ ๐‘‘ solver exists then answer the opposite ๐‘€ solver doesnโ€™t exist ๐‘€ ๐‘‘ solver doesnโ€™t exist Reduction 17

  18. Sematic Property โ€ข Turing machines ๐‘, ๐‘โ€ฒ are Functionally Equivalent if โˆ€๐‘ฆ โˆˆ ฮฃ โˆ— , ๐‘ ๐‘ฆ == ๐‘ ๐‘ฆ โ€ฒ โ€“ i.e. they compute the same function/language โ€ข A Semantic Property of a Turing machine is one that depends only on the input/output behavior of the machine โ€“ 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

  19. Examples โ€ข These properties are Semantic: โ€“ 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? โ€ข These properties are not Semantic: โ€“ 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. Riceโ€™s Theorem โ€ข For any Semantic property ๐‘„ of Turing Machines, either: โ€“ Every Turing machine has property ๐‘„ ๐‘„ is โ€œtrivialโ€ โ€“ No Turing machines have property ๐‘„ โ€“ ๐‘„ is uncomputable โ€ข In other words: โ€“ If ๐‘„ is semantic, and computable, then one of these two machines computes it: Return 1 Return 0 20

  21. Proof of Riceโ€™s Theorem Let ๐‘„ be a semantic property of a Turing machine โ€ข Assume ๐‘ โˆ… (a machine whose language is โˆ… ) doesnโ€™t have property ๐‘„ โ€ข (otherwise substitute ยฌ๐‘„ , then answer opposite) Let ๐‘ ๐‘„ be a machine that does have property ๐‘„ โ€ข โ€ข Idea: โ€“ If โ„ณ(๐‘ฅ)(๐‘ฆ) halts, ๐‘€ ๐‘ ๐‘ฅ๐‘ฆ = ๐‘€ ๐‘ โ„Ž๐‘๐‘ก ๐‘„ โ€“ If โ„ณ(๐‘ฅ)(๐‘ฆ) doesnโ€™t halt, ๐‘€ ๐‘ ๐‘ฅ๐‘ฆ = L ๐‘ โˆ… = โˆ… โ€“ ๐‘€(๐‘ ๐‘ฅ๐‘ฆ ) has property ๐‘„ if and only if โ„ณ ๐‘ฅ ๐‘ฆ halts โ„ณ ๐‘ฅ ๐‘ฆ Halts? It has property ๐‘„ Build this machine: ๐‘ ๐‘ฅ๐‘ฆ (๐‘ง): โ„ณ ๐‘ฅ ๐‘ฆ Doesnโ€™t Halt ? It doesnโ€™t have property ๐‘„ 1) run โ„ณ(๐‘ฅ)(๐‘ฆ) 2) return ๐‘ โ„Ž๐‘๐‘ก ๐‘„ (๐‘ง) 21

  22. Using ๐‘„ to build ๐ผ๐ต๐‘€๐‘ˆ Assume we have ๐‘ ๐‘„ which ๐‘ต ๐‘ธ computes ๐‘„ : โ„ณ(๐‘ฅ) does/doesnโ€™t ๐‘ฅ Does โ„ณ(๐‘ฅ) have have property ๐‘„ property ๐‘„ ? We could then build ๐‘ ๐ผ๐ต๐‘€๐‘ˆ which computes ๐ผ๐ต๐‘€๐‘ˆ like this: ๐‘ต ๐‘ฐ๐‘ฉ๐‘ด๐‘ผ Does โ„ณ ๐‘ฅ ๐‘ฆ halt? ๐‘ฅ โ„ณ(๐‘ฅ) ๐‘ต ๐‘ธ Build this machine: ๐‘ ๐‘ฅ๐‘ฆ (๐‘ง): does/doesnโ€™t Does โ„ณ(๐‘ฅ) have 1) run โ„ณ(๐‘ฅ)(๐‘ฆ) ๐‘ฆ have property ๐‘„ property ๐‘„ ? 2) return ๐‘ โ„Ž๐‘๐‘ก ๐‘„ (๐‘ง) 22

Recommend


More recommend