# The Halting Problem: Why Some Questions Computers Can Never Answer

Статья знакомит с проблемой остановки, одним из фундаментальных результатов теоретической информатики. Автор объясняет, как в 1936 году Алан Тьюринг доказал, что не существует алгоритма, способного определить, завершится ли произвольная программа или будет работать бесконечно, и шаг за шагом разбирает доказательство от противного. Далее показано, почему этот результат важен на практике: от пределов поиска ошибок и работы антивирусов до теоремы Райса, а также как инженеры обходят неразрешимость с помощью статического анализа, формальной верификации и тайм-аутов. Материал подойдёт студентам и разработчикам.

| Поле | Значение |
|---|---|
| Автор | Романов Никита Сергеевич |
| Организация | РТУ МИРЭА |
| Раздел | Computer Science |
| Опубликовано | 05.12.2026 |
| Идентификатор | AX-137069 |
| Лицензия | CC BY 4.0 |

Полный текст (PDF): https://arxivorg.ru/upload/iblock/055/98ac2jy24wgontw2bce33sw8xhoizvx4/Halting_Problem_Article.pdf
Источник (HTML): https://arxivorg.ru/computer-science/the-halting-problem-why-some-questions-computers-can-never-answer/
Архив: арХиворг.ру — открытый архив научных препринтов на русском языке.

## Полный текст

The Halting Problem: Why Some Questions Computers Can Never Answer An introduction to the limits of computation Introduction Modern computers seem almost limitless. They translate languages, recognize faces, beat grandmasters at chess and simulate the weather. It is tempting to believe that, given enough time and processing power, a computer can solve any well-defined problem. In 1936, however, the British mathematician Alan Turing proved that this belief is false. He showed that there are precise, meaningful questions that no algorithm can ever answer. The most famous of them is known as the halting problem. What Is the Halting Problem? The halting problem asks a simple question: given a program and an input, will the program eventually finish running, or will it continue forever in an infinite loop? For some programs the answer is obvious. A program that prints &quot;Hello, world&quot; and exits clearly halts, while a program containing the loop &quot;while true: do nothing&quot; clearly does not. The difficulty is that most real programs are not so simple, and their behavior can depend on complex calculations, user input or unsolved mathematical questions. It would be extremely useful to have a tool that could analyze any program and report whether it halts. Such a tool would let developers find every infinite loop before shipping software. Turing&#039;s result says that such a tool cannot exist. Turing&#039;s Proof by Contradiction The proof is short and elegant. It uses a technique called proof by contradiction: we assume the opposite of what we want to prove and show that this assumption leads to nonsense. • Step 1. Suppose a perfect function exists, called halts(program, input), which always returns true if the program halts on that input and false if it runs forever. • Step 2. Using it, build a new program called Paradox. Paradox receives a program as its input and asks halts whether that program halts when given its own code as input. If halts answers &quot;yes, it halts&quot;, Paradox deliberately enters an infinite loop. If halts answers &quot;no, it loops&quot;, Paradox stops immediately. • Step 3. Now run Paradox on its own code. If Paradox halts, then halts must have predicted that it loops, so it should loop. If Paradox loops, then halts must have predicted that it halts, so it should halt. Either way we reach a contradiction.

The only assumption we made was that halts exists, so that assumption must be false. No general algorithm can decide whether arbitrary programs halt. The argument echoes the diagonal argument of Georg Cantor and the self-referential paradoxes studied by Kurt Gödel, and it shows that the limits of computation are a deep mathematical fact rather than a shortcoming of current technology. Why It Matters in Practice The halting problem is not merely a curiosity. It is the foundation of a much broader family of results. Rice&#039;s theorem, proved in 1953, generalizes Turing&#039;s idea: every non-trivial question about what a program does, as opposed to how it is written, is undecidable. This has real consequences for software engineering. • Perfect bug detection is impossible. No tool can find every possible bug, or even every possible crash, in every program without sometimes being wrong. • Antivirus software has limits. Deciding whether an arbitrary program is malicious is undecidable in general, which is why security tools rely on heuristics, signatures and sandboxing. • Compilers cannot optimize everything. Determining whether two programs are always equivalent, or whether a piece of code is ever reached, cannot be solved in full generality. Living With Undecidability If the general problem is unsolvable, how do engineers get any work done? The answer is that they solve easier, more specific versions. Static analyzers can prove that particular classes of programs terminate, especially when loops are bounded or follow clear patterns. Type systems, formal verification and proof assistants such as Coq and Lean let programmers write code together with a machine-checked proof of its correctness. Some languages deliberately restrict what programs can express so that every program is guaranteed to halt. Tools that must be sound sometimes answer &quot;I don&#039;t know&quot;, and that honest third answer is what makes them practical. Timeouts are another everyday workaround. Operating systems, web servers and test frameworks do not try to predict whether a task will finish. They simply wait a reasonable amount of time and then stop it. Conclusion The halting problem teaches an important lesson: computation has boundaries, and those boundaries can be proven mathematically. Turing&#039;s 1936 paper did more than answer a question about programs. It helped define what a computer is, launched the field of computability theory and set the stage for the complexity theory that followed. Understanding what machines cannot do makes us better at designing what they can do, and it reminds us

that even in a world of ever more powerful artificial intelligence, some questions will always remain beyond the reach of any algorithm. Further reading: A. M. Turing, “On Computable Numbers, with an Application to the Entscheidungsproblem” (1936); M. Sipser, Introduction to the Theory of Computation.
