Math3800Notes Sol
Math3800Notes Sol
Roots of Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Modeling Change with Difference Equation . . . . . . . . . . . . . . 8
1.2 Approximating Change with Difference Equation . . . . . . . . . . 10
1.3 Solutions to Dynamical Systems . . . . . . . . . . . . . . . . . . . . 13
1.4 Systems of Difference Equations . . . . . . . . . . . . . . . . . . . . 16
2.2 Modelling Using Proportionality . . . . . . . . . . . . . . . . . . . . 21
3.1 Fitting Models to Data Graphically . . . . . . . . . . . . . . . . . . 23
3.2 Analytic Methods of Model Fitting . . . . . . . . . . . . . . . . . . 25
3.3 Applying the Least-Squares Criterion . . . . . . . . . . . . . . . . . 26
4.1 One-Term Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.3 Smoothing: Low-Order Polynomial Models . . . . . . . . . . . . . 38
4.4 Cubic Spline Models . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Numerical Differentiation and Integration . . . . . . . . . . . . . . . . 48
Gaussian Quadrature . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.2 Generating Random Numbers . . . . . . . . . . . . . . . . . . . . . 57
5.3 Simulating Probabilistic Behaviour . . . . . . . . . . . . . . . . . . 58
Traffic Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Simulating Blackjack with MATLAB . . . . . . . . . . . . . . . . . . . 60
6.2 Modelling Component and System Reliability . . . . . . . . . . . . 61
6.1 Probabilistic Modeling with Discrete Systems . . . . . . . . . . . . 64
Matrix Computations . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
11.1 Population Growth . . . . . . . . . . . . . . . . . . . . . . . . . . 75
11.4 Graphical Solutions of Autonomous Differential Equations . . . . 80
12.1 Graphical Solutions of Autonomous Systems of First-Order Differ-
ential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
12.2 A Competitive Hunter Model . . . . . . . . . . . . . . . . . . . . 85
12.3 A Predator-Prey Model . . . . . . . . . . . . . . . . . . . . . . . 90
11.5 Numerical Approximation Methods . . . . . . . . . . . . . . . . . 93
2 MATH3800 NOTES-ERIC HUA
Roots of Equations
Numerical methods: are mathematical methods that are used to approximate
the solution of complicated problems. Numerical methods are very useful be-
cause they are suitable for the use with computers.
• Bisection Method.
• Fixed-point Iteration.
• Newton’s Method.
g(a) = a,
then a is called a fixed point of the function g(x). An fixed point a is called
stable if the solutions that start near a stay near or approach a; if the solutions
that start near a moves away from it, then a is unstable.
5 − x3
x3 + 5x − 5 = 0, x = .
5
Let
5 − x3
g(x) = ,
5
then any fixed point of g(x), i.e., x = g(x), will be a zero of f (x).
Note that f (0.5) < 0, f (1) > 0, we start from x0 = 0.75 to approximate the
fixed point of g(x). Since
3
g 0 (x) = − x2 , |g 0 (x)| < 1 f or x ∈ (0.5, 1),
5
5 − x3n
xn+1 = g(xn ), xn+1 =
5
%% Matlab m-file for fixed point iteration to find the root of f(x)=x^3-5x-5 in (0,1)
%% Set initial guess
x(1)=0.75;
for n=1:17
z(n+1)=(5-z(n)^3)/5;
x(n)=z(n+1);
end
plot(x,”+r”);
xlabel(‘Iteration n’);
ylabel(‘x(n)’);
n x(n)
0 0.75
1 0.915625
2 0.846473651
3 0.878697339
4 0.864309973
5 0.870866605
6 0.867905448
7 0.869248332
8 0.868640468
9 0.868915854
10 0.868791141
11 0.868847629
12 0.868822045
13 0.868833633
14 0.868828384
15 0.868830761
16 0.868829685
17 0.868830172
x(n)
1
0.8
0.6
0.4
0.2
0
0 2 4 6 8 10 12 14 16 18
6 MATH3800 NOTES-ERIC HUA
f (xn )
xn+1 = xn −
f 0 (xn )
provided we have started with a good value for x0 , this will produce approximate
solutions to any degree of accuracy.
The following graph shows that with bad initial value, Newton’s method fails:
This is likely the case when f 0 (x0 ) is close to 0, we can see that x2 is even outside
the domain.
√
6
Example 3. Find the roots 2 by Newton’s method, correct to 8 decimals.
√
Solution: Let f (x) = x6 − 2. Then 6 2 is a solution of the equation f (x) = 0.
Note that f (2) = 62 > 0 and f (0) = −2 < 0 . This tells us that the root is
between 0 and 2. So we chose x0 = 1 for our initial guess.
x6n − 2 5x6n + 2
xn+1 = xn − = .
6x5n 6x5n
With our initial guess of x0 = 1, we can produce the following values:
MATH3800 NOTES-ERIC HUA 7
x0 1
x1 1.16666667
x2 1.12644368
x3 1.12249707
x4 1.12246205
x5 1.12246205
Solution: Note that f (−2) = −5 and f (0) = 1. This tells us that the root is
between -2 and 0. So we chose x0 = −1 for our initial guess.
x3n − xn + 1 2x3n − 1
xn+1 = xn − = .
3x2n − 1 3x2n − 1
With our initial guess of x0 = −1 , we can produce the following values:
x0 -1
x1 -1.500000
x2 -1.347826
x3 -1.325200
x4 -1.324718
x5 -1.324717
x6 -1.324717
x7 -1.324717
Notice how the values for xn become closer and closer to the same value. This
means that we have found the approximate solution to six decimal places. In
fact, this was obtained after only five relatively painless steps.
8 MATH3800 NOTES-ERIC HUA
Mathematical Modelling
• How:
Simplif ication /
Real world data Model
O
Predictions/explanations o Mathematical conclusions
Interpretation
y = kx
are called the first differences, and ∆an is called the nth first difference.
Example 5. You deposit $ 100 into a bank account, that pays 1% interest an-
nually. Model the balance after each year.
Solution: Let an be the balance after n-th year. Then we have the following
the sequence
A = {100, 101, 102.01, 103.0301, ....}.
The first differences are:
an = 1.01n a0 .
Example 6. (Yeast culture 1): Here we have data for yeast culture. From dot
plot, we can approximate the change in population as linear relation to population
size. Find the model.
Example 7. (Yeast culture 2): With more data, the model may be changed.
MATH3800 NOTES-ERIC HUA 11
The solution pn :
1. Observe a pattern.
4. Conclusion.
an+1 = 1.03an ,
which can model account balance with annual interest rate 3%. Predict the solu-
tion.
Conjecture: an = 1.03n a0 .
Test: an+1 = 1.03n+1 a0 = 1.03 ∗ 1.03n a0 = 1.03an , same as the dynamical
system.
Conclusion: an = 1.03n a0 .
Solution:
bn = r n b0 .
Remark. At any equilibrium, f (x) neither increases nor decreases, remains the
same.
Graphic approach: The intersections of the updating function and the line y = x.
an+1 = f (an )
with an equilibrium a.
an+1 = ran + b,
• If r = 1: the solution is
an = a0 + nb.
• If r 6= 1: the solution is
b
an = rn (a0 − a) + a, a = ,
1−r
where a is the equilibrium.
Solution:
a1 = ra0 + b,
a2 = ra1 + b = r(ra0 + b) + b = r2 a0 + (r + 1)b,
a3 = r3 a0 + (r2 + r + 1)b,
(1 − rn )b
an = rn a0 + (rn−1 + · · · + r2 + r + 1)b = rn a0 + = rn a0 + (1 − rn )a =
1−r
rn (a0 − a) + a.
Note that f (x) = rx + b. Set
b
a = f (a), a = ra + b, a = .
1−r
Since f 0 (a) = r,
Example 11. By ct we denote the amount (in mg) of caffeine at time t (in
hours). On average, our body eliminates 13% per hour. Assume that at the end
of the same time interval we consume 94.8 extra mg of caffeine.
Solution:
1. The model will be:
ct+1 = 0.87ct + 94.8.
2. The solution is
94.8 94.8
ct = 0.87t (c0 − )+ .
0.13 0.13
3. The equilibrium is
b 94.8
a= = =729.
˙
1−r 0.13
Since |r| = 0.87 < 1, a is stable, which is long-term behaviour.
16 MATH3800 NOTES-ERIC HUA
Solution:
(a) Let an and bn be the number of customers at the branch Andrew Park
and the branch Billings Bridge respectively, at the end of year n. Then
a = 0.6a + 0.3b
b = 0.4a + 0.7b
(c) We will show that the equilibrium values a = 3000, b = 4000 are stable
later. The system is insensitive to initial values. We predict that 3/7 customers
will end up in Andre Park, 4/7 in BB.
1. In the absence of other species, each individual species will grow uncon-
strained, and the population change is proportional to the population size.
2. The effect of the presence of the second species is to diminish the growth
of the other species. The decrease is proportional to the product of both
populations.
The Model:
an+1 − an = k1 an − k3 an bn
bn+1 − bn = k2 bn − k4 an bn ,
or
an+1 = (1 + k1 )an − k3 an bn
bn+1 = (1 + k2 )bn − k4 an bn ,
Find the equilibrium values and analyse sensitivity to initial values. When initial
values are a0 = b0 = 10, who will win?
Solution:
a = 1.2a − 0.001ab
b = 1.3b − 0.002ab,
xn+1 = axn − bxn yn ,
yn+1 = cyn + dxn yn ,
MATH3800 NOTES-ERIC HUA 19
• Here a > 1 represents the natural growth rate of the prey in the absence
of predators.
• b represents the consumption rate of the predators (where bxn is the average
number of prey eaten per predator in time n), i.e., the decrease rate of the
prey by the presence of predator.
• 0 < c < 1 is the survival rate of the predator (decrease rate) in the absence
of its prey source.
• d > 0 is the growth rate of the predator population due to the consumption
of prey.
The amount of prey consumed by the predator at each time step depends on not
only on the numbers of predators present, but also the numbers of prey present.
When the prey density is higher, it is easier for the predators to find prey and thus
more prey will be consumed. Likewise, the growth rate the predators depends
not only on the number of predators present (more predators should produce
more offspring overall), but also on the number of prey present (a large food
source often correlates with higher reproductive rates and/or larger litter or
clutch sizes).
The system has two fixed point (0, 0), and ( 1−c d
, a−1
b
).
Find the equilibrium values and analyse sensitivity to initial values. When initial
values are a0 = b0 = 10, or a0 = b0 = 500. Compare results.
Solution:
a = 1.2a − 0.001ab
b = 0.6b + 0.002ab,
where:
T = period of the orbit, measured in days.
R = average distance of the object, measured in units of distance.
k, c = constants.
Solution:
90466.8 − 0
c=
˙ = 0.41.
220869.1115 − 0
Example 16. The following is the data for Ontario muskie fish:
22 MATH3800 NOTES-ERIC HUA
(a) No.
Example 17. (The best-fitting line) A waiter at a restaurant received tips ac-
cording to his working hours. The data are:
Model the data with the best-fitting line such that the sum of absolute
deviations is minimum.
is minimum.
”Predictions from models are not always correct, the least squares criterion
proves minimized predictions based on this assumption.”
26 MATH3800 NOTES-ERIC HUA
by the function
y = f (x) = ax + b
such that m
X
S= [yi − f (xi )]2
i=1
is minimum. Then
Pm
xi y i − ( m xi )( m
P P
m i=1P i=1 i=1 yi )
a= ,
m m 2
Pm 2
i=1 ix − ( i=1 x i )
Pm
x2i )( i=1 yi ) − ( m xi yi )( m
P P P
( i=1 i=1 i=1 xi )
b= Pm 2 Pm 2
,
m i=1 xi − ( i=1 xi )
where a is called the slope, b is the intercept.
Solution: m
X
S= [yi − axi − b]2 .
i=1
To have optimality,
∂S ∂S
= 0, = 0.
∂a ∂b
We derive the system
m
X m
X
yi = a xi + mb
i=1 i=1
m
X m
X m
X
xi y i = a x2i +b xi .
i=1 i=1 i=1
The error sum of squares (SSE), which reflects variation about the regression
line, is given by
Xm
SSE = [yi − (axi + b)]2 .
i=1
MATH3800 NOTES-ERIC HUA 27
The total sum of squares (SST) measures the total amount of variation in
observed y values, and is defined as
m
X
SST = (yi − ȳ)2 .
i=1
SSR reflects the amount of variation in the y values explained by the linear
regression line y = ax + b when compared with the variation in the y values
about the line y = ȳ.
Coefficient of determination measures the proportion of the total variations
in y that can be explained by the linear model and it is defined as
SSE
R2 = 1 − ,
SST
pronounced as R squared.
2. R2 ≤ 1.
3. The value of R2 does not depend on which of the two variables is labelled
x and which is labelled y.
Residuals: The residuals are the errors between the actual and predicted values
ri = yi − (axi + b).
1. One way to evaluate the reasonableness of the fit of the model is to look
at the plot of residuals versus the independent variable.
Example 18.
We are going to fit the set with power function y = ax2 . Find a.
y = f (x) = axn
such that m
X
S= [yi − f (xi )]2
i=1
( m 2
ln yi ) − ( m ln xi ln yi )( m
P P P P
i=1 ln xi )( i=1 i=1 i=1 ln xi )
ln a = Pm 2
Pm 2
.
m i=1 ln xi − ( i=1 ln xi )
30 MATH3800 NOTES-ERIC HUA
Proof.
ln y = n ln x + ln a.
We are going to fit the set with power function y = axn . Find a and n.
4. Fitting Exponential Curve y = c akx , where both a and k are pa-
rameters.
Note that
log y = log c + (k log a)x,
we need to transform y to log y. Then use Line of Best Fit.
(a) Fit the data with y = c ekx . Find c and k.
(b) Fit the data with y = c 10kx . Find c and k.
(c) Fit the data with y = c (dx ). Find c and d.
Solution:
(i) ln y = ln c + kx. So we transform data (x, y) → (x, ln y). Then
ln y = ax + b = kx + ln c.
(ii) log y = log c + kx. So we transform data (x, y) → (x, log y). Then
log y = ax + b = kx + log c.
ln y = ax + b = (ln d)x + ln c.
32 MATH3800 NOTES-ERIC HUA
Scatterplot
The plot is concave up and increasing, which suggests a power function model
or exponential model.
V ∝ a(d2 ) + b.
Model Solutions:
Residuals Plot:
Remark:
• For the model V = 0.152d2 , SSE is much bigger than other models, resid-
uals plot shows an apparent trend, we would probably reject the model.
34 MATH3800 NOTES-ERIC HUA
2. Are there data points lie obviously outside the trend? If yes, we may need
to discard them.
Sometimes it is hard to construct a good model. We may think about the fol-
lowing transformations:
Ladder of powers
——————
..
.
z2
√z
z
ln z
√1
z
1
z
1
z2
——————
• If the data concave up, then go down the ladder (below z).
MATH3800 NOTES-ERIC HUA 35
Example 23. Consider the following data set, Harvesting of bluefish and blue
crabs versus time:
√
Now we try Ladder of powers: y → y
36 MATH3800 NOTES-ERIC HUA
Thus
We imply that √
y = 158.34 x.
38 MATH3800 NOTES-ERIC HUA
n+1
X
pn (x) = Lj (x)yj ,
j=1
where
Lj (x) = Πn+1 n+1
i=1,i6=j (x − xi )/Πi=1,i6=j (xj − xi ).
Example 24. Given three points (1.3, 3.2), (1.7, 4.4), (2.1, 5.2). Then
(x − x2 )(x − x3 ) (x − 1.7)(x − 2.1)
L1 (x) = = = 3.125x2 −11.875x+11.15625,
(x1 − x2 )(x1 − x3 ) (1.3 − 1.7)(1.3 − 2.1)
(x − x1 )(x − x3 ) (x − 1.3)(x − 2.1)
L2 (x) = = = −6.25x2 +21.25x−17.0025,
(x2 − x1 )(x2 − x3 ) (1.7 − 1.3)(1.7 − 2.1)
(x − x1 )(x − x2 ) (x − 1.3)(x − 1.7)
L3 (x) = = = 3.125x2 −9.375x+6.90625.
(x3 − x1 )(x3 − x2 ) (2.1 − 1.3)(2.1 − 1.7)
Then
P2 (x) = L1 (x)(3.2) + L2 (x)(4.4) + L3 (x)(5.2)
= −1.25x2 + 6.75x − 3.4625.
Example 25. Given four points (0, 1), (1, −1), (2, −3), (3, 1). Then
(x − x2 )(x − x3 )(x − x4 ) (x − 1)(x − 2)(x − 3) 1
L1 (x) = = = − x3 +x2 −2x+1,
(x1 − x2 )(x1 − x3 )(x1 − x4 ) (0 − 1)(0 − 2)(0 − 3) 6
(x − 0)(x − 2)(x − 3) 1 5
L2 (x) = = x3 − x2 + 3x,
(1 − 0)(1 − 2)(1 − 3) 2 2
(x − 0)(x − 1)(x − 3) 1 3
L3 (x) = = − x3 + 2x2 − x,
(2 − 0)(2 − 1)(2 − 3) 2 2
(x − 0)(x − 1)(x − 2) 1 1 1
L4 (x) = = x3 − x2 + x.
(3 − 0)(3 − 1)(3 − 2) 6 3 3
Then
P3 (x) = L1 (x)(1) + L2 (x)(−1) + L3 (x)(−3) + L4 (x)(1)
= x3 − 3x2 + 1.
MATH3800 NOTES-ERIC HUA 39
Divided Differences
Divided differences is an algorithm, historically used for computing tables of
logarithms and trigonometric functions.[citation needed] Charles Babbage’s dif-
ference engine, an early mechanical calculator, was designed to use this algorithm
in its operation.
Divided differences is a recursive division process. The method can be used
to calculate the coefficients in the interpolation polynomial.
Consider the model
P (x) = a + bx + cx2 + · · · .
We have
P 0 (x) = b + 2cx + ...
P 00 (x) = 2c + ...
Recall the definition of the derivative
f (x + h) − f (x) ∆y
f 0 (x) = lim = lim .
h→0 x+h−x h→0 ∆x
Thus
0 ∆P 00∆P 0
P ≈ , P ≈ , ...
∆x ∆x
Definition 3. Given the data set {(x1 , y1 ), ..., (xm , ym )}.
∆ = yi+1 − yi , i = 1..., m − 1.
The kth differences ∆k are computed by finding the difference between succes-
sive k − 1th differences.
Error Estimates
If we use a polynomial pn (x) to approximate f (x) such that
m
! m
! m
X X X
ma + xi b+ x2i c = yi
i=1 i=1 i=1
m
! m
! m
! m
X X X X
xi a+ x2i b + x3i c = xi yi
i=1 i=1 i=1 i=1
m
! m
! m
! m
X X X X
x2i a + x3i b + x4i c = x2i yi
i=1 i=1 i=1 i=1
Equivalently,
a + xb + x2 c = y
xa + x2 b + x3 c = xy
x2 a + x3 b + x4 c = x2 y
∂S ∂S ∂S
= = = 0.
∂a ∂b ∂c
Example 27. Consider the data collected for the tape recorder problem
where ci are the counter reading, t = P2 (c) are the elapsed time. Then
P2 (c) = 0.14286 + 1.94226c + 0.00105c2 .
Solution:
8a + 3600b + 2040000c = 9128
3600a + 2040000b + 1296000000c = 5318900
2040000a + 1296000000b + 8.772 × 1011 c = 3435390000
42 MATH3800 NOTES-ERIC HUA
All 2DDs are almost same, so second order polynomial to the data is appropriate.
Example 28. Consider the following data, which degree of polynomial will be
good model?
MATH3800 NOTES-ERIC HUA 43
All 4DDs are same, so 4th order polynomial to the data is appropriate.
44 MATH3800 NOTES-ERIC HUA
S1 (x) = a1 + b1 x, f or x ∈ [x1 , x2 )
S2 (x) = a2 + b2 x, f or x ∈ [x2 , x3 ]
Example 29. Given the data set (xi , y(xi )) = (1, 1), (2, 4), (3, 2). The spline
model is:
S1 (x) = −2 + 3x, f or x ∈ [1, 2)
S2 (x) = 8 − 2x, f or x ∈ [2, 3]
MATH3800 NOTES-ERIC HUA 45
Cubic Splines (Natural Spline): Consider the data set {(x1 , y1 ), (x2 , y2 ), (x3 , y3 )}
(3 points can be extended to N points). The Cubic Spline Model constructs 2
third-order piecewise continuous cubic polynomials (cubic splines) that connect
3 data points:
S1 (x) = a1 + b1 x + c1 x2 + d1 x3 , f or x ∈ [x1 , x2 )
S2 (x) = a2 + b2 x + c2 x2 + d2 x3 , f or x ∈ [x2 , x3 ]
Polynomial coefficients are chosen such that the resulting curve and its first
derivative are smooth at the points.
Solution:
(1)
y1 = S1 (x1 ) : 5 = a1 + b 1 + c 1 + d 1 (1)
y2 = S1 (x2 ) : 8 = a1 + 2b1 + 4c1 + 8d1 (2)
y2 = S2 (x2 ) : 8 = a2 + 2b2 + 4c2 + 8d2 (3)
y3 = S2 (x3 ) : 25 = a2 + 3b2 + 9c2 + 27d2 (4)
S10 (x2 ) = S20 (x2 ) : b1 + 4c1 + 12d1 = b2 + 4c2 + 12d2 (5)
S100 (x2 ) = S200 (x2 ) : 2c1 + 12d1 = 2c2 + 12d2 (6)
S100 (x1 ) = 0 : 2c1 + 6d1 = 0 (7)
S200 (x3 ) = 0 : 2c2 + 18d2 = 0. (8)
S1 (x) = 2 + 10x − 10.5x2 + 3.5x3 ,
S2 (x) = 58 − 74x + 31.5x2 − 3.5x3 .
Summary.
MATH3800 NOTES-ERIC HUA 47
48 MATH3800 NOTES-ERIC HUA
Then
f (xi+1 ) − f (xi−1 )
f 0 (xi ) ≈ , error = O(h2 ).
2h
Example 31. Estimate the first derivative of
f 0 (xi ) ≈ −1.155.
MATH3800 NOTES-ERIC HUA 49
• The second forward finite divided difference: We start from Taylor series:
f 00 (xi ) 2 f 000 (xi ) 3 f (n) (xi ) n
f (xi+1 ) = f (xi )+f 0 (xi )h+ h + h +...+ h +... h = xi+1 −xi
2! 3! n!
f 00 (xi ) f 000 (xi ) f (n) (xi )
f (xi+2 ) = f (xi )+f 0 (xi )(2h)+ (2h)2 + (2h)3 +...+ (2h)n +... 2h = xi+2 −xi
2! 3! n!
Then
f (xi+2 ) − 2f (xi+1 ) + f (xi )
f 00 (xi ) ≈ , error = O(h).
h2
• The second backward finite divided difference: Similarly,
f (xi ) − 2f (xi−1 ) + f (xi−2 )
f 00 (xi ) ≈ , error = O(h).
h2
• The second centred finite divided difference: Similarly,
f (xi+1 ) − 2f (xi ) + f (xi−1 )
f 00 (xi ) ≈ , error = O(h2 ).
h2
Numerical integration Z b
b−a
Methods approximating definite integrals f (x)dx: Let h = n
, xi = a + ih,
a
i = 0, 1, ..., n.
• Midpoint rule: uses the midpoint of each subinterval. mid(n) denotes the
result obtained by using ”midpoint rule” with n subintervals:
n−1
X xj + xj+1
midrule(a, b, n) = h f .
j=0
2
50 MATH3800 NOTES-ERIC HUA
• Trapezoid rule:
n−1
hX h
traprule(a, b, n) = [f (xj ) + f (xj+1 )] = {f (x0 )+2f (x1 )+...+2f (xn−1 )+f (xn )}.
2 j=0 2
Z b n/2
h X
f (t)dt = simprule(a, b, n) = [f (t2j−2 ) + 4f (t2j−1 ) + f (t2j )]
a 3 j=1
h
= {f (t0 ) + 4f (t1 ) + 2f (t2 ) + 4f (t3 ) + ... + 2f (tn−2 ) + 4f (tn−1 ) + f (tn )},
3
where we have used Lagrange polynomial interpolation through points
(t0 , f (t0 )), (t1 , f (t1 )), (t2 , f (t2 )):
(t − t1 )(t − t2 ) (t − t0 )(t − t2 ) (t − t0 )(t − t1 )
f (t) ≈ f (t0 )+ f (t1 )+ f (t2 )
(t0 − t1 )(t0 − t2 ) (t1 − t0 )(t1 − t2 ) (t2 − t0 )(t2 − t1 )
(t − t1 )(t − t2 ) (t − t0 )(t − t2 ) (t − t0 )(t − t1 )
= 2
f (t0 ) + 2
f (t1 ) + f (t2 ).
2h −h 2h2
The area of the small piece is
Z t2
f (t)f t.
t0
MATH3800 NOTES-ERIC HUA 51
For example,
h
simprule(a, b, 4) = {f (t0 ) + 4f (t1 ) + 2f (t2 ) + 4f (t3 ) + f (t4 )},
3
h
simprule(a, b, 6) = {f (t0 ) + 4f (t1 ) + 2f (t2 ) + 4f (t3 ) + 2f (t4 ) + 4f (t5 ) + f (t6 )}.
3
Maximum error:
Z 2
Example 32. Estimate I = sin(x2 )dx by using midrule(0,2,4), traprule(0,2,4),
0
simprule(0,2,2).
b−a
Solution: 1) h = n
= 0.5, x0 = 0, x1 = 0.5, x2 = 1, x3 = 1.5, x4 = 2.
0.5
traprule(0, 2, 4) = {f (0) + 2f (0.5) + 2f (1) + 2f (1.5) + f (2)}
2
0.5
simprule(0, 2, 4) = {f (0) + 4f (0.5) + 2f (1) + 4f (1.5) + f (2)}
3
52 MATH3800 NOTES-ERIC HUA
Gaussian Quadrature
Degree of Precision: If the integration rule has zero error when integrating
any polynomial of degree ≤ k, and if the error is non-zero for some polynomial
of degree k + 1, then we say that the rule has degree of precision = k.
For example,
Trapezoid rule has degree of precision = 1.
Z b
b−a b−a
f (x)dx = f (a) + f (b).
a 2 2
Simpsons rule has degree of precision = 3.
Z b
b−a 2(b − a) a + b b−a
f (x)dx = f (a) + f( )+ f (b).
a 6 3 2 6
Gaussian Quadrature of f (x):
Z b n
X
f (x)dx ≈ wi f (xi ),
a i=1
where wi are called weights, xi are nodes. The above formula is exactly equal
for any polynomial f (x) of degree less than or equal to 2n − 1.
Remark. By transformations,
Z b
b−a 1
b−a
Z
a+b
f (x)dx = f s+ ds.
a 2 −1 2 2
54 MATH3800 NOTES-ERIC HUA
Z 1.2
Example 34. Estimate sin xdx.
0
Z 1.2 Z 1 Z 1
Solution. sin xdx = 0.6 sin(0.6x + 0.6)dx = 0.6 sin 0.6(x + 1)dx
0 −1 −1
1 1
≈ 0.6 sin 0.6(− √ + 1) + sin 0.6( √ + 1) ≈ 0.6373216.
3 3
Legendre’s polynomials
For example,
P0 (x) = 1,
P1 (x) = x,
1
P2 (x) = (3x2 − 1),
2
1
P3 (x) = (5x3 − 3x),
2
1
P4 (x) = (35x4 − 30x2 + 3),
8
1
P5 (x) = (63x5 − 70x3 + 15x).
8
1 dn 2 n
Pn (x) = (x − 1) .
2n n! dxn
Z 1
0, m 6= n;
Pm (x)Pn (x) dx = 2
−1 2n+1
, m = n.
Theorem 8.
Z b n
X
f (x)dx ≈ wi f (xi ),
a i=1
1
x − xj
Z
wi = Li (x)2 dx, Li (x) = Πnj=1,j6=i .
−1 xi − xj
MATH3800 NOTES-ERIC HUA 55
if n == 0
coefs = 1;
elseif n == 1
coefs = [1 0];
else
P_nm1 = 1;
P_n = [1 0];
for i=1:(n-1);
end
coefs = P_np1;
end
56 MATH3800 NOTES-ERIC HUA
MATH3800 NOTES-ERIC HUA 57
Middle-Square Method:
1. Start with a four-digit number x0 , called the seed.
2. Square it to obtain an eight-digit number (add a leading zero if necessary).
3. Take the middle four digits as the next random number.
Continuing, we obtain a sequence that appears random over the integers from
0 to 9999. These integers can be scaled to any interval [a, b].
Example 35. Generate 5 numbers by Middle Square Method with the seed x0 =
2041.
Linear congruence generator: a linear rule for generating the next element
of a sequence from previous elements:
• P(Face 1)=0.1,
• P(Face 2)=0.1,
• P(Face 3)=0.1,
• P(Face 4)=0.1,
• P(Face 5)=0.2,
• P(Face 6)=0.4.
Example 37. Generate some numbers and find the total of getting each face.
60 MATH3800 NOTES-ERIC HUA
Traffic Simulation
https://en.wikipedia.org/wiki/Traffic simulation
• Series system is one that performs well as long as all of the components
are fully functional.
• Parallel system is one that performs well as long as a single one of its
components remains functional.
The system will function only if both components function. The probability
that A functions is given by P(A) = 0.98, and the probability that B functions is
62 MATH3800 NOTES-ERIC HUA
given by P(B) = 0.95. Assume that A and B function independently. Find the
probability that the system functions.
Solution:
Solution: Since the system will function so long as either of the two
components functions, it follows that
Example 40. Most practical equipments and systems are combinations of series
and parallel components. For example,
Solution: To solve this network, one merely uses series and parallel rela-
tionships to decompose and recombine the network step by step.
Markov chain
• A Markov chain is a process in which there are the same finite number of
states (or outcomes) that can be occupied at any given time.
• The system moves from one state to another, one for each time step. There
is a probability associated with this transition for each possible outcome.
• The sum of the probabilities for transitioning from one state to the next is 1.
Example 41. (Two-state Markov chain) MATH3800 Tutoring Ottawa has two
branches in Ottawa: Andrew Park, and Billings Bridge, with market portion
a0 and b0 respectively. According to market statistics, due to variety of tutors,
after each year, 40% of AP’s customers will switch to BB’s, while 30% of BB’s
customers will switch to AP’s.
We can array the data as following, which is transition matrix:
Let
an = the number of customers at the branch Andrew Park , at the end of
year n.
bn = the number of customers at the branch Billings Bridge, at the end of
year n.
Then
Numerical method:
3 4
an → , bn → .
7 7
Algebra method: Let T be the transition matrix, i.e., xk+1 = T xk , k =
a
0, 1, 2, · · · where xk = k Then Steady-State Vector ~q (which gives long-term
bk
distribution) is a probability vector such that
Now
0.6 0.3 −0.4 0.3 1 −3/4
T = ,T − I = ∼ .
0.4 0.7 0.4 −0.3 0 0
By solving the system q1 − 3/4q2 = 0, q1 + q2 = 1, q1 = 3/7, q2 = 4/7.
Algebra method:
0.75 0.2 0.4 −0.25 0.2 0.4 1 0 −20/9
T = 0.05 0.6 0.2 , T − I = 0.05 −0.4 0.2 ∼ 0 1 −7/9 .
0.2 0.2 0.4 0.2 0.2 −0.6 0 0 0
5 7 1
Thus q1 = , q2 = , q3 = .
9 36 4
68 MATH3800 NOTES-ERIC HUA
Matrix Computations
1. LU Decomposition.
To solve Ax = b, one way is to use row reduction, another way is to use LU-
decomposition.
2. Solve Ly = b.
3. Solve U x = y.
Then
u11 u12 u13 a11 a12 a13
LU = m21 u11 m21 u12 + u22 m21 u13 + u23 = a21 a22 a23 .
m31 u11 m31 u12 + m32 u22 m31 u13 + m32 u23 + u33 a31 a32 a33
1 2 4
Example 44. Solve Ax = b by LU-decomposition, where A = 3 8 14 , b =
2 6 13
3
13.
4
Solution. Step 1:
u11 u12 u13 1 2 4
m21 u11 m21 u12 + u22 m21 u13 + u23 = 3 8 14 .
m31 u11 m31 u12 + m32 u22 m31 u13 + m32 u23 + u33 2 6 13
1 0 0 1 2 4
L = 3 1 0 , U = 0 2 2 .
2 1 1 0 0 3
3
Step 2: Solve Ly = b, y = 4 .
−6
3
Step 3: Solve U x = y, x = 4 .
−2
MATH3800 NOTES-ERIC HUA 69
2. Cholesky Decomposition.
A = GGT ,
Solution.Step 1: A = GGT ,
2
g11 0 0 g11 g21 g31 g11 g11 g21 g11 g31
g21 g22 2 2
0 0 g22 g32 = g21 g11 g21 + g22 g21 g31 + g22 g32
2 2 2
g31 g32 g33 0 0 g33 g31 g11 g31 g21 + g32 g22 g31 + g32 + g33
2
g11 g11 g21 g11 g31 4 2 14
2 2
g21 g11 g21 + g22 g21 g31 + g22 g32 = 2 17 −5 .
2 2 2
g31 g11 g31 g21 + g32 g22 g31 + g32 + g33 14 −5 83
2 0 0
We imply that G = 1 4 0 .
7 −3 5
7
Step 2: Solve Gy = b, y = −27.
5
3
Step 3: Solve GT x = y, x = −6.
1
70 MATH3800 NOTES-ERIC HUA
In numerical linear algebra, the GaussSeidel method, also known as the Lieb-
mann method or the method of successive displacement, is an iterative method
used to solve a linear system of equations.
To solve Ax = b,
1. Write A = L + U , where L is the lower triangular matrix, U is the strict
upper triangular matrix:
a11 a12 · · · a1n a11 0 ··· 0 0 a12 · · · a1n
a21 a22 · · · a2n a21 a22 ··· 0 0 · · · a2n
+ 0
· · · · · · · · · · · · = · · ·
= L+U.
··· ··· ··· · · · · · · · · · · · ·
an1 an2 · · · ann an1 an2 · · · ann 0 0 ··· 0
16 3
Example 46. Solve Ax = b by Gauss Seidel Iteration, where A = ,
7 −11
11 1
b= , x(0) = .
13 1
16 3 16 0 0 3
Solution: A = = L + U, where L = , U = . We
7 −11 7 −11 0 0
imply that
(n+1) −1 (n) 0.0625 0 11 0 3 (n)
x = L (b − U x ) = ( − x )
0.0398 −0.0909 13 0 0
(n+1) 0 −0.1875 (n) 0.6875
x = x +
0 −0.1194 −0.7439
MATH3800 NOTES-ERIC HUA 71
Example 47. Find the least square fit of a line by Algebraic method to the points
(−2, 1), (0, 2), (2, 4).
1 −2 1
c ~
Solution: A = 1 0 , ~x =
,b= 2 .
d
1 2 4
T 3 0 T~ 7
A A= , A b= .
0 8 6
T −1 T~ 1 56
~x = (A A) (A b) = .
24 18
7 3
y= + x.
3 4
MATH3800 NOTES-ERIC HUA 73
1 x1 x21
y1
1 x2 x2 c1
2 .
1. Let A = .. .. .. , ~x = c2 , ~b = .. .
. . . c3
yn
1 xn x2n
P P
xi P x2i
P
n P yi
T T~ 2 3
P P
2. Solve A A~x = A b, i.e., P xi P xi P xi ~x = P xi yi .
x2i x3i x4i x2i yi
Example 48. Find the least square fit of quadratic by Algebraic method to the
points (0, 6), (1, 0), (2, 0).
Solution: y = 6 − 9x + 3x2 .
74 MATH3800 NOTES-ERIC HUA
det(A − λI) = 0.
5 −2 2
Example 49. Estimate eigenvalues of A = 2 0 4.
4 2 7
Solution:
|5 − λ1 | ≤ | − 2| + |2|, 1 ≤ λ1 ≤ 9;
|0 − λ1 | ≤ |2| + |4|, −6 ≤ λ1 ≤ 6;
|7 − λ1 | ≤ |4| + |2|, 1 ≤ λ1 ≤ 13.
√
Actual eigenvalues are 4, 6 ± 17.
MATH3800 NOTES-ERIC HUA 75
dP dP
∝ P, or, = kP.
dt dt
By separating variables, we get the solution:
Example 50. A bacteria culture growth at a rate proportional to its size. After 2
hours there are 40 bacteria and after 4 hours the count is 120. Find an expression
for the population after t hours.
P (t) = P (0)ekt .
Example 51. The half-life of Sodium-24 is 15 hours. Suppose you have 100
grams of Sodium-24. How many grams remaining after 27 minutes (keep three
decimals)?
1
m(t) = m(0)( )t/H ,
2
76 MATH3800 NOTES-ERIC HUA
Example 52. Yeast Culture: Given the data and scatterplot are as follows:
(3) Estimate r, t∗ .
Solution:
C −4.1636
t∗ = − =− = 7.845487093.
rM 0.5307
80 MATH3800 NOTES-ERIC HUA
• Phase line is the plot on the y axis with equilibrium values and intervals
where y 0 and y 00 are positive and negative.
dy
= f (y)
dt
with an equilibrium y∗. If f 0 (y∗) < 0, then y∗ is stable; If f 0 (y∗) > 0, then y∗ is
unstable.
Solution: Let T (t) be the temperature of the body at time t. Taking noon
as t = 0, we have T (0) = 70. Note that Ts = 60, we have
dT
= −k(T − 60),
dt
this equation is separable. We obtain
dT
= −kdt, ⇒ T (t) = 60 + Ce−kt .
T − 60
From T (0) = 70 we get 70 = 60 + C, C = 10 and
T (t) = 60 + 10e−kt .
82 MATH3800 NOTES-ERIC HUA
Thus
98.6 = 60 + 10e−t ln 2 , ⇒ t = − ln 3.86/ ln 2 = −1.95,
which means 1 hour and 0.95(60) minutes before noon, or 1 hour and 57 minutes
before noon. Or the time of death is 10:03AM.
f (P ) = rP (M − P ).
• If 0 < P < M , then dP/dt > 0 and thus, population grows (the point in
the graph moves to the right).
The arrows show that the equilibrium P = 0 is unstable, whereas the equilib-
rium P = M is stable. From the biological point of view, this means that after
small deviation of population numbers from P = 0 (e.g., immigration of a small
number of organisms), the population never returns back to this equilibrium.
Instead, population numbers increase until they reach the stable equilibrium
P = M . After any deviation from P = M the population returns back to this
stable equilibrium.
MATH3800 NOTES-ERIC HUA 83
• The solution curve whose coordinates are (x(t), y(t)) is called a trajectory,
path, orbit of the system.
– stable if any trajectory that starts close to the point stays close to it
for all future time;
– asymptotically stable it it is stable and if any trajectory that starts
close to (x0 , y0 ) approaches that point as t → ∞;
– unstable if (x0 , y0 ) is not stable.
Properties:
1. There is at most one trajectory through any point in the phase plane.
2. A trajectory that starts at a point other than an equilibrium point can not
reach an equilibrium point in a finite amount of time.
4. A particle along a trajectory behaves in one of three possible ways: (a) the
particle approaches an equilibrium point; (b) the particle moves along or
approaches asymptotically a closed path; (c) either x(t) → ∞ or y(t) → ∞
as t → ∞.
(a) Verify that The solution of the system is x = e−t sin t, y = e−t cos t.
(b) Find the equilibrium points and study the stability of the system
84 MATH3800 NOTES-ERIC HUA
Solution:
(b) Solve the system
−x + y = 0
−x − y = 0.
The equilibrium point is (x, y) = (0, 0).
Note that
x2 + y 2 = e−2t → 0 as t → ∞.
dx/dt = (a − by)x,
dy/dt = (m − nx)y,
Equilibrium points:
1. x0 (t) = 0 ⇔ y = ab .
2. y 0 (t) = 0 ⇔ x = m
n
.
m
• Along the vertical line x = and the x axis in the phase plane, the growth
n
in the bass population is zero;
a
• Along the horizontal line y = and the y axis in the phase plane, the
b
growth in the pike population is zero.
• Whenever x0 (t) > 0, the component x(t) of the trajectory is increasing and
the trajectory is moving toward the right; whenever x0 (t) < 0 is negative,
the trajectory is moving to the left.
• Whenever y 0 (t) > 0, the component y(t) of the trajectory is increasing and
the trajectory is moving upward; whenever y 0 (t) < 0 , the trajectory is
moving downward.
n a−m
• Along the diagonal y = x+ , the trajectories move toward the
m a
b0 0 b
equilibrium ( n , b ). Here y /x = y/x.
n a+m
• Along the diagonal y = − x + , the trajectories move away from
m a
b 0 0 b
the equilibrium ( n , b ). Here y /x = −y/x.
86 MATH3800 NOTES-ERIC HUA
dy (m − nx)y
= ,
dx (a − by)x
a m
− b dy = − n dx,
y x
a ln y − by = m ln x − nx + K.
MATH3800 NOTES-ERIC HUA 87
Example.
Equilibrium points:
Solve the system
(0.2 − 0.1y)x = 0
(0.2 − 0.6x)y = 0.
1
• Along the vertical line x = and the x axis in the phase plane, y 0 = 0, the
3
bass population has no change;
1
• On the left of the vertical line x = , y 0 > 0, the bass population increases;
3
1
• On the right of the vertical line x = , y 0 < 0, the bass population de-
3
creases;
• Along the horizontal line y = 2 and the y axis in the phase plane, x0 = 0,
thus the pike population has no change.
• Along the diagonal y = 6x, the trajectories move toward the equilibrium
(1/3, 2), for example, at the point (1/6, 1), x0 = 0.1/6, y 0 = 0.1.
• Along the diagonal y = −6x + 4, the trajectories move away from the
equilibrium (1/3, 2) .
dy (0.2 − 0.6x)y
= ,
dx (0.2 − 0.1y)x
0.2 ln y − 0.1y = 0.2 ln x − 0.6x + c, 2 ln y − y = 2 ln x − 6x + c.
90 MATH3800 NOTES-ERIC HUA
• The predator species (such as pike, walleye, bass, muskie) is totally depen-
dent on the prey species as their only food supply.
• The prey species (such as sunfish, perch) has an unlimited food supply and
no threat to their growth other than the specific predator.
The dynamics of the interaction between them is then described by the differen-
tial equations (system):
dx/dt = (a − by)x,
dy/dt = (nx − m)y, n = cb,
1. Find the nullcline of x, i.e., the set of points where dx/dt = 0, or equiva-
lently f (x, y) = 0.
2. Find the nullcline of y, i.e., the set of points where dy/dt = 0, or equiva-
lently g(x, y) = 0.
4. The intersection of the nullclines are equilibrium points (or steady states,
or rest points).
6. In each of the regions in space in between the nullclines, draw the direction
arrows.
For a given initial condition, draw a solution into the phase plane. Then plot
the two components of the solution as a function of time.
dy (nx − m)y
= ,
dx (a − by)x
a m
− b dy = n − dx,
y x
92 MATH3800 NOTES-ERIC HUA
a ln y − by = nx − m ln x + K.
Example 57. Find the equilibrium points, study stabilities, and sketch trajecto-
ries (solution curves).
Example 58. Let y(x) be the solution of the initial value problem y 0 = x + y,
y(0) = 0.
(a) Use Euler’s method with step size 0.1 to estimate y(0.4);
(b) Verify that the exact solution is y = −x − 1 + ex .
(c) Calculate the error in (a).
Solution:
(a)
i xi yi
0 0 0
1 0.1 0
2 0.2 0.01
3 0.3 0.031
4 0.4 0.0641
Remark. It is not true that by taking h sufficiently small one can obtain any
desired level of precision.
94 MATH3800 NOTES-ERIC HUA
Let h = ∆t.
tn+1 = tn + h,
xn+1 = xn + hf (xn , yn ),
yn+1 = yn + hg(xn , yn ).
dx/dt = (3 − y)x,
dy/dt = (x − 2)y,
i ti xi yi
0 0 1 2
1 0.1 1.1 1.8
2 0.2 1.232 1.638
3 0.3 1.3997984 1.5122016
MATH3800 NOTES-ERIC HUA 95
Improved Euler’s Method. Use Euler’s method to get ’predicted’ value (pre-
dictor), then use improved formula to get ’corrected’ value (corrector):
p
yn+1 = ync + hf (xn , ync )
c 1 p
= ync + h f (xn , ync ) + f (xn+1 , yn+1
yn+1 )
2
Example 60. Let y(x) be the solution of the initial value problem y 0 = x + y,
y(0) = 0. Use step size 0.1 to estimate y(0.4) and calculate the error.
Solution:
i xi yip yic
0 0 0 0
1 0.1 0 0.005
2 0.2 0.0155 0.021025
3 0.3 0.043128 0.049233
4 0.4 0.084156 0.090902
Runge-Kutta Method
Euler’s Method gave us one possible approach for solving differential equations
numerically. The problem with Euler’s Method is that you have to use a small
interval size to get a reasonably accurate result. That is, it’s not very efficient.
The Runge-Kutta Method of 4th order (RK4), Multi-step Predictor-corrector
Method , produces a better result in fewer steps.
We wish to approximate the solution to a first order differential equation
given by
dy
= f (x, y), y(xn ) = yn .
dx
k1 = hf (xn , yn )
1 1
k2 = hf (xn + h, yn + k1 )
2 2
1 1
k3 = hf (xn + h, yn + k2 )
2 2
k4 = hf (xn + h, yn + k3 )
1
yn+1 = yn + (k1 + 2k2 + 2k3 + k4 ).
6
• k2 is the increment based on the slope at the midpoint of the interval, using
y and k1 ;
• k3 is the increment based on the slope at the midpoint of the interval, using
y and k2 ;
• k4 is the increment based on the slope at the end of the interval, using y
and k3 .
MATH3800 NOTES-ERIC HUA 97
Example 61. Use Runge-Kutta method of order 4 to solve the following equa-
tion, using the step size h = 0.1 for 0 ≤ x ≤ 1:
dy
= (5x2 − y)e−(x+y) , y(0) = 1.
dx
Solution:
Step 1:
k1 = hf (x0 , y0 ) = 0.1f (0, 1) = −0.03678794411.
1 1
k2 = hf (x0 + h, y0 + k1 ) = 0.1f (0.05, 0.98160602794) = −0.03454223937.
2 2
1 1
k3 = hf (x0 + h, y0 + k2 ) = 0.1f (0.05, 0.98272888031) = −0.03454345267.
2 2
k4 = hf (x0 + h, y0 + k3 ) = 0.1f (0.1, 0.96545654732) = −0.03154393258.
We take those 4 values and substitute them into the Runge-Kutta RK4 formula:
1
y1 = y(x0 + h) = y(0.1) = y(0) + (k1 + 2k2 + 2k3 + k4 )
6
1
= 1+ (−0.03678794411−2×0.03454223937−2×0.03454223937−0.03154393258)
6
98 MATH3800 NOTES-ERIC HUA
= 0.9655827899
Steps 2-10: Repeat Step 1 with initial values (x1 , y1 ) = (0.1, 0.9655827899).
Example 62. Use Runge-Kutta method of order 4 to solve the following equa-
tion, using the step size h = 0.5 for 0 ≤ t ≤ 2:
dy
= y − t2 + 1, y(0) = 0.5.
dt
Given that the exact solution is
1
y(t) = t2 + 2t + 1 − et ,
2
estimate the error.
Solution:
Step 1:
k1 = hf (t0 , y0 ) = 0.5f (0, 0.5).
1 1
k2 = hf (t0 + h, y0 + k1 ) = 0.5f (0.25, 0.5 + k1 /2).
2 2
1 1
k3 = hf (t0 + h, y0 + k2 ) = 0.5f (0.25, 0.5 + k2 /2).
2 2
k4 = hf (t0 + h, y0 + k3 ) = 0.5f (0.5, 0.5 + k3 ).
We take those 4 values and substitute them into the Runge-Kutta RK4 formula:
1
y1 = y(t0 + h) = y(0.5) = y(0) + (k1 + 2k2 + 2k3 + k4 )
6
Steps 2-4: Repeat Step 1 with initial values (t1 , y1 ).
MATH3800 NOTES-ERIC HUA 99
dy
Fourth-order Runge-Kutta Method proof: = f (x, y):
dx
dy
= f (x, y), y 0 (xn ) = f (xn , yn ).
dx
By Taylor’s formula,
k1 = hf (xn , yn ),
k2 = hf (xn + c2 h, yn + a21 k1 ), !
i−1
X
ki = hf xn + ci h, yn + aij kj ,
j=1
s−1
!
X
ks = hf xn + ci h, yn + aij kj ,
j=1
i−1
X
aij = ci for i = 2, . . . , s
j=1
b1 b2 ... bs
0 0
1
0 0 0 0 0
1/2 1/2 0 0 0
1/2 0 1/2 0 0
1 0 0 1 0
1/6 1/3 1/3 1/6