In this lecture, I present the undecidability of the halting problem to advanced high-school students in a 40-minute lecture, using Python programs instead of the usual language of mathematical proof. But the content of the proof is entirely covered by the programs. I explain the proof as an automated method for debunking programs that are presented as solutions to the halting problem, by constructing test cases on which they must fail.
demo_script.py, a script
of all the demonstrations in the lecture.loop.py, a simple infinite
loop.mystery.py, a simple but
mysterious loop, whose halting behavior on large inputs is not
known.self_apply.py, the
self-application function, which applies fine to some functions, but
goes into an infinite loop applied to itself.detect_trivial_loop.py,
a simple-minded attempt to determine halting by looking out for
trivial loops controlled by 0 == 0.fool_detect_trivial_loop.py,
a program systematically created to fool the halting test above that
looks for trivial loops.make_fooler.py, a program
that automates the creation of test cases that fool halting
tests.detect_self_application.py,
another simple-minded halting test that looks for self-applications.|
| |