The halting problem asks whether it's possible to write a program that can decide, for any given program and input, whether that program will eventually stop running. This is known to be an undecidable problem.
Why is the halting problem undecidable?
No algorithm exists that can correctly decide, for every possible program and input, whether that program halts
No computer has enough memory to store every possible program and check its behaviour
No programming language allows a program to examine its own source code
No program can run for an unlimited amount of time before being stopped by the operating system
Was this exam question helpful?