Professional Documents
Culture Documents
ϵ ϵ ϵ
(1 − ) − 1 ⇒ (1 − ) − 1 ⇒ −
3 2 2
Part 1.3(b).
We know
ϵ
1 − 2−55 = 1 −
8
Noting the inequality
ϵ ϵ ϵ
1− <1− <1+ ,
4 8 2
we find that 1 − 2−55 falls within the range that will get rounded to 1. Thus, the quantity in the
parentheses evaluates to 1, meaning the entire quantity evaluates to 0 .
Part 1.3(e).
Note that
ϵ ϵ ϵ
1− <1− <1+
4 8 2
and that
ϵ ϵ ϵ
1− <1+ <1+
4 3 2
meaning both the numerator and denominator will evaluate to 1. Thus, the quotient is 1 .
Problem 1.14.
The printed output was:
hour: 1.0100501613189776e+02
second: 1.0100501665618636e+02
millisecond: 1.0100495865961672e+02
nanosecond: 1.0000000000000000e+02
picosecond: 1.0000000000000000e+02
The values computed for nanoseconds and picoseconds is clearly incorrect. This occurs because for
sufficiently large n, the quantity 1 + r/n will be rounded to 1 in floating point, effectively making
the calculation 100(1)n = 100, which is the case for part nanoseconds and picoseconds.
Given r ∈ (0, 1), for 1 + r/n to incorrectly evaluate to 1, it must be that
ϵ r ϵ
1− <1+ <1+
4 n 2
Since we know r > 0 and n > 0, we can just look at the second inequality and simplify.
r ϵ
1+ <1+
n 2
r ϵ
<
n 2
2r
n>
ϵ
So, for r ∈ (0, 1), we would expect incorrect values to occur starting at
2r
n=
ϵ
Problem 1.16(f).
Using the geometric sequence formula, we simplify the sum and multiply the numerator and de-
nominator by a constant to prevent evaluation of excessively large numbers.
e+1 e−1000 − e
<
e 1−e
(e − 1)(e + 1) < e − e−999
2
e2 − 1 < e2 − e−999
−1 < e−999
So, the first inequality holds. Looking at the second inequality, we have
e−1000 − e e
<
1−e e−1
e − e−1000 e
<
e−1 e−1
e − e−1000 < e
−e−1000 < 0
So, both inequalities hold and thus the original inequality holds.
( ) (1000 ) ( )
e+1 ∑ e
k
1000 + ln < ln e < 1000 + ln
e e−1
k=0
% ====== 1.16f
fprintf("\n\nQuestion 1.16f):\n\n%.16e\n", log(exp(-500) - exp(501)) -
log(exp(-500) - exp(-499)));
Question 1.16f):
1.0004586751453871e+03
1
Problem 1.21(b).
Intervals from 2 to 4 are of size 2ϵ and intervals from 4 to 8 are of size 4ϵ.
Thus, the numbers for which x will be rounded to 4 satisfy
4 − ϵ < x < 4 + 2ϵ
Problem 1.29.
Part 1.29(a).
The apparent limit is 0.002.
Part 1.29(b).
Note that sk − sk−1 = 0.63 · 10−(k+1) . Since 0.63 < 1, to find where iteration stops, we solve for
−(k + 1) = −8 which gives k = 7.
The number of significant digits is the number of digits between the 2 and 7, inclusive. This works
out to be k + 1 which means there are 8 correct significant digits at iteration k = 7.
Part 1.29(c).
Noting sk = 0.002 + 7 · 10−(k+3) , we have
So, iteration with relative error stops at k = 8, giving 9 correct significant digits.
Problem 6.
The largest n for which there was no error was 2.5 · 104 . My laptop has a 6-core CPU, 8 gigabytes
of DDR4 memory, and around 30 gigabytes of free space.
Note I have been running code using MATLAB Online since I had a bit of trouble installing the
MATLAB desktop application on my machine.