csci 2200 foundations of computer science
play

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2019 2 - PowerPoint PPT Presentation

1 CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2019 2 Announcements Homework 2 is due Thursday, Jan. 31 at 11:59pm. Solutions to Homework 1 will be presented in recitation this week. 3 MATHEMATICAL PROOFS Sections 1.7 1.8


  1. 1 CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2019

  2. 2 Announcements • Homework 2 is due Thursday, Jan. 31 at 11:59pm. • Solutions to Homework 1 will be presented in recitation this week.

  3. 3 MATHEMATICAL PROOFS Sections 1.7 – 1.8

  4. 4 Recap - Proving Theorems • Many theorems have the form: • To prove them, we show that, where c is an arbitrary element of the domain, • By universal generalization the truth of the original formula follows. • So, we must prove something of the form: prove p → q • Direct Proof : To prove p → q is true: • Assume that p is true. • Use rules of inference, axioms, and logical equivalences to show that q must also be true. Proof by Contraposition : To prove p → q is true, • • Assume ¬q • Show ¬p is also true.

  5. 5 Proof Strategies for proving p → q • Choose a method. First try a direct method of proof. 1. If this does not work, try an indirect method (e.g., try to 2. prove the contrapositive). For whichever method you are trying, choose a strategy. • First try forward reasoning . Start with the axioms and 1. known theorems and construct a sequence of steps that end in the conclusion. Start with p and prove q, or start with ¬q and prove ¬p. If this doesn’t work, try backward reasoning . When 2. trying to prove q, find a statement p that we can prove with the property p → q .

  6. 6 Recap - Proof by Contradiction Proof by Contradiction : (AKA reductio ad absurdum ): • Suppose we want to prove that a proposition p is true. • First, assume that p is false (¬p is true). • Then, show that ¬p implies a contradiction, i.e., ¬p → (r ∧ ¬r) for some proposition r. • This means that ¬p → F is true. • It follows that the contrapositive T → p is true. • Therefore, p is true.

  7. 7 Recap - Definitions • A real number r is rational if r = p/q for some integers p and q, q ≠ 0, where p and q have no common factors other than 1. • It can also be written as r = k(p/q), where r is any positive integer. • A real number that is not rational is called irrational .

  8. 8 Recap – Predicate Logic • Theorem: The difference between any rational number and any irrational number is irrational.

  9. 9 • Theorem: The difference between any rational number and any irrational number is irrational.

  10. 10 • Theorem: The difference between any rational number and any irrational number is irrational. • Corollary: The sum of a rational number and an irrational number is irrational. • You can use this theorem and corollary in your homework. • What about this one? • Theorem: The product of a non-zero rational number and an irrational number is irrational. • You may need to prove this for HW2.

  11. 11 Give a proof by contradiction for “√2 is irrational”.

  12. 12 What is wrong with this? “Proof” that 1 = 2

  13. 13 Theorems that are Biconditional Statements • To prove a theorem that is a biconditional statement, i.e., a statement of the form p ↔ q , we show that p → q and q → p are both true. • Example Theorem: “If n is an integer, then n is odd if and only if n 2 is odd.” • Must prove both: If n is odd, then n 2 is odd. If n 2 is odd, then n is odd. • Can use different proof methods for each conditional statement.

  14. 14 Proof by Cases • To prove a conditional statement of the form: • Use the tautology • Each of the implications is a case . • You need to prove each of them. • Can use different proof method for each case (though try to avoid this if you can)

  15. 15 Example - Proof by Cases • Let a @ b = max{a, b} If a ≥ b, a @ b = a. Otherwise a @ b = b. • Show that for all real numbers a , b , c (a @b) @ c = a @ (b @ c) *This means the operation @ is associative. • Proof : Let a , b , and c be arbitrary real numbers. Then one of the following 6 cases must hold. a ≥ b ≥ c 1. a ≥ c ≥ b 2. b ≥ a ≥ c 3. b ≥ c ≥ a 4. c ≥ a ≥ b 5. c ≥ b ≥ a 6.

  16. 16 • Show that for all real numbers a , b , c (a@b)@c = a@(b@c).

  17. 17 Without Loss of Generality • Show that if x and y are integers and both xy and x + y are even, then both x and y are even. • We will use a proof by contraposition. • What do we assume? • What do we want to prove?

  18. 18 • Show that if x and y are integers and both xy and x + y are even, then both x and y are even.

  19. 19 • Show that if x and y are integers and both xy and x + y are even, then both x and y are even.

  20. 20 Without Loss of Generality • For the proof of “Show that if x and y are integers and both xy and x + y are even, then both x and y are even.” We only cover the case where x is odd because the case where y is odd is similar. The phrase without loss of generality (w.l.o.g.) indicates this.

  21. 21 A note about writing proofs…. • If you are writing a direct proof, you do not not need to write that the proof is a direct proof. • If you are using a different proof method, it is common to state which proof method you are using at the beginning of the proof, e.g., • “This is a proof by contradiction.” • “This is a proof by contraposition.” • “This is a proof by induction.”

  22. 22 A note about writing proofs… • For a proof of p → q by contraposition, we write something like… “This is a proof by contraposition. Assume ¬q is true. Steps from ¬q to ¬p go here This implies that ¬p is also true. Therefore, if p is true, then q is true.” For this class, this sentence is optional

  23. 23 Existence Proofs • Some theorems are of the form • E.g., “There is a positive integer that can be written as the sum of cubes of two positive integers in two different ways: • Constructive existence proof : • Find an explicit value of c , for which P(c) is true. • Then is true by Existential Generalization (EG). • Proof : 1729 is such a number since 1729 = 10 3 + 9 3 = 12 3 + 1

  24. 24 Nonconstructive Existence Proofs • In a nonconstructive existence proof : • We prove that a c exists that makes P(c) true, but we don’t actually find what that c is. • One option: we assume no c exists for which P(c) is true and derive a contradiction.

  25. 25 Theorem: “There exist irrational numbers x and y such that x y is rational.”

  26. 26 Good Problems to Review • Section 1.7: 9, 13, 15, 17b, 27 • Section 1.8: 5, 7, 11, 15

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend