Download presentation
Presentation is loading. Please wait.
1
Discrete Mathematics Tutorial 11 Chin chlee@cse.cuhk.edu.hk
2
Induction Suppose – P(1) is true, and – If P(n) is true, P(n+1) is also true Then P(n) is true for every n ≥ 1 6 5 4 3 2 1
3
Induction Suppose I proved that 1.P(1) and P(2) are true. 2.If P(n) is true, then P(n+2) is true. Can I conclude that – P(n) is true for every n?
4
Suppose I proved that 1.P(1) and P(2) are true. 2.If P(n) is true, then P(n+2) is true. Two stack of dominoes – P(1)→P(3)→P(5)→… – P(2)→P(4)→P(6) →… Induction... 7 5 3 1. 8 6 4 2
5
Induction Suppose I proved that 1.P(1, 1) is true. 2.If P(n, m) is true, then P(n+1, m+1) is true. Can I conclude that – P(n, m) is true for every n, m?
6
Induction Suppose I proved that 1.P(1, 1) is true. 2.If P(n, m) is true, then P(n+1, m+1) is true. What about P(2,1)? (1,1) (2,1)(2,2) (3,1)(3,3) (4,1)(4,4) (5,1)(5,5) (6,1)(6,6) (7,1)(7,7)
7
Induction Suppose I proved that 1.P(1, 1) is true. 2.If P(n, m) is true, then P(n+1, m) is true. 3.If P(n, m) is true, then P(n-1, m+1) is true. Can I conclude that – P(n, m) is true for every n, m?
8
Induction Suppose I proved that 1.P(1, 1) is true. 2.If P(n, m) is true, then P(n+1, m) is true. 3.If P(n, m) is true, then P(n-1, m+1) is true. (1,1)(1,2)(1,3)(1,4)(1,5) (2,1)(2,2)(2,3)(2,4) (3,1)(3,2)(3,3) (4,1)(4,2) (5,1) (6,1) (7,1) 2,3 3,2 4,1 1,3 2,2 3,1 1,2 2,1 1,1
9
Induction Show that ∑ i 2 = n(2n+1)(n+1)/6 n i=1
10
Induction Show that ∑ i 2 = n(2n+1)(n+1)/6 i.e. 1 2 + 2 2 + 3 2 + … + n 2 = n(2n+1)(n+1)/6 Base case: – when n = 1 – L.H.S. = 1 – R.H.S. = 1 x 3 x 2 / 6 = 1 n i=1
11
Induction Assume P(n) is true: ∑ i 2 = n(2n+1)(n+1)/6 i.e. 1 2 + 2 2 + 3 2 + … + n 2 = n(2n+1)(n+1)/6 Then we need to show P(n+1) is also true: ∑ i 2 = (n+1)(2(n+1)+1)((n+1)+1)/6 i.e. 1 2 + 2 2 + … + n 2 + (n+1) 2 = (n+1)(2n+3)(n+2)/6 How to use the induction assumption? n i=1 n+1 i=1
12
Induction Then we need to show P(n+1) is also true: ∑ i 2 =(n+1)(2n+3)(n+2)/6 i.e. 1 2 + 2 2 + … + n 2 + (n+1) 2 = (n+1)(2n+3)(n+2)/6 How to use the induction assumption? ∑ i 2 = ∑ i 2 + (n+1) 2 ∑ i 2 = n(2n+1)(n+1)/6 + (n+1) 2 n+1 i=1 n+1 i=1 n n+1 i=1
13
Induction Now we have ∑ i 2 = n(2n+1)(n+1)/6 + (n+1) 2 Our goal is to make R.H.S. equal (n+1)(2n+3)(n+2)/6 Just expand everything out and factorize n+1 i=1
14
Induction ∑ i 2 = n(2n + 1)(n + 1)/6 + (n + 1) 2 = (2n 3 + 3n 2 + n)/6 + (n 2 + 2n + 1) = ((2n 3 + 3n 2 + n) + (6n 2 + 12n + 6)) /6 = (2n 3 + 9n 2 + 13n + 6)/6 How to factor? n+1 i=1
15
Induction ∑ i 2 = (2n 3 + 9n 2 + 13n + 6)/6 = (n + 1)(2n 2 + 7n + 6)/6 = (n + 1)(2n + 3)(n + 2)/6 n+1 i=1 How to factor? Remember, our goal is to make R.H.S. equal (n+1)(2n+3)(n+2)/6 So P(n+1) is also true. Done.
16
Strong induction Suppose – P(1) is true, and – If P(s) is true for every s < n, P(n+1) is also true Then P(n) is true for every n ≥ 1 6 5 4 3 2 1
17
Strong induction Prove that To divide up a chocolate bar with m x n squares, we need at least mn - 1 splits 5 = 2x3 - 1 splits
18
Strong induction Prove that To divide up a chocolate bar with m x n squares, we need at least mn - 1 splits We prove a stronger statement P(s) := To divide up a chocolate bar with s squares, we need at least s - 1 splits
19
Strong Induction Prove that P(s) := To divide up a chocolate bar with s squares, we need at least s-1 splits Base case P(1): – No need to split.
20
Strong Induction Prove that P(s) := To divide up a chocolate bar with s squares, we need at least s-1 splits Induction step: – (If P(k) is true for every k < s) – Assume for any chocolate bar with 1 ≤ k < s squares, we need at least k – 1 splits.
21
Strong induction Induction step (If P(k) is true for every k < s) : – Assume for any chocolate bar with 1 ≤ k < s squares, we need at least k – 1 splits. Given a chocolate bar with s squares Split it into two smaller bars with i and j squares, i + j = s j squares i squares s squares
22
Strong induction By induction assumption (P(k) is true for any k < s) Small chocolate bar with i < s squares – needs at least i-1 splits for one of the two bars Small chocolate bar with j < s squares – needs at least j-1 splits for one of the two bars Therefore we need (i-1) + (j-1) + 1 = s-1 splits – because i + j = s P(s) is true. Done. j-1 splits i-1 splits 1 split
23
Well-ordering principle Every nonempty set of nonnegative integers has a least element This is equivalent to Mathematical Induction: – If MI is true, then we can prove WOP is also true. – If WOP is true, then we can prove MI is also true.
24
Well-ordering principle Prove by well-ordering principle that ∑ i = n(n+1)/2 n i=1
25
Well-ordering principle Prove by well-ordering principle that ∑ i = n(n+1)/2 Prove by contradiction Suppose there exist some m, ∑ i ≠ m(m+1)/2 Let S be the set containing all such m – S is nonempty (exists at least one) – S is a set of nonnegative integers n i=1 m
26
Well-ordering principle Let S be the set containing all the m ∑ i ≠ m(m+1)/2 – S is nonempty (exists at least one) – S is a set of nonnegative integers By well-ordering principle, – there exists a least element m’ in S – i.e. m’ is the smallest number such that ∑ i ≠ m’(m’+1)/2 m i=1 m’ i=1
27
Well-ordering principle m’ is the smallest number such that ∑ i ≠ m’(m’+1)/2 This means for any 0 ≤ n < m’ ∑ i = n(n+1)/2 m’ i=1 n
28
Well-ordering principle This means for any 0 ≤ n < m’ ∑ i = n(n+1)/2 This is true when n = 0, so – m’ > 0 – m’-1 is non-negative and m’-1 < m’, so ∑ i = (m’-1)((m’-1)+1)/2 n i=1 m’-1 i=1
29
Well-ordering principle ∑ i = (m’-1)((m’-1)+1)/2 ∑ i = ∑ i + m’ = (m’-1)m’/2 + m’ = m’(m’+1)/2 But ∑ i ≠ m’(m’+1)/2 Contradiction m’-1 i=1 m’ i=1 m’ i=1 m’-1 i=1
30
Well-ordering principle Show that a 2 + b 2 = 3(s 2 + t 2 ) has no non-zero integer solutions.
31
Well-ordering principle Suppose it has non-zero integer solutions. Let S be the collection of (a, b, s, t) such that – (a, b, s, t) ≠ (0, 0, 0, 0), and – a 2 + b 2 = 3(s 2 + t 2 ) S is nonempty, by well-ordering principle – there is a least element (a 1, b 1, s 1, t 1 ) such that a 1 2 + b 1 2 = 3(s 1 2 + t 1 2 )
32
Well-ordering principle S is nonempty, by well-ordering principle – there is a least element (a 1, b 1, s 1, t 1 ) such that a 1 2 + b 1 2 = 3(s 1 2 + t 1 2 ) Right idea, but… – S is a set containing 4-tuples (a, b, s, t) – not a set of non-negative integers Cannot apply the well-ordering principle
33
Well-ordering principle Suppose there exists (a, b, s, t) ≠ (0, 0, 0, 0), a 2 + b 2 = 3(s 2 + t 2 ) Let S be the collection of |a| such that there exist b, s and t a 2 + b 2 = 3(s 2 + t 2 ) S is a nonempty set of non-negative integers By the well-ordering principle – There exists an a 1 in S such that |a 1 | is smallest
34
Well-ordering principle Let S be the collection of |a| such that there exist b, s and t a 2 + b 2 = 3(s 2 + t 2 ) By the well-ordering principle – There exists an a 1 in S such that |a 1 | is smallest And for this smallest |a 1 |, there exist b 1, s 1 and t 1, a 1 2 + b 1 2 = 3(s 1 2 + t 1 2 )
35
Well-ordering principle And for this smallest |a 1 |, there exist b 1, s 1 and t 1, a 1 2 + b 1 2 = 3(s 1 2 + t 1 2 ) This means – a 1 2 + b 1 2 is a multiple of 3 – a 1 and b 1 are both multiples of 3 proof by contrapositive – a 1 = 3a 2 and b 1 = 3b 2 for some a 2 and b 2
36
Well-ordering principle And for this smallest |a 1 |, there exist b 1, s 1 and t 1, a 1 2 + b 1 2 = 3(s 1 2 + t 1 2 ) a 1 = 3a 2 and b 1 = 3b 2 for some a 2 and b 2 – (3a 2 ) 2 + (3b 2 ) 2 = 3(s 1 2 + t 1 2 ) – 9a 2 2 + 9b 2 2 = 3(s 1 2 + t 1 2 ) – 3(a 2 2 + b 2 2 ) = s 1 2 + t 1 2 – s 1 2 + t 1 2 = 3(a 2 2 + b 2 2 ) therefore (s 1, t 1, a 2, b 2 ) is also a solution
37
Well-ordering principle There is a least element (a 1, b 1, s 1, t 1 ) a 1 2 + b 1 2 = 3(s 1 2 + t 1 2 ) We have just showed – (s 1, t 1, a 2 = a 1 /3, b 2 = b 1 /3) is also a solution Repeat the argument – (a 2 =a 1 /3, b 2 =b 1 /3, s 2 =s 1 /3, t 2 =t 1 /3) is also solution But |a 2 | < |a 1 |, contradiction.
38
Invariant Method The numbers 1, 2, 3, 4 and 5 are written on a board Repeat the following until there is only one number left: – pick any two of the numbers – erase them – write the absolute value of their difference on board Can the remaining number be 2?
39
Invariant Method Example 1 2 3 4 5 → 2 3 4 4 2 3 4 4 → 2 4 1 2 4 1 → 2 3 2 3 → 1
40
Invariant Method Observe 1 2 3 4 5 (1 + 2 + 3 + 4 + 5 = 15) 2 3 4 4 (2 + 3 + 4 + 4 = 13) 2 4 1 (2 + 4 + 1 = 7) 2 3 (2 + 3 = 5) 1 (1) What is the pattern?
41
Invariant Method Observation – can only get an odd number in the final answer – total sum of the numbers on the board is always odd Suppose I pick m and n on the board – Change in total sum = m + n - (m - n) = 2n – the change in total sum must be even – Therefore the total sum is always odd
42
Invariant Method At the beginning the total sum is 15 – which is odd Therefore the total sum is always odd Impossible to get 2 as final answer – In fact, impossible to get any even number as final answer
43
End Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.