Lecture 4,5 Mathematical Induction and Fibonacci Sequences.

Slides:



Advertisements
Similar presentations
Mathematical Induction
Advertisements

Recursive Definitions and Structural Induction
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Induction and Recursion. Odd Powers Are Odd Fact: If m is odd and n is odd, then nm is odd. Proposition: for an odd number m, m k is odd for all non-negative.
10.1 CompSci 102© Michael Frank Today’s topics RecursionRecursion –Recursively defined functions –Recursively defined sets –Structural Induction Reading:
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
CSE115/ENGR160 Discrete Mathematics 04/03/12 Ming-Hsuan Yang UC Merced 1.
Recursive Definitions Rosen, 3.4. Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
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/31/11
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.
1 Strong Mathematical Induction. Principle of Strong Mathematical Induction Let P(n) be a predicate defined for integers n; a and b be fixed integers.
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 by: Mohsin tahir (GL) Numan-ul-haq Waqas akram Rao arslan Ali asghar.
Induction and recursion
Applied Discrete Mathematics Week 9: Relations
Mathematical Maxims and Minims, 1988
Lecture 9. Arithmetic and geometric series and mathematical induction
Induction and recursion
Chapter 6 Mathematical Induction
Chapter 4: Induction and Recursion
CSE 311 Foundations of Computing I Lecture 15 Recursive Definitions and Structural Induction Autumn 2011 CSE 3111.
Section 5.3. Section Summary Recursively Defined Functions Recursively Defined Sets and Structures Structural Induction.
INDUCTION AND RECURSION. PRINCIPLE OF MATHEMATICAL INDUCTION To prove that P(n) is true for all positive integers n, where P(n) is a propositional function,
Chapter 5 With Question/Answer Animations. Section 5.1.
Time Complexity of Algorithms (Asymptotic Notations)
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.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
1 Recursive Definitions and Structural Induction CS 202 Epp section ??? Aaron Bloomfield.
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
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.
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 ( الاستقراء الرياضي )
Advanced Algorithms Analysis and Design
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
Section Recursion 2  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
Section Recursion  Recursion – defining an object (or function, algorithm, etc.) in terms of itself.  Recursion can be used to define sequences.
CSE 311 Foundations of Computing I Lecture 15 Strong Induction and Recursive Definitions Spring
Mathematical Induction And Recursion Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
Mathematical Induction I Lecture 19 Section 4.2 Mon, Feb 14, 2005.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
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.
Chapter 4: Induction and Recursion
CMSC Discrete Structures
Advanced Algorithms Analysis and Design
Induction and recursion
Induction and Recursion
Use mathematical induction to prove that the formula is true for all natural numbers m. {image} Choose the first step of the proof from the following:
Mathematical Induction Recursion
Chapter 5 Induction and Recursion
BaSIC Math Reviews.
Induction and recursion
Applied Discrete Mathematics Week 9: Integer Properties
CMSC Discrete Structures
Applied Discrete Mathematics Week 7: Computation
1A Recursively Defined Functions
Advanced Analysis of Algorithms
CMSC Discrete Structures
Mathematical Induction
Mathematical Induction
Lecture 3.1: Mathematical Induction
Recursion.
Presentation transcript:

Lecture 4,5 Mathematical Induction and Fibonacci Sequences

Mathematical induction is a powerful, yet straight- forward method of proving statements whose domain is a subset of the set of integers. Usually, a statement that is proven by induction is based on the set of natural numbers. This statement can often be thought of as a function of a number n, where n = 1, 2, 3,... Proof by induction involves three main steps –Proving the base of induction –Forming the induction hypothesis –Proving that the induction hypothesis holds true for all numbers in the domain. What is Mathematical Induction? mashhoood.webs.com2

Let P(n) be the predicate defined for any positive integers n, and let n 0 be a fixed integer. Suppose the following two statements are true 1.P(n 0 ) is true. 2.For any positive integers k, k  n 0, 3. if P(k) is true then P(k+1)is true. If the above statements are true then the statement:  n  N, such that n  n 0, P(n) is also true What is Mathematical Induction? mashhoood.webs.com3

Claim: P(n) is true for all n  Z +, for n  n 0 1.Basis –Show formula is true when n = n 0 2.Inductive hypothesis –Assume formula is true for an arbitrary n = k where, k  Z + and k  n 0 3.To Prove Claim –Show that formula is then true for k+1 Note: In fact we have to prove 1)P(n 0 ) and 2)P(k)  P(k+1) Steps in Proving by Induction mashhoood.webs.com4

Example 1 Prove that n 2  n  n  11 Solution Let P(n)  n 2  n  n  11 1.P(11)  11 2   121  111, true 2.Suppose predicate is true for n = k, i.e. P(k)  k 2  k + 100, truek  11 3.Now it can be proved that P(k+1)  (k+1) 2  (k+1) + 100, Ûk 2 + 2k +1  k  k 2 + k  100 (by 1 and 2) Hence P(k)  P(K+1) Proof by Induction mashhoood.webs.com5

