Intro to Theory of Computation

Slides:



Advertisements
Similar presentations
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CS 461 – Nov. 9 Chomsky hierarchy of language classes –Review –Let’s find a language outside the TM world! –Hints: languages and TM are countable, but.
The Halting Problem Sipser 4.2 (pages ). CS 311 Mount Holyoke College 2 Taking stock All languages Turing-recognizable Turing-decidable Context-free.
The Halting Problem Sipser 4.2 (pages ).
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Decidable and undecidable problems deciding regular languages and CFL’s Undecidable problems.
CHAPTER 4 Decidability Contents Decidable Languages
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 6 Decidability Jan Maluszynski, IDA, 2007
CS 310 – Fall 2006 Pacific University CS310 The Halting Problem Section 4.2 November 15, 2006.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 18 Instructor: Paul Beame.
Lecture 27UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 27.
CS21 Decidability and Tractability
Cardinality of Sets Section 2.5.
The Halting Problem – Undecidable Languages Lecture 31 Section 4.2 Wed, Oct 31, 2007.
1 Undecidability Reading: Chapter 8 & 9. 2 Decidability vs. Undecidability There are two types of TMs (based on halting): (Recursive) TMs that always.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Midterm 2 review Jundong Liu School of EECS
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Computability Universal Turing Machine. Countability. Halting Problem. Homework: Show that the integers have the same cardinality (size) as the natural.
CS 461 – Nov. 7 Decidability concepts –Countable = can number the elements  –Uncountable = numbering scheme impossible  –A TM undecidable –Language classes.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
CSCI 2670 Introduction to Theory of Computing
The Acceptance Problem for TMs
Discrete Mathematics CS 2610
CS 461 – Nov. 2 Sets Prepare for ATM finite vs. infinite Infinite sets
This statement is false.
CSCI 2670 Introduction to Theory of Computing
Lecture12 The Halting Problem
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
Intro to Theory of Computation
BCS 2143 Theory of Computer Science
MCC 2093 Advanced Theoretical Computer Science
Reducibility The Chinese University of Hong Kong Fall 2010
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
Intro to Theory of Computation
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Intro to Theory of Computation
CSE 105 theory of computation
CS154, Lecture 8: Undecidability, Mapping Reductions
CS154, Lecture 8: Undecidability, Mapping Reductions
Intro to Theory of Computation
CSE 105 theory of computation
Decidable Languages Costas Busch - LSU.
Decidable and undecidable languages
Discrete Math for CS CMPSC 360 LECTURE 43 Last time: Variance
CS21 Decidability and Tractability
CSCI 2670 Introduction to Theory of Computing
Formal Languages, Automata and Models of Computation
Intro to Theory of Computation
CSCI 2670 Introduction to Theory of Computing
Theory of Computability
CS21 Decidability and Tractability
CSE 105 theory of computation
Theory of Computability
More undecidable languages
Cardinality Definition: The cardinality of a set A is equal to the cardinality of a set B, denoted |A| = |B|, if and only if there is a one-to-one correspondence.
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
Theory of Computability
Instructor: Aaron Roth
CSE 105 theory of computation
Intro to Theory of Computation
Intro to Theory of Computation
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

Intro to Theory of Computation LECTURE 14 Last time Decidable languages Designing deciders Today Undecidable languages Diagonalization CS 332 Sofya Raskhodnikova 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Classes of languages recognizable decidable CFL regular 11/4/2019

Problems in language theory ADFA decidable ACFG decidable EDFA decidable ECFG decidable EQDFA decidable ATM ? ETM ? EQCFG ? EQTM ? 11/4/2019

Undecidability We will prove that there are some undecidable languages: i.e., problems a computer cannot solve no matter how long it computes The proof idea is “simple:” There are more languages than there are Turing Machines. 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper A language L is undecidable if there is no TM that decides L. If L is undecidable, then every TM must either: 1. Accept (infinitely many) strings s ∉ L. (infinitely many) 2. Reject (infinitely many) strings s ∈ L. (infinitely many) 3. Loop forever on some strings. (infinitely many) 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

