INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.

Slides:



Advertisements
Similar presentations
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 17: ProvingUndecidability.
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Lecture 3 Universal TM. Code of a DTM Consider a one-tape DTM M = (Q, Σ, Γ, δ, s). It can be encoded as follows: First, encode each state, each direction,
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.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Turing -Recognizable vs. -Decidable
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
1 CSC3130 Formal Languages and Automata Theory Tutorial 9 Undecidable Problem KN Hung SHB 1026.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
CPSC 411, Fall 2008: Set 12 1 CPSC 411 Design and Analysis of Algorithms Set 12: Undecidability Prof. Jennifer Welch Fall 2008.
Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve.
Fall 2004COMP 3351 Recursively Enumerable and Recursive Languages.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Recursively Enumerable and Recursive Languages
1 Uncountable Sets continued Theorem: Let be an infinite countable set. The powerset of is uncountable.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
Homework #9 Solutions.
Fall 2005Costas Busch - RPI1 Recursively Enumerable and Recursive Languages.
Courtesy Costas Busch - RPI1 Reducibility. Courtesy Costas Busch - RPI2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 18 Instructor: Paul Beame.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
CS21 Decidability and Tractability
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSCI 2670 Introduction to Theory of Computing November 4, 2004.
MA/CSSE 474 Theory of Computation More Reduction Examples Non-SD Reductions.
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.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
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.
Lecture 21 Reducibility. Many-one reducibility For two sets A c Σ* and B c Γ*, A ≤ m B if there exists a Turing-computable function f: Σ* → Γ* such that.
Recursively Enumerable and Recursive Languages
Decidability Decidable/Undecidable problems. Jaruloj Chongstitvatana Decidability2 Accepting: Definition Let T = (Q, , , , s) be a TM. T accepts.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
MA/CSSE 474 Theory of Computation Decision Problems, Continued DFSMs.
Costas Busch - RPI1 Decidability. Costas Busch - RPI2 Another famous undecidable problem: The halting problem.
1 Recursively Enumerable and Recursive Languages.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
Decidability and Undecidability Proofs
CIS Automata and Formal Languages – Pei Wang
Recursively Enumerable and Recursive Languages
Busch Complexity Lectures: Reductions
CSCI 2670 Introduction to Theory of Computing
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CS154, Lecture 8: Undecidability, Mapping Reductions
CS154, Lecture 10: Rice’s Theorem, Oracle Machines
CSCI 2670 Introduction to Theory of Computing
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
Proposed in Turing’s 1936 paper
More Undecidable Problems
CIS Automata and Formal Languages – Pei Wang
Presentation transcript:

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011

QUIZ 4 (a) If A and B are languages, then A is mapping reducible to B, or A ≤ m B, if there is a computable function ƒ such that: w  A ⇔ ƒ(w)  B (b) The acceptance problem A TM is the language: { 〈 M,w 〉 | M is a TM that accepts on input w }

QUIZ 4 (b) The identity function ƒ(w)=w is a reduction from the set { 0 n 1 n | n ≥ 0 } to the set { w | w has an equal number of 0s and 1s }. FALSE: the string 10 ∉ A but ƒ(10) = 10 ∈ B. (a) The recursion theorem states that a program cannot compute on its own code. FALSE: this is the negation of the theorem.

QUIZ 4 Let A 101 = { 〈 M 〉 | M is a TM and L(M) = {101} }. Let’s use Rice’s Theorem to prove that A ε is undecidable. For any TMs such that L(M 1 )=L(M 2 ), 〈 M 1 〉∈ A 101 ⇔ 〈 M 2 〉∈ A 101 : If L(M 1 ) = L(M 2 ), 〈 M 1 〉  A 101 ⇔ L(M 1 ) = {101} ⇔ L(M 2 ) = {101} ⇔〈 M 2 〉  A 101 There exist TMs 〈 M IN 〉 ∈ A 101 and 〈 M OUT 〉  A 101 : Let M IN (s) = “if s = 101 accept, else reject.” Then L(M IN )= {101}, so 〈 M IN 〉  A 101. Let M OUT (s) = “reject on any input.” Then L(M OUT ) = Ø ≠ {101}, so 〈 M OUT 〉  A 101. a. Prove A 101 is a language property: b. Prove that A 101 is nontrivial:

Why these stuff are important for reality? Who was phone? Recursion Theorem. Are some of these topics actually taught in like a Linguistics class? What do we actually need to know? What are the answers to the next homework? Another refresher on reducibility would be nice. What ARE mapping reductions? Star Wars or Star Trek? Kirk or Picard? Banana? Why didn’t the book cover Rice’s theorem? Why did it get so crazy all of a sudden? Can you parse HTML with RegEx? Is “The Princess Bride” your favorite movie?

Office hours: Today 4-5:30pm Wed. 11am-noon,2:30-4pm and Thurs. 9am-11am HW8 SOLUTIONS POSTED TOMORROW AFTERNOON.

0 → 0, R readwritemove  → , R q accept q reject 0 → 0, R  → , R 0 → 0, R  → , L TURING MACHINES UNBOUNDED TAPE 0 q0q0 q0q0 q1q1 q2q2 q1q1 qaqa 0

Definition: A Turing Machine is a 7-tuple T = (Q, Σ, Γ, , q 0, q accept, q reject ), where: Q is a finite set of states; q 0 is the start state Σ is the input alphabet, Γ is the tape alphabet  : Q  Γ → Q  Γ  {L,R} is the transition function q accept  q reject are the accept and reject states We can encode a TM as a string of 0s and 1s:

Terminology Every TM recognizes a language. The language of M is the set L(M) = { w | M(w) eventually accepts } A TM decides L if it accepts all strings in L and rejects all strings not in L A language is decidable if some TM decides it A language is recursively enumerable if some TM recognizes it. THE CHURCH-TURING THESIS: There is a program for L iff there is a TM for L

UN DECIDABILITY A language is a set of strings. It is a mathematical way of expressing a problem: given an input, is it in the set L? If a language is decidable, there is a computer program (TM) that can always solve the problem correctly – it terminates and has the right answer. If a language is undecidable, then no matter how smart you are, and no matter how long you give it, you cannot program a computer to always solve the problem correctly.

Let S be any set and P(S) be the power set of S Theorem: There is no onto map from S to P(S) Proof: Assume, for a contradiction, that there is an onto map ƒ : S  P(S) Let D ƒ = { d  S | d  ƒ(d) } If D ƒ = ƒ(y) then y  D ƒ if and only if y  D ƒ Turing Machines Strings of 0s and 1s Sets of strings of 0s and 1s Languages over {0,1} S P(S)

UNDECIDABLE PROBLEMS D TM = {  M  | M is a TM that does not accept  M  } Theorem. D TM is undecidable. Proof. Suppose machine N decides D TM. Then N accepts  N  ⇔  N   D TM ⇔ N does not accept  N  A TM = {  M,w  : M is a TM that accepts on input w } Theorem. If A TM is decidable, so is D TM. Proof. If ¬A TM is decided by the program nAccept we can decide if  M   D TM by calling nAccept(M,  M  ). Here we have reduced deciding D TM to deciding A TM. Since we know D TM is undecidable, A TM must also be undecidable.

MAPPING REDUCTIONS ƒ : Σ*  Σ* is a computable function if there is a TM that on input w, halts with ƒ(w) on its tape A  m B if there is a computable ƒ, such that w  A  ƒ(w)  B ƒ is called a reduction from A to B

HALT TM = {  M,w  | M is a TM that halts on string w } Theorem: HALT TM is undecidable THE HALTING PROBLEM Proof: We prove that A TM ≤ m HALT TM : Let M’ = M, with q loop in place of q reject. Let F = “On input  M,w  : Output  M’,w  ” F is a reduction. Suppose M accepts w. Then M’ halts on w. So  M,w   A TM ⇒  M’,w   HALT TM. M’ can only halt on w by accepting, and if M’ accepts w so does M. So  M’,w   HALT TM ⇒  M,w   A TM.

0 → 0, R  → , R q accept q reject 0 → 0, R  → , R q0q0 q1q1 0q10q1 q00q00 0q rej q10q10  q rej q0q0 q1q1  q acc 0 0   # # # #q 0 0# # ## q acc  q acc q acc 0q acc q acc q acc  q acc q acc 0 # #q 0 0#0q10q1 q00q00# ## 0 0 q1q1  q acc # # 0 0q acc  q acc # q acc ## # #q acc 0q acc # #

RICE ’ S THEOREM Let P be a set of Turing machines. If P satisfies the following two properties: For any TMs M 1 and M 2, where L(M 1 ) = L(M 2 ),  M 1   P if and only if  M 2   P There exist TMs  M IN   P and  M OUT   P Then P is undecidable EXTREMELY POWERFUL (i.e. P is a “nontrivial property of the r.e. languages.”)

DIAGONAL ARGUMENTS DECIDABLE LANGUAGES REDUCTIONS FINAL JEOPARDY

The next configuration of the following TM after □ x0q 2 x □. 0 → , R  → , R q accept q reject 0 → x, R x → x, R  → , R x → x, R 0 → 0, L x → x, L x → x, R  → , L  → , R 0 → x, R 0 → 0, R  → , R x → x, R { 0 | n ≥ 0 } 2n2n q0q0 q1q1 q2q2 q3q3 q4q4

Show that if L 1 and L 2 are decidable, then so is L 1 – L 2.

The state diagram of a TM that decides the language { a n b m : n ≤ m }.

A proof that the set {0,1,2}* is countable.

If ƒ: ℕ  P( ℕ ) is defined by ƒ(n) = { j | j ≤ n and j is not prime }, the “diagonal set” that is not output by ƒ on any natural number.

A proof that no PDA recognizes D CFG, where D CFG = { 〈 G 〉 | G is a CFG that does not generate 〈 G 〉. }

A proof that ODD ≤ m EVEN, where Σ = {0,1} ODD = { 1 i | i is odd} EVEN = { 1 i | i is even}

A proof, using Rice’s Theorem, that P 3 = { 〈 M 〉 | M accepts all strings of length 3 } is undecidable.

A proof that A TM ≤ m A JAVA, where A JAVA = { 〈 J,w 〉 | J is a Java program with method “public boolean test(String s)” that returns true on string w. }

FINAL JEOPARDY TRUE