Mathematical Induction. Mathematical Induction is a technique for proving theorems Theorems are typically of the form P(n) is true for all positive integers.

Slides:



Advertisements
Similar presentations
Extensible Networking Platform CSE 240 – Logic and Discrete Mathematics Review: Mathematical Induction Use induction to prove that the sum of the.
Advertisements

THE WELL ORDERING PROPERTY Definition: Let B be a set of integers. An integer m is called a least element of B if m is an element of B, and for every x.
Mathematical Induction
PROOF BY CONTRADICTION
Review for CS1050. Review Questions Without using truth tables, prove that  (p  q)   q is a tautology. Prove that the sum of an even integer and an.
Recursive Definitions and Structural Induction
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
Induction and recursion
1.  The set N = {1,2,3,4,……..} is known as natural numbers or the set of positive integers  The natural numbers are used mainly for :  counting  ordering.
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
CSE115/ENGR160 Discrete Mathematics 03/22/12 Ming-Hsuan Yang UC Merced 1.
1 Section 3.3 Mathematical Induction. 2 Technique used extensively to prove results about large variety of discrete objects Can only be used to prove.
CSE115/ENGR160 Discrete Mathematics 03/29/11 Ming-Hsuan Yang UC Merced 1.
Mathematical Induction
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
Induction and recursion
Mathematical Induction Assume that we are given an infinite supply of stamps of two different denominations, 3 cents and and 5 cents. Prove using mathematical.
Mathematical Maxims and Minims, 1988
Lecture 9. Arithmetic and geometric series and mathematical induction
Induction and recursion
Chapter 6 Mathematical Induction
Discrete Mathematics, 1st Edition Kevin Ferland
Introduction to Proofs
Mathematical Induction. F(1) = 1; F(n+1) = F(n) + (2n+1) for n≥ F(n) n F(n) =n 2 for all n ≥ 1 Prove it!
1 Introduction to Abstract Mathematics Chapter 4: Sequences and Mathematical Induction Instructor: Hayk Melikya 4.1- Sequences. 4.2,
CSE 311: Foundations of Computing Fall 2013 Lecture 8: More Proofs.
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
9.4 Mathematical Induction
Chap 3 –A theorem is a statement that can be shown to be true –A proof is a sequence of statements to show that a theorem is true –Axioms: statements which.
Section 3.3: Mathematical Induction Mathematical induction is a proof technique that can be used to prove theorems of the form:  n  Z +,P(n) We have.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Mathematical Induction
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Mathematical Induction I Lecture 5: Sep 20 (chapter of the textbook and chapter of the course notes)
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach a particular.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
Mathematical Induction
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Fall 2002CMSC Discrete Structures1 Chapter 3 Sequences Mathematical Induction Recursion Recursion.
3.3 Mathematical Induction 1 Follow me for a walk through...
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
Mathematical Induction. The Principle of Mathematical Induction Let S n be a statement involving the positive integer n. If 1.S 1 is true, and 2.the truth.
CSE15 Discrete Mathematics 03/22/17
Advanced Algorithms Analysis and Design
Chapter 3 The Real Numbers.
Induction and recursion
Mathematical Induction Recursion
Chapter 5 Induction and Recursion
Proofs, Recursion and Analysis of Algorithms
CS201: Data Structures and Discrete Mathematics I
Induction and recursion
Follow me for a walk through...
Section 2.1 Proof Techniques Introduce proof techniques:   o        Exhaustive Proof: to prove all possible cases, Only if it is about a.
Applied Discrete Mathematics Week 9: Integer Properties
Follow me for a walk through...
Induction Chapter
Advanced Analysis of Algorithms
Mathematical Induction
Mathematical Induction
Follow me for a walk through...
Presentation transcript:

Mathematical Induction

Mathematical Induction is a technique for proving theorems Theorems are typically of the form P(n) is true for all positive integers n where P(n) is a propositional function Mathematical Induction

