Helper file to reason through http://www.lel.ed.ac.uk/~gpullum/loopsnoop.html See the video linked from http://cs.indstate.edu/info/coding-demos.html for a walk-through Suppose program P solves the halting problem. So, P(prog, input) = 'Bad' if prog never halts P(prog, input) = 'Good' if prog halts Okay, create a program Q that uses P as follows, Q(A) result = P(A, A) if result = 'Bad' then stop if result = 'Good' then do not halt Now, what will the output of Q(Q) be? Let's see. result = P(Q, Q) // if result = 'Bad', P's definition says Q(Q) does not halt // Q's definition says that Q(Q) does not halt when P(Q, Q)='Good' // this would mean that result is 'Good' // So if result is 'Bad', it must be that result is 'Good' // what if result = 'Good'. trace through the same steps, and you // will find that it must be that result is 'Bad' If result is 'Bad', result must be 'Good'. If result is 'Good', result must be 'Bad'. That doesn't make sense, so it must be that P cannot exist.