Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Anal Turing was wrong

Name: Anonymous 2011-02-04 8:45

There are at most 2^n different programs of length n (in binary).

Those that terminate go on forever, those that don't terminate stop after x steps.

let f(n) = the largest x.

Now write the program:

halts?(program) {
 int maxsteps = f(length(program));
 for(int i = 0; i < maxsteps; i++) { step(program); }
 if(halted?(program)) return HALTS;
 else return LOOPS;
}


any questions Turing?

Name: Anonymous 2011-02-04 13:05

If the (entire) state of a program reaches one of the states it was in before, then it will not halt. Otherwise, the answer is "maybe".

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List