CSCE 222 Discrete Structures for Computing. Proof by Induction. Dr. Hyunyoung Lee. !!!!!! Based on slides by Andreas Klappenecker

Similar documents
Proof by Induction. Andreas Klappenecker

Mathematical Induction Assignments

CSCE 222 Discrete Structures for Computing. Proofs. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

CSC 344 Algorithms and Complexity. Proof by Mathematical Induction

CSCE 222 Discrete Structures for Computing. Review for Exam 2. Dr. Hyunyoung Lee !!!

CS 220: Discrete Structures and their Applications. Mathematical Induction in zybooks

Sum of Squares. Defining Functions. Closed-Form Expression for SQ(n)

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Induction. Announcements. Overview. Defining Functions. Sum of Squares. Closed-form expression for SQ(n) There have been some corrections to A1

Mathematical Induction. Rosen Chapter 4.1,4.2 (6 th edition) Rosen Ch. 5.1, 5.2 (7 th edition)

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 3

At the start of the term, we saw the following formula for computing the sum of the first n integers:

THE ISLAMIC UNIVERSITY OF GAZA ENGINEERING FACULTY DEPARTMENT OF COMPUTER ENGINEERING DISCRETE MATHMATICS DISCUSSION ECOM Eng. Huda M.

MODEL ANSWERS TO THE THIRD HOMEWORK. 1. We prove this result by mathematical induction. Let P (n) be the statement that

Chapter 2 Section 2.1: Proofs Proof Techniques. CS 130 Discrete Structures

EECS 1028 M: Discrete Mathematics for Engineers

Mathematical Induction. How does discrete math help us. How does discrete math help (CS160)? How does discrete math help (CS161)?

Note that r = 0 gives the simple principle of induction. Also it can be shown that the principle of strong induction follows from simple induction.

Outline. We will cover (over the next few weeks) Induction Strong Induction Constructive Induction Structural Induction

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 1

COMP232 - Mathematics for Computer Science

INDUCTION AND RECURSION. Lecture 7 - Ch. 4

Induction 1 = 1(1+1) = 2(2+1) = 3(3+1) 2

Mathematical Induction. EECS 203: Discrete Mathematics Lecture 11 Spring

Chapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms

Mathematical Fundamentals

Discrete Mathematics for CS Spring 2008 David Wagner Note 4

Discrete Mathematics, Spring 2004 Homework 4 Sample Solutions

MATH 215 Final. M4. For all a, b in Z, a b = b a.

CSCE 222 Discrete Structures for Computing

Carmen s Core Concepts (Math 135)

n(n + 1). 2 . If n = 3, then 1+2+3=6= 3(3+1) . If n = 2, then = 3 = 2(2+1)

Problem Set 5 Solutions

Discrete Mathematics. Spring 2017

ICS141: Discrete Mathematics for Computer Science I

Induction and recursion. Chapter 5

With Question/Answer Animations

Discrete Mathematics. Spring 2017

Mathematical Induction. Defining Functions. Overview. Notation for recursive functions. Base case Sn(0) = 0 S(n) = S(n 1) + n for n > 0

Math 242: Principles of Analysis Fall 2016 Homework 1 Part B solutions

CS1800: Mathematical Induction. Professor Kevin Gold

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Induction and recursion. Topics. Induction and Recursion Vojislav Kecman CMSC 302

Mathematical Reasoning Rules of Inference & Mathematical Induction. 1. Assign propositional variables to the component propositional argument.

MATH 55 - HOMEWORK 6 SOLUTIONS. 1. Section = 1 = (n + 1) 3 = 2. + (n + 1) 3. + (n + 1) 3 = n2 (n + 1) 2.

Lecture 4: Probability, Proof Techniques, Method of Induction Lecturer: Lale Özkahya

Fall 2017 Test II review problems

Mathematical Induction

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

We want to show P (n) is true for all integers

1 Examples of Weak Induction

Induction and Recursion

Math 3000 Section 003 Intro to Abstract Math Homework 6

What can you prove by induction?

Lecture 6 : Induction DRAFT

PRINCIPLE OF MATHEMATICAL INDUCTION

e π i 1 = 0 Proofs and Mathematical Induction Carlos Moreno uwaterloo.ca EIT-4103 e x2 log k a+b a + b

