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

6. (Pencil-and-paper, adapted from Holmes Problem 1.16.) Assume single-precision

ID: 3110670 • Letter: 6

Question

6. (Pencil-and-paper, adapted from Holmes Problem 1.16.) Assume single-precision IEEE arithmetic. Assume that the round-to-nearest rule is used with one modification: if there is a tie then the smaller value is picked this rule for ties is used to make the problem easier (a) For what real numbers will the computer claim that the inequalities 1 ac 2 hold? (b) For what real numbers a will the computer claim 4? (c) Suppose it is stated that there is a floating point number r that is the exact solution of a2-2 0. Why is this not possible? Also, suppose and R are the floats to the left and right of V2 respectively. What is the value of T

Explanation / Answer


Since the number of digits to be rounded upto is not mentioned,
I leave the rounding part to you, but I'll state the maximum and minumum values storable by the floating point.

(a)
The lowest number that can be stored by the single precision floating point over 1 would be
0 01111111 00000000000000000000001 in the IEEE 754 format.
The highest real number below two that can be stored is 0 01111111 11111111111111111111111 in the IEEE 754 format.

(b) The computer will claim x=4 for real numbers between 0 10000000 11111111111111111111111 which is the highest value storable below 4 and 0 10000001 00000000000000000000001, which is the lowest value storable above 4 in IEEE 754.

(c) The exact solution to the equation is the root of two, which is irrational, and hence non-recurring and non-terminating.
This means the solution has infinite decimal places. Hence the solution cannot be stored exactly by a floating point number xf. The difference between the floats to the left and right of sqrt(2) would be the least measurable difference between the two floats, and since it lies between 1 and 2, the difference would be 20(2-23)=2-23.

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