# Halting Problem

> Source: https://modeladay.com/models/halting-problem/
> Category: principle | Topics: science, cognition | Difficulty: 3/5

## Definition

No general algorithm can judge, for any program-plus-input, whether it will ever halt or run forever.

## Core Rule

There is no general algorithm that can decide, for any "program + input," whether it eventually halts or runs forever. Common manifestations: the decidability boundary proved by Turing, the archetypal problem of computational undecidability.

## Opening Context

You've left a program running and the screen still shows nothing. You could give it another second and see whether it finishes.

Or you could shut it down just before it gets to the last step. What if you had a checker that could read the program and its input and tell you whether waiting would pay off?

That's the halting problem. No algorithm can always finish and correctly say whether any given program will eventually stop on a given input. We'll follow Turing's machine on paper and see the one input that a universal checker can't get right.

## How It Works (Preview)

Turing first needed a picture of computation you could check one step at a time. In nineteen thirty-six, he described a machine that reads a square on a tape. Its rules tell it what symbol to write, which way to move, and what to do next.

You can write the machine's own instructions as symbols and have another machine read them. A print shop can print a short story or a manual for the printing press. In much the same way, a computing machine can work on instructions, including its own.

## When It Fails (Preview)

That result leaves a lot of room for reasoning about particular programs. Suppose a counter starts at ten and drops by one every time around a loop until it hits zero.

## Full Lesson, Audio & Practice

Get the full Halting Problem breakdown, 5-minute audio lesson, interactive mechanism animation, and decision checklist in the ConceptFlow app:
- iOS App Store: https://apps.apple.com/app/conceptflow-mental-models/id6756862333
- Google Play: https://play.google.com/store/apps/details?id=com.juxianyp.conceptflow
- Web page: https://modeladay.com/models/halting-problem/

## Related Mental Models

- [Diagonal Argument](https://modeladay.com/models/diagonal-argument/)
- [Prototype](https://modeladay.com/models/prototype/)
- [Kolmogorov complexity](https://modeladay.com/models/kolmogorov-complexity/)
