This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: ANSWERS CSci 5302 Homework 1 Due: 30 Jan 2018 1. 1a.
1b.
1c.
1d.
1e. 1f. 1h. 1i. 2a. There are 15 subquestions over 3 questions worth a total of 100 points over 2 pages. Assume you use the following 3 digit decimal arithmetic :l: X.YZ X 10*" where o X is any decimal digit 1, . . . , 9 (0 is allowed only for true zero) a Y,Z,W are any decimal digits 0, . . . ,9. Assume that we use the “round—to—even” rule, that overﬂows become inf ’s and that
underﬂows become zeroes. The “round—to—even” rule says that any result that is not
already representable should be rounded to the nearest representable number. If the
result is exactly half way between two representable numbers, it should be rounded to
the representable number that ends in an even digit. Answer the following questions (5 pts) Compute 2.04 x 10+1 144.50 x 10—1. 3.0 85.110 @ 108 Y 1'?) (5 pts) Compute 9.04 x 10+3»+ 9.55 x 10+? 191‘? 5 110B=> 1.0 o No“? (5 pts) Compute 9.04 x 10+9 + 9.55 x 10+8. 1°: 9 81‘ 10* 9:3 W FL (5 pts) Compute 1.44 x 10—8 — 1.40 x 10—8. 0 .o Lmo" g a) O {5 pts) Compute 1.44 x 10 3 — 1. 40 x 10 8 in a modiﬁed system that allows for
subnormal numbers. 0 O I" " '9 8—7—5 0. H 0 x :5 ‘7 (5 pts) Give the largest positive ﬂoating point number s such that ﬂ(9 99 X 10“1  a) = 9.99x101. s: a. $111041 1 “1120' '41 ‘1qu =9 c18801110 17711119 ( 5 pts} Give an example of a positive floating point number of the form a— H 1. 00 x 101 such that the ﬁoatingﬁproduct ﬂ(a >1< a) > 0 but ﬂ(a * a >1< a)— — 0. "111100110 4 )cz—LI
( 5 pts) How manyﬁilsitinc ct positive numbers can be represented in this system? \0 00 f 5 pts) How [ma1190 distinct 11d 131011.111 positive numbers can be represented in a modiﬁed
system that allows for subnormal numbers. Just cOunt the numbers that can be
represented in the modiﬁed system which cannot be represented in the original system
as given above. 0 \l %1 (0 cl —\3( 10110 100 \' CH (1111.: M11915)
In the following, use the same 3 digit ﬂoating point system as 111 the previous question
for all calculations. ( 12 pts) Compute the mathematically equivalent expressions y2 —:r2 and [y —a:]  [y+x]
with a: = 2.22 X 102 and y = 2.23 x 102. Fill in the table of intermediate values (a) 112 = 11.51? 110L1 ((1) y _ x = \«OﬂX’OO
(b) 952 = ”1331/09 (e) y + m = 4.115103
(C) y2_x2 = 9:031 IDL (f) (y—$)(y+m) = “ﬁsxmk 2b. 3a. 3b. 3c. 3d. (8 pts) For the ﬁnal results (c) and (f), answer the following (i) Which of (c) (f) are accurate to the full accuracy of the underlying arithmetic, if
any? (:6
(ii) Between (c) & (f), treat the more accurate answer as the “true” answer and
the other 5s)t11l§}“eomputed” answer. Give the absolute error in the .compﬂted ?
eeeeew c  e w 2 mm as Eweleg = e. .
(iii) Give the Wriii?relaltiir2§rr0r betweeln like compute and t 1; meiﬁswgfg ”0
(iv) the numbef (if digits 1' accuracy in the computed answer.
A I‘m \VQ, QFFOV . #(Lﬁi‘s «(Mugs \
Let 19(93) = 11:3 — 2.5x2 + 2:10 — .5011002. ( 10 pts) You buy a used calculator at a ﬂea market which claims to be able to ﬁnd
roots of polynomials. When you use it to ﬁnd the root of this 19(1):), the answer it gives
is 5: = 1.0. What is the backward error in this answer? @UObz«OOMDLo \L .1: .00 ex
(5 pts) Pick one of the £0110;ng ig’t‘éffv girldiilttﬁiii use to .st ltObieection to ﬁnd the root of the polynomial of question 3: [—1,0], [0, 1], [1, 2], assuming your calculator is
more accurate than the one from the ﬂea market. Identify your chosen interval and
show why you know the interval will work. Starting with your chosen interval, what would be the interval you’d have after 2 iterations of bisection? .
P t 13 = era :“5 NOV ”5' u em": ‘WH‘ "i use #1394‘5 ““3“" "‘ DEL]
(10 pts) Apply 2 iterations of Newton’s method to ﬁnd a; root of 11(33) = $3 — 2._5a:2'+ a“ .
2:1: — .5011002 = 0 with the starting value 1100 = l and then again with .399 = 0.9. Show ‘lQ‘C‘ W A
the formula for Newton’s method and a short table of Values 5:“ I. E}
J ‘H .00?) ”9(71
new 'Ltl'i‘t verse3.
3800‘ 3.95 Hr ”bee—9V Use :50 = 1 and again with x0 = 0.9. If it fails, explain Why. Stop after 2 iterations. (10 pts) Treat xt = 232 from one of the previous results as a true root pf p(a:). Let
ﬁx) = 51:3 — 2.551:2 +2m— .5 be an approximate polynomial. Evaluate p(a:t), p(f:), Mart),
and 13(57). Use these four values to give an estimate of the condition number of the
solution to p(x) = 0, pretending that p(:v) is the exact polynomial and act is the correct answer. NM: a lSe—S met ,5 W H“ :0“ . ”in _ eW tuberwiewei:
2 “(ll Phil“: Lit—‘35 ...
View
Full Document
 Spring '18
 Daniel Boley
 Algorithms, pts, Numerical digit, Positional notation, Decimal

Click to edit the document details