Proof by Mathematical Induction that P(n) is true for every positive integer n consists of three steps 0. State the proposition to be proved Let P(n) be the proposition that … 1. Basis Step. Show that P(1) is true (or P(0) or …) 2. Inductive Step. Prove P(n) P(n+1) is true for all positive n The statement P(n) is called the inductive hypothesis Expressed as a rule of inference, Mathematical Induction can be stated as Mathematical Induction

The Principle of Mathematical Induction show that P(n) is true when n 1, i.e. P(1) is true show that P(n) P(n+1) for all n > 0 show that P(n+1) cannot be false when P(n) is true do this as follows assume P(n) true (i.e. assume our inductive hypothesis) under this hypothesis that P(n) is true show that P(n+1) is also true (may resort to our hypothesis) Since P(1) is true and the implication P(n) P(n+1) is true for all positive integers, the principle of mathematical induction shows that P(n) is true for all positive integers

An ExampleProve, using Mathematical Induction, that the sum of the first n odd integers is n 2 Let P(n) denote the proposition that the sum of the first n odd integers is n 2 Basis Step P(1), the sum of the first odd integer, is 1 2 this is true, since 1 2 = 1 Inductive Step show that P(n) P(n+1) for all n > 0 assume P(n) is true for a positive integer n i.e … + (2n -1) = n 2 note: 2n - 1 is the nth odd number! show P(n+1) is true assuming P(n) is true assuming P(n) true, then … + 2n-1 + (2(n + 1) - 1) where (2(n + 1) - 1) is the n+1 th odd number = n 2 + (2(n + 1 )-1) // resorting to our inductive hypothesis = n 2 + 2n + 1 = (n+1) 2 Since P(1) is true and the implication P(n) P(n+1) is true for all +ve n, the principle of MathInd shows that P(n) is true for all +ve integers

A Bad ExampleWhats wrong with this? Let P(n) denote the proposition that the sum of the first n odd integers is n 2 Basis Step P(1) = 1 2 = 1. Therefore P(1) is true. Inductive Step show that P(n) P(n+1) for all n > 0 assume P(n) is true for a positive integer n i.e. P(n) = … + (2n -1) = n 2 show P(n+1) is true assuming P(n) is true assuming P(n) true, P(n+1) is then P(n+1) = … + 2n-1 + (2(n + 1) - 1) = n 2 + 2n + 1 = (n+1) 2 Since P(1) is true and the implication P(n) P(n+1) is true for all +ve n, the principle of MathInd shows that P(n) is true for all +ve integers What is P(n) ?

An Example Let P(n) denote the proposition 3 n 3 - n Basis Step P(1) is true, since = 0, and that is divisible by 3 Inductive Step assume P(n) is true i.e. 3|(n 3 - n) show P(n + 1) is true assuming P(n) is true, i.e 3|((n + 1) 3 - (n + 1)) (n + 1) 3 - (n + 1) = n 3 + 3n 2 + 3n (n + 1) = n 3 + 3n 2 + 2n = (n 3 - n) + 3n 2 + 3n Note trick = (n 3 - n) + 3(n 2 + n) 3|(n 3 - n) due to our assumption P(n) and … 3|3(n 2 + n) because it is of the form 3k we know if a|b and a|c then a|(b+c) We proved this consequently 3|((n 3 - n) + 3(n 2 + n)) By the principle of mathematical induction n 3 - n is divisible by 3 when n is positive

Let P(n) denote the proposition If n is greater than 11 then n can be expressed as 4p + 5q, where p and q are positive Basis Step P(12) is true, since 12 = 4x3 + 5x0 NOTE: we started at 12, since P(n) is defined only for n > 11 Inductive Step assume P(n) is true and prove P(n+1) We use a proof by cases if p > 0 and q > 0 then decrement p and increment q to get 1 more if p > 0 and q = 0 then decrement p and increment q to get 1 more if p = 0 and q > 0 then q must be at least 3, because n is at least 11 therefore 5q is at least 15 decrement q by 3 and increment p by 4 to get 1 more this covers all the cases where we want to increment n by 1 Therefore, by the principle of mathematical induction we have proved that any integer greater than 11 can be expressed as 4p + 5q

