P2 T1 L8 - Numerical errors Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Sometimes it is not possible to store an exact binary equivalent of the actual real number. (e.g. 1/3 as a decimal or binary)

This will affect the ________ of the stored numbers and introduce _________.

A

precision

errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State the 7 error types

A
  1. Precision
  2. Absolute
  3. Relative
  4. Rounding
  5. Cancellation
  6. Underflow
  7. Overflow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define precision error
(1 point)

Increasing significant bits used makes a number more accurate but reduces the exponent so the maximum size (number range) is _______

A
  1. When the number of bits used to represent the mantissa is too small to represent the number accurately.

reduced

e.g.
Implications of the following (Using 16 bits):
12 bit mantissa and 4 bit exponent more accurate but smaller number range
8 bit mantissa and 8 bit exponent less accurate but larger number range

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Define absolute errors (1 point)

What is the formula for an absolute error?

A
  1. The difference between an actual number and the nearest value that can be represented

Absolute error = (actual value – approximation)

e.g.
A bag of apples weighs 474g. Unfortunately the scales can only measure to 450g or 500g.

The absolute error is the actual difference: 24

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define relative error (1 point)

What is the formula for relative error?

A
  1. A way of identifying the scale of an absolute error as a percentage

Relative error = Absolute error / actual value * 100

e.g.
A bag of apples weighs 474g. Unfortunately the scales can only measure to 450g or 500g.
The absolute error is the actual difference: 24

The relative error is
24 / 474 = 0.0506 * 100 = 5.06%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define rounding errors

2 points

A
  1. Loss of value caused by rounding a number to nearest value that may be stored
  2. This may introduce an absolute error

E.g. 5.063291139240506 to 2dp is 5.06, in rounding we lost 0.003291139240506

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When do cancellation errors occur?

1 point

A
  1. These occur during addition or subtraction of numbers of widely different sizes in a restricted number of bits

E.g. adding a very big number to a very small number.
(1.011x 2^8) + (1.1 x2^−5) = 1.011 x 2^8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define underflow (1 point)

When might it happen? (1 point)

A
  1. A number is too small (close to zero) to be represented in available number of bits
  2. Might happen when you are dividing a small number by a very large number

E.g. represent .000002123456789 with 8 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define overflow (1 point)

When might it happen? (1 point)

A
  1. A number is too large to be represented in available bits
  2. Might happen when you are multiplying two large values together

E.g. represent 2123456789 with 8 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly