

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


AMSC/CMSC 460 Dr. Wolfe ASSIGNMENT #1 Due June 12, 2009
Ex.1.35, p.46, Numerical Computing with MATLAB. Modify the programs by insert- ing a counter that will count the lines of output. Do not hand in any output. Just answer the questions.
Ex.1.38, p.46, Numerical Computing with MATLAB
Ex.1.39, p.47, Numerical Computing with MATLAB Explain, using a fundamental property of the sine function, how one could modify powersin so it would compute sin x accurately for all real x.
Suppose a computer carries three decimal digits and rounds. If x and y are machine numbers, define the machine version of addition x ⊕ y to be the result of adding x and y and rounding to three digits. For example
3 ⊕ 57 .4 = 107.
Define machine multiplication x ⊗ y similarly. For example,
Constuct examples to show that, in general, the following statements are not true: (a) (x ⊕ y) ⊕ z = x ⊕ (y ⊕ z), (b) (x ⊗ y) ⊗ z = x ⊗ (y ⊗ z), (c) x ⊗ (y ⊕ z) = (x ⊗ y) ⊕ (x ⊗ z).
x¯ =
i=
xi.
The sample standard deviation s is defined to be
(N − 1)s^2 =
i=
(xi − x¯)^2.
Another expression,
(N − 1)s^2 =
i=
x^2 i −
i=
xi
is ofter recommended for hand computation of s. Show that these two expressions for s are mathematically equivalent. Explain why one of them may provide better numerical results than the other, and construct and example to illustrate your point.
sums to four significant figures. Compare your results with the correct sum x = 0 .113731041e + 5. (e+n means 10n.) 0.1673e+0 0.3875e+1 0.8053e+ 0.2548e+0 0.5478e+2 0.8886e+ 0.2997e+1 0.7113e+2 0.9546e+
ln(1 + x) − sin x − cos x + 1 x^3
Use MATLAB to compute f (x) for x = 10−m, m = 1, 2 , · · · , 12. According to the theory what is limx→ 0 f (x)? For x near zero what is a better way to compute f (x) ? (Hint: Use Taylor’s theorem on the numerator.)
with the starting values x 1 =
and x 2 =
Make a plot of log 2 xk (log2 in MATLAB) as a function of k. The exact solution of (1) is given by
xk =
41 −k 3 which decreases monotonically as k increases. Does your graph confirm this theo- retically expected behavior? Can you explain the results? (Hint: Find the general solution of (1). To do this, look for solutions of the form xk = αk^ and observe that (1) is linear.)