News for hackers. Stuff that matters.
Re:Am open to constructive criticism: My Halting Problem sol... by salawat on Wednesday March 20, 2024 @07:02PM (#39773071)
Halting Problem isn't "does this one instance of a program return". Halting problem is with a Turing Machine, implement an algorithm that will determine whether any arbitrary turing machine from the space of all possible Turing machines return.

You cannot generally decide the problem, because at best your algorithm can only practically determine "the Turing Machine under test has not returned...yet. The Turing Machine capable of ultimately deciding the returnability of TMuT, would necessarilly have practically infinite runtime.

And for that matter, bring yourself out of TM's and you've got all sorts of other nasty constraints that make the Halting Problem Solver unimplementable in the real. What happens when brownouts happen? Single-event-upsets? Rowhammer events? You couldn't win in the purely abstract theoretical, so even trying to get a literal win in the real doesn't stand a chance.

Halting Problem is Computer Science's realization that there is always a bigger Turing Machine, much like how mathematicians understand there to be infinitely many primes. Within the constraints of the axiomatic model of computation; you cannot put a pin in the entire space. Only increasingly large swathes of the space at the cost of completely unreasonable respurce expenditure.

Or as I like to think of it, HP is the understanding that only 2 people ever understood this code in it's totality. God, and me when I was writing it. And I long ago ditched that original context that allowed me to claim I understood it.

Re:Am open to constructive criticism: My Halting Problem sol... by pantantrant on Wednesday March 20, 2024 @07:10PM (#39773127)
My program won't misidentify an very long loop as infinite, it'll just run the practically infinite loop in a finite amount of time and not trigger it.

Well, my program basically detects if a infinite loop is of 1 iteration or two iterations or three iterations or ... iterations, but only infinite loops and not finite loops and in a finite amount of time. This means that finite loops don't trigger my program ever, only infinite ones after a finite amount of time.

TLDR: A turing machine can run my program and determine whether any other program halts or infinite loops in a finite amount of time, never infinite only if the variable n can be infinitely large.