Example 1 Prove that n 2  n  n  11 Solution Initially, base case Solution set = {11} By, P(k)  P(K+1)  P(11)  P(12), taking k = 11 Solution set = {11, 12} Similarly, P(12)  P(13), taking k = 12 Solution set = {11, 12, 13} And, P(13)  P(14), taking k = 13 Solution set = {11, 12, 13, 14} And so on Validity of Proof mashhoood.webs.com6

Reasoning of Proof Example 2 Use Mathematical Induction to prove that sum of the first n odd positive integers is n 2. Proof Let P(n) denote the proposition that Basis step : P(1) is true, since 1 = 1 2 Inductive step : Let P(k) is true for a positive integer k, i.e., …+(2k-1) = k 2 Note that: …+(2k-1)+(2k+1) = k 2 +2k+1= (k+1) 2 ∴ P(k+1) true, by induction, P(n) is true for all n  Z + Another Proof Another Easy Example mashhoood.webs.com7

Reasoning of Proof Example 3 Use mathematical Induction to prove that n < 2 n for all n  Z + Proof Let P(n) be the proposition that n < 2 n Basis step : P(1) is true since 1 < 2 1. Inductive step : Assume that P(n) is true for a positive integer n = k, i.e., k < 2 k. Now consider for P(k+1) : Since, k + 1 < 2 k + 1  2 k + 2 k = 2.2 k = 2 k + 1 ∴ P(k+1) is true. It proves that P(n) is true for all n  Z +. mashhoood.webs.com8

The harmonic numbers H k, k = 1, 2, 3, …, are defined by Use mathematical induction to show that Proof Let P(n) be the proposition that Basis step : P(0) is true, since, Inductive step Assume that P(k) is true for some k, whenever n is a nonnegative integer. Example 4: Harmonic Numbers mashhoood.webs.com9

∴ P(k+1) is true. Hence the statement is true for all n  Z +. Now consider Example 4: Harmonic Numbers mashhoood.webs.com10

Fibonacci Sequences Dr Nazir A. Zafar Advanced Algorithms Analysis and Design

In this lecture we will cover the following: Fibonacci Problem and its Sequence Construction of Mathematical Model Recursive Algorithms Generalizations of Rabbits Problem and Constructing its Mathematical Models Applications of Fibonacci Sequences Today Covered mashhoood.webs.com12

By studying Fibonacci numbers and constructing Fibonacci sequence we can imagine how mathematics is connected to apparently unrelated things in this universe. Even though these numbers were introduced in 1202 in Fibonacci’s book Liber abaci. Fibonacci, who was born Leonardo da Pisa gave a problem in his book whose solution was the Fibonacci sequence as we will discuss it today. Fibonacci Sequence mashhoood.webs.com13

Statement: Start with a pair of rabbits, one male and one female, born on January 1. Assume that all months are of equal length and that rabbits begin to produce two months after their own birth. After reaching age of two months, each pair produces another mixed pair, one male and one female, and then another mixed pair each month, and no rabbit dies. How many pairs of rabbits will there be after one year? Answer: The Fibonacci Sequence! 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144,... Fibonacci’s Problem mashhoood.webs.com14

Construction of Mathematical Model mashhoood.webs.com15

Total pairs at level k = Total pairs at level k-1 + Total pairs born at level k (1) Since Total pairs born at level k = Total pairs at level k-2 (2) Hence by equation (1) and (2) Total pairs at level k = Total pairs at level k-1 + Total pairs at level k-2 Now let us denote F k = Total pairs at level k Now our recursive mathematical model will become F k = F k-1 + F k-2 Construction of Mathematical Model mashhoood.webs.com16

Since F k = F k-1 + F k-2 F 0 = 0, F 1 = 1 F 2 = F 1 + F 0 = = 1 F 3 = F 2 + F 1 = = 2 F 4 = F 3 + F 2 = = 3 F 5 = F 4 + F 3 = = 5 F 6 = F 5 + F 4 = = 8 F 7 = F 6 + F 5 = = 13 F 8 = F 7 + F 6 = = 21 F 9 = F 8 + F 7 = = 34 F 10 = F 9 + F 8 = = 55 F 11 = F 10 + F 9 = = 89 F 12 = F 11 + F 10 = = Computing Values using Mathematical Model mashhoood.webs.com17

Theorem: The fibonacci sequence F 0,F 1, F 2,…. Satisfies the recurrence relation Find the explicit formula for this sequence. Solution: Let t k is solution to this, then characteristic equation The given fibonacci sequence Explicit Formula Computing Fibonacci Numbers mashhoood.webs.com18

Fibonacci Sequence For some real C and D fibonacci sequence satisfies the relation mashhoood.webs.com19

Fibonacci Sequence Dr Nazir A. Zafar Advanced Algorithms Analysis and Design mashhoood.webs.com20

After simplifying we get which is called the explicit formula for the Fibonacci sequence recurrence relation. Fibonacci Sequence mashhoood.webs.com21

