Está en la página 1de 12

Errors and Uncertainties in Computation

APRIL/2015

1
Topics

• Errors and Uncertainties in Computations


• Types of Errors, the 4 problems
• Disaster Model: Subtractive Cancelation
• Model for Multiplicative Errors
• Experiment Determine Errors
• Experimental Approach

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

3. Approximation errors: imprecision arising from simplifying the


mathematics, algorithm, approximation math.

(2) • Decrease as N increases


• Vanishes as N -> ∞

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)

• Significant figures •Most significant part: 1.12233


• a = 11223344556677889900 (4)
•Leas significant part: 44556677
• = 1.1223344556677889900 * 1019
•Error prone
• Exponent: stored separately
Small -> full precision

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

1. Basic algorithm questions:


◦ a) does it converge?
◦ b) if not, quit
◦ c) how precise are converged results?

2. Converged ≠ correct
3. How $$ (time consuming) ?

9
Experiment: expect behavior

10
Experimental Approach

11
The end:

Time for exercises

Computational Physics
Problem Solving with Computers, Rubin Landau, Enlarged eTextBook Python
3rd Edition, Pag: 51

12

También podría gustarte