POP QUIZ Which one is largest? Let ℕ = {1,2,…} be the natural numbers. ℤ the same size. Let E = {2,4,6,…} be the even natural numbers. Let ℤ = {…,-2,-1,0,1,2,…} be the integers. {madam, dad, but, tub, book}

Are there more blue or yellow dots? ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Set Theory 101 Set A Set B A function 𝑓:𝐴→𝐵 is 1-to-1 (or injective) if 𝑓 𝑎 ≠𝑓(𝑏) for 𝑎≠𝑏. onto (or surjective) if for all 𝑏∈𝐵, some 𝑎∈𝐴 maps to 𝑏: 𝑓 𝑎 =𝑏. correspondence (or bijective) if it is 1-to-1 and onto, i.e., each 𝑎∈𝐴 maps to a unique 𝑏∈𝐵, and each 𝑏∈𝐵 has a unique 𝑎∈𝐴 mapping to it. 𝒇 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

How to compare sizes of infinite sets? Two sets are the same size if there is a bijection between them. A set is countable if it is finite or it has the same size as ℕ, the set of natural numbers 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Examples of countable sets Ø, {0}, {0,1}, {0,1, …, 255} E = {2,4,6,…} O = {1,3,5,7,…} SQUARES = {1,4,9,16,25…} POWERS = {1,2,4,8,16,32…} |POWERS| = |SQUARES| = |E| = |O| = |ℕ| 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper There is a bijection between ℕ and ℕ × ℕ. (0,0) (0,1) (0,2) (0,3) (0,4) … (1,0) (1,1) (1,2) (1,3) (1,4) … (2,0) (2,1) (2,2) (2,3) (2,4) … (3,0) (3,1) (3,2) (3,3) (3,4) … (4,0) (4,1) (4,2) (4,3) (4,4) … 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper {0,1}* is countable { 〈M〉 | M is a TM } is countable Q+= { p/q | p,q ∈ Z+} is countable! Is any set uncountable? 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Creator of Set Theory Georg Cantor 1845--1918

Sofya Raskhodnikova; based on slides by Nick Hopper Theorem. There is no bijection from the positive integers to the real interval (0,1) Proof: Suppose f is such a function: n 1 2 3 4 5 ⋮ f(n) 0.28347279… 2 0.88388384… 8 0.77635284… 6 0.11111111… 1 0.12345678… 5 ⋮ Construct 𝒃∈(𝟎,𝟏) that does not appear in the table. b=0. 𝒅 𝟏 𝒅 𝟐 𝒅 𝟑 …, 𝐰𝐡𝐞𝐫𝐞 𝒅 𝒊 ≠𝐝𝐢𝐠𝐢𝐭 𝒊 𝐨𝐟 𝒇 𝒊 . 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Diagonalization The process of constructing a counterexample by “contradicting the diagonal” is called DIAGONALIZATION 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper What if we try this argument on ℚ instead of ℝ? Proof: Suppose f is such a function: n 1 2 3 4 5 : f(n) 0.28347279… 2 0.88388384… 8 0.77635284… 6 0.11111111… 1 0.12345678… 5 : Construct 𝒃∈(𝟎,𝟏) that does not appear in the table. b=0. 𝒅 𝟏 𝒅 𝟐 𝒅 𝟑 …, 𝐰𝐡𝐞𝐫𝐞 𝒅 𝒊 ≠𝐝𝐢𝐠𝐢𝐭 𝒊 𝐨𝐟 𝒇 𝒊 . 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Exercise What if we try Cantor’s diagonalization argument on ℚ instead of ℝ? It works. It fails because there are some rational numbers that cannot be represented in decimal point notation. It fails because the 𝑖-th number might have no digit in the 𝑖-th position after the decimal point. It fails because the constructed number is not rational. None of the above. {madam, dad, but, tub, book}

Sofya Raskhodnikova; based on slides by Nick Hopper Let L be any set and P(L) be the power set of L Theorem: There is no bijection from L to P(L) Assume, for a contradiction, that there is bijection f : L  P(L) Proof: We construct a set S that cannot be the output, f(y), for any y L. Make less general 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

