} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops.

Similar documents
CSE 105 THEORY OF COMPUTATION

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

ACS2: Decidability Decidability

CPSC 421: Tutorial #1

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

CSE 105 THEORY OF COMPUTATION

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

Decidability (intro.)

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION

Decidability (What, stuff is unsolvable?)

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION

1 Showing Recognizability

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

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable

Intro to Theory of Computation

V Honors Theory of Computation

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

CSE 105 THEORY OF COMPUTATION

Theory of Computation (IX) Yijia Chen Fudan University

Decidability. Human-aware Robotics. 2017/10/31 Chapter 4.1 in Sipser Ø Announcement:

DM17. Beregnelighed. Jacob Aae Mikkelsen

Non-emptiness Testing for TMs

Lecture Notes: The Halting Problem; Reductions

Undecidability. We are not so much concerned if you are slow as when you come to a halt. (Chinese Proverb)

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

Computability and Complexity

A non-turing-recognizable language

CSE 105 THEORY OF COMPUTATION

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

Decidability: Church-Turing Thesis

Theory of Computation CS3102 Spring 2014 A tale of computers, math, problem solving, life, love and tragic death

Decidable and undecidable languages

Decidability and Undecidability

Chap. 4,5 Review. Algorithms created in proofs from prior chapters

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

CSCE 551 Final Exam, Spring 2004 Answer Key

Computability Theory

UNIT-VIII COMPUTABILITY THEORY

Lecture 12: Mapping Reductions

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

1 Reducability. CSCC63 Worksheet Reducability. For your reference, A T M is defined to be the language { M, w M accepts w}. Theorem 5.

Introduction to Languages and Computation

CS5371 Theory of Computation. Lecture 10: Computability Theory I (Turing Machine)

CSE 105 Theory of Computation

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

4.2 The Halting Problem

6.8 The Post Correspondence Problem

Decidable Languages - relationship with other classes.

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

Reducability. Sipser, pages

Turing Machines. Reading Assignment: Sipser Chapter 3.1, 4.2

Reading Assignment: Sipser Chapter 3.1, 4.2

Turing Machine Recap

Computation Histories

Computability Theory

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 8 Nancy Lynch

Turing Machines Part III

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

Decidability. Overview. Preliminaries to Halting Problem. Decidable Problems of Regular Languages. Decidable Problems of Context-Free Languages

Computational Models Lecture 8 1

Computational Models Lecture 8 1

The Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability

From Fundamentele Informatica 1: inleverdatum 1 april 2014, 13:45 uur. A Set A of the Same Size as B or Larger Than B. A itself is not.

34.1 Polynomial time. Abstract problems

Properties of Context-Free Languages. Closure Properties Decision Properties

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

TURING MAHINES

CSE 105 Theory of Computation

Further discussion of Turing machines

Computational Models Lecture 8 1

CSE 105 THEORY OF COMPUTATION

MA/CSSE 474 Theory of Computation

1 Computational Problems

1 More finite deterministic automata

Undecidable Problems and Reducibility

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

Intro to Theory of Computation

Theory of Computation (Classroom Practice Booklet Solutions)

Notes for Lecture Notes 2

The Unsolvability of the Halting Problem. Chapter 19

Computability Theory. CS215, Lecture 6,

16.1 Countability. CS125 Lecture 16 Fall 2014

Part I: Definitions and Properties

CSE 105 THEORY OF COMPUTATION

15-251: Great Theoretical Ideas in Computer Science Lecture 7. Turing s Legacy Continues

Theory of Computation

Automata Theory CS S-FR2 Final Review

Lecture 24: Randomized Complexity, Course Summary

CSCI3390-Lecture 6: An Undecidable Problem

Computability and Complexity

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

Theory of Computation

Functions on languages:

Transcription:

and their languages

} Some languages are Turing-decidable A Turing Machine will halt on all inputs (either accepting or rejecting). No infinite loops. } Some languages are Turing-recognizable, but not decidable. A Turing Machine recognizes the language, but it will loop infinitely on some inputs } Some languages are not Turing-recognizable There is no Turing Machine that can recognize the language

