Computability and computational complexity

Similar documents
Lecture 2: Uncomputability and the Haling Problem

Lecture 9: Hierarchy Theorems

CS151 Complexity Theory

Computability and computational complexity

Computability and computational complexity

If a subset E of R contains no open interval, is it of zero measure? For instance, is the set of irrationals in [0, 1] is of measure zero?

Introduction to Automata Theory. Reading: Chapter 1

PRACTICE FINAL SOLUTIONS

Lecture 11: Pseudorandom functions

Cardinality Homework Solutions

Machine Learning Theory Tübingen University, WS 2016/2017 Lecture 11

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

1. By using truth tables prove that, for all statements P and Q, the statement

CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

Infinite Sequences and Series

Homework 9. (n + 1)! = 1 1

Chapter 0. Review of set theory. 0.1 Sets

Context-free grammars and. Basics of string generation methods

The Borel hierarchy classifies subsets of the reals by their topological complexity. Another approach is to classify them by size.

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

Course 8 Properties of Regular Languages

Relations Among Algebras

Quantum Computing Lecture 7. Quantum Factoring

Lecture 10: Mathematical Preliminaries

Section 11.8: Power Series

Lecture Notes for Analysis Class

Math F215: Induction April 7, 2013

Finite Automata. Reading: Chapter 2

TEACHER CERTIFICATION STUDY GUIDE

Machine Learning for Data Science (CS 4786)

Math 299 Supplement: Real Analysis Nov 2013

CHAPTER I: Vector Spaces

6.895 Essential Coding Theory October 20, Lecture 11. This lecture is focused in comparisons of the following properties/parameters of a code:

Sets. Sets. Operations on Sets Laws of Algebra of Sets Cardinal Number of a Finite and Infinite Set. Representation of Sets Power Set Venn Diagram

CS 336. of n 1 objects with order unimportant but repetition allowed.

Advanced Stochastic Processes.

Number Representation

Properties of Regular Languages. Reading: Chapter 4

2017 PRACTICE MIDTERM SOLUTIONS

The Boolean Ring of Intervals

MA131 - Analysis 1. Workbook 2 Sequences I

Lecture 1: Basic problems of coding theory

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

Chapter 2. Periodic points of toral. automorphisms. 2.1 General introduction

Commutativity in Permutation Groups

CSI 2101 Discrete Structures Winter Homework Assignment #4 (100 points, weight 5%) Due: Thursday, April 5, at 1:00pm (in lecture)

Machine Learning Theory Tübingen University, WS 2016/2017 Lecture 12

Economics 250 Assignment 1 Suggested Answers. 1. We have the following data set on the lengths (in minutes) of a sample of long-distance phone calls

USA Mathematical Talent Search Round 3 Solutions Year 27 Academic Year

THE ASYMPTOTIC COMPLEXITY OF MATRIX REDUCTION OVER FINITE FIELDS

MA131 - Analysis 1. Workbook 3 Sequences II

Lecture Notes for CS 313H, Fall 2011

An alternating series is a series where the signs alternate. Generally (but not always) there is a factor of the form ( 1) n + 1

Math 220A Fall 2007 Homework #2. Will Garner A

Sequences A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Discrete-Time Systems, LTI Systems, and Discrete-Time Convolution

Axioms of Measure Theory

A sequence of numbers is a function whose domain is the positive integers. We can see that the sequence

Part A, for both Section 200 and Section 501

Read carefully the instructions on the answer book and make sure that the particulars required are entered on each answer book.

Section 5.1 The Basics of Counting

Lecture 2 Clustering Part II

Algebraic Geometry I

Math 2784 (or 2794W) University of Connecticut

CSE 202 Homework 1 Matthias Springer, A Yes, there does always exist a perfect matching without a strong instability.

Let us consider the following problem to warm up towards a more general statement.

Proof of Goldbach s Conjecture. Reza Javaherdashti

Continued Fractions and Pell s Equation

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

Induction: Solutions

A Turing Machine. The Tape. Languages accepted by Turing Machines. Tape... Read-Write head. Context-Free n Languages. Control Unit.

Hardness Results for Intersection Non-Emptiness

ECE-S352 Introduction to Digital Signal Processing Lecture 3A Direct Solution of Difference Equations

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

Sequences I. Chapter Introduction

A representation approach to the tower of Hanoi problem

UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 17 Lecturer: David Wagner April 3, Notes 17 for CS 170

1 Counting and Stirling Numbers

Chapter 4. Fourier Series

Homework 3. = k 1. Let S be a set of n elements, and let a, b, c be distinct elements of S. The number of k-subsets of S is

# fixed points of g. Tree to string. Repeatedly select the leaf with the smallest label, write down the label of its neighbour and remove the leaf.

Recursive Algorithms. Recurrences. Recursive Algorithms Analysis

FIR Filters. Lecture #7 Chapter 5. BME 310 Biomedical Computing - J.Schesser

Exercises 1 Sets and functions

SEQUENCES AND SERIES

Product measures, Tonelli s and Fubini s theorems For use in MAT3400/4400, autumn 2014 Nadia S. Larsen. Version of 13 October 2014.

