Download presentation
Presentation is loading. Please wait.
Published byDamon Lane Modified over 9 years ago
1
1 Course Summary CS 202 Aaron Bloomfield
2
2 Outline A review of the proof methods gone over in class Interspersed with the most popular demotivators from CS 101 Course summary
3
3 Demotivator winners! Methodology Methodology –1 st place vote counted for 3 points –2 nd place vote counted for 2 points –3 rd place vote counted for 1 point Have not tallied the Toolkit ones yet Have not tallied the Toolkit ones yet –I won’t get those for a few weeks Will then buy two demotivators and hang them in my office… Will then buy two demotivators and hang them in my office…
4
4 Proof methods learned so far Logical equivalences via truth tables via truth tables via logical equivalences via logical equivalences Set equivalences via membership tables via membership tables via set identities via set identities via mutual subset proof via mutual subset proof via set builder notation and logical equivalences via set builder notation and logical equivalences Rules of inference for propositions for propositions for quantified statements for quantified statements Pigeonhole principle Combinatorial proofs Ten proof methods in section 1.5: Direct proofs Direct proofs Indirect proofs Indirect proofs Vacuous proofs Vacuous proofs Trivial proofs Trivial proofs Proof by contradiction Proof by contradiction Proof by cases Proof by cases Proofs of equivalence Proofs of equivalence Existence proofs Existence proofsConstructiveNon-constructive Uniqueness proofs Uniqueness proofs Counterexamples CounterexamplesInduction Weak mathematical induction Weak mathematical induction Strong mathematical induction Strong mathematical induction Structural induction Structural induction
5
5 Idempotent Law Associativity of Or Definition of implication Using Logical Equivalences Re-arranging Original statement DeMorgan’s Law
6
6 In 12 th place (11 votes)
7
7 Definition of difference DeMorgan’s law Complementation law Distributive law Complement law Identity law Commutative law Set equivalences (§1.7) Prove that A∩B=B-(B-A)
8
8 Proof by set builder notation and logical equivalences 2 Original statement Definition of difference Negating “element of” Definition of difference DeMorgan’s Law Distributive Law Negating “element of” Negation Law Identity Law Definition of intersection
9
9 In 11 th place (1/3) (12 votes)
10
10 Rules of inference ( §1.5) Example 6 of Rosen, section 1.5 We have the hypotheses: “It is not sunny this afternoon and it is colder than yesterday” “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? “It is not sunny this afternoon and it is colder than yesterday” “It is not sunny this afternoon and it is colder than yesterday” “We will go swimming only if it is sunny” “We will go swimming only if it is sunny” “If we do not go swimming, then we will take a canoe trip” “If we do not go swimming, then we will take a canoe trip” “If we take a canoe trip, then we will be home by sunset” “If we take a canoe trip, then we will be home by sunset” Does this imply that “we will be home by sunset”? p q r s t ¬p q¬p q r → p ¬r → s s → t t
11
11 Rules of inference ( §1.5) 1.¬p q1 st hypothesis 2.¬pSimplification using step 1 3.r → p2 nd hypothesis 4.¬rModus tollens using steps 2 & 3 5.¬r → s3 rd hypothesis 6.sModus ponens using steps 4 & 5 7.s → t 4 th hypothesis 8.tModus ponens using steps 6 & 7
12
12 In 11 th place (2/3) (12 votes)
13
13 Rules of inference ( §1.5) Rosen, section 1.5, question 10a Given the hypotheses: “Linda, a student in this class, owns a red convertible.” “Linda, a student in this class, owns a red convertible.” “Everybody who owns a red convertible has gotten at least one speeding ticket” “Everybody who owns a red convertible has gotten at least one speeding ticket” Can you conclude: “Somebody in this class has gotten a speeding ticket”? C(Linda) R(Linda) x (R(x)→T(x)) x (C(x) T(x))
14
14 Rules of inference ( §1.5) 1. x (R(x)→T(x))3 rd hypothesis 2.R(Linda) → T(Linda)Universal instantiation using step 1 3.R(Linda)2 nd hypothesis 4.T(Linda)Modes ponens using steps 2 & 3 5.C(Linda)1 st hypothesis 6.C(Linda) T(Linda)Conjunction using steps 4 & 5 7. x (C(x) T(x))Existential generalization using step 6 Thus, we have shown that “Somebody in this class has gotten a speeding ticket”
15
15 In 11 th place (3/3) (12 votes)
16
16 Proof methods ( §1.5) Ten proof methods: 1. Direct proofs 2. Indirect proofs 3. Vacuous proofs 4. Trivial proofs 5. Proof by contradiction 6. Proof by cases 7. Proofs of equivalence 8. Existence proofs 9. Uniqueness proofs 10. Counterexamples
17
17 In 10 th place (1/5) (13 votes)
18
18 Direct proof example Rosen, section 1.5, question 20 Show that the square of an even number is an even number Show that the square of an even number is an even number Rephrased: if n is even, then n 2 is even Rephrased: if n is even, then n 2 is even Assume n is even Thus, n = 2k, for some k (definition of even numbers) Thus, n = 2k, for some k (definition of even numbers) n 2 = (2k) 2 = 4k 2 = 2(2k 2 ) n 2 = (2k) 2 = 4k 2 = 2(2k 2 ) As n 2 is 2 times an integer, n 2 is thus even As n 2 is 2 times an integer, n 2 is thus even
19
19 Indirect proof example If n 2 is an odd integer then n is an odd integer Prove the contrapositive: If n is an even integer, then n 2 is an even integer Proof: n=2k for some integer k (definition of even numbers) n 2 = (2k) 2 = 4k 2 = 2(2k 2 ) n 2 = (2k) 2 = 4k 2 = 2(2k 2 ) Since n 2 is 2 times an integer, it is even
20
20 In 10 th place (2/5) (13 votes)
21
21 Proof by contradiction Given a statement p, assume it is false Assume ¬p Assume ¬p Prove that ¬p cannot occur A contradiction exists A contradiction exists Given a statement of the form p→q To assume it’s false, you only have to consider the case where p is true and q is false To assume it’s false, you only have to consider the case where p is true and q is false
22
22 Proof by contradiction Theorem (by Euclid): There are infinitely many prime numbers. Proof. Assume there are a finite number of primes List them as follows: p 1, p 2 …, p n. Consider the number q = p 1 p 2 … p n + 1 This number is not divisible by any of the listed primes This number is not divisible by any of the listed primes If we divided p i into q, there would result a remainder of 1 We must conclude that q is a prime number, not among the primes listed above We must conclude that q is a prime number, not among the primes listed above This contradicts our assumption that all primes are in the list p 1, p 2 …, p n.
23
23 Proof by contradiction example 2 Rosen, section 1.5, question 21 (b) Prove that if n is an integer and n 3 +5 is odd, then n is even Prove that if n is an integer and n 3 +5 is odd, then n is even Rephrased: If n 3 +5 is odd, then n is even Rephrased: If n 3 +5 is odd, then n is even Thus, p is “n 3 +5” is odd, q is “n is even” Assume p and q Assume that n 3 +5 is odd, and n is odd Assume that n 3 +5 is odd, and n is odd Since n is odd: n=2k+1 for some integer k (definition of odd numbers) n=2k+1 for some integer k (definition of odd numbers) n 3 +5 = (2k+1) 3 +5 = 8k 3 +12k 2 +6k+6 = 2(4k 3 +6k 2 +3k+3) n 3 +5 = (2k+1) 3 +5 = 8k 3 +12k 2 +6k+6 = 2(4k 3 +6k 2 +3k+3) As n 3 +5 = 2(4k 3 +6k 2 +3k+3) is 2 times an integer, n must be even As n 3 +5 = 2(4k 3 +6k 2 +3k+3) is 2 times an integer, n must be even Thus, we have concluded q Thus, we have concluded qContradiction! We assumed q was false, and showed that this assumption implies that q must be true We assumed q was false, and showed that this assumption implies that q must be true As q cannot be both true and false, we have reached our contradiction As q cannot be both true and false, we have reached our contradiction
24
24 In 10 th place (3/5) (13 votes)
25
25 Vacuous proof example When the antecedent is false Consider the statement: All criminology majors in CS 202 are female All criminology majors in CS 202 are female Rephrased: If you are a criminology major and you are in CS 202, then you are female Rephrased: If you are a criminology major and you are in CS 202, then you are female Could also use quantifiers! Since there are no criminology majors in this class, the antecedent is false, and the implication is true
26
26 Trivial proof example When the consequence is true Consider the statement: If you are tall and are in CS 202 then you are a student If you are tall and are in CS 202 then you are a student Since all people in CS 202 are students, the implication is true regardless
27
27 Proof by cases example Prove that Note that b ≠ 0 Note that b ≠ 0Cases: Case 1: a ≥ 0 and b > 0 Case 1: a ≥ 0 and b > 0 Then |a| = a, |b| = b, and Case 2: a ≥ 0 and b < 0 Case 2: a ≥ 0 and b < 0 Then |a| = a, |b| = -b, and Case 3: a 0 Case 3: a 0 Then |a| = -a, |b| = b, and Case 4: a < 0 and b < 0 Case 4: a < 0 and b < 0 Then |a| = -a, |b| = -b, and
28
28 In 10 th place (4/5) (13 votes)
29
29 Proofs of equivalence example Rosen, section 1.5, question 40 Show that m 2 =n 2 if and only if m=n or m=-n Show that m 2 =n 2 if and only if m=n or m=-n Rephrased: (m 2 =n 2 ) ↔ [(m=n) (m=-n)] Rephrased: (m 2 =n 2 ) ↔ [(m=n) (m=-n)] Need to prove two parts: [(m=n) (m=-n)] → (m 2 =n 2 ) [(m=n) (m=-n)] → (m 2 =n 2 ) Proof by cases! Case 1: (m=n) → (m 2 =n 2 ) (m) 2 = m 2, and (n) 2 = n 2, so this case is proven (m) 2 = m 2, and (n) 2 = n 2, so this case is proven Case 2: (m=-n) → (m 2 =n 2 ) (m) 2 = m 2, and (-n) 2 = n 2, so this case is proven (m) 2 = m 2, and (-n) 2 = n 2, so this case is proven (m 2 =n 2 ) → [(m=n) (m=-n)] (m 2 =n 2 ) → [(m=n) (m=-n)] Subtract n 2 from both sides to get m 2 -n 2 =0 Factor to get (m+n)(m-n) = 0 Since that equals zero, one of the factors must be zero Thus, either m+n=0 (which means m=n) Or m-n=0 (which means m=-n)
30
30 In 10 th place (5/5) (13 votes)
31
31 Constructive existence proof example Show that a square exists that is the sum of two other squares Proof: 3 2 + 4 2 = 5 2 Proof: 3 2 + 4 2 = 5 2 Show that a cube exists that is the sum of three other cubes Proof: 3 3 + 4 3 + 5 3 = 6 3 Proof: 3 3 + 4 3 + 5 3 = 6 3
32
32 Non-constructive existence proof example Rosen, section 1.5, question 50 Prove that either 2*10 500 +15 or 2*10 500 +16 is not a perfect square A perfect square is a square of an integer A perfect square is a square of an integer Rephrased: Show that a non-perfect square exists in the set {2*10 500 +15, 2*10 500 +16} Rephrased: Show that a non-perfect square exists in the set {2*10 500 +15, 2*10 500 +16} Proof: The only two perfect squares that differ by 1 are 0 and 1 Thus, any other numbers that differ by 1 cannot both be perfect squares Thus, any other numbers that differ by 1 cannot both be perfect squares Thus, a non-perfect square must exist in any set that contains two numbers that differ by 1 Thus, a non-perfect square must exist in any set that contains two numbers that differ by 1 Note that we didn’t specify which one it was! Note that we didn’t specify which one it was!
33
33 In 9 th place (14 votes)
34
34 Uniqueness proof example If the real number equation 5x+3=a has a solution then it is unique Existence We can manipulate 5x+3=a to equal (a-3)/5 We can manipulate 5x+3=a to equal (a-3)/5 Is this constructive or nonconstructive? Is this constructive or nonconstructive?Uniqueness If there are two such numbers, then they would fulfill the following: a = 5x+3 = 5y+3 If there are two such numbers, then they would fulfill the following: a = 5x+3 = 5y+3 We can manipulate this to yield that x = y We can manipulate this to yield that x = y Thus, the one solution is unique!
35
35 In 8 th place (15 votes)
36
36 Counterexamples Given a universally quantified statement, find a single example which it is not true Note that this is DISPROVING a UNIVERSAL statement by a counterexample x ¬R(x), where R(x) means “x has red hair” Find one person (in the domain) who has red hair Find one person (in the domain) who has red hair Every positive integer is the square of another integer The square root of 5 is 2.236, which is not an integer The square root of 5 is 2.236, which is not an integer
37
37 In 7 th place (16 votes)
38
38 Weak mathematical induction (§ 3.3) Rosen, question 7: Show Base case: n = 1 Inductive hypothesis: assume
39
39 Weak mathematical induction (§ 3.3) Inductive step: show
40
40 In 6 th place (18 votes)
41
41 Strong mathematical induction (§ 3.3) Show that any number > 1 can be written as the product of primes Base case: P(2) 2 is the product of 2 (remember that 1 is not prime!) 2 is the product of 2 (remember that 1 is not prime!) Inductive hypothesis: P(1), P(2), P(3), …, P(k) are all true Inductive step: Show that P(k+1) is true
42
42 Strong mathematical induction (§ 3.3) Inductive step: Show that P(k+1) is true There are two cases: k+1 is prime k+1 is prime It can then be written as the product of k+1 k+1 is composite k+1 is composite It can be written as the product of two composites, a and b, where 2 ≤ a ≤ b < k+1 By the inductive hypothesis, both P(a) and P(b) is true
43
43 In 5 th place (1/2) (21 votes)
44
44 Structural induction (§ 3.4) Show that n(T) ≥ 2h(T) + 1 Inductive hypothesis: Let T 1 and T 2 be full binary trees Let T 1 and T 2 be full binary trees Assume that n(T 1 ) ≥ 2h(T 1 ) + 1 for some tree T 1 Assume that n(T 2 ) ≥ 2h(T 2 ) + 1 for some tree T 2 Recursive step: Let T = T 1 ∙ T 2 Let T = T 1 ∙ T 2 Here the ∙ operator means creating a new tree with a root note r and subtrees T 1 and T 2 New element is T By the definition of height and size, we know: By the definition of height and size, we know: n(T) = 1 + n(T 1 ) + n(T 2 ) h(T) = 1 + max ( h(T 1 ), h(T 2 ) ) Therefore: Therefore: n(T) = 1 + n(T 1 ) + n(T 2 ) ≥ 1 + 2h(T 1 ) + 1 + 2h(T 2 ) + 1 ≥ 1 + 2*max ( h(T 1 ), h(T 2 ) )the sum of two non-neg #’s is at least as large as the larger of the two = 1 + 2*h(T) Thus, n(T) ≥ 2h(T) + 1 Thus, n(T) ≥ 2h(T) + 1
45
45 In 5 th place (2/2) (21 votes)
46
46 Induction methods compared Weak mathematical StrongMathematicalStructural Used for Usually formulae Usually formulae not provable via mathematical induction Only things defined via recursion Assumption Assume P(k) Assume P(1), P(2), …, P(k) Assume statement is true for some "old" elements What to prove True for P(k+1) Statement is true for some "new" elements created with "old" elements Step 1 called Base case Basis step Step 3 called Inductive step Recursive step
47
47 In 4 th place (25 votes)
48
48 Pigeonhole principle (§4.2) Consider 5 distinct points (x i, y i ) with integer values, where i = 1, 2, 3, 4, 5 Show that the midpoint of at least one pair of these five points also has integer coordinates Thus, we are looking for the midpoint of a segment from (a,b) to (c,d) The midpoint is ( (a+c)/2, (b+d)/2 ) The midpoint is ( (a+c)/2, (b+d)/2 ) Note that the midpoint will be integers if a and c have the same parity: are either both even or both odd Same for b and d Same for b and d There are four parity possibilities (even, even), (even, odd), (odd, even), (odd, odd) (even, even), (even, odd), (odd, even), (odd, odd) Since we have 5 points, by the pigeonhole principle, there must be two points that have the same parity possibility Thus, the midpoint of those two points will have integer coordinates Thus, the midpoint of those two points will have integer coordinates
49
49 In 3 rd place (1/2) (27 votes)
50
50 Combinatorial proof (§4.3) Let n be a non-negative integer. Then Combinatorial proof A set with n elements has 2 n subsets A set with n elements has 2 n subsets By definition of power set Each subset has either 0 or 1 or 2 or … or n elements Each subset has either 0 or 1 or 2 or … or n elements There are subsets with 0 elements, subsets with 1 element, … and subsets with n elements Thus, the total number of subsets is Thus, Thus,
51
51 In 3 rd place (2/2) (27 votes)
52
52 Official course goals 1.Logic: Introduce a formal system (propositional and predicate logic) which mathematical reasoning is based on. (sections 1.1- 1.4) 2.Proofs: Develop an understanding of how to read and construct valid mathematical arguments (proofs) and understand mathematical statements (theorems), including inductive proofs. Also, introduce and work with various problem solving strategies and techniques. (sections 1.5, 3.1, 3.3, 3.4) 3.Counting: Introduce the basics of integer theory, combinatorics, and counting principles, including a brief introduction to discrete probability. (sections 2.4, 4.1-4.4, 5.1) 4.Structures: Introduce and work with important discrete data structures such as sets, relations, sequences, and discrete functions. (sections 1.6-1.8, 2.7, 3.2, 7.1, 7.3-7.6) 5.Applications: Gain an understanding of some application areas of the material covered in the course. (sections 2.6, 3.6, 10.3) The written final will be based on these goals!
53
53 In 2 nd place (30 votes)
54
54 Unofficial course goals Ensure that all students have a “base” level of discrete mathematical proficiency In particular, ensure that they know a number of covered topics, such as sets, logic, etc. In particular, ensure that they know a number of covered topics, such as sets, logic, etc. Used in CS 216, in particular Used in CS 216, in particular To prepare for more advanced computer theory classes (CS 302, CS 432) To give the students more experience in math The best way to get better at anything is through practice The best way to get better at anything is through practice To help create a computer scientist, not a computer programmer
55
55 And the winner is… with 45 votes…
56
56 Have a summer! Final is 9 a.m. this Saturday!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.