Turing-Recognizable Decidable Is there anything out here? What lives here? Context Free Deterministic Context Free Finite Regular

} Game plan 1. Show that there exists a language that is Turingrecognizable but not decidable. 2. Show that there exists a language that is not Turing-recognizable. Note: it s not enough to just design a TM that loops on some input. As we ve seen, this may just be a poor approach, and a better (TM decider) approach may exist. Instead, we have to prove there is no way to build such a decider.

} Variety of Unsolvable problems Hilbert s 10 th problem: determine if a polynomial has an integral root Software Verification: determine if software is performing as it is intended to Ambiguity: determine if an arbitrary context-free grammar is ambiguous Acceptance test for Turing Machines: determine if an arbitrary Turing Machine accepts an arbitrary string Halting problem for Turing Machines: determine if an arbitrary Turing Machine halts on a given input string

} Running algorithms on objects: TMs take strings as input. For running algorithms on other objects, Must encode the object as a string. Any decent encoding will do. When running TMs on objects, it is assumed that decoding gets performed by the TM and that input is valid. Notation: If O is an object to be input to a TM, <O> is the encoded object. If O 1, O 2,, O n are multiple objects to be used as input to a TM, <O 1, O 2,, O n > is the encoded list of objects.

} Examples of decidable languages in which the accepted strings are encodings of objects A = {<G> G is a connected undirected graph } A DFA = {<B,w> B is a DFA that accepts input string w} EQ DFA = {<A,B> A and B are DFAs and L(A) = L(B)} A CFG = {<G,w> G is a CFG that generates string w} E CFG = {<G> G is a CFG and L(G) = Ø}

} Consider the following A TM = { <M, w> M is a TM and M accepts w} This is the acceptance problem for Turing Machines A TM is the language corresponding to whether a string is accepted by a given Turing Machine Can we build a TM that takes a TM as input Yes, but this is where we will lose decidability

} Note that A TM is recognizable. } Define TM U as follows: U = on input <M, w>, where M is a TM, and w is a string: Simulate M on input w If M accepts, U accepts. If M rejects, U rejects. } U recognizes A TM } U is sometimes called the Universal Turing Machine. (it can simulate any other TM)

} Proof by contradiction Assume A TM = {<M, w> M is a TM and M accepts w} is decidable Let H be a decider for A TM H is a TM that halts on all inputs Next we construct a TM, D, that takes as input the encoding of a TM, M. It uses H as a subroutine to determine what M does with a string w that is actually the encoding of the machine M itself. That is, it simulates H on input <M, <M>>. Whatever H does D does the opposite

} Proof by contradiction D = On input <M> where M is a TM: Run H on input <M, <M>> Output the opposite of what H outputs. D accepts <M> if H rejects <M, <M>> D accepts <M> if M does not accept <M> D rejects <M> if H accepts <M, <M>> D rejects <M> if M accepts <M>

} Proof by contradiction D accepts <M> if M does not accept <M> D rejects <M> if M accepts <M> } What happens if D is run with its own description? D accepts <D> if D does not accept <D> D rejects <D> if D accepts <D> CONTRADICTION } D and H can not exist: A TM is not decidable

} Turing-unrecognizable languages exist Consider any arbitrary Turing Machine M = (Q, S, G, d, q 0, q accept, q reject ) We can define a small alphabet to encode M E.g. S = {0, 1, p} 0,1 are used to indicate numerical values How many states there are Unicode/ASCII encoding of alphabet symbols Details of transition function p is a punctuation symbol that is used to demarcate different pieces of the string } Any TM can be encoded using just these symbols!

} Turing-unrecognizable languages exist Consider finite alphabet Σ How many strings over Σ? Countably infinite we can list all strings of length 0, 1, 2, How many TM can be encoded using Σ? Countably infinite (some subset of all strings over Σ) Thus there at most are countably infinite different TM, and each recognizes only 1 language

} Turing-unrecognizable languages exist How many languages are there over Σ? Power set of all strings over Σ All subsets of an infinite collection Uncountably infinite SOME (MOST) OF THESE LANGUAGES HAVE NO TURING MACHINE TO RECOGNIZE THEM

} The complement of A TM is not Turingrecognizable } This will follow from the following theorem: A language is decidable if and only if it is Turingrecognizable and co-turing-recognizable (A language is co-turing-recognizable if its complement is Turing-recognizable)

} A language is decidable if and only if it is Turingrecognizable and co-turing-recognizable Assume language A is decidable. Decidable languages are closed under complement. (Since TM halts on all input, we can have a different TM that flip-flops reject/accept. It also halts on all input, and accepts the complement of A.) So both A and A are decidable Decidable languages are also recognizable.

} A language is decidable if and only if it Turingrecognizable and co-turing-recognizable Assume A and A are both Turing-recognizable. Let M 1 be a TM for A Let M 2 be a TM for A M 1 and M 2 may loop on some inputs, but they halt on all accepted strings. Have TM M run both M 1 and M 2 in parallel (take turns running each machine for an increasing number of steps) if M 1 accepts, then M accepts If M 2 accepts, then M rejects Since M 1 and M 2 each halt on accepting inputs, M will halt on all inputs

} The complement of A TM is not Turingrecognizable We know A TM is Turing-recognizable but not decidable. If the complement of A TM were Turing-recognizable, then by the previous theorem, they would both also be decidable.

} The class of decidable languages is closed under: Union Concatenation Kleene Star Complementation Intersection Difference See Problem 3.15 for details

} The class of Turing-recognizable languages is closed under: Union Concatenation Kleene Star Intersection } But not closed under complementation (we just showed that using A TM ) And therefore not closed under difference either