
Numerical Computing S’09 MATH/CSCI 4800-01
Homework-1
Due in class on Thursday January 22, 2009
Illegible reports will be returned without grading. Show all work. All Matlab scripts, Matlab output and
plots should be printed out and stapled to the report.
1. Find (a) the binary representation of the base-10 number 12.8 and (b) the base-10 representation of
the binary number 10.0101101.(Overbar notation denotes recurrence of digits under the overbar.)
2. Express x= 12.8 as a single-precision IEEE float fl(x),using the round-to-nearest rule. (The result
of Problem 1 above will be useful.) Compute the relative error d=|x−fl(x)|/|x|exactly as a base-10
number, and show that dsatisfies d≤(1/2)mach.
3. (a) Text: Section 0.3, Page 16, Problem 4.
(b) Text: Section 0.3, Page 16, Problem 8.
(c) Let xand ybe normalized positive floating point numbers on a binary computer with p-bit
precision. How small can y−xbe if x < 4< y ?
4. (a) Text: Section 0.4, Page 19, Problem 2. Hint: Use a calculator. Use the ideas presented in Example
0.6 on pages 18-19 of the Text. Taylor expansion of the square root in the quadratic formula may
also be helpful.
(b) Text: Section 0.5, Page 23, Problem 8.
5. Text: Section 0.4, Page 20, Computer Problem 2(a).
6. Consider the polynomial f(x) = (x−1)6.It can also be written in the expanded form as g(x) =
x6−6x5+ 15x4−20x3+ 15x2−6x+ 1.Write a Matlab Script to plot fand gon the interval
[1−h, 1 + h], h = 0.005.In your program evaluate the expanded form gby Horner’s method, outlined
in Section 0.1 of the Text. You may use the Matlab script PolyTest.m provided on the course home
page as a starting point for your own script.
Make sure that the script is suitably commented, that the two functions are plotted in different colors,
that the axes are appropriately labeled, and that the plot is titled. Attach the script and the plot to
your report.
You will find that the two plots are not identical. Discuss the results, giving reasons for the observed
differences.