# Homepage for CSC 338, Spring 2018

# Numerical Methods

# Department of Mathematical and Computational Sciences

# University of Toronto Mississauga

###

ANNOUNCEMENTS:

The TA will hold office hours on Weds April 11, 3-6pm, in
DH-3097D.

Solutions to Assignment 3 are now available outside my office
(DH-3090).

A marking scheme has been added to Assignment 3.

For the final exam, you are responsible for all the material
in the lecture slides in chapters 1, 2, 3, 5, and 6 that were
covered in class (see below). Chapter 7 will not be on the
exam.

The final tutorials for the semester will be on Weds April 4
at the usual time and place. The TA will conduct a review
for the final exam.

If you have trouble accessing the MNIST test data in Question
9(i), I have added a fix in the latest version of the question
on the assignment sheet.
The TA will hold office hours in DH-3097 on Friday March 30
from 3-6pm, on Mon April 2 from 5-7pm, and on Tues April 3 from
4-7pm.

In Question 1(a) of Assignment 3, you should compute Ha
without computing either H or v.

In Question 8(c) and (d), the gradient should be very close to
(0,0) at termination.

In Question 5(a) of Assignment 3, find the condition number as
a function of x.

I have added some slides to Chapter 6.

Assignment 3 is now complete. No more questions will be
added.

Question 8 on Assignment 3 is now complete.
In Questions 6(b) and (c), please print out the initial value
of x, as well as the final value.

Questions 1-6 and 9 on Assignment 3 are now complete.

A typo in Question 5(b)i on Assignment 3 has been corrected.

Another question has been added to Assignment 3 (March 23).

The TA will return the marked Assignment 1 on Thursday March
22 from 3-6pm in DH-3097.

The first five questions of Assignment 3 are now available,
below.

Midterm grades are now available on Blackboard.

The TA will return the marked midterms on Tuesday March 13
from 5-6pm in DH-3097.

Solutions to Assignment 2 and the midterm are now available
outside my office (DH-3090).

If (all of) Question 8 on Assignment 2 takes more than a
minute to execute, then you are probably using too many
loops. No doubly-nested loops are needed, and Questions
8(a), (b) and (e) don't need any loops at all.

A marking scheme has been added to Assignment 2.

Assignment 2 is now complete. No more questions will be
added. A marking scheme will be added shortly.
Please reread question 8 carefully, as some detailed changes
were made.

Questions 8(e) and (f) have been added to Assignment 2.

Questions 8(a) and (b) have been expanded somewhat (to include
error computations).

Some parts of Question 8 have been clarified.

An item (error computation) has been added to Questions 6 and
7

The first two parts of Question 8 have been added to
Assignment 2.
The midterm starts at 3:10pm sharp!
After the midterm, there will be a short break and then a
lecture.

Questions 6 and 7 have been added to Assignment 2.

Algorithm 2.7 on page 86 of the text has an error in it.
(See if you can find it.)

Here are the lecture slides
you are responsible for on the midterm.
A good way to study for the midterm is to do Assignment 2.
For the midterm, be sure to study the solutions to Assignment
1.

Question 2 has been reorganized and clarified.

The first five questions of Assignment 2 are now available.
Question 2 is now complete.

Question 3 has been expanded. Each of its answers must be
justified.
Solutions to Assignment 1 will be handed out in class and in
tutorial. They are also available outside my office door
(DH-3090).

A copy of an old midterm and the solutions are given below.

The MIDTERM TEST will be held on February 28 (NOT March
28). See below.

Reminder: hand in all your code, so we can generate your
output.

The TA will hold office hours on Monday February 5 from 5-7pm
in DH3097D for questions related to Assignment 1.
Typo: In Question 11(g), you should display z, not y.

Hint: In Question 7 of Assignment 1, look at the rounding
error produced by each of the three additions.

If you have trouble opening the MNIST data file, I have added
a fix in the latest version of the assignment.
Please use Python 2.7 (see below).

A grading scheme has been added to Assignment 1.
Questions 9 and 12 of Assignment 1 have been clarified.

Assignment 1 is now complete. A marking scheme will be
added shortly.

Most of Question 12 has been added to Assignment 1. More
questions will be added shortly.

The first part of Question 10 has been added to Assignment 1.

The first eight questions of Assignment 1 are now available,
below. More questions will be added shortly.
All tutorials will now take place in IB260.

Please read the NumPy tutorial, below.

COURSE DESCRIPTION

Numerical methods are algorithms for solving practical
problems in applied mathematics. They are used extensively in
many areas of science, engineering and business. For instance,
they are crucial to machine learning and data mining, robotics
and self-driving cars, video games and graphics, bioinformatics
and aerospace, computational finance and portfolio management,
as well as many other areas. In fact, many contemporary and
high-tech problems would be impossible to solve without
numerical methods. These problems include predicting climate
change, designing modern aircraft, producing special effects in
movies, finding hidden oil reserves, simulating car crashes,
computing the trajectory of spacecraft, estimating the future
value of stocks, optimizing the price of airline tickets,
simulating the biological activity of living cells, and many
more. Numerical methods are run on computers of all sizes, from
laptops to workstations to supercomputers. In fact, the need to
apply numerical methods to complex problems is the main reason
supercomputers were developed.