Discrete Math, Spring Solutions to Problems V

PRINCIPLE OF MATHEMATICAL INDUCTION

Proof Terminology. Technique #1: Direct Proof. Learning objectives. Proof Techniques (Rosen, Sections ) Direct Proof:

n n P} is a bounded subset Proof. Let A be a nonempty subset of Z, bounded above. Define the set

Course: CS1050c (Fall '03) Homework2 Solutions Instructor: Prasad Tetali TAs: Kim, Woo Young: Deeparnab Chakrabarty:

Induction. Induction. Induction. Induction. Induction. Induction 2/22/2018

Mathematical Induction

Section 4.2: Mathematical Induction 1

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 3

Mathematical Induction

Climbing an Infinite Ladder

3.1 Induction: An informal introduction

CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction. Linda Shapiro Spring 2016

Reading 5 : Induction

Mathematical Structures Combinations and Permutations

Number Theory and Graph Theory

Solution Set 2. Problem 1. [a] + [b] = [a + b] = [b + a] = [b] + [a] ([a] + [b]) + [c] = [a + b] + [c] = [a + b + c] = [a] + [b + c] = [a] + ([b + c])

CISC-102 Fall 2017 Week 3. Principle of Mathematical Induction

Discrete Mathematics & Mathematical Reasoning Induction

CSC236H Lecture 2. Ilir Dema. September 19, 2018

S15 MA 274: Exam 3 Study Questions

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

Math.3336: Discrete Mathematics. Mathematical Induction

CSE 311: Foundations of Computing. Lecture 14: Induction

Sums and Products. a i = a 1. i=1. a i = a i a n. n 1

Sequences & Mathematical Induction

PUTNAM TRAINING MATHEMATICAL INDUCTION. Exercises

Proofs Not Based On POMI

MATH 301 INTRO TO ANALYSIS FALL 2016

21 Induction. Tom Lewis. Fall Term Tom Lewis () 21 Induction Fall Term / 14

Discrete Structures: Sample Questions, Exam 2, SOLUTIONS

CS173 Lecture B, September 10, 2015

1. Introduction to commutative rings and fields

Complete Induction and the Well- Ordering Principle

Proof Techniques (Review of Math 271)

Another Proof By Contradiction: 2 is Irrational

Section Summary. Proof by Cases Existence Proofs

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive

CS2800 Questions selected for fall 2017

CHAPTER 4 SOME METHODS OF PROOF

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Discrete Mathematics & Mathematical Reasoning Induction

Transcription:

CSCE 222 Discrete Structures for Computing Proof by Induction Dr. Hyunyoung Lee Based on slides by Andreas Klappenecker 1

Motivation Induction is an axiom which allows us to prove that certain properties are true for all positive integers (or for all nonnegative integers, or all integers >= some fixed number) 2

Induction Principle Let A(n) be an assertion concerning the integer n. If we want to show that A(n) holds for all positive integer n, we can proceed as follows: Induction basis: Show that the assertion A(1) holds. Induction step: For all positive integers n, show that A(n) implies A(n+1). 3

Standard Example For all positive integers n, we have A(n): 1+2+...+n = n(n+1)/2 Induction basis: Since 1 = 1(1+1)/2, the assertion A(1) is true. Induction step: Suppose that A(n) holds. Then 1+2+...+n+(n+1) = n(n+1)/2 + n+1 = (n 2 + n+2n+2)/2 = (n+1)(n+2)/2, hence A(n+1) holds. Therefore, the claim follows by induction on n. 4

The Main Points We established in the induction basis that the assertion A(1) is true. We showed in the induction step that A(n+1) holds, assuming that A(n) holds. In other words, we showed in the induction step that A(n)->A(n+1) holds for all n >= 1. 5

Example 2 Theorem: For all positive integers n, we have 1+3+5+...+(2n-1) = n 2 Proof. We prove this by induction on n. Let A(n) be the assertion of the theorem. Induction basis: Since 1 = 1 2, it follows that A(1) holds. Induction step: Suppose that A(n) holds. Then 1+3+5+...+(2n-1)+(2n+1) = n 2 +2n+1 = (n+1) 2 holds. In other words, A(n) implies A(n+1). 6

Quiz Theorem: We have 1 2 + 2 2 +... + n 2 = n(n+1)(2n+1)/6 for all n >= 1. Proof. Your turn Let B(n) denote the assertion of the theorem. Induction basis: Since 1 2 = 1(1+1)(2+1)/6, we can conclude that B(1) holds. 7

Quiz Inductive step: Suppose that B(n) holds. Then 1 2 + 2 2 +... + n 2 + (n+1) 2 = n(n+1)(2n+1)/6 + (n+1) 2 Factoring out (n+1) on the right hand side yields (n+1)(n(2n+1)+6(n+1))/6 = (n+1)(2n 2 +7n+6)/6 One easily verifies that this is equal to (n+1)((n+1)+1)(2(n+1)+1)/6 Thus, B(n+1) holds. Therefore, the claim follows by induction on n. 8

Tip How can you verify whether your algebra is correct? Use http://www.wolframalpha.com [Not allowed in any exams, though. Sorry] 9

What s Wrong? 10

Billiard Balls Theorem : All billiard balls have the same color. Proof: By induction, on the number of billiard balls. Induction basis: Our theorem is certainly true for n=1. What s wrong? Induction step: Assume the theorem holds for n billiard balls. We prove it for n+1. Look at the first n billiard balls among the n+1. By induction hypothesis, they have the same color. Now look at the last n billiard balls. They have the same color. Hence all n+1 billiard balls have the same color. 11

Weird Properties of Positive Integers Theorem : For all positive integers n, we have n=n+1. Proof : Suppose that the claim is true for n=k. Then k+1 = (k) + 1 = (k+1) + 1 by induction hypothesis. Thus, k+1=k+2. What s wrong? Therefore, the theorem follows by induction on n. 12

Maximally Weird Theorem : For all positive integers n, if a and b are positive integers such that max{a,b}=n, then a=b. Proof: By induction on n. The result holds for n = 1, i.e., if max {a, b} = 1, then a = b = 1. Suppose it holds for n, i.e., if max {a,b} = n, then a = b. Now consider max {a, b} = n + 1. Case 1: a 1 b 1. Then a b. Hence a=max{a,b}=n+1. Thus a 1 = n and max {a 1, b 1} = n. By induction hypothesis, a 1=b 1. Hence a=b. Case 2: b 1 a 1. Same argument. 13

Maximally Weird Fallacy: In the proof we used the inductive hypothesis to conclude max {a 1, b 1} = n a 1 = b 1. However, we can only use the inductive hypothesis if a 1 and b 1 are positive integers. This does not have to be the case as the example b=1 shows. 14

More Examples 15

Factorials Theorem. nx i=0 i(i) = (n + 1) 1. By convention: 0 = 1 Induction basis: Since 0 = 1 1, the claim holds for n =0. Induction Step: Suppose the claim is true for n.then n+1 X nx i(i) = (n + 1)(n + 1) + i(i) i=0 i=0 = (n + 1)(n + 1) + (n + 1) 1byind.hyp. = (n + 2)(n + 1) 1 = (n + 2) 1 16

Divisibility Theorem: For all positive integers n, the number 7 n -2 n is divisible by 5. Proof: By induction. Induction basis. Since 7-2=5, the theorem holds for n=1. 17

Divisibility Inductive step: Suppose that 7 n -2 n is divisible by 5. Our goal is to show that this implies that 7 n+1-2 n+1 is divisible by 5. We note that 7 n+1-2 n+1 = 7x7 n -2x2 n = 5x7 n +2x7 n -2x2 n = 5x7 n +2(7 n -2 n ). By induction hypothesis, (7 n -2 n ) = 5k for some integer k. Hence, 7 n+1-2 n+1 = 5x7 n +2x5k = 5(7 n +2k), so 7 n+1-2 n+1 =5 x some integer. Thus, the claim follows by induction on n. 18

Strong Induction 19

Strong Induction Suppose we wish to prove a certain assertion concerning positive integers. Let A(n) be the assertion concerning the integer n. To prove it for all n >= 1, we can do the following: 1) Prove that the assertion A(1) is true. 2) Assuming that the assertions A(k) are proved for all k<n, prove that the assertion A(n) is true. We can conclude that A(n) is true for all n>=1. 20

