Lecture 36: Other Non-computable Problems

Similar documents
Lecture 31: Reductions

Lecture 29: Tractable and Intractable Problems

Lecture 17: Floyd-Hoare Logic for Partial Correctness

NP-Complete and Non-Computable Problems. COMP385 Dr. Ken Williams

Lecture 27: Theory of Computation. Marvin Zhang 08/08/2016

Undecidability. Andreas Klappenecker. [based on slides by Prof. Welch]

Nondeterministic finite automata

To factor an expression means to write it as a product of factors instead of a sum of terms. The expression 3x

Computer Sciences Department

Turing Machine Recap

Notes for Lecture Notes 2

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: NP-Completeness I Date: 11/13/18

CS173 Strong Induction and Functions. Tandy Warnow

On Rice s theorem. Hans Hüttel. October 2001

Undecidability and Rice s Theorem. Lecture 26, December 3 CS 374, Fall 2015

MA 1125 Lecture 33 - The Sign Test. Monday, December 4, Objectives: Introduce an example of a non-parametric test.

Computer Science 385 Analysis of Algorithms Siena College Spring Topic Notes: Limitations of Algorithms

1 Computational Problems

Automata Theory CS S-FR2 Final Review

Important Properties of R

Lecture 3: Big-O and Big-Θ

Loop Convergence. CS 536: Science of Programming, Fall 2018

NP-Completeness. Until now we have been designing algorithms for specific problems

highlights proof by contradiction what about the real numbers?

Turing Machines Part III

CS154, Lecture 10: Rice s Theorem, Oracle Machines

CH 66 COMPLETE FACTORING

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

Turing Machines and Time Complexity

U.C. Berkeley CS278: Computational Complexity Professor Luca Trevisan August 30, Notes for Lecture 1

20.1 2SAT. CS125 Lecture 20 Fall 2016

CSCI3390-Lecture 6: An Undecidable Problem

Lecture 5. 1 Review (Pairwise Independence and Derandomization)

Lecture 39 (Barrier Tunneling) Physics Fall 2018 Douglas Fields

CS151 Complexity Theory. Lecture 1 April 3, 2017

Great Theoretical Ideas in Computer Science. Lecture 7: Introduction to Computational Complexity

Introduction to Computer Science and Programming for Astronomers

CH 24 IDENTITIES. [Each product is 35] Ch 24 Identities. Introduction

Mathematics-I Prof. S.K. Ray Department of Mathematics and Statistics Indian Institute of Technology, Kanpur. Lecture 1 Real Numbers

Complexity Theory Part I

Writing proofs for MATH 51H Section 2: Set theory, proofs of existential statements, proofs of uniqueness statements, proof by cases

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

NP-Completeness I. Lecture Overview Introduction: Reduction and Expressiveness

CS103 Handout 22 Fall 2012 November 30, 2012 Problem Set 9

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

( )( b + c) = ab + ac, but it can also be ( )( a) = ba + ca. Let s use the distributive property on a couple of

Introduction to Turing Machines. Reading: Chapters 8 & 9

CS 124 Math Review Section January 29, 2018

Basics of Proofs. 1 The Basics. 2 Proof Strategies. 2.1 Understand What s Going On

Introduction to Computer Science. Polly Huang NTU EE

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

Boolean circuits. Lecture Definitions

Section 1.7 Proof Methods and Strategy. Existence Proofs. xp(x). Constructive existence proof:

A Note on Turing Machine Design

Introduction. An Introduction to Algorithms and Data Structures

1 General Tips and Guidelines for Proofs

CSCE 551: Chin-Tser Huang. University of South Carolina

CS 350 Algorithms and Complexity

CS 350 Algorithms and Complexity

CS264: Beyond Worst-Case Analysis Lecture #18: Smoothed Complexity and Pseudopolynomial-Time Algorithms

Algorithms and Data Structures 2016 Week 5 solutions (Tues 9th - Fri 12th February)

Properties of Sequences

Section 14.1 Computability then else

EQ: How do I convert between standard form and scientific notation?

CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010

Warm-Up Problem. Please fill out your Teaching Evaluation Survey! Please comment on the warm-up problems if you haven t filled in your survey yet.

The Limits of Computation

CS 125 Section #10 (Un)decidability and Probability November 1, 2016

CS264: Beyond Worst-Case Analysis Lecture #15: Smoothed Complexity and Pseudopolynomial-Time Algorithms

(a) Definition of TMs. First Problem of URMs

The Complexity of Optimization Problems

Advanced topic: Space complexity