This course introduces the theory, practice and application of
numerical methods. As part of the course, you will expand your
Python skills to include numerical and scientific programming.
As a fringe benefit, you will also find out what all that math
you learned is actually used for!

PREREQUISITES:

Informal: a basic knowledge of calculus, linear algebra and
Python programming.
Formal: CSC148H5, 290H5/MAT202H5;
MAT134Y5/135Y5/137Y5/157Y5, MAT223H5/240H5
TEXT:

Michael Heath, Scientific
Computing: An Introductory Survey, Second Edition, McGraw
Hill, 2002.
Roughly the first half of the book will be covered.
The relevant chapters have been made available by McGraw Hill
in the textbook store at a special price.
Interactive
demos of the material in the text.
SOFTWARE:

The Python 2.7
programming language (Python 3.6 works most of the time, but
will occasionally produce frustrating errors or program
behaviour that you can't figure out, so please don't use it.)
The NumPy libraries
(Numerical Python)
The SciPy libraries
(Scientific Python)
The Spyder IDE
(Scientific Python Development Environment) (optional)
The easiest way to install this software on your own computer
is to download and install Anaconda, a
Python-based data-science platform that includes many popular
data-science packages, including NumPy, SciPy and Spyder.
Anaconda is also available on the MCS Lab machines.
NumPy
tutorial (highly recommended)
NumPy
user guide
SciPy
tutorial
Getting
started with SciPy
SciPy documentation
SciPy
lecture notes by Valentin Haenel, Emmanuelle Gouillart,
and Gael Varoquaux (eds)
INSTRUCTOR:

Anthony
Bonner
email: [my last name] [at] cs [dot] toronto [dot] edu
phone: 905-828-3813 (UTM), 416-978-7441 (St George)
office: DH-3090 (UTM), BA-5230 (St George)
office hours: Wednesday 6-7pm

GENERAL:

Classes: Wednesday 3-5pm IB140.
Tutorials: Friday 1-2pm IB260 and 2-3pm IB260.

Tutorials may introduce new material not covered in lectures
or the text.
Teaching Assistant: Samir Hamdi, shamdi [at] cs [dot]
toronto [dot] edu
Lecture slides (list of slides covered in class)

Course information sheet
On all work, 20% of your grade is for quality of
presentation, including the use of good English, properly
commented and easy-to-understand programs, and clear proofs.
Course Syllabus
ASSIGNMENTS:

Assignments should be submitted electronically at the UTORSubmit website.
All scanned submissions should be clear and readible.
Assignment 1 Due
February 6. No more questions will be added.
MNIST data file: tfMnist.pickle.zip
or npMnist.npy.zip
Submission instructions
for Assignment 1.

Assignment 2 Due March
6. No more questions will be added.

Data file for curve fitting: data2.pickle.zip
Submission instructions
for Assignment 2.

Assignment 3 Due April
3. No more questions will be added.
MNIST test data: npMnistTest.npy.zip
Submission instructions
for Assignment 3.

MIDTERM TEST:

February 28, in class.
Starts at 3:10pm sharp!
50 minutes, ends at 4pm.
There will be a short break and a lecture after the test.
CLOSED BOOK: no text book allowed.

CHEAT SHEET: You will be allowed a 1-page "cheat sheet"
(8.5x11in, single-sided). It should contain no more than 6,000
characters. If typed, it should be in 12pt font or larger.
No other aids are allowed.
You are responsible for all lectures, tutorials, the
assignments and assignment solutions.
Old midterm and solutions.
The midterm test will follow the "I don't know" policy: if you
do not know the answer to a question, and you write "I don't
know", you will receive 20% of the marks of that question. If
you just leave a question blank with no such statement, you will
get 0 marks for that question.
FINAL EXAM:

CLOSED BOOK: no text book allowed.
You must receive at least 40% on the final exam to pass the
course.
CHEAT SHEET: You will be allowed a 1-page "cheat sheet"
(8.5x11in, two-sided). It should contain no more than 12,000
characters. If typed, it should be in 12pt font or larger.
No other aids are allowed.
The exam will cover the entire course, but will emphasize
material not on the midterm.
You are responsible for all lectures, tutorials, assignments
and assignment solutions.
Here is an old exam.
The exam will follow the "I don't know" policy: if you do not
know the answer to a question, and you write "I don't know", you
will receive 20% of the marks of that question. If you just
leave a question blank with no such statement, you will get 0
marks for that question.
ADDITIONAL REFERENCES:

R.L.Burden, J.D. Faires, *Numerical Analysis*, 8th
Edition, Brooks/Cole, 2005.
Petersen and Pedersen, *The Matrix Cookbook*. Free Download
Lipschutz and Lipson, *Schaum's Outline of Linear Algebra*.
(very handy, very cheap)
Wrede and Spiegle, *Schaum's Outline of Calculus*.
(very handy, very cheap)
PLAGIARISM AND CHEATING:

Students should become familiar with and are expected to
adhere to the Code
of
Behaviour on Academic Matters, which can be found in the
UTM Calendar. The following web sites may also be helpful:
Advice
on avoiding plagiarism
Advice
on academic offences