cse 105
play

CSE 105 THEORY OF COMPUTATION Fall 2016 - PowerPoint PPT Presentation

CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ T odays lecture Countable and uncountable sets Diagonalization There are languages not in RE or coRE An interesting undecidable language


  1. CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/

  2. T oday’s lecture ● Countable and uncountable sets ● Diagonalization ● There are languages not in RE or coRE ● An interesting undecidable language

  3. Countable Sets ● You can make an infjnite list of all natural numbers N: 0,1,2,3,4,…. ● You can make an infjnite list containing all integers Z: 0,1,-1,2,-2,3,-3,4,-4,… ● Defjnition: a set S is countable if there is a bijection f: N → S Informally: you can list the elements of S: f(0),f(1),f(2),…. – N and Z are countable –

  4. Countable Sets Question: Is any of these sets countable? Q (rational numbers), R (real numbers), C (complex numbers) ● You can make an infjnite list of all natural numbers A) None of them is countable N: 0,1,2,3,4,…. B) Q is countable, but R and C are not ● You can make an infjnite list containing all integers C) Q and R are countable, but C is not because Z: 0,1,-1,2,-2,3,-3,4,-4,… D) They are all countable ● Defjnition: a set S is countable if there is a bijection f: N → S Informally: you can list the elements of S: f(0),f(1),f(2),…. – N and Z are countable –

  5. Diagonalization ● Theorem: R is not countable. Even [0,1) is uncountable! ● Proof: assume for contradiction it is countable ● List its element [0,1) (1)0.0100010… (2)0.1101000… (3)0.0110001… (4)0.1010101… (5)0.1111000… ● Flip the diagonal: r=0.10011… ● The real number r is not on the list: Contradiction!

  6. Some countable sets ● The set of all strings {0,1}* is countable Just list them in lexicographic order: ε,0,1,00,01,10,11,000,… – Lexicographic order: fjrst sort by length, then alphabetically. – ● The set TM={<M> | M is a T uring Machine} ● RE: The set of all T uring Recognizable languages L(M 1 ), L(M2),...L(Mk),… – ● coRE: L(M 1 ), L(M 2 ),...L(M k ),… ● RE U coRE

  7. Some uncountable sets ● Recall: {0,1}*= {w[i] | i in N} is countable ● R is uncountable ● [0,1] is uncountable ● The set of all languages P({0,1}*) is not countable Languages can be represented by real numbers: – r=0.10010101011100…. ↔ {w[i] | the i th digit of r is 1} – Difgerent reals are mapped to difgerent languages – There are at least as many languages as r in [0,1] –

  8. Summary uncountable L ● RE U coRE is countable ● P({0,1}*) is uncountable ● There is a language L in D P({0,1}*) - (RE U coRE)! Context-free RE coRE Regular countable

  9. Undecidable Lanugages ● There are uncountably many undecidable languages! ● In fact, there are uncountably many languages that are not even in RE (or coRE)! ● Questions: Can we find a specific language not in RE or coRE? – Can we find interesting languages not in RE or coRE? – Is HALT TM undecidable? –

  10. Diagonalization ● [0,1) is uncountable because given any list of r in [0,1) ● 0.0100010… ● 0.1101000… ● 0.0110001… ● 0.1010101… ● 0.1111000… we can build an r=0.10011… that is not in the list ● We can make a list of all L in RE: L(M 1 ), L(M 2 ),L(M 3 )… ● Can we build a language not in this list?

  11. A language not in RE ● We want a language L that is difgerent from L(M 1 ) – difgerent from L(M 2 ) – difgerent from L(M 3 ) – ….. – difgerent from L(M k ) – ….. –

  12. A language not in RE Two numbers are different if they ● We want a language L that is differ at some digit difgerent from L(M 1 ) – Two languages are different if they differ at some string w: difgerent from L(M 2 ) – Either w in L(M) but not in L, difgerent from L(M 3 ) Or w in L but not in L(M) – ….. – difgerent from L(M k ) – W? ….. – W?

  13. A language not in RE ● We want a language L that is difgerent from L(M 1 ) at <M 1 > – difgerent from L(M 2 ) at <M 2 > – difgerent from L(M 3 ) at <M 3 > – ….. – difgerent from L(M k ) at <M k > – ….. – ● L = {<M> | M it a TM such that <M> is not is L(M) }

  14. A “diagonal” language ● Diag={<M> | M is a TM s.t. <M> is not in L(M) } ● Why is Diag difgerent from L(M k )? We need a string w that belongs to one but not the other – Let w = <M k > – If <M k > is in L(M k ), then – Not (Not “<M k > is in L(M k )”) ● “<M k > is not in L(M k )” is false ● <M k > is not in Diag ● If w is not in Diag, then w is in L(M k ) –

  15. A “diagonal” language ● Diag={<M> | M is a TM s.t. <M> is not in L(M) } ● Why is Diag difgerent from L(M k )? Question: What can you tell about Diag? We need a string w that belongs to one but not the other – Let w = <M k > – A) Diag is in RE, but not in coRE If <M k > is in L(M k ), then – B) Diag is coRE, but not in RE Not (Not “<M k > is in L(M k )”) ● C) Diag is neither in RE nor in coRE “<M k > is not in L(M k )” is false ● D) Diag is decidable <M k > is not in Diag ● E) I don’t know If w is not in Diag, then w is in L(M k ) –

  16. Diag is in coRE ● Diag={<M> | M is a TM s.t. <M> is not in L(M) } ● Here is a recognizer for Diag M diag (w) = 1) Check if w=<M> for some TM M. If not, accept. 2) Parse w as <M> for some TM M 3) Run M on input w 4) If M(w) accepts, then accept, else reject.

  17. Is M diag a decider? Diag is in coRE A) Yes, because L(M diag )=Diag ● Diag={<M> | M is a TM s.t. <M> is not in L(M) } B) No, because it can loop at step 1 C) No, because it can loop at step 2 ● Here is a recognizer for Diag D) No, because it can loop at step 3 M diag (w) = E) I don’t know 1) Check if w=<M> for some TM M. If not, accept. 2) Parse w as <M> for some TM M 3) Run M on input w 4) If M(w) accepts, then accept, else reject.

  18. What can you say about Diag Diag is in coRE A) Diag is decidable B) Diag is in RE, but not coRE ● Diag={<M> | M is a TM s.t. <M> is not in L(M) } C) Diag is in coRE, but not RE ● Here is a recognizer for Diag D) Diag is neither in RE nor coRE E) I don’t know M diag (w) = 1) Check if w=<M> for some TM M. If not, accept. 2) Parse w as <M> for some TM M 3) Run M on input w 4) If M(w) accepts, then accept, else reject.

  19. Summary ● Diag is in coRE because L(M diag )=Diag ● Diag is not in RE because Diag ≠ L(M k ) for all TM M k ● Diag is undecidable ● Diag is in coRE, but not RE ● So far: We have found specific languages not in RE or coRE. ● Can we find more interesting examples? What about HALT TM = {<M,w> | M(w) terminates}? – What about A TM = {<M,w> | M(w) accepts}? –

  20. A TM is undecidable ● Assume for contradiction A TM is decidable ● A TM is also decidable ● MM = {<M,<M>> | M is a TM} is decidable ● DD = MM ∩ A TM is decidable ● Notice: DD = { <M,<M>> | M is a TM such that M is not in L(M) } –

  21. What can you say about DD? A TM is undecidable A) DD is decidable ● Assume for contradiction A TM is decidable B) DD is undecidable because DD = Diag ● A TM is also decidable C) DD is undecidable but ● MM = {<M,<M>> | M is a TM} is decidable I am not sure why D) DD is both decidable and ● DD = MM ∩ A TM is decidable undecidable ● Notice: E) I don’t know DD = { <M,<M>> | M is a TM such that M is not in L(M) } –

  22. A TM is undecidable ● Assume for contradiction A TM is decidable ● DD = { <M,<M>> | M is a TM such that M is not in L(M) } is decidable. Let M DD be a decider for DD. ● M’ diag (<M>) = Run M DD (<M,<M>>) L(M’ diag )=Diag – M’ diag is a decider (M’ diag always terminates) – ● This proves that Diag is decidable: contradiction!

  23. For next Time ● Try to prove that HALT TM is undecidable ● Reading: Sipser Chapters 3 and 4 ● HW6 due on Nov 15 ● Haskell 4 due Nov 21 ● Exam 3 : Nov 18

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend