1 / 28

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

CSci 4011. INHERENT LIMITATIONS OF COMPUTER PROGRAMS. QUIZ 4. 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: .

judith
Download Presentation

INHERENT LIMITATIONS OF COMPUTER PROGRAMS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS

  2. QUIZ 4 • 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 ATM is the language: { 〈M,w〉 | M is a TM that accepts on input w }

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

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

  5. Why these stuff are important for reality? Who was phone? Are some of these topics actually taught in like a Linguistics class? Recursion Theorem. Why did it get so crazy all of a sudden? Can you parse HTML with RegEx? Is “The Princess Bride” your favorite movie? 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?

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

  7. qreject q0 q1 qa TURING MACHINES read write move  → , R 0 → 0, R q0 q1 qaccept 0→ 0, R  → , R 0→ 0, R q2  → , L 0 0 UNBOUNDED TAPE

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

  9. 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

  10. UNDECIDABILITY 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.

  11. 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ƒ Languages over {0,1} Turing Machines Strings of 0s and 1s Sets of strings of 0s and 1s P(S) S

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

  13. 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

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

  15. # q00 q10  qacc0 qacc 0qacc qacc## qacc q0 #q00# 0qrej  0q1 qrej qacc qacc qacc qacc # # # q1 0 qreject qacc 0 # # q00 # 0 q1 # # # 0 0qacc qacc # #q00# 0q1 # 0 qacc # # # 0 qacc qacc 0 → 0, R  → , R q0 q1 qaccept 0→ 0, R  → , R

  16. RICE’S THEOREM Let P be a set of Turing machines. If P satisfies the following two properties: For any TMs M1 and M2, where L(M1) = L(M2), M1 P if and only if M2  P There exist TMs MIN  P and MOUT  P (i.e. P is a “nontrivialproperty of the r.e. languages.”) Then P is undecidable EXTREMELY POWERFUL

  17. DECIDABLE LANGUAGES DIAGONAL ARGUMENTS REDUCTIONS 100 100 100 200 200 200 300 300 300 FINAL JEOPARDY

  18. x → x, L 2n 0 → 0, L { 0 | n ≥ 0 } q2  → , R  → , L x → x, R x → x, R q0 q1 q3 0 → , R 0 → x, R x → x, R 0 → 0, R  → , R qreject 0 → x, R  → , R qaccept q4 x → x, R  → , R The next configuration of the following TM after □x0q2x□.

  19. Show that if L1 and L2 are decidable, then so is L1 – L2.

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

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

  22. 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.

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

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

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

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

  27. FINAL JEOPARDY TRUE

More Related