Strong Induction Induction basis: Show that A(1) is true. Induction step: Show that (A(1) A(2)... A(n)) A(n+1) holds for all n >=1. strong induction hypothesis 21

Postage Theorem: Every amount of postage that is at least 12 cents can be made from 4 and 5 stamps. 22

Postage Proof by induction on the amount of postage. Induction Basis: If the postage is 12 : use three 4 and zero 5 stamps (12=3x4+0x5) 13 : use two 4 and one 5 stamps (13=2x4+1x5) 14 : use one 4 and two 5 stamps (14=1x4+2x5) 15 : use zero 4 and three 5 stamps (15=0x4+3x5) (Not part of induction basis, but let us try some more) 16 : use (three+one) 4 and zero 5 stamps ((3+1)x4+0x5) 17 : use (two+one) 4 and one 5 stamps ((2+1)x4+1x5) 18 : use (one+one) 4 and two 5 t stamps ((1+1)x4+2x5) 19 : use (zero+one) 4 and three 5 stamps ((0+1)x4+3x5) 20 : use (three+two) 4 and zero 5 stamps ((3+2)x4+0x5)... 23

Postage Inductive step: Suppose that we have shown how to construct postage for every value from 12 up through k. We need to show how to construct k + 1 cents of postage. Since we ve already proved the induction basis, we may assume that k + 1 16. Since k+1 16, we have (k+1) 4 12. By inductive hypothesis, we can construct postage for (k + 1) 4 cents using m 4 stamps and n 5 stamps for some non-negative integers m and n. In other words ((k + 1) 4) = 4m + 5n; hence, k+1 = 4(m+1)+5n. 24

