SCNC1111 Scientific Method and Reasoning
Part II a: Quantitative Reasoning: Mathematics
Lecture 6
Difference Equations
26th, 30th September 2014
3rd October 2014
Dr. Rachel Lui
Rabbits
2
kunoshima The hundreds of rabbits found on the island today
are thought to be descendants of eight rabbits released by schoolchildren in 1971.
3
Problem of the Rabbits Leonardo Bonacci (c. 1170 c. 1250) known as
Fibonacci, and also Leonardo of Pisa introduced the famous Problem of the Rabbits in his masterpiece, the Liber Abaci (The book of Calculation or The Book of the Abacus).
4
Leonardo Fibonacci (1170-1250) Source: Wikimedia Commons
Problem of the Rabbits Initially there is a pair of baby rabbits one of each
gender.
Each month, a couple of baby rabbits will mature.
A couple of adult rabbits will produce a couple of baby rabbits.
Assume that the rabbits will never die. What is the total number of rabbit pairs after one year?
5
Problem of the Rabbits Number of pairs of baby Rabbits
Number of pairs of mature rabbits
Total number of pairs of rabbits
Start Jan 1 1 0 1
After 1 month Feb 1 0 1 1
After 2 months Mar 1 1 1 2
After 3 months Apr 1 1 2 3
After 4 months May 1 2 3 5
After 5 months Jun 1 3 5 8
After 6 months Jul 1 5 8 13
After 7 months Aug 1 8 13 21
After 8 months Sept 1 13 21 34
After 9 months Oct 1 21 34 55
After 10 months Nov 1 34 55 89
After 11 months Dec 1 55 89 144
After 1 year Jan 1 89 144 233
6
Problem of the Rabbits Starting from the rst month, the number of rabbit
pairs is:
1, 1, 2, 3, 5, 8, 13, 21, . . .
This pattern is the Fibonacci sequence, named after Fibonacci.
Note, however, the Fibonacci sequence have been known in India at least 500 years earlier.
7
Source: Wikimedia Commons
Notation We use 0 to denote the number of pairs of rabbits
at the start.
We use 1 to denote the number of pairs of rabbits after 1 month.
We use 2 to denote the number of pairs of rabbits after 2 months.
.
We use to denote the number of pairs of rabbits after months.
8
Problem of rabbits
9
It turns out that we have
+2 = +1 + ( 1), 1 = 2 = 1
Note: we may also write the equation as
= 1 + 2 ( 3).
Fibonacci Rabbits
Reason for the equation = 1 + 2
Recall that in month 2 , there are 2 pairs of rabbits.
In month 1 , all the 2 pairs of rabbits of the previous month will still be there, and they are all adults now. Any additional pairs of rabbits must be babies, produces by those adult rabbits of the previous month. Altogether there are 1 pairs of rabbits.
In month , all the 1 pairs of rabbits of the previous month will still be there. The additional rabbits are babies produced by the 2 adult pairs of the previous month, which means there are 2 pairs of baby rabbits, resulting in a total of = 1 + 2 pairs of rabbits.
10
Radioactive Decay
11
A half-life of a radioactive element is the time required for half of the atoms to decay.
The half-life of radioactive elements varies greatly. Light emission caused by radioactive decay Source: About.com Uranium-238 has a half-life of 4.5 billion years, making it a
candidate to measure the age of planets or even the universe.
Carbon-14 has a half-life of 5,730 years, and is frequently used to date ancient organic matters.
Polonium-214 has an extremely short half-life, about 160 microseconds, and it only appears as an immediate product of a series of radioactive decays.
Decay of Radium-226
The half-life of radium-226 is 1,600 years. If the current amount of radium-226 is 0, then
after one half-life, there will be only
1 = 0.50 left.
after two half-lives (i.e. 3,200 years), there will be just
2 = 0.51.
after three half-lives (i.e. 4,800 years), there will be just
3 = 0.52.
In general, the amount of radium-226 after half-lives satises the dierence equation
= 0.5 1
12
My breakfast
13
Half Life of Caffeine The half-life of caffeine the time required for the
body to eliminate one-half of the total amount of caffeine in your body.
In healthy adults, caffeine's half-life is roughly 37 hours.
Assume one drinks coffee at 9 a.m. and the half life of caffeine to be 6 hours, how much caffeine will be left in his or her body at 3 p.m.? What about 9 p.m.?
Can you formulate this scenario?
14
Bacteria Growth
Consider the question:
If in every minute, 75% bacteria reproduce but 20% bacteria die, how can we formulate this problem mathematically?
To formulate the problem, first let denote the bacteria population at time . Here is measured in numbers (of bacteria), and is measured in minutes.
If stands for the current bacteria population, then the total population in the next minute should be
+1 = + 0.75 0.2
= 1.55 .
The constant factor 1.55 in the above equation is the growth rate of the bacteria.
15
Population Control
16
To control the population of predators, the local government may issue license to kill a number of predators each year.
In Oregon, USA, totally 777 cougars are allowed to be hunted each year.
Suppose the natural growth rate of cougars is 1.7 per year. Then we have
Cougars Source: Wikimedia Commons
+1 = 1.7 777 where is the number of cougars in Oregon at year .
What you have learned Until now
1. you should be able to formulate a scenario
In case you dont understand, you are strongly advised to find anyone in the teaching team. You can also make a good use of the discussion forum. Your fellows would be happy to help.
17
What is a difference equation?
Denition
Let 1, 2, 3, be a sequence of numbers. A recurrence relation or dierence equation is an equation in which each further term is dened as a function of the preceding terms.
Examples
= 1 + 2 (Fibonacci)
+1 = 0.5 (Radioactive decay)
+1 = 1.55 (Bacterial growth)
+1 = 1.7 777 (Population Control)
18
Solution to a difference equation
What is the meaning of solving the following algebraic equation
3 2 = 7
where is an unknown?
19
Solution to a difference equation Solve +1 2 = 0.
Prove that = 2 is a solution of +1 2 = 0.
Is it the only solution?
We call any of the
= 3 2
= 4 2
= 1
5 2 etc.
the particular solution of +1 2 = 0.
We call = 2, where is an arbitrary
constant, the general solution.
20
Take-home exercises
Prove that = + is a solution of +1
2 2 = 1
where is a constant.
Prove that = 1 2
is a solution to the difference
equation
( + 1)+1+ = 2 3.
21
Exercises Prove that +1 1 = 0 has two particular
solutions = (1) and = 1.
Let 1 and 2 be two arbitrary constants. Prove that 1 (1)
+ 2 1 is also a solution to +1 1 =0.
We call 1 (1)+ 2 1 a linear combination of
(1) and 1.
22
What you have learned Until now
1. you should be able to formulate a scenario
2. you should understand what a particular solution and a general solution mean.
In case you dont understand, you are strongly advised to find anyone in the teaching team. You can also make a good use of the discussion forum. Your fellows would be happy to help.
23
Initial Conditions
With dierent initial values, the same dierence equation will give dierent sequences:
a) = 31 + 4 with 1 = 1 gives 1, 7, 25, 79, ...
= 31 + 4 with 1 = 0 gives 0, 4, 16, 52, ...
b) = 1 + 2 with 1 = 2 = 1 gives 1, 1, 2, 3, 5, 8,
= 1 + 2 with 1 = 1, 2 = 0 gives 1, 0, 1, 1, 2, 3, 5,
24
Initial conditions The initial conditions or initial values for a dierence
equation is an assignment of values to the rst terms of the sequence, so that we can deduce other terms using the dierence equation.
25
Initial conditions The difference equation +2 4+1 + 4 = 0
has the solution = 2(1 + 2) for any
constants 1 and 2.
Proof: +2 4+1 + 4 = 2+2 1 + 2 + 2
4 2+1 1 + 2 + 1
+4 2 1 + 2
= 0
For every pair of values of the constants 1 and 2, we found that there infinitely many solutions to +2 4+1 + 4 = 0. Therefore, you are given an initial conditions of the difference equations.
26
Example Solve +2 4+1 + 4 = 0 with initial
conditions 0 = 1 and 1 = 6.
We know that = 2(1 + 2) is a solution to the
difference equation.
Substituting = 0 and k = 1, we get 0 = 1and 1 = 2(1 + 2).
Hence 1 = 1 and 2 1 + 2 = 6, which implies 2 = 2.
Therefore = 2(1 + 2) is a particular solution.
27
Exercise We know that = 2
is the general solution to +1 2 = 0. Find a solution of the difference equation satisfying the initial condition 0 = 3.
28
What you have learned Until now
1. you should be able to formulate a scenario
2. you should understand what a particular solution and a general solution mean.
3. you should know what initial condition is and why it is important.
29
Order of a difference equation A rst order dierence equation is a recurrence
relation of the form = (, 1)
Example: = 31 + 4 is a rst order dierence equation.
A second order dierence equation is a recurrence relation of the form
= , 1, 2 Example: = 1 + 2
30
Examples
31
Difference equations Order?
= 12 + 3
= 32
+2 + 5+1 7 = 2
+2 + 5+1 = 2
+2 7 = 2
3+2 + 2+1 6 = 0
4+3 3+2 + 2
+1 = 1
Suppose a sequence of numbers 1, 2, 3, is given. = 11 + 22 + 3
Linear or non-linear? Denition
A -th order linear dierence equation is a dierence equation of the form
= 11 + 22 + + + +1
where 1, 2, , , +1 are constants.
32
Classification of difference equations
Difference equations Order? Linear or non-linear?
+1 3 + 1 = 2nd order Linear
+1 = 2 1st order Non-linear
+4 = 2 4th order Linear
+1 = 0.252 1st order Non-linear
+3 = cos 3rd order Non-linear
+2 + 3 1 +1
+ 1 = 0
2nd order Linear
33
Homogeneous or non-homogeneous?
Denition
A -th order homogeneous dierence equation is a dierence equation of the form
= 11 + 22 + +
where 1, 2, , are constants. It is homogeneous because the RHS does not have terms
involving (not even a nonzero constant term).
34
Exercises Difference equations Order? Linear or non-
linear? Homogeneous or
non-homogeneous?
= 1 where is a constant
1st order Linear Homogeneous
= 2 1 1st order Linear Homogeneous
+1 = 1.7 1st order Linear Homogeneous
= 1 1st order Linear Homogeneous
+1 = 1.7 777 1st order Linear Non-homogeneous
= 1 1st order Non-linear Homogeneous
35
Exercises
Difference equations Order Linear or non-linear Homogeneous or non-homogeneous
= 1 + 2
= 1 + 52 + 33
= 52
+ 4 2 = 0
+3 7+1 + 6 = 0
36
Classifications
37
Why do we need to classify all these equations?
Help you to find the right way to solve.
What you have learned Until now
1. you should be able to formulate a scenario
2. you should understand what a particular solution and a general solution mean.
3. you should know what initial condition is and why it is important.
4. you should be able to classify different types of difference equations.
38
Solving first order homogeneous linear difference equations Consider the general form of a first order
homogeneous linear difference equation
+1 = 1.55 (bacterial growth)
What if I want to find the population when = 24 ?
39
Bacteria Growth
If 0 denotes the initial value of at time = 0, then we have = 1.551
= 1.55 1.552
= 1.5522
= 1.552 1.553
= 1.5533
=
= 1.550
this dierence equation has a closed form solution =1.550.
40
Decay of Radium-226 In general, the amount of radium-226 after
half-lives satises the dierence equation = 0.5 1
It has a closed form formula = 0.5 0
In general, the closed form solution to = 1 is
= 0.
41
What you have learned Until now
1. you should be able to formulate a scenario
2. you should understand what a particular solution and a general solution mean.
3. you should know what initial condition is and why it is important.
4. you should be able to classify different types of difference equations.
5. you should be able to solve the first order linear homogeneous difference equation.
42
Solving higher order homogeneous linear difference equations
Consider the general form of a k-th order homogeneous linear difference equation
+ + 1+1 + + 1+1 + = 0 (*)
where 1, 2,, are known numbers.
For example, +3 6+2 + 3+1 + 2 = 0
Step 1: To find the general solution to (*), we build the characteristic equation
+ 11 + + 1 + = 0.
43
Characteristic Equations
Denition
For a homogeneous linear dierence equation
= 11 + 22 + + 1 +1 + ,
its characteristic polynomial equation is defined as the following equation with as variable:
= 11 + 2
2 + + 1 + .
Note: the characteristic equation can be rewritten as
11 2
2 = 0
44
Characteristic Equations
Examples
45
Difference equation Characteristic equation
= 1.55 1 = 1.55
= 1 + 2 2 = + 1
= 1 + 52 + 33 3 = 2 + 5 + 3
= 52 2 = 5
+ 4 2 = 0 2 + 4 = 0
+3 7+1 + 6 = 0 3 7 + 6 = 0
Procedure of Finding Closed Form Solution of Homogeneous Linear Difference Equations
Step 2: factorize the characteristic equation into linear factors
11 2
2
= 0
where 1, , are the distinct roots of the equation.
Note: Because the characteristic polynomial equation has degree , we will have 1 + 2 + + = .
46
Closed Form Solution of Homogeneous Linear Difference Equations
Find the closed form solution of +2 = 3+1 2.
Step 1: 2 = 3 2 2 3 + 2 = 0
Step 2: 1 2 = 0
Step 3: suppose and are the two roots of the characteristic equation 2 = 0. a) If then the closed form should be 1
+ 2 for
some constants 1, 2.
b) If = then the closed form should be 1 + 2
for some 1, 2.
47
Closed Form Solution of Homogeneous Linear Difference Equations
Example
Find the closed form solution of +2 = 3+1 2.
Step 1: 2 = 3 2 2 3 + 2 = 0
Step 2: 1 2 = 0
= 1 or = 2
Step 3: = 1(1)+2(2)
Step 4 : We can find 1 and 2 if the initial conditions are given.
48
Double Root Example
Example
Consider = 21 2 with initial conditions 1 = 2, 2 = 1.
The characteristic equation is 2 2 + 1 = 0, which has a double root 1. Thus the general closed form is
= 1 + 1, or = + .
From initial conditions 1 = 2, 2 = 1, we get 2 = + ,
1 = + 2.
Solution of this pair of equations is = 3, = 1.
Substitute these into the general closed form = + , we obtain = 3 .
49
Closed Form of the Fibonacci Sequence
Example
Solve = 1 + 2, 1 = 2 = 1
Step 1: The characteristic equation 2 1 = 0
Step 2: two distinct roots 1+ 5
2,
1 5
2.
Step 3: = 1+ 5
2
+ 1 5
2
Step 4: From initial conditions 1 = 2 = 1 we get
(substitute = 1: ) 1 = 1 = 1+ 5
2+
1 5
2
(substitute = 2:) 1 = 2 = 1+ 5
2
2
+ 1 5
2
2
Solving the two equations above, we obtain =1
5, =
1
5 .
Hence =1
5
1+ 5
2
1 5
2
.
50
Closed Form of the Fibonacci Sequence
=1
5
1+ 5
2
1 5
2
is called the Binets
formula, named after Jacques Binet (1786-1856), although it is known to Abraham de Moivre (1667-1754) a century earlier.
Binets formula is a closed form for the Fibonacci sequence.
51
Take-home exercises The closed form of = 1 + 2 with 1 =
2 = 1 is =1
5
1+ 5
2
1 5
2
.
The closed form of = 1 + 2 with
1 = 1, 2 = 3 is =1+ 5
2
+1 5
2
.
The closed form of = 1 + 2 with
1 = 5 + 2, 2 = 5 + 6 is = 31+ 5
2
+
1 5
2
.
52
A Non-homogeneous Equation Consider the difference equation = 1 + , where , are constants and
.
This is not a homogeneous equation (although it is still linear).
For the case 0 and 1, we can work out the solution like this: = 1 +
= 1 + 1
1
= 1 +
1
1
+
1= 1 +
1
Now define = +
1 for all . Then the above becomes = 1, which has
closed form solution = 0.
This gives closed from solution of as +
1= 0 +
1, i.e., =
0 +
1
1.
53
Example
54
Recall the example of the cougars in Oregon, USA: Each year 777 cougars are allowed to be hunted, and suppose the natural growth rate of cougars is 1.7 per year. Then we have
Cougars Source: Wikimedia Commons
+1 = 1.7 777 where is the number of cougars in Oregon at year .
A Non-homogeneous Equation
Consider the difference equation = 1 + , where , are constants and .
This gives closed from solution = 0 +
1
1.
+1 = 1.7 777 (cougars)
=?
=?
We obtain closed form solution:
= 1.7(01110) + 1110
55
Take-home exercises
a) The closed form of = 31 + 4 with 1 = 1 is = 3
2
b) The closed form of = 31 + 4 with 1 = 0 is = 2(3
1) 2
56
A Non-homogeneous Equation In the previous slide, we found the closed form of
the difference equation
= 1 +
where 0 and 1.
Question: what if 0 and = 1?
Answer: Your exercise!
57
Summary
Real world examples of difference equations
Bacteria growth
Animal population
Radioactive decay
Fibonacci sequence
General difference equations
Linear homogeneous difference equations
Characteristic equation
Finding closed form solution
Solving = 1 +
58
Exercises
Problem 1 Find the rst seven terms of the difference
equation = 1 + 2 7 + 11
2, 1 = 1
Problem 2 Find the closed form of for the difference equation = 31 22, 1 = 2 = 2.
Problem 3 Find the closed form of for the difference equation
3 = 13 + 2
3 , 1 = 2 = 1
Problem 4 Find the closed form of for the difference equation = 31 43, 0 = 2, 1 = 1, 2 = 15
59