How to Make a Proof of Halting Problem More Convincing: A Pedagogical Remark

Similar documents
Why in Mayan Mathematics, Zero and Infinity are the Same: A Possible Explanation

Why Bellman-Zadeh Approach to Fuzzy Optimization

Positive Consequences of Negative Attitude: Game-Theoretic Analysis

Diophantine Equations. Elementary Methods

CSCI3390-Lecture 6: An Undecidable Problem

When Can We Reduce Multi-Variable Range Estimation Problem to Two Fewer-Variable Problems?

Propagation of Probabilistic Uncertainty: The Simplest Case (A Brief Pedagogical Introduction)

Theory of Computation

CHAPTER 6. Copyright Cengage Learning. All rights reserved.

ENEE 459E/CMSC 498R In-class exercise February 10, 2015

Hilbert s Tenth Problem

Decision Making under Interval Uncertainty: What Can and What Cannot Be Computed in Linear Time and in Real Time

Double Total Domination on Generalized Petersen Graphs 1

Kekule's Benzene Structure: A Case Study of Teaching Usefulness of Symmetry

How to Define Relative Approximation Error of an Interval Estimate: A Proposal

Undecibability. Hilbert's 10th Problem: Give an algorithm that given a polynomial decides if the polynomial has integer roots or not.

Decidability and Undecidability

CS/MA 109 Quantitative Reasoning. Wayne Snyder Computer Science Department Boston University

Voting Aggregation Leads to (Interval) Median

Solving Homogeneous Systems with Sub-matrices

CST Part IB. Computation Theory. Andrew Pitts

Random Utility Functions are Uniquely Determined by User Preferences

Use of Grothendieck s Inequality in Interval Computations: Quadratic Terms are Estimated Accurately (Modulo a Constant Factor)

On a Principal Ideal Domain that is not a Euclidean Domain

Introduction to Computer Science

University of Texas at El Paso. Vladik Kreinovich University of Texas at El Paso,

Pure Quantum States Are Fundamental, Mixtures (Composite States) Are Mathematical Constructions: An Argument Using Algorithmic Information Theory

Similarity Beyond Correlation: Symmetry-Based Approach

Why Locating Local Optima Is Sometimes More Complicated Than Locating Global Ones

Handouts. CS701 Theory of Computation

Formula for Lucas Like Sequence of Fourth Step and Fifth Step

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

The Limit of Humanly Knowable Mathematical Truth

Checking Monotonicity is NP-Hard Even for Cubic Polynomials

Principles of Computing, Carnegie Mellon University. The Limits of Computing

Church s undecidability result

Pure Mathematical Sciences, Vol. 6, 2017, no. 1, HIKARI Ltd,

New Algorithms for Statistical Analysis of Interval Data

Restrained Weakly Connected Independent Domination in the Corona and Composition of Graphs

Why Copulas? University of Texas at El Paso. Vladik Kreinovich University of Texas at El Paso,

On Symmetric Bi-Multipliers of Lattice Implication Algebras

Logic of Scientific Discovery: How Physical Induction Affects What Is Computable

A Note on Open Loop Nash Equilibrium in Linear-State Differential Games

Computation in Quantum Space-time Could Lead to a Super-polynomial Speedup

CSE 105 THEORY OF COMPUTATION

Full Superposition Principle Is Inconsistent with Non-Deterministic Versions of Quantum Physics

A Short Note on Universality of Some Quadratic Forms

Secure Weakly Convex Domination in Graphs

Computability, Undeciability and the Halting Problem

New Algorithms for Statistical Analysis of Interval Data

Characteristic Value of r on The Equation 11 x r (mod 100)

Obsevations, Truth and Logic

Computational Aspects of Aggregation in Biological Systems

Towards Designing Optimal Individualized Placement Tests

The Church-Turing Thesis. Chapter 18

How to Measure Loss of Privacy

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Double Total Domination in Circulant Graphs 1

Locating Chromatic Number of Banana Tree

arxiv:math/ v1 [math.nt] 17 Feb 2003

Reductions in Computability Theory

A Generalization of p-rings

Approximations to the t Distribution

Computability of the Avoidance Set and of the Set-Valued Identification Problem

A Generalized Fermat Equation with an Emphasis on Non-Primitive Solutions

On a Certain Representation in the Pairs of Normed Spaces

Positive Consequences of Negative Attitude: Game-Theoretic Analysis

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 20. To Infinity And Beyond: Countability and Computability

Large Numbers, Busy Beavers, Noncomputability and Incompleteness

International Mathematical Forum, Vol. 9, 2014, no. 36, HIKARI Ltd,

On a Diophantine Equation 1

Time Magazine (1984)

Exact Bounds on Sample Variance of Interval Data

On a Boundary-Value Problem for Third Order Operator-Differential Equations on a Finite Interval

Why Curvature in L-Curve: Combining Soft Constraints