Example: Compute F 3 Verification of the Explicit Formula mashhoood.webs.com22

Fibo-R(n) if n = 0 then 0 if n = 1 then 1 else Fibo-R(n-1) + Fibo-R(n-2) Recursive Algorithm Computing Fibonacci Numbers Terminating conditions Recursive calls mashhoood.webs.com23

Least Cost: To find an asymptotic bound of computational cost of this algorithm. Running Time of Recursive Fibonacci Algorithm mashhoood.webs.com24

Recursion Tree Drawback in Recursive Algorithms F(n) F(n-1)F(n-2) F(0)F(1) F(n-2)F(n-3) F(n-4) F(1)F(0) mashhoood.webs.com25

Statement: Start with a pair of rabbits, one male and one female, born on January 1. Assume that all months are of equal length and that rabbits begin to produce two months after their own birth. After reaching age of two months, each pair produces two other mixed pairs, two male and two female, and then two other mixed pair each month, and no rabbit dies. How many pairs of rabbits will there be after one year? Answer: Generalization of Fibonacci Sequence! 0, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683,... Generalization of Rabbits Problem mashhoood.webs.com26

Construction of Mathematical Model mashhoood.webs.com27

Total pairs at level k = Total pairs at level k-1 + Total pairs born at level k (1) Since Total pairs born at level k = 2 x Total pairs at level k-2 (2) By (1) and (2), Total pairs at level k = Total pairs at level k x Total pairs at level k-2 Now let us denote F k = Total pairs at level k Our recursive mathematical model: F k = F k F k-2 General Model (m pairs production): F k = F k-1 + m.F k-2 Construction of Mathematical Model mashhoood.webs.com28

Recursive mathematical model (one pair production) F k = F k-1 + F k-2 Recursive mathematical model (two pairs production) F k = F k F k-2 Recursive mathematical model (m pairs production) F k = F k-1 + m.F k-2 Generalization mashhoood.webs.com29

Since F k = F k F k-2 F 0 = 0, F 1 = 1 F 2 = F F 0 = = 1 F 3 = F F 1 = = 3 F 4 = F F 2 = = 5 F 5 = F F 3 = = 11 F 6 = F 5 + F 4 = = 21 F 7 = F 6 + F 5 = = 43 F 8 = F 7 + F 6 = = 85 F 9 = F 8 + F 7 = = 171 F 10 = F 9 + F 8 = = 341 F 11 = F 10 + F 9 = = 683 F 12 = F 11 + F 10 = = Computing Values using Mathematical Model mashhoood.webs.com30

Statement: Start with a different kind of pair of rabbits, one male and one female, born on January 1. Assume all months are of equal length and that rabbits begin to produce three months after their own birth. After reaching age of three months, each pair produces another mixed pairs, one male and other female, and then another mixed pair each month, and no rabbit dies. How many pairs of rabbits will there be after one year? Answer: Generalization of Fibonacci Sequence! 0, 1, 1, 1, 2, 3, 4, 6, 9, 13, 19, 28, 41, 60,... Another Generalization of Rabbits Problem mashhoood.webs.com31

Construction of Mathematical Model mashhoood.webs.com32

Total pairs at level k = Total pairs at level k-1 + Total pairs born at level k (1) Since Total pairs born at level k = Total pairs at level k-3 (2) By (1) and (2) Total pairs at level k = Total pairs at level k-1 + Total pairs at level k-3 Now let us denote F k = Total pairs at level k This time mathematical model:F k = F k-1 + F k-3 Construction of Mathematical Model mashhoood.webs.com33

Since F k = F k-1 + F k-3 F 0 = 0, F 1 = F 2 = 1 F 3 = F 2 + F 0 = = 1 F 4 = F 3 + F 1 = = 2 F 5 = F 4 + F 2 = = 3 F 6 = F 5 + F 3 = = 4 F 7 = F 6 + F 4 = = 6 F 8 = F 7 + F 5 = = 9 F 9 = F 8 + F 6 = = 13 F 10 = F 9 + F 7 = = 19 F 11 = F 10 + F 8 = = 28 F 12 = F 11 + F 9 = = Computing Values using Mathematical Model mashhoood.webs.com34

Recursive mathematical model (one pair, production after three months) F k = F k-1 + F k-3 Recursive mathematical model (two pairs, production after three months) F k = F k F k-3 Recursive mathematical model (m pairs, production after three months) F k = F k-1 + m.F k-3 Recursive mathematical model (m pairs, production after n months) F k = F k-1 + m.F k-n More Generalization mashhoood.webs.com35

Fibonacci sequences Are used in trend analysis By some pseudorandom number generators Many plants show the Fibonacci numbers in the arrangements of the leaves around the stems. Seen in arrangement of seeds on flower heads Consecutive Fibonacci numbers give worst case behavior when used as inputs in Euclid’s algorithm. Applications of Fibonacci Sequences mashhoood.webs.com36