Quiz Why did we need to establish four cases in the induction basis? Isn t it enough to remark that the postage for 12 cents is given by three 4 cents stamps? 25

Another Example: Sequence Theorem: Let a sequence (a n ) be defined as follows: a 0 =1, a 1 =2, a 2 =3, a k = a k-1 +a k-2 +a k-3 for all integers k 3. Then a n 2 n for all integers n 0. P(n) Proof. Induction basis: The statement is true for n=0, since a 0 =1 1=2 0 P(0) for n=1: since a 1 =2 2=2 1 P(1) for n=2: since a 2 =3 4=2 2 P(2) 26

Sequence (cont d) Inductive step: (S.I.H.) Assume that P(i) is true for all i with 0 i<k, that is, a i 2 i for all 0 i<k, where k>2. Show that P(k) is true: a k 2 k 2 3 2 2 2 1 2 0 a k = a k-1 +a k-2 +a k-3 by def. of seq. 2 k-1 +2 k-2 +2 k-3 by S.I.H. 2 0 +2 1 + +2 k-3 +2 k-2 +2 k-1 1 0 0 0 2 = 8 10-1 2-1 10 1 1 1 2 = 7 10 = 2 k -1 2 k by understanding binary number system Thus, P(n) is shown true for all integers n 0 by strong induction. 27

Yet Another Example Sequence A sequence a 0, a 1, a 2,... is defined recursively as follows: a 0 = 0; a 1 = 1; a n = 5a n-1-6a n-2 for all n >= 2. Prove that for all non-negative integers n, a n = 3 n - 2 n : P(n) Proof. Induction basis: need to show P(0) and P(1) hold. P(0) holds since a 0 = 0 = 1-1 = 3 0-2 0 P(1) holds since a 1 = 1 = 3-2 = 3 1-2 1 28

Yet Another Example Sequence (Cont.) Inductive step: (S.I.H.) Assume that P(i) is true for all i with 0 i<n, that is, a i = 3 i - 2 i for all 0 i<n, where n>1. Show that P(n) is true: a n = 3 n - 2 n a n = 5a n-1-6a n-2 by def. of seq. = 5(3 n-1-2 n-1 ) - 6(3 n-2-2 n-2 ) by S.I.H. = (3+2)(3 n-1-2 n-1 ) - 3 2(3 n-2-2 n-2 ) = 3 3 n-1-3 2 n-1 + 2 3 n-1-2 2 n-1-2 3 3 n-2 + 3 2 2 n-2 = 3 3 n-1-2 2 n-1 = 3 n - 2 n Thus, P(n) is shown true for all integers n 0 by strong induction. 29