Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Halting Problem and You!
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
blbradley
March 30, 2013
Programming
1
62
The Halting Problem and You!
A simple(st) proof of the halting problem and why it's important to you!
blbradley
March 30, 2013
Tweet
Share
Other Decks in Programming
See All in Programming
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
130
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
200
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
870
仕様漏れ実装漏れをなくすトレーサビリティAI基盤のご紹介
orgachem
PRO
7
3.5k
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
270
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
450
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
280
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1.2k
モックわからないマン卒業記 ~振る舞いを起点に見直した、フロントエンドテストにおけるモックの使いどころ~
tasukuwatanabe
3
430
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
安いハードウェアでVulkan
fadis
1
850
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
790
Featured
See All Featured
The Curious Case for Waylosing
cassininazir
0
280
Are puppies a ranking factor?
jonoalderson
1
3.2k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Accessibility Awareness
sabderemane
0
87
A better future with KSS
kneath
240
18k
Tell your own story through comics
letsgokoyo
1
870
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
230
Faster Mobile Websites
deanohume
310
31k
Six Lessons from altMBA
skipperchong
29
4.2k
Mind Mapping
helmedeiros
PRO
1
140
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Transcript
The Halting Problem and You! Brandon Bradley tweet: @crixdev github:
blbradley freenode: bbradley
The Problem
“... there is no algorithm for deciding whether any given
machine, when started from any given initial situation, eventually stops.” - Stephen Kleene
decision problem
unsolvable with real and abstract computing machines
The Proof (by contradiction)
suppose we could write a program to solve it
let’s call it oracle(p)
input - any program code output - halts or does
not
oracle p yes no halts?
some trivial examples
p = while(true) oracle p yes no halts?
p = pass, nop oracle p yes no halts?
sure, but it must work for ANY program
let’s make another program!
call it deceiver(p)
deceiver(p) def deceiver(p): if (oracle(p) == true): while(true): pass else:
return true
oracle yes no halts? while(true) true p
the creative part: refer the deceiver to himself
two cases: deceiver loops and deceiver halts
oracle yes no halts? while(true) true p p = deceiver
loops
oracle yes no halts? while(true) true p p = deceiver
halts
halts => loops loops => halts
WAT?
deceiver(p) provides a contradiction
what’s wrong with this? def deceiver(p): if (oracle(p) == true):
while(true): pass else: return true
this! def deceiver(p): if (oracle(p) == true): while(true): pass else:
return true
so, our initial assumption is wrong
program oracle(p) can’t be written
QED
“and You!”
there are simple, well- defined problems which exist that can’t
be solved
many of them ‘reduce’ to the halting problem
the ‘canonical’ unsolvable problem
intuition is simply not enough
algorithms are fun!
other undecidable problems • do two compilers/interpreters accept the same
languages? • the dead-code problem
questions?
References & Thanks • Craig Kaplan, Understanding the Halting Problem
• Stephen Kleene - Introduction to Metamathematics. 1952. Chapter XIII - Computable Functions. • The Matrix, Warner Bros, © 1999 Thanks to Jason, Emma, all of our speakers, and the rest of our great community!