A13 · Problem set 1
Problem set 1: floating point, error and simple iterations
These problems use lessons 1 to 4: floating-point formats and spacing, rounding and cancellation, conditioning and stability, bisection and fixed-point iteration. Double precision has 53 significant bits.
Check
Doubles near x = 5000.
(a)
What's the spacing between neighbors there?
(b)
What's that spacing relative to x?
Check
A format has 16 significant bits.
(a)
What's its machine epsilon?
(b)
Above what integer does it first skip integers?
Check
A float32 running total adds 0.03 each step.
(a)
From what total does an addition stop changing it?
(b)
And for a double running total?
Check
Subtracting b = 1 from a = 1 + 0.0001.
(a)
By about what factor does the relative error grow?
(b)
About how many decimal digits does that cost?
Check
.
(a)
What's the small root?
(b)
What's the large root?
Check
Condition numbers.
(a)
What's κ for at x = 1 + 0.0001?
(b)
What's κ for at x = 10?
Check
Stability and conditioning.
(a)
A system has . About how many digits can a stable solver deliver?
(b)
The series for has terms up to what size?
Check
Bisection on a bracket 1 wide.
(a)
How many steps guarantee an error below 0.0001?
(b)
What's the guaranteed error after 20 steps?
Check
The iteration .
(a)
What does it converge to?
(b)
By what factor does each step shrink the error?
Check
A linear iteration with rate 0.2.
(a)
About how many steps for 9 digits?
(b)
If the last step changed x by 1 unit, about how far is x from the answer, in those units?
Check
A 5 V source drives a diode ( A, = 25.85 mV) through 1000 Ω.
(a)
What's after one step from 0.7 V of ?
Write units the way you normally would: 1.5 V, 1500 mV and 0.0015 kV are the same answer.
(b)
What's near there, , with ≈ 0.7 V?
Check
at x = 5 × 10⁸.
(a)
What's its true value?
(b)
What does double precision give when it's computed as written?
Check
A binary format has 24 significant bits.
(a)
What is its unit roundoff?
(b)
About how many decimal digits does it carry?
Check
Two positive numbers of similar size, each with a tiny relative error, differ by a relative amount 1 × 10⁻⁵. They are subtracted.
(a)
By about what factor does the subtraction amplify their relative errors?
Check
Bisection starts on a bracket 1 wide.
(a)
How many steps shrink the bracket below 1 × 10⁻⁶?
Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.
Practice
Keep practicing
15 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.