Therefore, by the principle of mathematical induction we have proved that any integer greater than 11 can be expressed as 4p + 5q If a countrys cheapest postage cost is 12 pence then 4 penny and 5 penny stamps will allow us to send any parcel/letter within the country Could you imagine a similar type of problem with delivering change from a vending machine?

Your Example Let P(n) denote the proposition The sum of the first n positive integers, Sum(n), is n(n+1)/2 Basis Step Inductive Step Since P(1) is true and the implication P(n) P(n+1) is true for all positive integers, the principle of mathematical induction shows that P(n) is true for all positive integers

Your Example Let P(n) denote the proposition The sum of the first n positive integers is n(n+1)/2 Basis Step P(1) is true, since 1(1+1)/2 = 1 Inductive Step assume P(n) is true, i.e … + n = n(n+1)/2 show P(n+1) is true assuming P(n) is true, i.e … + n + (n+1) = (n + 1)(n + 2)/2 using the inductive hypothesis P(n) it follows that … + n + (n+1) = n(n + 1)/2 + (n + 1) = (n 2 + n + 2n + 2)/2 = (n 2 + 3n + 2)/2 = (n + 1)(n + 2)/2 Therefore P(n+1) follows from P(n) This completes the inductive proof

Our Example Let P(n) denote the proposition A set S has 2 n subsets, where n is the cardinality of S Basis Step Inductive Step Since P(0) is true and the implication P(n) P(n+1) is true for all positive integers, the principle of mathematical induction shows that P(n) is true for all positive integers

Our Example Let P(n) denote the proposition A set S has 2 n subsets, where n is the cardinality of S Basis Step P(0) is true, since the only subset of the empty set is the empty set {} Inductive Step assume P(n) is true show P(n + 1) is true assuming P(n) is true Create a new set T = S {e}, where e is not already in S of the 2 n subsets of S we can have each of those subsets with element e or without element e therefore we have twice as many subsets of T as of S therefore the number of subsets of T is 2(2 n ) = 2 (n+1) This shows that P(n+1) is true when P(n) is true, and completes the inductive step. Hence, it follows that a set of size n has 2 n subsets

Example

Basis Step P(0) is true, since ar 0 = (ar a)/(r - 1) = a(r - 1)/(r - 1) = a Inductive Step assume P(n) true and P(n + 1) follows, therefore Since P(0) is true and the implication P(n) P(n+1) is true for all positive integers, the principle of mathematical induction shows that P(n) is true for all positive integers

Mathematical Induction Used frequently in CS when analysing the complexity of an algorithm or section of code. When we have a loop, such as for i from 1 to n do

Bubble Sort for i := 1 to n do for j := 1 to n-i do if s[j] > s[j+1] // * then swap(s,j,j+1) // * Assume we have an array s to be sorted into non-decreasing order how many times is the section * executed for a given size of array Bubble sort?

Bubble Sort for i := 1 to n do for j := 1 to n-i do if s[j] > s[j+1] // * then swap(s,j,j+1) // * Assume we have an array s to be sorted into non-decreasing order What is bubble sort? index content n = 7 i = 1 (first time) j = 1 to 6 first compares s[1] with s[2], and swaps s[1] and s[2] then compares s[2] with s[3], and swaps s[2] with s[3] … finally compares s[6] with s[7] n = 7 i = 2 (second time) j = 1 to 5 first compares s[1] with s[2], … finally compares s[5] with s[6] n = 7 i = 3 (third time) j = 1 to 4 first compares s[1] with s[2], … finally compares s[4] with s[5]

Bubble Sort for i := 1 to n do for j := 1 to n-i do if s[j] > s[j+1] // * then swap(s,j,j+1) // * inner loop executes * n-i times, for each i outer loop executes inner loop n times What s bubble sorts complexity ?

Bubblesort demo in java? Find the jdk? sortDemo..\..\..\j2sdk1.4.2_05\demo\applets\SortDemo\example1.html

Reading Please read the following before the next tutorial Recursive definitions and structural induction recursively defined functions recursively defines sets and structures