Submitted:
04 December 2025
Posted:
08 December 2025
You are already at the latest version
Abstract
This paper presents an analytical exploration of the Halting Problem as a foundational concept within the Theory of Computation (ToC). Rooted in the work of Alan Turing’s 1936 formulation, the Halting Problem addresses whether a universal algorithm can determine, for any given program and input, whether the program will eventually terminate or run indefinitely. The study reviews key theoretical underpinnings of computability, including Turing Machines, decidability, and recognizability, to establish the context of computational limits. Through Turing’s proof by contradiction, the research demonstrates that the Halting Problem is undecidable, as no algorithm can consistently predict the halting behavior of all programs. Furthermore, the discussion highlights the real-world implications of undecidability in areas such as software verification, artificial intelligence, and cybersecurity—fields that continually confront the constraints of algorithmic prediction. By synthesizing classical theory with modern applications, this paper emphasizes the enduring significance of the Halting Problem as both a mathematical revelation and a philosophical boundary for computation.
Keywords:
Introduction


Foundations of Computability
Computability and Turning Machine
- Infinite tape: acting as an input and memory, divided into discrete cells capable of storing a symbol of an alphabet previously defined.
- Read/write head: capable of reading the current cell, writing a new symbol, and moving left or right along the tape.
- Finite set of internal states: consisting of a start state and one or more are halting (accept or reject) states.
- A transition function that defines how the machine will act according to the current state and the symbol positioning under the tape head. It governs which symbol to write, the direction of head and what state to move to.

Decidability, Recognizability, and the Limits of Computation
The Halting Problem
Proof of Undecidability
Turing Proof using Contradiction

