{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ps1solution

# ps1solution - 13.002 PS#1 Solution 1.2.4(a(1.0110101)2...

This preview shows pages 1–4. Sign up to view the full content.

13.002 PS #1 Solution 1.2.4. (a) (1.0110101) 2 = (2^0)+(2^-2)+(2^-3)+(2^-5)+(2^-7)= 1.41406250000000 1.2.4. (b) (11.0010010001) 2 = (2^1)+(2^0)+(2^-3)+(2^-6)+(2^-10)= 3.14160156250000 1.2.5. (a) 2 (1.0110101) = 1.41421356237309 1.41406250000000= 2 = 1.510623730900385e-004 (absolute error) 1.510623730900385e-004 = 1 .068172283940988e-004 (relative error) 1 .41421356237309 1.2.5. (b) π (11.0010010001) 2 = 3.14159265358979- 3.14160156250000 = -8.908910209992627e-006 (absolute error) 8.908910209992627e-006 = 2 .835794194964366e-006 (relative error) 3.14159265358979 1.2.13. (b) 1 1 1 ( + ) + = 10 3 5 × 2 1 ((0.1101) × 2 3 + (0.1011) ) = (0.1110) × 2 1 2 2 2 × 2 2 (0.1110) × 2 1 + (0.1101) = (0.1010) × 2 0 2 2 2 19 (0.1010) × 2 0 30 2 0.63333333333333- 0.6250000000000= 0.008 3 333333333 (absolute error) 0.0083333333333 = 0.01315... (relative error) 0.63333333333333

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
1.3.1.(b) 98350-98000 = 350 (absolute error) 350 = 0 .00355871886121 (relative error) (2 significant digits) 9 8350 1.3.1.(c) 0 .000068-0.00006= 8e-006 (absolute erro r ) 8e-006 = 0.117647058 (relative error) (no signifi c ant digits) 0 .000068 1.3.12 b 2 b 2 b + 4 ac b + 4 ac 2 c = x 1 new = b 2 b 2 2 a b + 4 ac b + 4 ac b 2 b 2 b 4 ac b 4 ac 2 c = x 2 new = b 2 b 2 2 a b 4 ac b 4 ac 1.3.13. (a) 2 x 1, 000.001 x + 1 = 0 b 2 b + 4 ac x 1 = = 1 000 2 a 2 c x 2 = = 0.001 b 2 b 4 ac
Programming Exercise 1 % script M-file findroots.m a=input(’Enter the value of "a" from ax^2+bx+c=0 :’); b=input(’Enter the value of "b" from ax^2+bx+c=0 :’); c=input(’Enter the value of "c" from ax^2+bx+c=0 :’); if b>= 0; sign=1; else sign=-1; end; q=-0.5*(b+sign*sqrt((b^2)-4*a*c)); x1=q/a; x2=c/q; xx1=num2str(x1); xx2=num2str(x2); disp([’X1 is equal to ’, xx1]) disp([’X2 is equal to ’,xx2]) Programming Exercise 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

ps1solution - 13.002 PS#1 Solution 1.2.4(a(1.0110101)2...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online