Let’s imagine that we have a plan for reading other plans and saying if they will end. Our imaginary plan is called E, for Ending. We want to know if a plan like E is possible. We do not know what the steps of plan E are. All we know is that we are imagining that we can follow plan E to read another plan and say whether it will end or not. (We need a name for this other plan. We’ll call it X.)
But wait! We know there are plans that sometimes end, and sometimes go on forever. Here is one —
Plan Z:
Start with a number.
If our number is zero, stop.
Make our number smaller by 1.
Go to step 2.
Plan Z will always stop if the number we start with is bigger than zero and is a whole number. But if our number is one-half (or something else not whole) then Z will never end. That is because our number will go right past zero without ever being zero.
Plan Z is not really whole by itself. It needs something else that we give it: the number in step 1. We can think of this number as “food” for the plan. The “food” is something Z needs in order to go, or even to make sense. Some food is good for you, and some is bad for you … … and whether Z ends or not depends on what number we feed it.
Plan Z ends if we feed it the number 1 or 42, but not if we feed it the number one-half.
And so when we ask “Will plan X end?” we really should ask “Will plan X end, if we feed F to plan X?”
So in order to follow plan E, we need to know two things: a plan X, and a something called F. (What kind of something? Whatever kind X wants. If X wants a number, then F is a number.
If X wants a cookie, then F is a cookie. If X wants a plan to read, then F is a plan.) Following E will then tell us if X-fed-with-F will end or run forever.
Now here is another plan —
Plan G:
Start with a plan. Call it plan X.
Follow plan E to read plan X, with plan X as food. This will tell us if plan X will end or not.
Now, if E told us that X never ends, then stop!
But if E told us that X stops, then sing “The Song That Never Ends”.
So when we follow plan G, we don’t do the same thing that X does. We do the other thing! If X never ends, then G ends. And if X ends, then G never ends.
But what happens if X is G? G is a plan, and G wants a plan for its food. So we can feed G to G itself! If we feed G to G, then G will end if G doesn’t end. And G will go on forever if G ends.
That does not make any sense at all. Everything about that makes no sense! It is like saying “If the cat is white, then the cat is not white.” It is really wrong!
What part is wrong, though? G is very simple. There is nothing wrong with G. The wrongness is in the thing that we imagined:
Plan E, the plan that can tell us if any plan will end or not.
This means that E is not really possible. That is the part that looked like it might make sense, but really it did not. Oh well. It sure would be nice if E was possible. But it is not.
The Halting Problem (Part Three)
Let’s imagine that we have a plan for reading other plans and saying if they will end.
Our imaginary plan is called E, for Ending. We want to know if a plan like E is possible.
We do not know what the steps of plan E are.
All we know is that we are imagining that we can follow plan E to read another plan and say whether it will end or not.
(We need a name for this other plan. We’ll call it X.)
But wait! We know there are plans that sometimes end, and sometimes go on forever. Here is one —
Plan Z:
Start with a number.
If our number is zero, stop.
Make our number smaller by 1.
Go to step 2.
Plan Z will always stop if the number we start with is bigger than zero and is a whole number.
But if our number is one-half (or something else not whole) then Z will never end.
That is because our number will go right past zero without ever being zero.
Plan Z is not really whole by itself.
It needs something else that we give it: the number in step 1.
We can think of this number as “food” for the plan.
The “food” is something Z needs in order to go, or even to make sense.
Some food is good for you, and some is bad for you …
… and whether Z ends or not depends on what number we feed it.
Plan Z ends if we feed it the number 1 or 42, but not if we feed it the number one-half.
And so when we ask “Will plan X end?” we really should ask “Will plan X end, if we feed F to plan X?”
So in order to follow plan E, we need to know two things: a plan X, and a something called F.
(What kind of something? Whatever kind X wants.
If X wants a number, then F is a number. If X wants a cookie, then F is a cookie.
If X wants a plan to read, then F is a plan.)
Following E will then tell us if X-fed-with-F will end or run forever.
Now here is another plan —
Plan G:
Start with a plan. Call it plan X.
Follow plan E to read plan X, with plan X as food.
This will tell us if plan X will end or not.
Now, if E told us that X never ends, then stop!
But if E told us that X stops, then sing “The Song That Never Ends”.
So when we follow plan G, we don’t do the same thing that X does.
We do the other thing!
If X never ends, then G ends.
And if X ends, then G never ends.
But what happens if X is G?
G is a plan, and G wants a plan for its food. So we can feed G to G itself!
If we feed G to G, then G will end if G doesn’t end.
And G will go on forever if G ends.
That does not make any sense at all.
Everything about that makes no sense!
It is like saying “If the cat is white, then the cat is not white.”
It is really wrong!
What part is wrong, though?
G is very simple. There is nothing wrong with G.
The wrongness is in the thing that we imagined: Plan E, the plan that can tell us if any plan will end or not.
This means that E is not really possible.
That is the part that looked like it might make sense, but really it did not.
Oh well.
It sure would be nice if E was possible.
But it is not.