Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.

Similar presentations


Presentation on theme: "CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons."— Presentation transcript:

1 CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at http://peerinstruction4cs.org. Permissions beyond the scope of this license may be available at http://peerinstruction4cs.org.

2 DECIDABILITY IMPORTANT DECIDABLE LANGUAGES More Proofs 2

3 Notation Notes Turing Machines always take a single input string of finite length – M(w) But sometimes we want them to take as input several strings, or an object, or several objects 3

4 Notation Notes Several strings can be combined into one string by using a delimiter character not in the main alphabet – w = s 1 #s 2 #s 3 Many objects can be encoded as a finite string – Ex: MPEG-4 is a movie encoded as a very long string of 0’s and 1’s Since we already know these encodings can be done, we just write TM’s as taking multiple complex inputs, but put triangle brackets around them to denote “encode this as a string” – Ex: M( ) – For standard objects (TMs, DFAs, etc), no further explanation is necessary—use book as your guide

5 Prove that the class of Decidable languages is closed under Union Given: Two decidable languages A and B, and TMs that decide them, M A and M B. Want to Show: A TM M U that decides A U B. Construction: – M U (w) = //w is a string 1.Simulate running M A (w) – If it accepts, accept. If it rejects, go to step 2: 2.Simulate running M B (w) – If it accepts, accept. If it rejects, reject. Correctness: //this is for you to debate! Conclusion: M U is a TM that decides AUB, therefore AUB is decidable, and decidable languages are closed under union. QED. This proof is: (a)Correct (b)Incorrect

6 Prove that the class of Recognizable languages is closed under Union Given: Two recognizable languages A and B, and TMs that recognize them, M A and M B. Want to Show: A TM M U that recognizes A U B. Construction: – M U (w) = //w is a string 1.Simulate running M A (w) – If it accepts, accept. If it rejects, go to step 2: 2.Simulate running M B (w) – If it accepts, accept. If it rejects, reject. Correctness: //this is for you to debate! Conclusion: M U is a TM that recognizes AUB, therefore AUB is recognizable, and recognizable languages are closed under union. QED. This proof is: (a)Correct (b)Incorrect

7 Prove that the class of Recognizable languages is closed under Intersection Given: Two Turing-recognizable languages A and B, and TMs that recognize them, M A and M B. Want to Show: A TM M I that recognizes A intersect B. Construction: – M I (w) = //w is a string 1.Simulate running M A (w) – If it rejects, reject. If it accepts, go to step 2: 2.Simulate running M B (w) – If it accepts, accept. If it rejects, reject. Correctness: //this is for you to debate! Conclusion: M I is a TM that recognizes A intersect B, therefore A intersect B is recognizable, and recognizable languages are closed under intersection. QED. This proof is: (a)Correct (b)Incorrect

8 Prove that the class of Decidable languages is closed under Intersection Given: Two decidable languages A and B, and TMs that decide them, M A and M B. Want to Show: A TM M I that decides A intersect B. Construction: – M I (w) = //w is a string 1.Simulate running M A (w) – If it rejects, reject. If it accepts, go to step 2: 2.Simulate running M B (w) – If it accepts, accept. If it rejects, reject. Correctness: //this is for you to debate! Conclusion: M I is a TM that decides A intersect B, therefore A intersect B is decidable, and decidable languages are closed under intersection. QED. This proof is: (a)Correct (b)Incorrect

9 Prove that the class of Decidable languages is closed under Complement Given: A decidable language A, and a TM that decides it, M A. Want to Show: A TM M C that decides the complement of A. Construction: – M C (w) = //w is a string 1.Simulate running M A (w) – If it accepts, reject. If it rejects, accept. Correctness: //this is for you to debate! Conclusion: M C is a TM that decides the complement of A, therefore the complement of A is decidable, and decidable languages are closed under complement. QED. This proof is: (a)Correct (b)Incorrect

10 Prove that the class of Recognizable languages is closed under Complement Given: A recognizable language A, and a TM that recognizes it, M A. Want to Show: A TM M C that recognizes the complement of A. Construction: – M C (w) = //w is a string 1.Simulate running M A (w) – If it accepts, reject. If it rejects, accept. Correctness: //this is for you to debate! Conclusion: M C is a TM that recognizes the complement of A, therefore the complement of A is recognizable, and recognizable languages are closed under complement. QED. This proof is: (a)Correct (b)Incorrect


Download ppt "CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons."

Similar presentations


Ads by Google