University of Utah Electrical & Computer Engineering Department ECE 3510 Lab 9 Inverted Pendulum

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 8

ORF 523. Finish approximation algorithms + Limits of computation & undecidability + Concluding remarks

The Inductive Proof Template

Math 144 Summer 2012 (UCR) Pro-Notes June 24, / 15

Theory of Computation

Lecture Notes: The Halting Problem; Reductions

CS 361: Probability & Statistics

CS 6901 (Applied Algorithms) Lecture 3

Hypothesis testing I. - In particular, we are talking about statistical hypotheses. [get everyone s finger length!] n =

Algorithms Exam TIN093 /DIT602

Inference and Proofs (1.6 & 1.7)

GRAVITY. David J. Jeffery. Department of Physics, University of Idaho, PO Box , Moscow, Idaho , U.S.A January 1 ABSTRACT

Commutative Rings and Fields

CS154 Final Examination

CS 361: Probability & Statistics

6.2 Important Theorems

Essential facts about NP-completeness:

A non-turing-recognizable language

Guide to Proofs on Discrete Structures

Notes from How to Prove it: A Structured Approach by Daniel J. Velleman

Elementary factoring algorithms

CS395T Computational Statistics with Application to Bioinformatics

Computational complexity and some Graph Theory

QUADRATICS 3.2 Breaking Symmetry: Factoring

MITOCW watch?v=pqkyqu11eta

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009

CMSC 441: Algorithms. NP Completeness

Transcription:

Lecture 36: Other Non-computable Problems Aims: To show how to prove that other problems are non-computable, which involves reductions from, e.g., the Halting Problem; and To point out how few problems are, in fact, computable. Page 1 of 14

36.1. There are many problems for which there is no algorithm. In fact, the number of things which can be computed is infinitesimal compared with the number of things one might like to compute but which cannot be computed. To prove a problem P is non-computable, We could give a proof similar to the one we gave for the Halting Problem. This would be a direct but tedious way of proving non-computability. But there is an indirect way of proving non-computability which is usually easier. We exploit the fact that we already have one problem that has been proved to be non-computable, i.e. the Halting Problem. The proof will still be a proof by contradiction; it will also use a reduction. We assume that P is computable. Then we show that, if this assumption is true, then the Halting Problem would be computable. But we know the Halting Problem is non-computable. Contradiction! So our assumption is false: P is non-computable. Page 2 of 14

36.2. We ll prove the following is non-computable: Problem 36.1. Parameters: A MOCCA program P. Returns: YES if P would terminate for all its inputs; NO otherwise. Assume that the Totality Problem is computable. I.e. we have a MOCCA program T P that solves the Totality Problem. But in that case, we can write a MOCCA program HP to solve the Halting Problem. It will use program T P as a procedure. Page 3 of 14 P x P f TP output This converts P & x TP is an algorithm that into P. solves the Totality Problem. HP HP is an algorithm that solves the Halting Problem. So, HP takes in two inputs P and x. Function f uses these two inputs to write a new program called P, which

takes in an input y but ignores it; runs P on x Page 4 of 14 In other words, f outputs the following program: Algorithm: // Ignore y P(x); P (y) P is then the input to T P (the program that solves the Totality Problem). So we re using T P to find out whether P halts on all inputs. But what P does is: ignore its input and simply run P on x. So asking whether P halts on all inputs is the same as asking whether P halts on x. So we ve managed to write a program that solves the Halting Problem! We know that no such program can exist, so there must be something wrong with what we ve done. There s nothing wrong with f, so the only part that can be held responsible is T P. We conclude that a program T P, solving the Totality Problem, cannot exist.

36.3. The Negative Value Problem Page 5 of 14 We ll prove the following is non-computable: Problem 36.2. The Negative Value Problem Parameters: A MOCCA program P that does not require any input and a variable v used in P. Returns: YES if v ever gets assigned a negative value when P is executed; NO otherwise. Assume that the Negative Value Problem is computable. I.e. we have a MOCCA program NV P that solves the Negative Value Problem. But in that case, we can write a MOCCA program HP to solve the Halting Problem. It will use program NV P as a procedure. P x This converts P & x into P and v. HP NVP output NVP is an algorithm that solves the Negative Value Problem. HP is an algorithm that solves the Halting Problem. So, HP takes in two inputs P and x. f P v

