When a Computer Says the Difference Is Zero
Situation
It began with polyhedra.
Leo explored the icosahedron and dodecahedron, then started investigating the golden ratio, φ, through consecutive Fibonacci numbers. When asked what would happen to the ratio (n+1)/n as n increased, he expected it would eventually end with a number.
That answer opened a door.
Turning Point
We moved on to the Basel problem, one of the famous challenges in mathematical history. Leo wrote a Python program named euler.py, in honour of the great Leonhard Euler.
His program added the terms
1/1² + 1/2² + 1/3² + ...
and calculated the square root of six times the partial sum.
With 10,000 terms, the result was approximately 3.14149716—remarkably close to π, even though Leo's program contained no special knowledge of circles or π.
Then we returned to Fibonacci.
Leo wrote his own iterative program, using two variables and a temporary variable to preserve the value needed for the next step. His program calculated the ratio of consecutive Fibonacci numbers and compared it with φ.
At n = 10, the difference was small but visible.
At n = 100, Python reported:
0.0
We both stopped in surprise. Had something gone wrong?
Emergence
The mathematics had not broken. We had encountered the limits of numerical representation.
The Fibonacci ratios converge rapidly toward the golden ratio. But Python's ordinary floating-point numbers have finite precision. Eventually, the computed ratio and the computed value of φ rounded to the same representable number.
Their subtraction produced exactly zero—not because the underlying mathematical quantities were identical, but because the computer could no longer distinguish them at that precision.
A beginner's experiment had unexpectedly opened a window into numerical analysis.
What We Learned
A short program can explore a profound mathematical idea.
Repetition in code can approximate an infinite sum.
Two variables can carry the state of a mathematical sequence from one iteration to the next.
A sequence of ratios can reveal the golden ratio.
A computer's numerical answer is not necessarily the same as mathematical truth.
Perhaps the most important lesson was not any particular formula. It was the willingness to question a surprising result instead of accepting it blindly.
The Bigger Picture
From polyhedra to Fibonacci, from Euler to π, and from a zero difference to floating-point precision, Leo followed a chain of ideas that connected mathematics with programming.
His program was called euler.py to honour a great mathematician.
But the spirit of the experiment was even more valuable: curiosity, computation, and the courage to ask, “Wait—is that really right?”