exam by email before midnight tonight – Some resources allowed (read front directions page carefully) • Blue Belts who haven’t yet qualified (15) – Need to qualify for Red Belt by last day of class (1 week from today) – Project 5 and Project 6 • Not yet Blue Belt (10) – Need to complete Blue Belt qualification soon!
simulate any “mechanical computer”. Alan Turing, 1912-1954 2 What cannot be computed by a TM? What cannot be computed by any mechanical computer? Weds/Fri: What cannot be computed by any mechanical computer in a reasonable time?
Output: 1 if it eventually halts, 0 if it never halts when running on an empty input tape Is it possible to design a Turing Machine that solves the Halting Problem?
Show that if you have A you can make X. 3. Therefore, A must not exist. Noncomputability (Alan Turing) X = paradox procedure A = algorithm that solves HALTING Problem
def paradox(): if halts('paradox()'): while True: pass 1. paradox leads to a contradiction. 2. If we have halts, an algorithm that solves the Halting Problem, we can define paradox. 3. Therefore, halts must not exist.
3 ''''') The only way the program s passed to evaluates_to_3could not evaluate to 3, is if s doesn’t halt. (Note: assumes evaluating s cannot produce an error, but we can use error handling to deal with this case.) Where cleanreturns(s) is a procedure that replaces all return x statements in s with x; return 3