COMPUTER SCIENCE 349A
Handout Number 10
QUADRATIC CONVERGENCE OF NEWTON'S METHOD
The following result is proved on p. 141 of the 5th ed. (p. 150 of the 6th ed.)
Theorem If Newton's method is applied to f ( x) = 0 producing a sequence cfw_xi that
converge
COMPUTER SCIENCE 349A
Handout Number 9
An illustration of order of convergence when = 1 and = 2 . The limit of each
sequence is xt = 1.3652 3001 3414 097 .
Note: in the following computed approximations, the underlined digits are correct.
Example 1
Comput
COMPUTER SCIENCE 349A
Handout Number 8
THE BISECTION METHOD (Section 5.2: pp. 116-123 5th ed; pp. 124-131 6th ed)
- can be used to compute a zero of any function f ( x) that is continuous on an
interval [ xl , xu ] for which f ( xl ) f ( xu ) < 0 .
Consid
COMPUTER SCIENCE 349A
Handout Number 7
STABILITY OF AN ALGORITHM
Textbook (page 92 of the 5th ed.; page 97 of the 6th): a computation is numerically
unstable if the uncertainty of the input values is greatly magnified by the numerical
method. The followin
COMPUTER SCIENCE 349A
Handout Number 6
CONDITION OF A PROBLEM
Definition
A problem whose (exact) solution can change greatly with small changes
in the data defining the problem is called ill-conditioned.
data cfw_ di
defining a problem
exact solution cfw
COMPUTER SCIENCE 349A
Handout Number 5
Taylors Theorem is the fundamental tool for deriving and analyzing numerical
approximation formulas in this course. It states that any smooth function (one with a
sufficient number of derivatives) can be approximated
COMPUTER SCIENCE 349A
Handout Number 4
SUBTRACTIVE CANCELLATION (pages 68-72 of the 5th edition; pages 73-76 of
the 6th edition)
Subtractive cancellation refers to the loss of significant digits during a floatingpoint computation due to the subtraction of
COMPUTER SCIENCE 349A
Handout Number 3
Two methods of representing a real number p in floating-point: rounding and chopping.
Example
Let b = 10 , k = 4 and p = 2 / 3 .
floating - point
approximation to p
chopping
+ 0.6666 10 0
rounding
absolute error rela
COMPUTER SCIENCE 349A
Handout Number 2
Measures of error (pages 54-57 of the 5th edition of the textbook; pages 56-59 of the 6th
edition)
If p denotes the true (exact) value of some quantity, and p * denotes some
approximation to p, then
Et = p p *
is cal
COMPUTER SCIENCE 349A
Handout Number 11
ORDER OF CONVERGENCE OF THE SECANT METHOD
AND BISECTION METHOD
The Secant method iterative formula is
xi +1 = xi f ( xi )
xi xi 1
.
f ( xi ) f ( xi 1 )
Therefore, if xt denotes an exact zero of f ( x) ,
xi +1 x t =
COMPUTER SCIENCE 349A
Handout Number 12
MULTIPLE ROOTS AND THE MULTIPLICITY OF A ZERO
(Section 6.4 in 5th ed. or Section 6.5 in 6th ed.)
If Newton's method converges to a zero xt of f ( x) , a necessary condition for quadratic
convergence is that f ( xt )
COMPUTER SCIENCE 349A
Handout Number 13
HORNERS ALGORITHM
(NESTED MULTIPLICATION, SYNTHETIC DIVISION)
n
Given a polynomial f ( x) = ai x i and a value x0 , this algorithm is used to efficiently
i =0
evaluate f ( x 0 ) and f ( x0 ) . To illustrate the basi
CSc 349A A01/A02
Page 1
1. [18 marks]
For each of the specied functions in the table below, place an X in all of the
appropriate boxes to indicate for which of the sets of values of x the evaluation of the
function may have a large relative error using
,
!
i
CSc349~ AOI
Page 1
[18 marks]
1.
For each of the specified functions in the tablle below, place an X in all ofthe
appropriate boxes to indicate for which ofthe sets of values of x the evaluation of the
function may have a large relative error using
COMPUTER SCIENCE 349A SAMPLE FINAL EXAM WITH SOLUTIONS
(a) [4 marks] For what values of the real variable x , where x > 1, is the following expression subject to subtractive cancellation that will produce a very inaccurate result (in terms of relative err
COMPUTER SCIENCE 349A
SAMPLE EXAM QUESTIONS WITH SOLUTIONS
PARTS 3, 5, 6 , 7
PART 3.
3.1
Suppose that a computer program, using the Gaussian elimination algorithm, is to
be written to accurately solve a system of linear equations Ax = b , where A is an
ar
COMPUTER SCIENCE 349A
SAMPLE EXAM QUESTIONS WITH SOLUTIONS
PARTS 1, 2
PART 1.
1.1
(a) Define the term ill-conditioned problem.
(b) Give an example of a polynomial that has ill-conditioned zeros.
1.2
Consider evaluation of
f ( x) =
1
,
1 tanh( x)
where tan
COMPUTER SCIENCE 349A
Handout Number 15
NAVE GAUSSIAN ELIMINATION (Section 9.2)
Notation for a system of n linear equations in n unknowns: Ax = b , where
A is an n n nonsingular matrix
and
x and b are (column) vectors with n entries.
Equivalently,
a11 x1
COMPUTER SCIENCE 349A
Handout Number 14
ZEROS OF POLYNOMIALS USING NEWTON'S METHOD WITH
HORNERS ALGORITHM, AND POLYNOMIAL DEFLATION
Outline of a procedure to compute a zero of a polynomial f ( x) using Newton's method
and Horners algorithm:
Let x 0 be an
COMPUTER SCIENCE 349A
Handout Number 1
NUMERICAL ANALYSIS is the study of algorithms for solving problems of
continuous mathematics.
key words:
continuous mathematics
- means that real or complex
variables are involved
- the floating-point representation
COMPUTER SCIENCE 349A
SAMPLE EXAM QUESTIONS WITH SOLUTIONS
PARTS 3, 5, 6 , 7
PART 3.
3.1
Suppose that a computer program, using the Gaussian elimination algorithm, is to
be written to accurately solve a system of linear equations Ax = b , where A is an
ar
COMPUTER SCIENCE 349A
SAMPLE EXAM QUESTIONS WITH SOLUTIONS
PARTS 1, 2
PART 1.
1.1
(a) Define the term ill-conditioned problem.
(b) Give an example of a polynomial that has ill-conditioned zeros.
1.2
Consider evaluation of
f ( x) =
1
,
1 tanh( x)
where tan
COMPUTER SCIENCE 349A
Handout Number 26
NEWTON-COTES CLOSED QUADRATURE FORMULAS
The case n = 1 (Section 21.1 of the textbook):
f(x)
P(x)
h
x
a
= x0
b
= x1
Here h = b a . The (linear) interpolating polynomial is
P( x ) =
x x1
x x0
f ( x0 ) +
f ( x1 ) .
x 0
COMPUTER SCIENCE 349A
Handout Number 25
CUBIC SPLINE INTERPOLATION
Example: the case n = 3.
S (x)
2
S (x)
0
o
o
h0
x
S (x)
1
h1
x1
0
o
o
h2
x2
x3
o denotes interpolated values f(x i )
Condition (b) in the definition of a cubic spline interpolant implies t
COMPUTER SCIENCE 349A
Handout Number 24
CUBIC SPLINE INTERPOLANTS
The following definition is the same as given in points 1-5 on pages 501-502 of
the 5 ed. (pages 515-516 of the 6th ed.), but is more precise.
th
Definition
Given data
x0 , x1 , K , x n wi
COMPUTER SCIENCE 349A
Handout Number 23
THE RUNGE PHENOMENON
The following example is the classical example to illustrate the oscillatory nature
and thus the unsuitability of high order interpolating polynomials. It is due to Runge in
1901.
Consider the p