Module 02:
Finding roots
Started Tuesday, March 22, 2016
21/03/2016
CS371/AM242 Winter 2016
1
Given a function f(x), computationally
find x* such that f(x*) = 0.
Possible computational problems:
fl(x*) may not be exact
fl(f(x*) may not be exactly 0
Ad

Module 06:
Finding roots
Started Tuesday, March 22, 2016
30/03/2016
CS371/AM242 Winter 2016
1
Given a function f(x), computationally
find x* such that f(x*) = 0.
Possible computational problems:
fl(x*) may not be exact
fl(f(x*) may not be exactly 0
Ad

We have so far assumed
Unique soln to Ax = b, and
Well-conditioned system.
It can be shown (see course notes) that the
conditioning of solving Ax=b depends primarily
on properties of A.
For example, consider (A) (x+ x) = b+b, what
x
x
can we say about

Ax = b, where
=
,b= ,x=
If n<m: Underdetermined system
If n>m: Overdetermined system
We will concentrate on square systems with
unique solutions
22/02/2016
Module 03: Linear Systems
25
How to solve Ax=b
Use the inverse matrix: = ()

Module 03: Fourier Analysis
Working with periodic data and
some cool algorithms
Starting Tuesday, January 26, 2016
26/01/2016
1
Fourier Analysis
The process of approximating periodic
functional data (from observations or a known
function) with a (possibl

Cubic Spline Interpolation
21/01/2016
CS371/AM242 Winter 2016
30
Set the scene spline S(x)
= for , , where
= + +
+
Since j=0:n-1, we have 4n unknowns.
What "knowns" do we have?
21/01/2016
CS371/AM242 Winter 2016
31
Knowns: for k=0:n-1
The functio

Module 02: Interpolation
Starting Thursday, January 14, 2016
11/02/2016
CS371/AM242 Winter 2016
1
What is interpolation?
According to wikipedia:
In the mathematical field
of numerical analysis,
interpolation is a method
of constructing new data
points wit

Error bound on Lagrange Interpolation
Theorem: Assume that
x0, x1, x2, , xn are distinct values of [a,b]
f is (n+1) times continuously differentiable
over [a,b]
Then, for all x [a,b], () [a,b] such that
() ( )
( )( ) ( )
= +
+1 !
for the Lagrange int

Module 02: Interpolation
Starting Thursday, January 14, 2014
14/01/2016
CS371/AM242 Winter 2016
1
What is interpolation?
According to wikipedia:
In the mathematical field
of numerical analysis,
interpolation is a method
of constructing new data
points wit

CS371/AM242
Introduction to
Computational Mathematics
Winter 2016
Module 01
Starting Tuesday, January 5, 2016
05/01/2016
CS371/AM242 Winter 2016
1
Course Information
Basic Information on course web page
https:/www.student.cs.uwaterloo.ca/~cs371/
Most in

Assignment 1
AMATH 242 CS 371
Due 1:00 p.m., January 17th, 2017
Collobaration: You can discuss your assignment with your classmates and consult outside
sources, but the final write-up must be strictly your own. Every line of the code you hand
in must be

Assignment #4. LU factorization.
AMATH 242 /CS 371
Due 1:00 p.m., February 28th, 2017
1. Solve the system Ax = b by hand
1 2 4
A = 2 5 2 ,
4 1 1
11
b = 3 .
8
(1)
(a) Find the LU decomposition of A. Show all your work, including explicit expressions
for th

W2017 Eduardo Martn-Martnez
AMATH475/AMATH675/PHYS476 Assignment 1v2.
Hnading-in instructions READ CAREFULLY
This assignment consists of 5 questions and it is due on Thursday, February 9th by
7pm. Once completed Your homework will be due in the homework d

Assignment #3.
AMATH 242 /CS 371
Due February 9th, 2017, by 1 p.m., NO EXTENSIONS
Reading: (1) Course Notes Ch. 5, 6 and
(2) M. Heath, Chapters on Integration and Interpolation (posted through Course Reserves)
1. Let f (x) = x2 + 3x + 2. Let y2 (x) be the

Assignment #2. Zeros and roots.
AMATH 242 / CS 371
Due 1:00 p.m., January 31st, 2017
This is a longer assignment that involves computing - delaying working on it until the last
evening is not a good idea.
Everything said at the top of Assignment # 1 is

Discrete Fourier Transform (DFT)
() not usually known exactly
Periodic data, period T, ( ) = ()
Assume N evenly spaced observations at
= (/), = 0: 1
Our "known" values are: , = 0: 1
We will assume = , due to periodic data
02/02/2016
24
Di

Bzier Curves
What if we drop the requirement that the
interpolating curve must travel through all
points, but only required it to go through the
first and last points?
The remaining points will still influence the
shape of the curve, but won't necessari

Consider the double integral:
,
Use simple Simpson's Rule to approximate
over each variable individually
Follow-up:
How many function evaluations are needed
for composite rule, if we want to divide xinterval into n pieces, and y-interval into n

What if the system is overdetermined?
(More equations than unknowns)
=
And x =
03/03/2016
b=
where m > n.
Module 03: Linear Systems
77
How many solutions are there?
No solutions
x1 + x2 = 2, x1 x2 = 0, x1 + 2x2 = 5
One solution
x1 + x2 = 2, x1

Module 05:
Numerical Integration
Starting Thursday, March 10, 2016
10/03/2016
CS371/AM2142 Winter 2016
1
The Definite Integral
Given a continuous function f(x) and an interval
[a,b], determine:
=
Solution:
Find F such that
=
10/03/2016
=
CS371/

Inverse DFT: How to we convert back?
Recall,
M=
=
1
1
1
1
()
=
Show that
04/02/2016
1
()
()()
37
IDFT Continues
= which implies =
,
so
=
04/02/2016
38
Important Note: Matlab's DFT
Uses fast version of the algorithm (FFT) coming soon

Module 03: Fourier Analysis
Working with periodic data and
some cool algorithms
Starting Tuesday, January 26, 2016
11/02/2016
1
Fourier Analysis
The process of approximating periodic
functional data (from observations or a known
function) with a (possibl

Solving the Least Squares Problem
Another matrix decomposition approach:
Factor = , where
is orthogonal ( =
)
is upper triangular with > 0
Use factorization in Normal Equations
08/03/2016
Module 03: Linear Systems
90
How to find QR?
Assuming A i

Composite Rules
Divide the interval into n equal pieces
= ( )/
,
= , = ,
= + = 0:
#
= $
=
!"
=
Each of the formulas can be used in this manner
14/03/2016
CS371/AM2142 Winter 2016
30
Composite Midterm Rule
14/03/2016
CS371/AM2142 Wint

Newton-Cotes Methods for
Approximate f(x) by a polynomial of degree n
Integrate the interpolating polynomial
Evaluate f(x) at n+1 evenly-spaced points
Can we reduce the error further by
considering other choices of points and
approaches?
17/03/2016
CS371/

Module 04:
Numerical Linear Algebra
Starting
Thursday, February 11, 2016
11/02/2016
Winter 2016 CS371/AM242
1
Google PageRank Algorithm:
An application of
Numerical Linear Algebra
We will look at a very simplified version of this
algorithm
Involves seve

Module 02: Interpolation
Starting Thursday, January 14, 2016
26/01/2016
CS371/AM242 Winter 2016
1
What is interpolation?
According to wikipedia:
In the mathematical field
of numerical analysis,
interpolation is a method
of constructing new data
points wit

Module 05:
Numerical Integration
Starting Thursday, March 10, 2016
30/03/2016
CS371/AM2142 Winter 2016
1
The Definite Integral
Given a continuous function f(x) and an interval
[a,b], determine:
=
Solution:
Find F such that
=
30/03/2016
=
CS371/