250 likes | 486 Views
Induction and Invariant Method. Leo Cheung. News. Register your project group at https://spreadsheets.google.com/viewform?hl=en&formkey=dG41TGJEQ19RM2VjX1R1US1ONzZqblE6MA#gid=0 Homework 1 is posted Bring your calculator to the next 3 weeks tutorial. A Quick Review. Induction
E N D
Induction and Invariant Method Leo Cheung
News • Register your project group at • https://spreadsheets.google.com/viewform?hl=en&formkey=dG41TGJEQ19RM2VjX1R1US1ONzZqblE6MA#gid=0 • Homework 1 is posted • Bring your calculator to the next 3 weeks tutorial
A Quick Review • Induction • Strong induction • Well ordering principle • Invariant method
Induction - 1 7n – 1 is divisible by 6, for all n ≥ 1.
Induction - 1 7n – 1 is divisible by 6, for all n ≥ 1. Base case: n=1 71-1=6 which is divisible by 6. Assume the statement is true for n=k, i.e. 7k-1=6m for some m When n = k+1 7k+1-1 = 7(6m+1) - 1 = 42m + 6 = 6(7m+1) So by induction 7n – 1 is divisible by 6, for all n ≥ 1.
Induction - 2 For all integer n ≥ 0
Induction - 2 For all integer n ≥ 0 Base cases: n=0, L.S.= 2 =R.S. Assume the statement is true for n=k, i.e When n = k+1
Induction - 3 • For which positive integers n satisfy 2n+3≤2n? Prove your answer using induction.
Induction - 3 • You can check the statement is wrong for n=1,2,3. • When n=4, 2(4)+3=11<16=24 • Assume 2k+3<2k (k≥4) • When n=k+1 Hence by induction 2n+3<2n for all integer n≥4
Induction - 4 • Which of the powers of 9 (90 91 92 93 …) have 9 as unit digit? Proof your answer by induction.
Induction - 4 • Lets prove the statement 92n and 92n+1 has unit digit 1 and 9 respectively for all integer n≥0. • Base case: Trivial • Assume 92k and 92k+1 has unit digit 1 and 9 respectively • When n=k+1 • 92(k+1)=9 x 92k+1 which has unit digit 1 • More precisely • Very similar proof for 92(k+1)+1 • Hence 92n+1 has unit digit 9 for all integer n≥0
Recall Strong Induction (Lecture 6, Slide 11) Prove P(0). Then prove P(n+1) assuming all of P(0), P(1), …, P(n)(instead of just P(n)). Conclude n.P(n) Strong induction equivalent 0 1, 1 2, 2 3, …, n-1n. So by the time we got to n+1, already know all of P(0), P(1), …, P(n) Ordinary induction
Strong Induction - 1 Given for all integer k ≥ 2 Prove fn ≤ n for all integer n ≥ 1
Strong Induction - 1 Base case f1 = 1 ≤ 1 Assume fj ≤ j, for all j such that 1 ≤ j ≤ k Done.
Strong Induction - 2 • Given • g0 = 12 • g1 = 29 • gk = 5gk-1 – 6gk-2 for all integers k ≥ 2 • Prove gn = 5x3n + 7x2n for all integers n ≥ 0
Strong Induction - 2 • Base Case • n = 0, 1 : Trivial • Assume the hypothesis is true for 0,1,2,….k-1,k By induction, the proof is done.
Strong induction - 3 • Show that a 6xn board (n≥2) can be tiled with L-shaped tiles, without gap and overlapping.
Strong Induction - 3 Assume board of dimension 6x2, 6x3, 6x4 …. 6x(k-1), 6xk can be tiled When n=k+1 N=2 N=3 k+1 columns Tile 2 columns, the remaining k-1 columns can be tiled by inductive assumption
Strong Induction - 4 • You get a chocolate bar with mxn squares. Your task is to split the bar into 1x1 squares. Show that you always need mn-1 breaks. You can only break one piece at a time.
Strong Induction - 4 • Chocolate with A=mxn squares need A-1 breaks. • A=1: trivial • Assume choco with area j need j-1 breaks, for all 1 ≤ j ≤ k • When A=k+1 • We break the size k+1 choco to two piece of size X and Y, X+Y=k+1 • By inductive assumption • The size X pieces need X-1 breaks (1 ≤ X ≤ k) • The size Y pieces need Y-1 breaks (1 ≤ Y ≤ k) • Hence in total we need 1+(X-1)+(Y-1) = X+Y-1=k breaks
Invariant Method • Find properties (the invariants) that are satisfied throughout the whole process. • Show that the target do not satisfy the properties. • Conclude that the target is not achievable.
Invariant Method • Integers 1, 2, 3, 4 and 5 are written on a board. Tom picks any two of the numbers, deletes them, and writes on the board the absolute value of their difference. He repeats this procedure with the resulting 4 numbers, and so on. After he does it 4 times, only one number remains on the board. Can this number be 2?
Invariant Method - Answer • Observe that whatever move you made, you can only get an odd number in the final answer. • Observe that the total sum of the numbers on the board remains odd. • Consider a move, you pick m and n on the board, and write back m-n. • Change in total sum = m+n-(m-n) = 2n • Which means whatever move you make, the change in total sum must be even • The parity of total sum is the invariant • Since we start with an odd total sum 15, it is not possible have 2 as the final number because it is even.
Exercises • Following exercises can be found in textbook • 4.2 : 12 13 15 • 4.3 : 10 14 16 19 24 34 • 4.4 : 4 15