Analytics Vidhya
Published in

Analytics Vidhya

Proving Halting Problem is undecidable (for layman programmers)

Photo by Markus Spiske on Unsplash

Defining Halting Problem

Example

func P(x int32) {
for x%2 == 1 {
x += 2
}
}

Theorem: The halting problem is undecidable

How can we hope to prove this theorem?

Defining the signature of this algorithm

func doesTerminate(P, I) bool

The Plan

Evil genius (Heavy recursion ahead)

func Contradictory(J) {
for doesTerminate(J, J) {}
}

The Paradox

The Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store