Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Elementary Numerical Analysis. Homework 1. 1. Convert the following decimal numb

ID: 3881975 • Letter: E

Question

Elementary Numerical Analysis.

Homework 1.

1. Convert the following decimal numbers to binary and hexadecimal forms

65, 10.01, 33.8125.

2. Convert the following numbers to decimal form

(1011.011)2, (B5A.D4)16.

3. Calculate directly in base 2

1110.0111 + 101.01 =? 1110.0111 101.01 =? 1110.0111 · 101.01 =? 1110.0111 / 101.01 =?

4. The following MATLAB program computes the unit roundo of the computer that you are using:

k = 0;

twopowerk = 1.0;

half = 1.0/2.0;

b = 1.0;

while (b ~= 0.0)

k = k-1;

twopowerk = twopowerk*half;

a = 1.0 + twopowerk;

b = a - 1.0;

end

fprintf(’k=%3.2d unit roundoff=%20.16e ’,k,twopowerk)

Type and run this program. What is the nal value of k? What is the value of the unit roundo?

5. What are the exact values of the machine epsilon M, of the unit roundo u, of the smallest and largest positive normalized oating-point numbers xmin and xmax, and of the largest representable integer M for IEEE double precision arithmetic which uses rounding and whose parameters are b = 2,p = 53,emin = 1022,emax = 1023? Give your results in base 10 with at least 12 correct signicant digits.

6. For the simple academic example of oating-point arithmetic (b = 2,p = 3,emin = 2,emax = 2, see p. 5 of the class notes) what are the corresponding oating-point representations of (1.4)10 and of (2.75)10 using rounding?

Explanation / Answer

1) This is the way computer will store the numbers :

65 = (1111111111111111111111111111111111111111111111111111111110111111)2 = (FFFFFFFFFFFFFFBF)16

10.01=(01000001001000000010100011110110)2=(412028f6)16

33.8125=(11000010000001110100000000000000)2=(C2074000)16

2) (1011.011)2= (11.375)10=(B.6)16

(B5A.D4)16= (2906.828125)10

3) 1110.0111

+0101.0100

--------------------

0011.1011

----------------------

1110.0111

0101.0100

--------------------

1001.0011

---------------------

1110.0111

. 0101.0100

------------------

11100111

11100111x

11100111xx

-----------------------

110010100.01

---------------------------

1110.0111 / 101.01 = 10.11

4) k=-53 unit roundoff=1.1102230246251565e-16

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote