Whenever people ask about the halting problem as it pertains to programming, people respond with \"If you just add one loop, you\'ve got the halting program and therefore yo
There's an OK proof the Halting Problem on wikipedia.
To illustrate, exactly, why just applying some technique to loops is insufficient, consider the following program (pseudocode):
int main()
{
//Unbounded length integer
Number i = 3;
while(true)
{
//example: GetUniquePositiveDivisiors(6) = [1, 2, 3], ...(5) = 1, ...(10) = 1, 2, 5, etc.
Number[] divisiors = GetUniquePositiveDivisiors(i);
Number sum = 0;
foreach(Number divisor in divisiors) sum += divisor;
if(sum == i) break;
i+=2;
}
}
Can you think of an approach that will return true if this code halts, and false otherwise?
Think Carefully.
If by chance you're in serious contention for a Fields medal, imagine some code for these problems in place of the above.