Taller 2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Taller 2

Danny Andres Garcia Jimenez

4,2) Convert the following base 2 numbers to base 10:

a)1011001

10111001= 1 x 26 +0 x 25 +1 x 24 + 1 x 23+ 0 x 22+ 0 x 21 +1 x 20=90

b)0.01011

0.01011=0 x 2−1+1 x 2−2+ 0 x 2−3 +1 x 24 +1 x 2−5 =0.34375

c)110.01001

110=1 x 22 +1 x 21+ 0 x 20=6

0.01001=0 x 2−1+1 x 2−2+ 0 x 2−3 +0 x 2−4 +1 x 2−5=0.28125

110.01001=6.28125

4.9) (a) Evaluate the polynomial

y=x 3−7 x 2 +8 x−0.35


At x=1.37 . Use 3-digit arithmetic with chopping. Evaluate the percent relative error

y=1.37 3−7 ( 1.37 )2 +8 ( 1.37 ) −0.35=0.043053


3 digit arithmetic with chopping Y=0.043

Percent relative error:

E=¿ 0.043053−0.04 3∨ ¿ ∗100 %=0.1231 % ¿


0.043053
(b) Repeat (a) but express y as

y= ( ( x−7 ) x+ 8 ) x −0.35

y= ( ( 1.37−7 ) 1.37+ 8 ) 1.37−0.35=0.043052999999999

E=¿ 0.043052999999999−0.043∨ ¿ ∗100 %=0.1231 % ¿


0.043052999999999
Ea =Eb

4.24) One common instance where subtractive cancellation occurs involves finding the roots of a
parabola, a x 2+ bx+ c , with the quadratic formula:

−b ± √ b2−4 ac
x=
2a
For cases where b 2 ≫ 4 ac , the difference in the numerator can be very small and roundoff errors
can occur. In such cases, an alternative formulation can be used to minimize subtractive
cancellation:

−2 c
x=
−b ± √ b2−4 ac
Use 5-digit arithmetic with chopping to determine the roots of the following equation with both
versions of the quadratic formula.

x 2−5000.002 x +10

−b ± √ b2−4 ac
Roots with x=
2a
X1= -0.00199 x2= -0.00199

Roots with

−2 c
x v=
−b ± √ b2−4 ac
X1v= -0.002 x2v= -5.000000000118234e+03

You might also like