MATH 472: Numerical Methods With Financial Applications: Course Basics Fundamentals
MATH 472: Numerical Methods With Financial Applications: Course Basics Fundamentals
Lecture 1
Course Basics
Chapter 0 Fundamentals
Prakash Chakraborty
University of Michigan
1 / 18
Course basics
2 / 18
Course basics
Homework Rules
I Show your work neatly.
I Ensure your homework is in the correct order (the order in which the problems
were assigned) before uploading to Canvas. Make sure that your name, section
# as well as assignment # is written on the first page.
I If you feel that some parts of a graded assignment should be regraded, please
come to me within 2 weeks of getting back your assignment.
2 / 18
Course basics
Homework Rules
I Show your work neatly.
I Ensure your homework is in the correct order (the order in which the problems
were assigned) before uploading to Canvas. Make sure that your name, section
# as well as assignment # is written on the first page.
I If you feel that some parts of a graded assignment should be regraded, please
come to me within 2 weeks of getting back your assignment.
Admin
I All questions regarding course registration and waitlist should be asked to the
Student Services Office in 2082 East Hall. We will do our best to get you into a
section of the course which has space.
2 / 18
Course basics
Homework Rules
I Show your work neatly.
I Ensure your homework is in the correct order (the order in which the problems
were assigned) before uploading to Canvas. Make sure that your name, section
# as well as assignment # is written on the first page.
I If you feel that some parts of a graded assignment should be regraded, please
come to me within 2 weeks of getting back your assignment.
Admin
I All questions regarding course registration and waitlist should be asked to the
Student Services Office in 2082 East Hall. We will do our best to get you into a
section of the course which has space.
2 / 18
Course basics
Matlab
I There will be homework assignments that need the help of Matlab, such as
running or writing codes.
I Instructions on getting Matlab at no cost could be found at http://caenfaq.
engin.umich.edu/software-for-students/Matlab-for-students.
3 / 18
Course basics
Matlab
I There will be homework assignments that need the help of Matlab, such as
running or writing codes.
I Instructions on getting Matlab at no cost could be found at http://caenfaq.
engin.umich.edu/software-for-students/Matlab-for-students.
I There are also alternative online analogues of Matlab, by simply searching
“Matlab online”, such as
https://www.tutorialspoint.com/execute_matlab_online.php. However,
these online analogues may not be as powerful as Matlab. For example, if you
want to round a number 1.3456 to the first decimal place, you may run the code
“round(1.3456,1)”. Matlab will give you the answer 1.3, while the above online
tool will give you an error, which means you have to run the code
“round(1.3456*10)/10” instead.
3 / 18
Course basics
Matlab
I There will be homework assignments that need the help of Matlab, such as
running or writing codes.
I Instructions on getting Matlab at no cost could be found at http://caenfaq.
engin.umich.edu/software-for-students/Matlab-for-students.
I There are also alternative online analogues of Matlab, by simply searching
“Matlab online”, such as
https://www.tutorialspoint.com/execute_matlab_online.php. However,
these online analogues may not be as powerful as Matlab. For example, if you
want to round a number 1.3456 to the first decimal place, you may run the code
“round(1.3456,1)”. Matlab will give you the answer 1.3, while the above online
tool will give you an error, which means you have to run the code
“round(1.3456*10)/10” instead.
I Appendix B in the textbook gives a brief introduction to Matlab’s commands and
features.
I Matlab has a very powerful and friendly user help system. You could either
search your question online or type “help XYZ” in Matlab, where XYZ is any
function name that you want to get help on.
3 / 18
Before we start
Why do we have to take this course and learn the required topics on Numerical
Methods with Financial Applications?
4 / 18
Before we start
Why do we have to take this course and learn the required topics on Numerical
Methods with Financial Applications?
I I will do research on theories, instead of working on numerical analysis, in and
after the graduate school.
4 / 18
Before we start
Why do we have to take this course and learn the required topics on Numerical
Methods with Financial Applications?
I I will do research on theories, instead of working on numerical analysis, in and
after the graduate school.
I I will find a job in banks, factories, insurance/IT/... companies, etc.
4 / 18
Before we start
Why do we have to take this course and learn the required topics on Numerical
Methods with Financial Applications?
I I will do research on theories, instead of working on numerical analysis, in and
after the graduate school.
I I will find a job in banks, factories, insurance/IT/... companies, etc.
I People have already got many software products and function packages. I could
just use them.
4 / 18
Before we start
Why do we have to take this course and learn the required topics on Numerical
Methods with Financial Applications?
I I will do research on theories, instead of working on numerical analysis, in and
after the graduate school.
I I will find a job in banks, factories, insurance/IT/... companies, etc.
I People have already got many software products and function packages. I could
just use them.
4 / 18
Before we start
Why do we have to take this course and learn the required topics on Numerical
Methods with Financial Applications?
I I will do research on theories, instead of working on numerical analysis, in and
after the graduate school.
I I will find a job in banks, factories, insurance/IT/... companies, etc.
I People have already got many software products and function packages. I could
just use them.
4 / 18
Before we start
Why do we have to take this course and learn the required topics on Numerical
Methods with Financial Applications?
I I will do research on theories, instead of working on numerical analysis, in and
after the graduate school.
I I will find a job in banks, factories, insurance/IT/... companies, etc.
I People have already got many software products and function packages. I could
just use them.
5 / 18
Before we start
5 / 18
Before we start
5 / 18
Before we start
5 / 18
Before we start
Example 2 continued: .
6 / 18
Before we start
Example 2 continued: .
6 / 18
Let us get started
Chapter 0 Fundamentals
7 / 18
0.1 Evaluating a polynomial
8 / 18
0.1 Evaluating a polynomial
8 / 18
0.1 Evaluating a polynomial
8 / 18
0.1 Evaluating a polynomial
9 / 18
0.1 Evaluating a polynomial
9 / 18
0.1 Evaluating a polynomial
Question: What is the best way to evaluate
P (x) = 2x4 + 3x3 3x2 + 5x 1
1
at x = 2
in the computer?
Method 3: (Nested Multiplication or Horner’s method) Rewrite the polynomial
backwards and factor out x successively, so that it can be evaluated from the
inside out:
P (x) = 1 + 5x 3x2 + 3x3 + 2x4
= 1 + x(5 3x + 3x2 + 2x3 )
= 1 + x(5 + x( 3 + 3x + 2x2 ))
= 1 + x(5 + x( 3 + x(3 + 2x)))
= 1 + x ⇤ (5 + x ⇤ ( 3 + x ⇤ (3 + 2 ⇤ x))).
10 / 18
0.1 Evaluating a polynomial
Question: What is the best way to evaluate
P (x) = 2x4 + 3x3 3x2 + 5x 1
1
at x = 2
in the computer?
Method 3: (Nested Multiplication or Horner’s method) Rewrite the polynomial
backwards and factor out x successively, so that it can be evaluated from the
inside out:
P (x) = 1 + 5x 3x2 + 3x3 + 2x4
= 1 + x(5 3x + 3x2 + 2x3 )
= 1 + x(5 + x( 3 + 3x + 2x2 ))
= 1 + x(5 + x( 3 + x(3 + 2x)))
= 1 + x ⇤ (5 + x ⇤ ( 3 + x ⇤ (3 + 2 ⇤ x))).
Now evaluate from the inside out:
1 1
⇤ 2, add + 3 ! 4,
multiply multiply ⇤ 4, add 3! 1,
2 2
1 9 1 9 5
multiply ⇤ ( 1), add + 5 ! , multiply ⇤ , add 1! .
2 2 2 2 4
There are 4 multiplications and 4 additions.
10 / 18
0.1 Evaluating a polynomial
11 / 18
0.1 Evaluating a polynomial
Some applications may require a more general form, e.g., the interpolation
calculations in Chapter 3 requires the form
11 / 18
0.1 Evaluating a polynomial
Example 0.1
Find an efficient method for evaluating the polynomial
12 / 18
0.2 Binary numbers
. . . b2 b1 b0 .b 1 b 2 ...,
13 / 18
0.2 Binary numbers
. . . b2 b1 b0 .b 1 b 2 ...,
. . . b2 2 2 + b 1 2 1 + b 0 2 0 + b 12
1
+b 22
2
... .
For example, the decimal number 4 is expressed as (100.)2 in base 2, and 3/4
is represented as (0.11)2 .
13 / 18
0.2 Binary numbers
. . . b2 b1 b0 .b 1 b 2 ...,
. . . b2 2 2 + b 1 2 1 + b 0 2 0 + b 12
1
+b 22
2
... .
For example, the decimal number 4 is expressed as (100.)2 in base 2, and 3/4
is represented as (0.11)2 .
Question: How to convert decimal to binary? E.g. (53.7)10 = (?)2
13 / 18
0.2.1 Decimal to binary
It is simplest to break the decimal number into integer and fractional parts and
then convert each part separately. Write (53.7)10 = (53)10 + (0.7)10 .
14 / 18
0.2.1 Decimal to binary
It is simplest to break the decimal number into integer and fractional parts and
then convert each part separately. Write (53.7)10 = (53)10 + (0.7)10 .
Integer part: Convert decimal integers to binary by dividing by 2 successively
and recording the remainders. The remainders, 0 or 1, are recorded by starting
at the decimal point (or more accurately, radix) and moving away (to the left).
For (53)10 , we would have
.
14 / 18