Note. Several of the book problems ask for the "actual error". The actual error is true value - approximation. In these problems the actual error is f(x) - Pn(x). For example, in problem 7b, the actual error in using P2(0.5) to approximate f(0.5) is f(0.5) - P2(0.5).
Due
Thursday, Sept 12 (Week 3, day 2)
Set 2.
9E Section 1.2 (p. 28): 1c, 2b, 5ae, 6e, 7e, 8e, 12*, 15ab, (extra credit: 26)
10E Section 1.2 (p. 28): 1c, 4b, 6a, 7a, 8a, 9a, 10a, 14*, 19ab, (extra credit: 29)
*In 12c (or 14c) follow the example of the answer in the back of the book for 11c (or 13c). That is, simplify (P3(x) - P3(-x))/x
using algebra.
Evaluate, as a decimal number, the
half-precision
numbers with these bit representations
0 10000 1000000000
0 10010 1010000000
1 01110 0000000000
0 00000 1010000000 (Note: this is subnormal: see the
wiki page on half-precision.)
Due Thursday, Sept. 19 (Week 4, day 2)
Set 3.
Section 1.3 (p. 39): 1a, 6a, 7a, (9 in 9E or Discussion question 3 in 10E)
Write a MATLAB, Mathematica, Python, C/C++ or other program to implement the bisection method to find a point closer than tol to a solution to f(x) = 0 in [a, b].
Your code should define f(x), and initialize a and b and a tolerance tol.
Check to make sure that f(a) and f(b) have opposite sign.
Turn in a hardcopy of the code
and use it to solve:
Section 2.1: 5a, 7, 13, (14 in 9E or 17 in 10E)
Due Thursday, October 3 (Week 6, day 2)
Set 4.
Section 2.2: 1, 2, (13 in 9E/ 15 10E)
Section 2.3: 1, 5a, 7a (computer only), (14 in 9E/ 20 in 10E).
Print out a listing of your matlab (or other language) code for fixed point iteration (including Newton's method), and for secant method. (2 programs)
Notes:
* The computer programs will
be needed for computer project 1, which will be asigned soon.
* Do all of these (except 2.3, 7a) with a calculator and your computer program. You will be asked to do fixed
point iteration and Newton's method on your calculator at the exam, which will be after project 1 is due.
* They want an answer with some desired accuracy (tol), you may stop when |pn-1 - pn| < tol.
Unlike the bisection method, with fixed point methods it is hard to guarantee that pn is within tol of the true solution.
Corollary 2.5 can do this, you do not need to use this in the homework.
Due Wednesday, October 9 (Week 7) at 11:59 pm via email
Project 1
Due Tuesday, October 29 (Week 10, day 1)
Set 5.
Section 3.1: 2a, 4 (related to 2a only), 9, (14 in 9E/ 15 in 10E) (Answer to 9 is y = 4.25; answer in 9E is wrong.)
We skipped section 3.2.
Section 3.3: 1a, 2a, 7, (10 in 9E / 19 in 10E), (11 in 9E / 20 in 10E), (17 in 9E / 16 in 10E), (19 in 9E / 21 in 10E)
Here is a scanned solution of a previous semester's first problem: section 3.1: 1a.
I didn't assign it this semester becasue
the answer in the back of the book is wrong.
Due
Thursday, November 7 (Week 11)
Set 6
Section 3.5: 1 (change to f(2) = 3), 2 (change to f(2) = 3), 11, 14, (26 in 9E / 34 in 10E), (27 9E / 35 in 10E)
Note: for problems 1 and 2, get the 8 equations in 8 unknowns and solve them by hand or with electronic assistance.
I suggest you use reduced-row-echelon form (rref) on your calculator. I will expect you to be able to solve
linear systems on your calculator at the next exam.
You will not be required to implement Algorithms 3.4 and 3.5. The algorithms prove that there is always a unique solution
to the linear equations for the coefficients in the cubic spline.
Section 3.6 #3a, 3c, 4.
Also, write a program in Mathematica (modify the notebook below) or Matlab or other language that will graph a function f: [a, b] -> R using cubic Bezier curves
(several n = 1 clamped cubic spline curves).
Input the function f (and f' if you are not using Mathematica, or the symbolic package in MATLAB).
Also input a, b, and n (the number of subintervals)
Output is a approximate graph of f on the interval [a, b] using a Bezier curve (n=1 clamped
cubic spline) on each of the n subintervals of length h = (b-a)/n:
[a, a+h], [a+h, a+2h], ... [b - h, b].
Turn in a printout of your code, and the result of plotting f(x) = e^(-x^2) on [0,
3] using n = 1, 2, and 3.
You may start with this Mathematica notebook, and modify it: plotFunctionUsingClampedSplines.nb.
For problem 3 find the cubic polynomials by hand, and use this Mathematica notebook, Bezier2D.nb,
or some other software to plot the output of the parametric curves you find by hand.
The answer in the book for 3c should not say "For t between (0,0) and (4,6), we have". Instead it should say "For the curve between (0,0) to (4,6)
use the following with 0 ≤ t ≤ 1:" Similarly, the second curve has 0 ≤ t ≤ 1.
For problem 4, use the BezierCurve function in that same Mathematica notebook, Bezier2D.nb, or use some other program.
The notation in problem 4 is wrong (in both 9E and 10E). The heading row should be
i, xi, yi, xi+, yi+, xi-, yi-
Here is my version of the N figure of problem 4.
Due Tuesday, November 19 (Week 13, day 1)
Set 7.
Section 4.1: 1a, 3a, 5a, 7a, 28 (Same in 9E and 10E)
Note: The solutions in the back to problems 4.1: 1 and 3 are misleading, since they try to do the forward difference (FD, with h > 0) and the backward difference (BD, with h < 0) together.
Do the FD and the BD separately.
Due Tuesday, November 26
at 11:59 pm via email (Week 14)
Project 2. You may want to start with this numInt.nb
Mathematica notebook or this numint.txt MATLAB file (save as numint.m). You can also use any other computer language.