Download presentation
Presentation is loading. Please wait.
Published byPaulina Willis Modified over 9 years ago
1
Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks, or something TA Evaluations at the end of class! There’s a lot of stuff in today’s lecture
2
CSE 105 Theory of Computability Dr. Alexander Tsiatas Spring 2012 2
3
REVIEW Preparing for DIAGONALIZATION proof!! 3
4
Sizes of infinite sets: countably infinite The natural numbers {0, 1, 2, 3, 4, …} are countably infinite. Any set that’s the same size as the natural numbers is countably infinite. 2 sets are the same size if there’s a correspondence between them. Informal, but equivalent: a set is countably infinite if you can list them systematically like the natural numbers. – The list will eventually contain ALL elements 4
5
Sizes of infinite sets: strings For any alphabet (here, {0, 1}), the set of all strings is countably infinite: ε, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011, 100, 101, 110, 111, 0000, …. 5
6
Sizes of infinite sets: Turing machines The set of all Turing machines is countably infinite: – You can just encode TM’s as strings. 6
7
Sizes of infinite sets: Languages Remember: a language is a set of strings. Can we make a list of ALL languages? Let’s try 7
8
Sizes of infinite sets: Languages s1=εs2=0s3=1s4=0s5=01s6=10s7=11s8=000… L1 L2 L3 L4 L5 L6 L7 L8 … 8 Claim: no matter the order you list languages, there is ALWAYS one that’s not on the list. BAD = {si | si is NOT in Li}
9
So what?!?! No matter how you try to list languages, there’s always a BAD language not on the list. The set of languages is NOT countably infinite! The set of TM’s IS countably infinite! – |Languages| > |TM’s| Pigeonhole principle: there are languages that are NOT accepted by any TM. 9
10
A TM = { | M is a TM, M accepts w} A TM is: a)A language b)An operation c)A set of strings d)A Turing Machine e)None or more than one of the above 10
11
THE TM ACCEPTANCE PROBLEM A TM 11
12
A TM = { | M is a TM, M accepts w} A TM is Recognizable a)TRUE b)FALSE c)Other 12
13
A TM IS UNDECIDABLE At last the proof you’ve all been waiting for! 13
14
The Game Plan: Recall: A TM = { | M is a TM, M accepts w} Thm: A TM is undecidable Proof by Contradiction: Assume (towards contradiction) that A TM is decidable, so there exists some TM M ATM decides A TM. Want to show: A TM D that uses M ATM as a subroutine, allowing D to do something impossible/contradictory. D(w): //w is a string – What D is or what it does is totally up to us—but we will have to be very clever to come up with something that will cause an impossibility/contradiction. Then, because we will have reached a contradiction, we will conclude that the assumption is false, and A TM is not decidable. 14
15
Let’s look at M ATM : Assume (towards contradiction) that A TM is decidable, so there exists some TM M ATM decides A TM. Let TM G be a recognizer s.t. L(G) = {w | |w| is even} What will happen if we run M ATM ( )? a)M ATM accepts b)M ATM rejects c)M ATM loops d)Not enough information e)Other 15 A TM = { | M is a TM, M accepts w}
16
Proof: Thm: A TM = { | M is a TM, M accepts w} is undecidable Assume (towards contradiction) that A TM is decidable, so there exists some TM M ATM that decides A TM. Construct a TM D as follows: – D( ): //input is a string description of a TM M ATM ( >) //M ATM is a decider, so no infinite looping—it will tell us if is in L(M) or not, even if M loops on If M ATM accepts, we reject If M ATM rejects, we accept // we do the opposite of M ATM Now, it will take one more step to show how D can do something impossible 16
17
Pause to Examine TM D D( ): //input is a string description of a TM – M ATM ( >) //M ATM is a decider, so no infinite looping—it will tell us if is in L(M) or not, even if M loops on – If M ATM accepts, we reject – If M ATM rejects, we accept // we do the opposite of M ATM Let M x be a TM, where L(M x ) = {}. What happens when we input M x to D like this: D( )? a)D accepts b)D rejects c)D loops d)Not enough information e)Other 17 A TM = { | M is a TM, M accepts w}
18
Pause to Examine TM D D( ): //input is a string description of a TM – M ATM ( >) //M ATM is a decider, so no infinite looping—it will tell us if is in L(M) or not, even if M loops on – If M ATM accepts, we reject – If M ATM rejects, we accept // we do the opposite of M ATM M L (w): – Go into an infinite loop What happens when we input M L to D like this: D( )? a)D accepts b)D rejects c)D loops d)Not enough information e)Other 18 A TM = { | M is a TM, M accepts w}
19
Pause to Examine TM D D( ): //input is a string description of a TM – M ATM ( >) //M ATM is a decider, so no infinite looping—it will tell us if is in L(M) or not, even if M loops on – If M ATM accepts, we reject – If M ATM rejects, we accept // we do the opposite of M ATM Let M v be a TM where L(M v ) = Σ*. What happens when we input M v to D like this: D( )? a)D accepts b)D rejects c)D loops d)Not enough information e)Other 19 A TM = { | M is a TM, M accepts w}
20
Pause to Examine TM D D( ): //input is a string description of a TM – M ATM ( >) //M ATM is a decider, so no infinite looping—it will tell us if is in L(M) or not, even if M loops on – If M ATM accepts, we reject – If M ATM rejects, we accept // we do the opposite of M ATM What happens when we input D to D like this: D( )? a)D accepts b)D rejects c)D loops d)Not enough information e)Other 20 A TM = { | M is a TM, M accepts w}
21
Proof: Thm: A TM = { | M is a TM, M accepts w} is undecidable Assume (towards contradiction) that A TM is decidable, so some TM M ATM decides A TM. Construct a TM D as follows: – D( ): //input is a string description of a TM M ATM ( >)– M ATM is a decider, so it will either accept or reject (no infinite looping) If M ATM accepts, we reject If M ATM rejects, we accept // we do the opposite of M ATM Run D( ). Observe that D( ) should accept when D( ) rejects, and D( ) should reject when D( ) accepts, a contradiction. Therefore the assumption is false, and A TM is undecidable. 21
22
THE HALTING PROBLEM HALT TM Proving it is undecidable 22
23
The Halting Problem HALT TM = { | M is a TM and M halts on input w} – Doesn’t say if M accepts or rejects w, just that it halts Imagine we have a hypothetical TM M halt that decides HALT TM. – Could we use M halt to build a decider for A TM ? – (recall: A TM = { | M is a TM and M accepts w}) 23
24
Thm. HALT TM is undecidable. Proof by contradiction. Assume that HALT TM is decidable, and some TM M halt decides it. Construct a TM M ATM that decides A TM : But is A TM is undecidable, a contradiction. So the assumption is false and HALT TM is undecidable. 24
25
We just did a reduction! We will do a LOT more of this next week! 25
26
TA Evaluations!!!!!111 Class number: CSE 105 TA’s name: Srdjan Krstic OR Wenbo Zhao – Evaluate whoever you had the MOST contact with – Only evaluate ONE of the TA’s – If you didn’t have much TA contact: leave it blank When finished: bring to front and you can go 26
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.