Function f scans P to identify a variable v that is not used by P and then writes a new program called P, which Page 6 of 14 takes in an input y but ignores it; runs P on x; then assigns -1 to v. In other words, f outputs the following program: Algorithm: // Ignore y P(x); v := 1; P (y) P and v are then the input to NV P (the program that solves the Negative Value Problem). So we re using NV P to find out whether P assigns a negative value to v. But what P does is: ignore its input, run P on x and assign -1 to v. So asking whether P ever assigns a negative value to v is the same as asking whether P halts on x. (Why? Because we ll only get to the command in which -1 is assigned into v if P halts on x.) So we ve managed to write a program that solves the Halting Problem! We know that no such program can exist, so there must be something wrong with what we ve done. There s nothing wrong with f, so the only part that can be held responsible is NV P.

We conclude that a program NV P, solving the Negative Value Problem, cannot exist. Page 7 of 14

36.4. Page 8 of 14 You can see that, in these proofs, the non-computability of one problem is being established by finding a reduction from a problem that is already known to be noncomputable. In the examples, we have shown The Halting Problem reduces to The Totality problem The Halting Problem reduces to The Negative Value Problem If P 1 is known to be non-computable and P 1 reduces to P 2, then P 2 must be noncomputable too. The reason is that, otherwise, we could solve P 1 by an algorithm that would transform P 1 s inputs into a suitable form and ask P 2 for the answer. This is like the reductions we were using to show that a problem is NP-hard. The difference there was that we also required the reduction to have worst-case polynomial time complexity, whereas here efficiency is not the issue so the reduction can use as much resource as it needs. In both cases, once we have such a reduction, P 1 cannot be worse than P 2. It s common to show reductions from the Halting Problem. But any problem that has been proved to be non-computable can be used. E.g. now that we know that the Totality Problem is non-computable, we can use that, if we wish, in future proofs. Indeed, in the next section, we use the Totality Problem to prove the non-computability of the Equivalence Problem. We do this by showing reduces to

36.5. We ll prove the following is non-computable: Problem 36.3. Parameters: Two MOCCA programs P 1 and P 2. Returns: YES if P 1 and P 2 solve the same problems (same outputs for same inputs); NO otherwise. Assume that the Equivalence Problem is computable. I.e. we have a MOCCA program EP that solves the Equivalence Problem. But in that case, we can write a MOCCA program T P to solve the Totality Problem. It will use program EP as a procedure. Page 9 of 14 P P1 f P2 EP output This converts P into P1 and P2. EP is an algorithm that solves the Equivalence Problem. TP TP is an algorithm that solves the Totality Problem. So, T P takes in one input P.

Function f uses this input to write a new program called P 1, which takes in an input x; runs P on x; returns CS2205 (for example) and it also writes a new program P 2, which takes in an input x but ignores it; returns CS2205 In other words, f outputs the following programs: Algorithm: P 1 (x) P(x); return CS2205 ; Algorithm: P 2 (x) // Ignore x return CS2205 ; Page 10 of 14 P 1 and P 2 are then the input to EP (the program that solves the Equivalence Problem). So we re using EP to find out whether P 1 and P 2 are equivalent. But what P 1 does is run P on x and return CS2205, and what P 2 does is return CS2205. So asking whether P 1 and P 2 are equivalent (same outputs for same inputs) is the same as asking whether P halts on all inputs.

So we ve managed to write a program that solves the Totality Problem! We know that no such program can exist, so there must be something wrong with what we ve done. There s nothing wrong with f, so the only part that can be held responsible is EP. We conclude that a program EP, solving the Equivalence Problem, cannot exist. Page 11 of 14

36.6. Maybe you re feeling that almost any interesting question that we ask about algorithms is not computable. You d be basically right! Virtually all problems that involve writing a program that takes in another program P and tries to answer a question about the behaviour of P are non-computable.. Think of a task that some algorithms perform and others do not (such as outputting 28, computing the square root of the input, always giving the same output irrespective of the input, etc). There is no algorithm that can take in an arbitrary program P, inspect P and tell whether P performs that task. This has consequences for compilers and virus checkers. Page 12 of 14

36.7. We ve only grazed the surface of this topic! Some of the non-computable problems are less computable than others. E.g. the Halting Problem and the Totality Problem are both non-computable but the Totality Problem is less computable than the Halting Problem! In fact, there is an infinite hierarchy of levels of (non-)computability! Acknowledgements I based some of this on [Har92] and [GL82]. Clip Art (of head with bomb) licensed from the Clip Art Gallery on DiscoverySchool.com. Page 13 of 14

References [GL82] L. Goldschlager and A. Lister. Computer Science: A Modern. Prentice-Hall, 1982. [Har92] D. Harel. Algorithmics: The Spirit of Computing. Addison-Wesley, 2nd edition, 1992. Page 14 of 14