Test One (Answer Key)

Sums, products and sequences

6.867 Machine learning, lecture 7 (Jaakkola) 1

Homework 2. Show that if h is a bounded sesquilinear form on the Hilbert spaces X and Y, then h has the representation

Classification of problem & problem solving strategies. classification of time complexities (linear, logarithmic etc)

Chapter IV Integration Theory

Sequences and Series

Seunghee Ye Ma 8: Week 5 Oct 28

(I.C) THE DISTRIBUTION OF PRIMES

Complex Numbers Solutions

Sets and Probabilistic Models

DS 100: Principles and Techniques of Data Science Date: April 13, Discussion #10

6. Uniform distribution mod 1

Math 140 Introductory Statistics

Transcription:

Computability ad computatioal complexity Lecture 4: Uiversal Turig machies. Udecidability Io Petre Computer Sciece, Åbo Akademi Uiversity Fall 2015 http://users.abo.fi/ipetre/computability/ 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 1

Cotet Uiversal Turig machies Udecidability 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 2

UNIVERSAL TURING MACHINES 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 3

Uiversal Turig machies Ay TM has a fixed program, solvig a sigle problem Questio: Is there a programmable Turig machie? A uiversal Turig machie U takes as iput the descriptio of aother Turig machie M ad a iput x for M, ad the simulates M o x: U(M,x)=M(x) Assume that the alphabet ad the states of all Turig machies are itegers ={1,2,, } K={ +1,, + K, + K +1,, + K +6}, where the last 6 symbols stad for the directioal istructios, for h, yes, ad o the iitial state is +1 all umbers are represeted i biary, each with eough leadig 0s so that they are of the same legth 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 4

Uiversal Turig machies Descriptio of a UTM start with K ad i biary a descriptio of d follows: ( (,s), (p,r,d) ) the add a separator symbol the add a descriptio of x, with each symbol of x as a biary umber, separated with aother separator symbol o tape S 1 U keeps a descriptio of M o tape S 2 it keeps the curret cofiguratio of M U simulates M Sca S 2 to fid a iteger correspodig to a state Search S 1 for a rule of d matchig the curret state ad the scaed symbol Apply the rule 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 5

Smallest uiversal Turig machie 1962, M.Misky: 7-state, 4-symbol UTM; i short (7,4) Later proposals: (15,2), (9,3), (6,4), (5,5), (4,6), (3,9), (2,18) Smallest kow UTM (i terms of descriptioal complexity) is by Yurii Rogozhi: (4,6)-machie usig oly 22 istructios 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 6

Towards udecidability ON RE LANGUAGES 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 7

Recall: acceptig vs. decidig Let LÌ(S-{#})* A Turig machie decides L iff for every xî (S-{#})*, if xîl, the M(x)= yes if xïl, the M(x)= o I this case, we say that L is a recursive laguage A Turig machie accepts L iff for every xî (S-{#})*, xîl iff M(x)= yes if xïl, M might ot termiate o x we could ask that M(x)= for all xïl I this case we say that L is a recursively eumerable laguage Note: ay recursive laguage is recursively eumerable 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 8

Recursively eumerable The laguage E(M) eumerated by a Turig machie M: E(M)={x: (s,>,1)"*(,y#x#,1), for some x,y} I other words: all strigs x such that at some poit durig the operatio of M, there is a time whe the tape eds with #x# 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 9

L is recursively eumerable iff there is a TM M such that L=E(M) This machie E eumerates the strigs i laguage L This machies M accepts laguage L: for ay iput strig x, wait to see whether it is eumerated by E; if it comes out, the M accepts x This machie M accepts laguage L This machies E eumerates the strigs i L: for each i>0, simulate M up to i steps o each of the first i strigs (lexicographic order); output ay strig that gets accepted 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 11

Strigs i lexicographic order w 1 w 2 w 3 w 4 w 5 1 Number of steps 2 2 3 3 3 4 4 4 4 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 12

No recursively eumerable laguages Recursively eumerable laguages Recursive laguages 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 13

Fiite Ifiite coutable Ifiite ucoutable Alphabet! All strigs over! All sets of strigs (laguages) over! 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 14

Fiite Ifiite coutable Ifiite ucoutable S Powerset 2 S of S S is coutable: S={s 1, s 2, s 3, } Elemets of the powerset: {s 5, s 19, s 34 }, {s 1, s 729, s 1234, s 2459, s 57990 } Each of them ca be writte as a ifiite seuece of 0/1: 1 o positio i iff s i is i that set Assume that the powerset is coutable: L 1, L 2, L 3, L 4, Cosider the followig elemet D of the powerset: Iclude s i i D iff s i is ot i L i, for all i>0 Observe that D is ot i our eumeratio If D=L k, the the k-th bit should be its ow complemet!!! Powerset Ecodig s 1 s 2 s 3 L 1 1 0 1 L 2 0 0 1 L 3 1 1 0 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 15

No-RE laguages Follow-up from the previous slide: there are (far) more laguages tha Turig machies Ucoutable umber of laguages vs. coutable umber of TM Coclusio: there exist o-recursively eumerable laguages (caot be described by algorithms) No recursively eumerable laguages Recursively eumerable laguages Recursive laguages 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 16

What about udecidable laguages Questio 1: are there udecidable laguages? I other words, laguages that are RE, but ot recursive Questio 2: are there also atural udecidable problems? Aswer: YES!!! No recursively eumerable laguages Recursively eumerable laguages Recursive laguages 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 17

UNDECIDABILITY 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 18

Haltig problem HALTING. Give the descriptio of Turig machie M ad a iput x, will M halt o x? We prove that HALTING is a udecidable problem We prove that H is ot a recursive laguage, i.e., there is o Turig machie to decide it We prove also that H is recursively eumerable Deote H={M;x: M(x)¹ } the set of YES istaces of HALTING 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 19

Haltig problem H={M;x: M(x)¹ } Propositio. H is recursively eumerable. Proof. Cosider a uiversal Turig machie U ad modify it so that wheever it halts, it does so i a acceptig state. Let U be the ew machie. Note ow that U accepts H: If M,xÎH, the M(x)¹ ad so, U(M,x)¹, i.e., U (M,x)= yes If M,xÏH, the M(x)= ad so, U(M,x)=, i.e., U (M,x)= 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 20

HALTING is udecidable Theorem. H is ot recursive. I other words: HALTING is udecidable Proof: Assume that H is recursive: there is a TM M H decidig H. This meas that for ay TM M ad iput x, we ca decide if M halts o x. Techiue of the proof: diagoalizatio. Ituitive idea: All iput strigs s 1 s 2 s 3 All Turig machies M 1 1 0 1 M 2 0 0 1 M 3 1 1 0 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 22

Formal proof Costruct a TM D as follows: O iput M, D first simulates M H o iput M;M util it is about to halt If M H is about to accept, the D eters ito a ifiite loop If M H is about to reject, the D halts i a acceptig state I other words: D(M)= if M H (M;M)= yes ad D(M)= yes otherwise Questio: What is D(D)? I other words, does machie D halt o iput D? If D(D)=, the M H (D;D)= yes, i.e., D;DÎH, i.e., D halts o iput D, i.e. D(D)¹ ; cotradictio If D(D)¹, the M H (D;D)¹ yes, i.e., D;DÏH, i.e., D does ot halt o iput D, i.e., D(D)= ; cotradictio Coclusio: there is o TM decidig H 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 23

More udecidability results May other properties ca be show to be udecidable usig the techiue of reductio ad our proof of HALTING beig udecidable HALTING Trasformatio computable by a TM The A must be udecidable PROBLEM A If A were decidable, the HALTING would also be decidable decide M o x by decidig whether t(m,x)îa 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 24

More udecidability Propositio. The followig laguages are ot recursive: {M: M halts o all iputs} {M;x: there is y such that M(x)=y} {M;x: the computatio of M o x uses all states of M} {M;x;y: M(x)=y} I other words: it is udecidable whether: (i) M halts o all iputs, (ii) M gives a output o x; Proof. Oly show here the first property, usig the reductio techiue Let M be a TM ad x a strig Costruct TM M that o a iput y works as follows: if y=x, the it simulates M o x, otherwise it halts Clearly, M halts o x iff M halts o all iputs 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 26

Ay o-trivial property of TM is udecidable! Very geeral result: Rice s theorem Deote by L(M) the laguage accepted by a Turig machie M Rice s theorem. Suppose that C is a proper, o-empty subset of the set of all recursively eumerable laguages. The the followig problem is udecidable: Give a Turig machie M, is L(M)ÎC? Proof. We ca assume ÆÏC (otherwise repeat the argumet below for the complemet of C, also a proper, o-empty subset of RE laguages). Also, there is LÎC, accepted by TM M L Cosider a arbitrary TM M ad a strig x. Costruct a TM M x such that M halts o x iff L(M x )ÎC M x o iput y: first it simulates M o x ad if it halts, the it cotiues by simulatig M L o y Note: L(M x )=L if M halts o x ad it is Æ otherwise I other words, sice ÆÏC: L(M x )ÎC iff M halts o x 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 27

More o recursive laguages Propositio. If L is recursive, the so is its complemet. Proof: make all acceptig states be rejectig states ad the other way aroud Propositio. L is recursive iff both L ad its complemet are recursively eumerable Proof. Direct implicatio clear by the previous result Reverse implicatio Let L be accepted by a TM M ad its complemet by a TM M Build a TM decidig L: O a secod tape make a copy of the iput Simulate o the two tapes machies M ad M o iput x Oe step of oe machie, followed by oe step of the other machie x must be i either L or L evetually oe of the machies will accept it Give aswer yes if it was accepted o the first tape, o if it was accepted o the secod tape Coseuece: the complemet of HALTING is ot recursively eumerable The set of Turig machies M ad iputs x for which M does ot halt o x 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 28

Learig objectives Uderstad the cocept of udecidability Ability to prove udecidability results through reductios 21. toukokuu 2018 http://users.abo.fi/ipetre/computability/ 29