Poincaré`s Map in a Van der Pol Equation

Hilbert s problems, Gödel, and the limits of computation

Turing Machines. Lecture 8

CPSC 421: Tutorial #1

Turing Machine Recap

Restrained Independent 2-Domination in the Join and Corona of Graphs

Decidability. Linz 6 th, Chapter 12: Limits of Algorithmic Computation, page 309ff

CS 275 Automata and Formal Language Theory

Direct Proof and Counterexample I:Introduction

Hyperbolic Functions and. the Heat Balance Integral Method

Sums of Tribonacci and Tribonacci-Lucas Numbers

CS 208: Automata Theory and Logic

Sequences from Heptagonal Pyramid Corners of Integer

Is there a computable upper bound for the height of a solution of a Diophantine equation with a unique solution in positive integers?

The Greatest Common Divisor of k Positive Integers

Membership Functions Representing a Number vs. Representing a Set: Proof of Unique Reconstruction

Modeling Extremal Events Is Not Easy: Why the Extreme Value Theorem Cannot Be As General As the Central Limit Theorem

How to Define "and"- and "or"-operations for Intuitionistic and Picture Fuzzy Sets

Direct Proof and Counterexample I:Introduction. Copyright Cengage Learning. All rights reserved.

Only Intervals Preserve the Invertibility of Arithmetic Operations

1 Reals are Uncountable

Remarks on the Maximum Principle for Parabolic-Type PDEs

Lecture Notes: The Halting Problem; Reductions

Rainbow Connection Number of the Thorn Graph

Some Properties of D-sets of a Group 1

Transcription:

International Mathematical Forum, Vol. 13, 2018, no. 1, 9-13 HIKARI Ltd, www.m-hikari.com https://doi.org/10.12988/imf.2018.71299 How to Make a Proof of Halting Problem More Convincing: A Pedagogical Remark Benjamin W. Robertson 1, Vladik Kreinovich 1, and Olga Kosheleva 2 Departments of 1 Computer Science and 2 Teacher Education University of Texas at El Paso 500 W. University El Paso, TX 79968, USA Copyright c 2018 Benjamin W. Robertson, Vladik Kreinovich and Olga Kosheleva. This article is distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Abstract As an example of an algorithmically undecidable problem, most textbooks list the impossibility to check whether a given program halts on given data. A usual proof of this result is based on the assumption that the hypothetical halt-checker works for all programs. To show that a halt-checker is impossible, we design an auxiliary program for which the existence of such a halt-checker leads to a contradiction. However, this auxiliary program is usually very artificial. So, a natural question arises: what if we only require that the halt-checker work for reasonable programs? In this paper, we show that even with such a restriction, halt-checkers are not possible and thus, we make a proof of halting problem more convincing for students. Mathematics Subject Classification: 03D35 68Q01 97Q80 Keywords: halting problem, 10th Hilbert problem, Russell s paradox, set theory, pedagogical notes

10 B. Robertson, V. Kreinovich, and O. Kosheleva 1 Formulation of the Problem Halting problem: reminder. A computer science degree means acquiring both the practical skills needed to design and program software and the theoretical knowledge describing which computational tasks are possible and which are not. Different programs include different examples of problems for which no computational solution is possible, but all of them include with proof the very first example of such a problem: the halting problem, according to which no algorithm is possible that, given a program p and data d, always checks whether p halts on d; see, e.g., [2]. Some textbooks describe this result in terms of Turing machines but, in our opinion, this result is much clearer to students when it is described in terms of programs i.e., something with which are very familiar rather than in terms of Turing machines, a new concept that they have just learned in the corresponding theoretical course and with which they are not yet very familiar. Let us therefore concentrate on the formulation of this result in terms of programs. How this result is usually proved. To come up with a proof, we first need to describe both the program and the data in terms of natural numbers. This description is almost straightforward. Indeed, in the computer, no matter what symbols we type, any program or data is represented as a sequence of 0s and 1s. In principle, we can just take the corresponding sequence of 0s and 1s, and interpret it as a binary number: e.g., 100 would be interpreted as 4, 101 as 5, etc. However, this does not provide us with a perfect representation, since in this case, two different sequences of 0s and 1s, e.g., 1 and 001, are represented by the same natural number and so, based on this number, it is impossible to uniquely reconstruct the corresponding program. To avoid this non-uniqueness, we can append 1 in front the sequence of 0s and 1s. This way, 1 becomes 11 which is the number 3, while 0011 becomes 1001 which is a different natural number 9. Once this representation is agreed upon, we can then prove, by contradiction, that the desired halt-checker h(p, d) is not possible. Indeed, if it was possible, then we could write the following auxiliary program: procedure auxiliary(i): if h(i,i) then loop forever else return 0 where loop forever means invoking a non-halting while-loop, such as while(true}) i = i;

Halting problem: pedagogical remark 11 The proof is straightforward. Indeed, our auxiliary program corresponds to some integer i 0. If this program halts on the number i 0, then h(i 0, i 0 ) is true and hence, our auxiliary program loops forever which contradicts to our assumption that it halts. Similarly, if the auxiliary program does not halt, this means that h(i 0, i 0 ) is false and thus, our auxiliary program returns 0 which contradicts to our assumption that it does not halt. In both possible cases, we get a contradiction, which means that our assumption that a halting program h(p, d) is possible is wrong. Thus, no such halting program is possible. A natural question. What this proof shows that if we require that a program h(p, d) correctly checks halting for all possible programs p and data d. To prove this, we consider a weird example of an auxiliary program a program which was invented for the sole purpose of proving this result. What if we limit ourselves to program which are more reasonable (in some natural sense)? Will this result still hold? This question makes perfect sense in view of the analogy with barber s paradox and Russell s paradox in set theory. Most textbooks emphasize that the main idea behind the above proof comes from the origins of set theory. The corresponding construction can be informally described by the known barber s paradox, when a military barber attached to a detachment is commanded to shave those and only those who do not shave themselves. This is clearly a paradox: if he shaves himself, then he is not allowed to do it, and vice versa, if he does not shave himself, then he is commanded to shave himself. In set theory context, this paradox was first described by the famous philosopher Bertrand Russell who proposed to consider the set S def = {x : x x} of all the sets that are not elements of themselves (being an element of oneself is not an impossibility: e.g., the set of all possible sets is clearly its own element). Here: If S S, then, since S is an element of the class of all sets that do not belong to themselves, we should have S S. Vice versa, if S is not an element of S, then it should not have the property S S and thus, we would have S S.

12 B. Robertson, V. Kreinovich, and O. Kosheleva In both cases, we have a contradiction. This situation is indeed similar to the halting problem. However, in contrast to the halting problem, for sets, we do not make a radical conclusion that sets do not exist: it turns out that if we limit ourselves to reasonable sets, paradoxes disappear, and we have a very reasonable theory actually, set theory is, at present, the foundation for all mathematics. So, this analogy emphasizes the above natural question: what if we limit ourselves to reasonable programs like in set theory, when we limit ourselves to reasonable sets will we get a different result? What we do in this paper. In this paper, we explain that as is rather easy to explain in class the halt-checking program h(p, d) is not possible even if we require that it only work for reasonable programs. 2 Halt-Checking Is Impossible Even If We Limit Ourselves to Reasonable Programs Main idea. The main idea behind our explanation is based on another algorithmically unsolvable problem which is often presented in theoretical computing classes the problem of checking whether a given Diophantine equation is solvable. A Diophantine equation is a equation of the type P (x 1,..., x n ) = 0, where P (x 1,..., x n ) is a polynomial with integer coefficients, and we are looking for solutions in which all x i are natural numbers. It is known that no algorithm is possible that would check whether a given Diophantine equation has a solution. This result is a solution to one of the 23 challenging mathematical problems that David Hilbert, on behalf of the world s mathematical community, presented to the 20 century mathematicians this problem (No. 10 on Hilbert s list) was eventually solved by Yuri Matiyasevich in 1970; see, e.g., [1]. How to transform this result into a more convincing proof of the halting problem. For each polynomial P, we can use exhaustive search to see if the corresponding polynomial equation has a solution in natural numbers: we start with Stage 0, on which we check whether P (x 1,..., x n ) = 0 for any tuple for which n x 1 =... = x n = 0, so this checking is easy; x i = 0 there is actually only one such tuples then, we perform Stage 1, i.e., we check whether P (x 1,..., x n ) = 0 for any tuple for which n x i = 1 there are n such tuples, with x i = 1 for some i and x j = 0 for all j i;

Halting problem: pedagogical remark 13 after that, we perform Stage 2, i.e., we check whether P (x 1,..., x n ) = 0 for any tuple for which n x i = 2;... at Stage k of this algorithm, we check whether P (x 1,..., x n ) = 0 for any tuple for which n x i = k;... At each stage, we check finitely many tuples. If the polynomial equation has a solution, this algorithm will find it. Thus, this program is reasonable (definitely more reasonable than the program used in the usual proof of halting problem). On the other hand, if the original equation does not have a solution, then this program will never halt. So, if it was possible to check whether any such program halts or not, we would then be able to tell whether a given Diophantine equation has a solution and we know, from Matiyasevich s result, that this is not possible. Thus, even if we limit ourselves to reasonable programs p, it is still not possible to have a program that would check, for each such program p and data d, whether p halts on d. Comment. Of course, the impossibility of such a general result does not preclude us from sometimes being able to check whether a program halts: such checks are indeed possible for many specific classes of programs. Acknowledgments. This work was supported in part by the National Science Foundation grant HRD-1242122 (Cyber-ShARE Center of Excellence). References [1] Yu. Matiyasevich, Hilbert s 10th Problem (Foundations of Computing), MIT Press, Cambridge, Massachusetts, 1993. [2] M. Sipser, Introduction to the Theory of Computation, Cengage Learning, Boston, Massachusetts, 2012. Received: December 22, 2017; Published: January 5, 2018