What is it?
The number line : the rationals plus the limits of all their convergent sequences. Its defining property is completeness — every non-empty set bounded above has a least upper bound — and calculus depends on it.
Why does it exist?
The rationals have holes: has no rational solution, and the sequence gets ever closer to something that is not there. Limits, derivatives and integrals would all break on those holes. The reals are the smallest number system without them.
Formal definition
is a complete ordered field. Completeness (the supremum axiom): if is non-empty and bounded above, there is a least upper bound .
Formulas
- the number systems
- least upper bound
Why does it matter?
A computer cannot store : a 64-bit word has only values, and almost every real number needs infinitely many digits. Everything numerical software does is a careful approximation of this ideal object, and most numerical bugs live in the gap between the two.
Where it shows up in computing
IEEE 754 doubles are a finite, unevenly spaced subset of ; every operation rounds back into it.
Computer algebra systems keep or exact as symbols instead of approximating them.
Where is it used?
Computing topics reachable from here, through the chain of ideas that leads to them:
λ Scientific computing and algorithms
- Floating point (IEEE 754)★★★★★
- Floating point (IEEE 754)→Scientific computing★★★★★
- Functions→Exponential functions→Logarithmic functions→Algorithm analysis and complexity★★★★★
- Functions→Riemann sums→Definite integral→Monte Carlo methods★★★★★
- Functions→Limit of a function→Derivative→Differentiation rules→Symbolic computation (CAS)★★★★★
3D Computer graphics
- Vectors→Gradient→Surface normals★★★★★
- Vectors→Dot product→Lighting and shading★★★★★
- Functions→Polynomial functions→Bézier curves and splines★★★★★
- Vectors→Gradient→Signed distance fields and ray marching★★★★★
- Vectors→Curvature (basic differential geometry)→Mesh processing (discrete differential geometry)★★★★★
- Vectors→Gradient→Surface normals→Ray tracing★★★★★
- +2
⚙ Robotics and control
- Functions→Ordinary differential equations→Control theory★★★★★
- Functions→Limit of a function→Derivative→Kinematics: position, velocity, acceleration★★★★★
- Vectors→Matrices and linear maps→Jacobian matrix→Robot Jacobian (velocity kinematics)★★★★★
- Vectors→Matrices and linear maps→Jacobian matrix→Inverse kinematics★★★★★
- Functions→Exponential functions→Continuous distributions→Kalman filter★★★★★
- Functions→Maxima and minima→Constrained optimization→Trajectory optimization and MPC★★★★★
- +2
⚛ Physics and simulation
- Vectors→Physics engines★★★★★
- Functions→Ordinary differential equations→Classical mechanics★★★★★
- Functions→Exponential functions→Population and epidemic models★★★★★
- Vectors→Physics engines→N-body gravitational simulation★★★★★
- Complex numbers→Fourier series→Heat equation and diffusion★★★★★
- Vectors→Vector fields→Electromagnetism (Maxwell's equations)★★★★★
- +4
∿ Signals, media and vision
- Complex numbers→Signal processing★★★★★
- Complex numbers→Fast Fourier transform (FFT)★★★★★
- Complex numbers→Signal processing→Sampling theorem (Nyquist–Shannon)★★★★★
- Complex numbers→Signal processing→Digital filters★★★★★
- Complex numbers→Signal processing→Media compression (JPEG, MP3, video)★★★★★
- Functions→Polynomial functions→Interpolation→Image processing and computer vision★★★★★
- +1
What depends on it
Exercises
Prove that is irrational.
Hint
Assume in lowest terms and look at parity.
Solution
If then is even, so is even: . Then , so and is even too, contradicting that was in lowest terms.
In most languages 0.1 + 0.2 == 0.3 is false. Explain why in terms of real numbers.
Solution
, and have infinite binary expansions, so each is rounded to the nearest double. The rounded plus the rounded , rounded again, lands on a different double than the rounded . Compare with a tolerance: .