- If (Z) started on (Z) halts, then (Y) started on (Z) with input (Z) halts as well.
- If (Y) started on (Z) with input (Z) halts, then (X) decides that (Z) started on (Z) does not halt.
- If (Z) started on (Z) does not halt, then (Y) started on (Z) with input (Z) does not halt either.
- If (Y) started on (Z) with input (Z) does not halt, then (X) decides that (Z) started on (Z) halts.
Constructing a Hypothetical Decider and Deriving a Contradiction
- Definability of the Hypothetical Halting Decider H
- “Halts”, if P (I) eventually terminates
- “Loops”, if P(I) runs indefinitely
- 2.
- Construction of the Contradictory Program D
- Simulates H(P,P) - to determine if P halts when given its own description as input.
- If H(P,P) = “Halts”, then D enters an infinite loop.
- If H(P,P) = “Loops”, then D halts immediately.
- 3.
- Deriving the Contradiction
- ➢
-
Case 1: Assume D(D) Halts
- By definition of H, this means H(D,D) = “Halts”.
- But by construction, D(D) only halts if H(D,D) = “Loops”.
- This is a contradiction as H cannot simultenuosly return “Halts” and “Loops”
- ➢
-
Case 2: Assume D(D) Loops Forever
- By definition of H, this means H(D,D) = “Loops”.
- But D(D) loops only if H(D,D) = “Halts”.
- This is a contradiction as H cannot simultenuosly return “Loops” and “Halts”
Conclusions
Author Contributions
References
- GeeksforGeeks. Halting Problem in Theory of Computation. GeeksforGeeks. 3 October 2018d. Available online: https://www.geeksforgeeks.org/theory-of-computation/halting-problem-in-theory-of-computa.
- Tutorialspoint.com Halting Problem in Automata Theory. 2025. Available online: https://www.tutorialspoint.com/automata_theory/automata_theory_halting_problem.htm.
- Gautam. Introduction to the Halting Problem, Baeldung on Computer Science. 2024. Available online: https://www.baeldung.com/cs/halting-problem.
- Sanders, S. On the computational properties of the Baire Category Theorem. arXiv.org. 2022. Available online: https://arxiv.org/abs/2210.05251.
- Triantafyllou, S.A. Understanding and Designing Turing Machines with Applications to Computing, Springer Nature Switzerland; 2024; Available online: https://link.springer.com/chapter/10.1007/978-3-031-48465-0_19.
- GeeksforGeeks. Turing Machine in TOC. GeeksforGeeks. 4 May 2016. Available online: https://www.geeksforgeeks.org/theory-of-computation/turing-machine-in-toc/.
- Wong, K.K.L. ‘Turing Machine’. 2023, pp. 249–266. [CrossRef]
- Tourlakis, G. Computability. In Chapman & Hall/CRC Applied Algorithms and Data Structures Series; 2022. [Google Scholar] [CrossRef]
- Strnad, P. Online Turing Machine Recognition. Zamm-Zeitschrift Fur Angewandte Mathematik Und Mechanik 1970, 50, 87. [Google Scholar] [CrossRef]
- Fried, M.D.; Jarden, M. Undecidability, Springer Nature Switzerland; 2023; Available online: https://link.springer.com/chapter/10.1007/978-3-031-28020-7_32.
- GeeksforGeeks. Halting Problem in Theory of Computation. GeeksforGeeks. 3 October 2018. Available online: https://www.geeksforgeeks.org/theory-of-computation/halting-problem-in-theory-of-computa.
- Manoharan, I. (Ilak) (2024) 210. Halting Problem: Can We Predict a Program’s Fate? Medium. 30 March. Available online: https://medium.com/@ilakk2023/210-halting-problem-can-we-predict-a-programs-fate-7f887.
- Butt, S.Y. Halting problem, Purdue University (bepress). 2016. Available online: https://www.researchgate.net/publication/295254085_Halting_problem.
- Tools and Algorithms for the Construction and Analysis of Systems. 2020. Available online: https://link.springer.com/book/10.1007/978-3-030-45190-5.
- Brohi, S.; Jhanjhi, N. Z.; Pillai, T. R. A Research Landscape of Agentic AI and Large Language Models: Applications, Challenges and Future Directions. Algorithms 2025, 18(8), 499. [Google Scholar] [CrossRef]
- Chaubey, N.; Jhanjhi, N. Z.; Thampi, S. M.; Parikh, S.; Amin, K. (Eds.) Computing Science, Communication and Security: 5th International Conference, COMS2 2024, Mehsana, Gujarat, India, February 6–7, 2024, Proceedings; Springer Nature, 2024; Vol. 2174. [Google Scholar]
- Almufareh, M. F.; Jhanjhi, N. Z.; Khan, N. A.; Almuayqil, S. N.; Humayun, M.; Javed, D. BertSent: transformer-based model for sentiment analysis of penta-class tweet classification. In IEEE Access; 2024. [Google Scholar]
- Almazroi, A. A.; Alsubaei, F. S.; Ayub, N.; Jhanjhi, N. Z. Inclusive Smart Cities: IoT-Cloud Solutions for Enhanced Energy Analytics and Safety. International Journal of Advanced Computer Science & Applications 2024, 15(5). [Google Scholar]
- Baligodugula, V. V. Unsupervised-based distributed machine learning for efficient data clustering and prediction; 2023. [Google Scholar]
- Din, S. N. U.; Muzammal, S. M.; Bibi, R.; Tayyab, M.; Jhanjhi, N. Z.; Habib, M. Securing the Internet of Things in Logistics: Challenges, Solutions, and the Role of Machine Learning in Anomaly Detection. In Digital transformation for improved industry and supply chain performance; IGI Global, 2024; pp. 133–165. [Google Scholar]
- Shah, I. A.; Jhanjhi, N. Z.; Brohi, S. N. IoT smart healthcare security challenges and solutions. In Advances in Computational Intelligence for the Healthcare Industry 4.0; IGI Global Scientific Publishing, 2024; pp. 234–247. [Google Scholar]
- Niveshitha, N.; Amsaad, F.; Jhanjhi, N. Z. Air Quality Prediction in Smart Cities Using Cloud Machine Learning. 2023 Second International Conference On Smart Technologies For Smart Nation (SmartTechCon), 2023, August; IEEE, 2023; pp. 1115–1119. [Google Scholar]
- Razaque, A.; Frej, M. B. H.; Bektemyssova, G.; Almi’ani, M.; Amsaad, F.; Alotaibi, A.; Alshammari, M. Quality of Service Generalization using Parallel Turing Integration Paradigm to Support Machine Learning. Electronics 2023, 12(5), 1129. [Google Scholar] [CrossRef]
- Alex, S. A.; Jhanjhi, N. Z.; Ray, S. K. Blockchain based e-medical data storage for privacy protection. International Conference on Mathematical Modeling and Computational Science, 2023, February; Springer Nature Singapore: Singapore; pp. 125–133. [Google Scholar]
- Chaudhary, M.; Gaur, L.; Chakrabarti, A.; Jhanjhi, N. Z. Unravelling the Barriers of human resource analytics: Multi-criteria decision-making approach. Journal of Survey in Fisheries Sciences 2023, 306–321. [Google Scholar]
- Gaur, L.; Rana, J.; Jhanjhi, N. Z. Digital twin and healthcare research agenda and bibliometric analysis. In Digital Twins and Healthcare: Trends, Techniques, and Challenges; 2023; pp. 1–19. [Google Scholar]
- Pal, S.; VijayKumar, H.; Akila, D.; Jhanjhi, N. Z.; Darwish, O. A.; Amsaad, F. Information-centric IoT-based smart farming with dynamic data optimization. Computers, Materials & Continua 2023, 74(1), 321–338. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).