Professional Documents
Culture Documents
PS1B
PS1B
PS1B
IMPORTANT:
• You don’t need to turn in this problem set.
• The computer problems are marked by †.
How would you avoid overflow and harmful underflow in this computation?
Problem 3. † The polynomial (x − 1)6 has the value zero at x = 1 and is positive
elsewhere. The expanded form of the polynomial, x6 − 6x5 + 15x4 − 20x3 + 15x2 −
6x + 1, is mathematically equivalent but may not give the same results numerically.
Compute and plot the values of this polynomial, using each of the two forms, for
101 equally spaced points in the interval [0.995, 1.005], i.e., with a spacing of 0.0001.
Your plot should be scaled so that the values for x and for the polynomial use the
full ranges of their respective axes. Can you explain this behavior?
Problem 4. † Write a program to generate the first n terms in the sequence given
by the difference equation
xk+1 = 2.25xk − 0.5xk−1 ,
with starting values
1 1
x1 = and x2 = .
3 12
Use n = 25 if you are working in single precision, n = 60 if you are working in
double precision. Make a semilog plot of the values you obtain as a function of k.
The exact solution of the difference equation is given by
41−k
xk = ,
3
which decreases monotonically as k increases. Does your graph confirm this theo-
retically expected behavior? Can you explain your results? (Hint: Find the general
solution to the difference equation.)
1
Problem 5. Let A be an n × n matrix such that A2 = O, the zero matrix. Show
that A must be singular.
Problem 6. Let [ ]
1 1+ϵ
A= .
1−ϵ 1
(a) What is the determinant of A?
(b) In floating-point arithmetic, for what range of values of ϵ will the computed
value of the determinant be zero?
(c) What is the LU factorization of A?
(d) In floating-point arithmetic, for what range of values of ϵ will the computed
value of U be singular?
2
Problem 10. Let A be a band matrix with bandwidth β, and suppose that the
LU factorization P A = LU is computed using Gaussian elimination with partial
pivoting. Show that the bandwidth of the upper triangular factor U is at most 2β.