2 Errors and Uncertainties
2 Errors and Uncertainties
2 Errors and Uncertainties
APRIL/2015
1
Topics
2
Errors and Uncertainties in Computations
Whether you are careful or not, errors and uncertainties are a part of
computation. Some errors are the ones that humans inevitably make, but
some are introduced by the computer. Computer errors arise because of
the limited precision with which computers store numbers or because
algorithms or models can fail. Although it stifles creativity to keep
thinking “error” when approaching a computation, it certainly is a waste
of time, and may lead to harm, to work with results that are meaningless
(“garbage”) because of errors. In this chapter we examine some of the
errors and uncertainties that may occur in computations. Even though we
do not dwell on it, the lessons of this chapter apply to all other chapters
as well.
To err is human, to forgive divine.
Alexander Pope
3
Problem: Life + Errors (Uncertainties)
Errors always are part of computation
Finite precision -> uncertainties = “errors”
Don´t be afraid and Don’t play with garbage.
Errors accumulate with steps Ui
Ex:
Start -> U1 -> U2 -> … -> Un -> end (1)
p = probability Ui correct
P = pn = probability n steps correct
n = 1000, p= 0,9993 -> P = 1/2
4
Types of Errors: (4 plagues)
1. Bunders: typos, wrong program, wrong data, ….
2. Ramdom errors: electronic fluctuations, cosmic rays, someone
pulling a plug…
• Rare, but if 108 steps?
• Can’t control
• Repeat calculation
5
Types of Errors: (4 plagues)
4. Round-Off Errors: imprecision arising from the finite number of digits
used to store floating-point numbers.
• Beause: numbers via finite # bits
• ≈ uncertainties in measurement
• Some numbers represent exact (2n)
• Accumulates with steps -> unstable
• -> garbage: RO ≈ result:
(3)
6
Model for disaster: Subtractive Cancelation
Theorem: If you subtract two large numbers and end up with a small
one, there will be less significance, and possibly a lot less significance, in
the small one.
7
Model for Multiplicative Errors
8
Experiment: Determine Errors
2. Converged ≠ correct
3. How $$ (time consuming) ?
9
Experiment: expect behavior
10
Experimental Approach
11
The end:
Computational Physics
Problem Solving with Computers, Rubin Landau, Enlarged eTextBook Python
3rd Edition, Pag: 51
12