Send
Close Add comments:
(status displays here)
Got it! This site "creationpie.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
Exact math only approximates reality
1. Exact math only approximates reality
2. Exact math only approximates reality
A common programming fallacy taught to beginning students is to use floating point variables when it is not appropriate.
An exact mathematical solution involving real numbers (which are not really real, they are assumed to be real) is only an approximation.
Any floating point number (e.g., that represent real numbers) has an inherent rounding error.
3. Chaos theory
Chaos theory: sensitive dependency on initial conditions of modeling of dynamical systems.
Analogy: It is
as if a butterfly flapping it's wings resulted in a tornado (1972). His original
analogy used a seagull and a storm.
Some pastors will confuse "
potentiality" or "
as if" or "
analogy" with an "
actuality" or "
fact" and preach how a butterfly can create this effect and then preach that you should be like that butterfly, etc. The "
liken" or "
as if" word of
analogy is used
16 times in Matthew (more times in other Gospels and by Paul, etc.).
Other
chaos meanings: (KAOS is from the 1960's comedy
Get Smart)
English: informal meaning of disorder as in an informal entropy.
Greek myth: Universe started as chaos.
An
exact mathematical model is only an
approximation of reality.
Question: What is the sum of ten one-tenths? That is, ten times one-tenth.
Some pastors will preach Greek mythology chaos as if it were the statements made in Genesis.
Note: We are here ignoring discrete mathematics that involve only integers.
4. Slide rules
A slide rule (not slide ruler) was once used to do manual computations.
Whenever a slide rule is used, it is very evident that any computation involving real numbers is an approximation.
5. Mathematics and computation
What are the values of the following (using a computer program)?
1/10
1/10 + 1/10
1/10 + 1/10 + 1/10
1/10 + 1/10 + 1/10 + 1/10
1/10 + 1/10 + 1/10 + 1/10 + 1/10
1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10
1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10
1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10
1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10
1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10 + 1/10
Note: These are rational numbers, not irrational like
√2 or transcendental numbers like
π or
e.
6. Mathematical point of view
Here is the mathematics result expressed as real (rational) numbers.
1/10 = 0.1
2/10 = 0.2
3/10 = 0.3
4/10 = 0.4
5/10 = 0.5
6/10 = 0.6
7/10 = 0.7
8/10 = 0.8
9/10 = 0.9
10/10 = 1.0
7. Computation point of view
8. Lua program
Here is a simple Lua program to add values of
1/10 as
0.1.
Here is the output of the Lua code.
|
The 17 places in the output is important to being exactly precise.
An exact mathematical model is only an approximation of reality.
|
9. Error accumulation
Even when symbolic math can solve a problem, any attempt to compute real answers involves the same approximations
The difference is small at each step but the difference can add up to a significant amount over many iterations.
Note: One can fix this specific instance by using a fixed decimal notation, but that only works, in base 10, for numbers and increments that are multiples of 2 or 5, the prime factors of 10.
10. Chaos theory
Rounding errors need to be addressed in fields of computer science such as numerical analysis.
11. Chaos theory
James Gleick (American author and historical scientist) has written a very interesting book on the field known as "
chaos theory" - a sensitive dependency on initial conditions. The field was accidentally discovered by the young French mathematician Henri Poincaré while attempting to find an exact mathematical solution for the three body problem.
Lorentz, in the weather field, rediscovered this idea and provided a name for it. The
analogy is that, due to round-off errors in computations, it is "
as if" a butterfly flapped it's wings in California and a typhoon resulted in China.
Gleick, J. (1988).
Chaos: making a new science. New York: Penguin Books..
12. Two and three body problem
Exact mathematics can solve the (idealized) two body problem such as the sun and earth or the earth and moon.
An exact solution for the (idealized) three body problem such as the sun, earth and moon has not been found.
Accurate weather prediction requires solving the (idealized) almost infinite particle system.
13. Quantum computing in brief
Quantum computing:
much faster than conventional computers
best for problems that allow probabilistic solutions
cannot solve all problems - despite the hype
[exponential speedup not clearly defined, like entanglement]
14. Quantum computing analogies
Quantum computing analogies: pick the best way
walk on foot: pencil and paper
drive by car : conventional computer (go most anywhere)
fly by jet : quantum computers (does not go anywhere, sometimes impractical)
no way to get to Mars, nearest star, etc.
15. Dollars and cents
Fallacy:
Dollars and cents should be represented using floating point variables.
The general rule, sometimes taught, that if the number has a decimal point, it should be represented as a floating point variable does not hold for dollars and cents.
The amount $123.56 is not a floating point value. It an integer value. That is 12345¢ cents.
Rule: Convert dollars and cents to cents, do the arithmetic, then convert back into dollars and cents (for display purposes). This distinction needs to be carefully handled in languages such as JavaScript and Lua which do not have integer variables.
The approximation issue involves floating point division so every such division needs to result in an integer value.
16. Numbers
Fallacy:
Social security numbers and phone numbers should be represented using integers.
How should social security numbers and phone numbers be represented? They appear to be numbers. That is, integers.
Are you ever going to add, subtract, multiply or divide these values? If not, use text.
SSN: 999-99-9999 (1 billion values, originally geographically located)
Ask your self the following question.
Are you ever going to add, subtract, multiply or divide these values?
If not, represent them using text. Note:
Leading zeros are lost using integers.
If an ordering is present, care must be taken when sorting lists of such values.
17. End of page