(yi ∈ S) = Y iff (yi ∈ f(yi)) = N Use diagonalization x y1∈f(x)? y2∈f(x)? y3∈ f(x)? y4 ∈ f(x)? … y1 Y N y2 y3 y4   Y Y N Y Define set S by flipping the diagonal: (yi ∈ S) = Y iff (yi ∈ f(yi)) = N 11/4/2019

EXAMPLE {0,1} Let L = {0,1,2}. Then P(L) = {Ø, {0}, {1}, {2}, {0,1}, {0,2}, {1,2}, {0,1,2}} Let f(0) = {1}, f(1) = Ø, f(2) = {0,2}. Then: x 0 ∈ f(x)? 1 ∈ f(x)? 2 ∈ f(x)? N Y 1 2 S = {0,1}

Sofya Raskhodnikova; based on slides by Nick Hopper Let L be any set and P(L) be the power set of L Theorem: There is no bijection from L to P(L) Assume, for a contradiction, that there is bijection f : L  P(L) Proof: We construct a set S that cannot be the output, f(y), for any y L. Let S = { x  L | x  f(x) } Make less general If S = f(y) then y  S if and only if y  S 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper For all sets L, P(L) has more elements than L 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Not all languages over {0,1} are decidable TM Deciders Languages over {0,1} Sets of strings of 0s and 1s Strings of 0s and 1s L P(L) 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Not all languages over {0,1} are recognizable Turing Machines Languages over {0,1} Sets of strings of 0s and 1s Strings of 0s and 1s L P(L) 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper A specific undecidable language ATM = { 𝑴, 𝒘 ∣ M is a TM, w is a string, and M accepts w } 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

𝑯 𝑴,𝒘 = 𝐚𝐜𝐜𝐞𝐩𝐭 𝐢𝐟 𝑴 𝐚𝐜𝐜𝐞𝐩𝐭𝐬 𝒘 𝐫𝐞𝐣𝐞𝐜𝐭 𝐢𝐟 𝑴 𝐝𝐨𝐞𝐬 𝐧 ′ 𝐭 𝐚𝐜𝐜𝐞𝐩𝐭 𝒘 Theorem. ATM is undecidable. Proof: For contradiction, suppose a TM H decides ATM. 𝑯 𝑴,𝒘 = 𝐚𝐜𝐜𝐞𝐩𝐭 𝐢𝐟 𝑴 𝐚𝐜𝐜𝐞𝐩𝐭𝐬 𝒘 𝐫𝐞𝐣𝐞𝐜𝐭 𝐢𝐟 𝑴 𝐝𝐨𝐞𝐬 𝐧 ′ 𝐭 𝐚𝐜𝐜𝐞𝐩𝐭 𝒘 Idea: Use 𝑯 to check what TM M does on its own description (and do the opposite). D is a decider. What does it do on 𝐷 ? TM D = `` On input 𝑴 , where M is a TM: Run 𝐻 on input <M, 𝑴 >. Accept if it rejects. O.w. reject.’’ 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Is it diagonalization again? Does M accept 𝑴 ? TMs 〈𝑴 𝟏 〉 〈𝑴 𝟐 〉 〈𝑴 𝟑 〉 〈𝑴 𝟒 〉 … 𝑴 𝟏 Y N 𝑴 𝟐 𝑴 𝟑 𝑴 𝟒   Y Y N Y D accepts 𝑴 𝒊 iff entry (𝒊,𝒊) is N . 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

Sofya Raskhodnikova; based on slides by Nick Hopper Is it diagonalization again? Does M accept 𝑴 ? TMs 〈𝑴 𝟏 〉 〈𝑴 𝟐 〉 〈𝑴 𝟑 〉 〈𝑴 𝟒 〉 … 〈𝑫〉 𝑴 𝟏 Y N 𝑴 𝟐 𝑴 𝟑 𝑴 𝟒   D Y Y N Y ? 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper

A movie about undecidability of the Halting Problem https://www.youtube.com/watch?v=92WHN-pAFCs 11/4/2019 Sofya Raskhodnikova; based on slides by Nick Hopper