How Are Numbers Built?

R (Chandra) Chandrasekhar

2024-03-21 | 2024-04-21

Estimated Reading Time: 15 minutes

“How are numbers built?” This was the simple but profound question that my polymath friend Solus “Sol” Simkin asked me when we met unexpectedly at an evening function.

“Sol, have a sense of occasion, of time and place, please! This is a social event at a Music School, not the Agora of Athens! Your question is too deep to be discussed here and now. We are planning to go on a tour of Santorini in a month’s time. Let our thoughts mingle with those of the ancient, philosophical Greeks. Until then, I will take a raincheck on your question,” I remonstrated.

And so it was that Sol next resumed this conversational thread while we gazed upon the azure sea, from under the shade of an olive grove, atop a hillock on Santorini.

How would you build a world?

“If you were given the power to build a world, how would you do it?” Sol asked me without forewarning.

“Why so outlandish a question? Enjoy the sun and the breeze, and the bleats of the sheep,” I replied.

“Have you heard of the Worldbuilding Stackexchange? It ‘is a question and answer site for writers/artists using science, geography and culture to construct imaginary worlds and settings’.”

“No,” I said.

“It is a serious site on the Web where bizarre worlds, with negative gravity and entropy, may be conceived and discussed, before being constructed and populated. My question is not a flippant one.”

“I stand educated. But what has mathematics to do with those flights of fancy?” I queried.

Sol said, “Everything”. “One cannot construct a world without the laws of physics, or the laws of mind. Or the laws of cause and effect. As long as structure, consistency, repeatability, and durability are desired, one cannot do without numbers. More than light or atoms, numbers are the building blocks of the world.”

We had launched at last into the discussion proper. And what a majestic premise: that the world is built with numbers, before it could be built with light or atoms. I asked Sol to let his canons of unassailable argument boom, while I waited passively to be informed and entertained.

Lessons from observing life

“You must have heard of my paternal cousin, once removed, Hieronymus Septimus Simkin, whom I affectionately call Seven. He it was who opened my eyes first to the unguarded secrets staring at us from Nature. He introduced me to books like D’Arcy Wentworth Thompson’s classic On Growth and Form [1] and the interestingly titled The Parsimonious Universe [2]. These books postulate, with incontrovertible evidence, that the Book of Nature derives its intelligence from adaptation, powered by mathematics.

“If Nature is constructed from—or using—mathematics, how are numbers constructed? Are numbers themselves the very first creation of a colossal intelligence? Numbers. Before light, before atoms, before cause and effect?”

But, Sol did not stop there.

“God made the integers”

“Nature is varied and variegated in a way that defies monotony. There is pattern but also variation. Fractals typify what I am trying to convey. Perhaps, you will remember that Leopold Kronecker was reputed to have said ‘Die ganzen Zahlen hat der liebe Gott gemacht, alles andere ist Menschenwerk’, meaning ‘(The Dear) God made the integers, all else is the work of man’ [3],” Sol thundered on.

He waited for his exposition to sink in. Given our idyllic surroundings, it was hard not to day dream and slip silently into slumber. He ordered two glasses of Frappé to keep me from descending into somnolence.

The integers have their place, but …

“The integers are fundamental because all mathematics begins with counting. The quantitative fields are all founded on the natural numbers we count with. And zero and one are the two most important integers—that I grant you. But can we stop with the integers, and exclude everything else?” asked Sol.

“Are you trying to play Devil’s advocate, Sol?” I asked somewhat confused by the change in tenor of his argument.

“Aha! So, you are still awake enough to follow what I say,” he laughed. “Yes, that was a deliberate rhetorical question, and a segue to my next observation.”

The square and the circle

“The square is the four-sided regular polygon,” Sol observed. “If we consider a square with a side length equal to one unit, by the theorem of Pythagoras, we know that its diagonal has a length equal to \(\sqrt{1^2 + 1^2} = \sqrt{2}\) units. And there are proofs aplenty on the Web that this number is in no way an integer. Indeed, it is not even the ratio of two integers. How could something as basic as the diagonal of a square cause the first chink in Kronecker’s armour?

“Moving from the finite to the infinite, the circle may be viewed as the limiting case of a regular polygon of \(n\) sides as \(n \to \infty\). And if we tried to find out how many diameters would fit into the circumference of a circle, we do not get an integer, or even an exact fraction, but rather a number that sits between \(3\) and \(4\), having decimal places without end, namely, \(\pi \approx 3.141592654\dots\). And that number is not an integer by a country mile.

“The natural numbers, the integers, and the rationals—all of these come under Kronecker’s integers, but where do we stash \(\sqrt{2}\) and \(\pi\) amongst them?”

Sol’s earnest question was met by bemused silence from me.

How about the number \(e\)?

Never one to leave a thread of thought half-fleshed out, Sol mounted his next hobby horse, and expounded on \(e\), the mystical number, sometimes called Euler’s number.

“The number \(e\) is probably the most important number after \(0\) and \(1\). And do you know what it is? It is both irrational and transcendental. If you differentiate or integrate, you will find that the exponential function \(\exp(x) = e^x\) is an eigenfunction of each operation. If you look into Nature, \(e\) holds the pride of place in the normal distribution. If you are into linear system theory you cannot escape \(e\).

“But what exactly is the value of \(e\)? It cannot be confined like an integer: \(e \approx 2.718281828\dots\), again in a never ending decimal sequence. This number pervades all of Nature and yet it cannot be bottled into a finite number of digits! Were the legions of integers to duel with this puny expeditionary force of three numbers, \(\sqrt{2}\), \(\pi\), and \(e\), which group would you expect to win?

“It appears that Nature has inserted into the foundations of Creation, non-integers like \(\sqrt{2}\), \(\pi\), and \(e\). But how are these numbers built? If you had to create a universe, what method would you use to exactly construct these three convoluted numbers at the bedrock of Creation?”

“Very penetrating,” I nodded in appreciation.

“Let me digress a little,” Sol continued.

Open secrets

Helen Keller is reputed to have exclaimed, when she felt the warm glow of a wood-fire, that it was the release of sunbeams that had been trapped long ago in the wood. Her statement is remarkably perceptive, poetic, and precise,” Sol continued.

“Unlike ancient sunlight trapped in wood, \(\sqrt{2}\), \(\pi\), and \(e\), cannot be caged in a finite box. These three numbers—that pervade Nature—have decimal forms that clearly announce that they are not integers. Their value defies finite expression; only with symbols may we do them justice.

“Do you know why they are open secrets? They are public, staring at us from every square, circle, and electrical signal, and yet, their full form is never revealed. They cannot be contained except in infinity. To know the next decimal place of \(\sqrt{2}\), or \(\pi\), or \(e\), one needs to compute it using some formula. Or one could look up a table. But there is no knowing that sought after next decimal place, as we know \(\frac{1}{2} = 0.5\), with as many zeros stacked at the end as we wish. That sort of closed form is not baked into nature. She prefers the indescribable exactitude of numbers without end, like \(e\).” Sol set forth.

The rest of Sol’s dialogue was intricately mathematical. I have recorded it here, substantially as a logical exposition—complete with references—for the benefit of the casual reader, with bits of direct speech thrown in.

The square root of two

Of the triad—\(\sqrt{2}\), \(\pi\), and \(e\)—we first consider \(\sqrt{2}\). It is the most within our everyday grasp. It evokes geometry rather than number for its precise expression. It is the diagonal of a unit square. And we know that its square root must lie between \(1\) and \(1.5\), as the latter squared is \(2.25\). It may be evaluated painstakingly using algorithms from the age-before-calculators. So, let us look at one of those first.

Manual extraction of root two

The manual extraction of square roots is analogous to long division. The process is both tedious and error-prone. The algorithm uses the fact that the factor \(2\) figures in any square, witness: \((x + a) = x^2 + 2ax +a^2\). So, this particular method makes use of this fact at each step in the “long division” that is done. To see the end result and the working, please see this [4]. For a deeper explanation, read this blog [5]. “I consider this form of working, with pencil and paper, a sophisticated form of torture. Euler or Gauss might have revelled in such pursuits, but count me out!” Sol added as a snide aside.

Different ways of expressing a number

The decimal representation of a number is not the only way to express it. For example, the integer \(5\) may be expressed as: \(5 = \frac{5}{1} = 5.0 = 101_2\)1, but being prime, it cannot be decomposed into factors. And even with decimals, we may rightfully claim \(5.0 = 4.9999\dots\), [6], which only muddies the waters a little more. So, how would the Creator have defined our triad of numbers in the most succinct way?

The decimal representation comes from expressing a number as the sum of fractions whose denominators are powers of ten. And if the decimal is never ending, the process of division and summation does not terminate. Recall that the Manual extraction of root two also relied on division of sorts. So, does division hold the key to how numbers are built?

Sol then confessed, “I had forgotten that the decimal system is not the only way to represent irrationals and transcendentals in never-ending glory. And I don’t mean a change of base. Can you guess what I had forgotten?”

“Nothing from me to egg you on,” I said in a sleepy tone. The time, place, and weather had lulled me into a restful somnolence that was ill-suited to mathematical head-scratching, even with the Frappé.

“It is something that we learn at high school, more as a curiosity than as useful mathematics,” Sol continued by way of enticing me with a clue. “Can you guess what it is?”

When I shook my head with a dazed stare, Sol said, “Come on. One last clue. It has to do with division and fractions.”

When I refused to be drawn into guessing what it was, Sol exclaimed, “Continued Fractions!” [711] rousing me into full wakefulness with his thunderous voice.

“Apart from a change of base, there are basically two ways I know of representing real numbers: decimals, and continued fractions. Patterns not discernible in the decimal representation suddenly pop out with pellucid clarity when the same number is expressed as a continued fraction. The advent of computers and 64-bit computation has diverted our attention away from experiencing the periodic beauty of a quadratic irrational, expressed as a continued fraction,” Sol went on, lyrically.

“Practically, every irrational, when pressed to computational use, is really a rational approximation to the irrational, to an accuracy that serves the purpose. In that sense, Kronecker was not far from the truth. But the full glory of \(\sqrt{2}\), or \(\pi\), or \(e\) can only be encapsulated by the symbols we use for them. Every other, rational expression is but a costumed appearance, not the true persona.” Sol was in his element as he expounded.

The charm of continued fractions

Sol then went on to demonstrate his preferred method of evaluating \(\sqrt{2}\), using continued fractions. The method seemed like sleight of hand, but it is well-founded, and is also an example of how integers are used to tame the irrationals.

Continued fractions are curious mathematical entities that have surprising properties. They are an alternative rational number representation of real numbers. No finite continued fraction can equate to an irrational number. But a never-ending continued fraction can indeed represent an irrational number. “This is why I say that the rationals and the irrationals meet at infinity,” Sol said with panache.

Continued fraction expansion of a rational number

“Let us start modestly and try to expand a rational number using continued fractions,” said Sol. “Give me a scary or hairy rational number, preferably larger than one,” he said.

“What about \(\frac{3257}{106}\)?” I answered, choosing the two numbers that randomly came to mind.

“Taken,” replied Sol. We start off by doing plain long division to get: \[ \begin{aligned} \tfrac{3257}{106} &= 30 + \tfrac{77}{106}\\ &= 30 + \frac{1}{\frac{106}{77}}\\ \end{aligned} \qquad{(1)}\] Why do we write it like this? We want to get whole number quotients and whole number remainders. The trick is to always divide the larger number by the smaller, by inverting the remainder fraction. If you keep in mind that our goal always is an improper fraction, you are good to go.

“Because \(\frac{3257}{106}\) is a rational number, the continued fraction terminates. The full expansion is shown in Equation 2 below: \[ \begin{aligned} \tfrac{3257}{106} &= 30 + \tfrac{77}{106}\\ &= 30 + \frac{1}{\frac{106}{77}}\\ &= 30 + \cfrac{1}{1 + \tfrac{77}{29}}\\ &= 30 + \cfrac{1}{1 + \cfrac{1}{2 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \tfrac{1}{9}}}}}} \end{aligned} \qquad{(2)}\]

You will agree that this form—more easily written by hand than typed—is a little cumbersome. So, the convention for writing a continued fraction is to enclose the quotients and remainders in square brackets and express it as \([30; 1, 2, 1, 1, 1, 9]\), with a semi-colon after the integer part, and commas separating the other digits. Note that we have exact equality: \[ \tfrac{3257}{106} = [30; 1, 2, 1, 1, 1, 9]. \] We conclude that—in addition to a decimal representation—a number may be expressed as a continued fraction. We assert the equality below: \[ \tfrac{3257}{106} = 30 \tfrac{77}{106} = 30.\overline{72641509433962} = [30; 1, 2, 1, 1, 1, 9]. \] Note that the decimal expansion is recurring with a period [12] of \(13\) digits, whereas, the continued fraction expansion terminates.

Continued fraction expansion of √2

The irrational number \(\sqrt{2}\) is amenable to a simply derived continued fraction expansion. Consider: \[ \begin{aligned} \sqrt{2} &= \sqrt{2} &\text{ (add and subtract $1$ on the RHS)}\\ &= 1 + \sqrt{2} - 1 &\text{ (multiply second term on RHS by $\frac{\sqrt{2}+1}{\sqrt{2}+1} = 1$)}\\ &= 1 + \frac{(\sqrt{2} - 1)(\sqrt{2} + 1)}{\sqrt{2} + 1} &\text{ (difference of two squares)}\\ &= 1 + \frac{1}{1 + \textcolor{Maroon}{\sqrt{2}}}. \end{aligned} \qquad{(3)}\] This is a recursion embodying \(\sqrt{2}\). Since the LHS2 in Equation 3 is \(\sqrt{2}\), we may substitute the entire RHS in place of the term \(\textcolor{Maroon}{\sqrt{2}}\) on the RHS. So doing, we get the following infinite descending staircase of continued fractions: \[ \begin{aligned} \sqrt{2} &= 1 + \frac{1}{1 + \textcolor{Maroon}{\sqrt{2}}}\\ &= 1 + \cfrac{1}{1 + \textcolor{Maroon}{1 + \cfrac{1}{1+\sqrt{2}}}}\\ &= 1 + \cfrac{1}{2 + \cfrac{1}{1 + \sqrt{2}}} &\text{ (and recursively substituting for $\sqrt{2}$ again)}\\ &= 1 + \cfrac{1}{2 + \cfrac{1}{1 + 1 + \cfrac{1}{1 + \sqrt{2}}}}\\ &= 1 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1 + \sqrt{2}}}}\\ &= 1 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{2 + \cfrac{1}{1+\sqrt{2}}}}}\\ &\hskip 100pt\ddots\\ % Care! \end{aligned} \qquad{(4)}\] Because the continued fraction repeats itself, we may write: \[ \sqrt{2} = [1; 2, 2, 2, 2\dots] = [1; \overline{2}]. \] This is an exact, succinct, and elegant representation.

Congruents

The congruents or approximants from a continued fraction are partial sums that we may accumulate as successive rational approximations to the irrational number—\(\sqrt{2}\) in our case—that we seek to represent. Unfurling the continued fractions into partial sums is a tricky exercise. There are also recurrence relations for them [711]. In our particular case, we ignore the terminal \(\frac{1}{1 + \sqrt{2}}\) terms that occur in the denominator of Equation 4 but count the numerator terms to get a sequence of fractions.

In this way, we start off with \(1\), followed by \(1 + \frac{1}{2} = \frac{3}{2}\). Working our way down, we encounter \(1 + \frac{1}{2 + \frac{1}{2}} = 1+\frac{1}{\frac{5}{2}} = 1 + \frac{2}{5} = \frac{7}{5}\). The next convergent after this, when simplified, is \(1 + \frac{1}{2+\frac{2}{5}} = 1 + \frac{5}{12} = \frac{17}{12}\).

The first fifteen convergents are tabulated in Table 1. Note that these values oscillate about the true value as consecutive congruents successively overestimate and underestimate the irrational number. Some of the congruents have large numerators and denominators. In many cases, the decimal representations have recurring decimals that could have very long periods, as indicated in the third column of the table.

Table 1: The first fifteen convergents for \(\sqrt{2}\). The periods of the repeating portions of the decimals were obtained from the Wolfram Alpha website.
Convergent Decimal Value Period
\(\frac{1}{1}\) \(1.0\) \(0\)
\(\frac{3}{2}\) \(1.5\) \(0\)
\(\frac{7}{5}\) \(1.4\) \(0\)
\(\frac{17}{12}\) \(1.41\overline{6}\) \(1\)
\(\frac{41}{29}\) \(1.\overline{4137931034\dots}\) \(28\)
\(\frac{99}{70}\) \(1.4\overline{142857}\) \(6\)
\(\frac{239}{169}\) \(1.\overline{4142011834\dots}\) \(78\)
\(\frac{577}{408}\) \(1.414\overline{2156862745098039}\) \(16\)
\(\frac{1393}{985}\) \(1.41421319796954314\dots\) \(98\)
\(\frac{3363}{2378}\) \(1.4142136248\) \(140\)
\(\frac{8119}{5741}\) \(1.4142135516\dots\) \(5740\)
\(\frac{19601}{13860}\) \(1.41\overline{421356}\) \(6\)
\(\frac{47321}{33461}\) \(1.4142135620\dots\) \(4780\)
\(\frac{114243}{80782}\) \(1.4142135624\dots\) \(546\)
\(\frac{275807}{195025}\) \(1.4142135623\dots\) \(1876\)

Sol said that working out the fractions in Table 1 could be a form of torture, unless you are particularly fond of, or adept at computing them by hand. He himself did not relish such hand computations, but preferred to program to get a solution. The link to a program is given toward the end of this blog.

The rational fractions above are tabulated with their decimal versions to provide an idea of how the convergents do indeed converge to the “benchmark” decimal value of \(\sqrt{2}\) as available on a Julia REPL, which is shown below. There is agreement at best to about ten decimal places.

sqrt(big(2))
1.414213562373095048801688724209698078569671875376948073176679737990732478462102

Elegant and inelegant representations

Sol said, “It is clear that \(\tfrac{1}{3} = 0.\overline{3}\) is an elegant representation for the rational number \(\tfrac{1}{3}\). The recurring decimals are not an issue; it is whether the digits may be predicted beforehand.”

“Likewise, \(\sqrt{2} = [1, \overline{2}]\) is an elegant representation for the irrational number \(\sqrt{2}\).

“Two different approaches have led to two different representations of two different numbers—one rational and the other irrational—that are both elegant. I consider that a marvel.

“This leads me to think that there might be other ways in which the important numbers in Nature may be expressed using only integers. We know only of decimals and continued fractions,” Sol mused. “But there must be other identities as yet undiscovered.”

“What about infinite series and such for \(\pi\) and \(e\)?” I ventured.

“Spot on,” said Sol. “It is my belief that the Creator built each number that plays a major role in Nature using some elegant and succinct representation. If the act of Creation were not efficient or parsimonious, I do not think we will have the diversity we experience today. Let us talk about \(\pi\) and \(e\) and \(\phi\) some other time.”

“My only quibble is with prime numbers. They cannot be built from anything except by adding \(1\) to their predecessors. The day we solve the mystery of how the primes are built, we would have understood a major mystery of Creation, and learned to think like the Creator!”

And on that final note, Sol and I wrapped up our discussion on how numbers are built, while enjoying the idyllic environment of Santorini.

A simple Julia program, ContFrac.jl, is available. It provides functions related to continued fractions, but no claims are made as to its absolute correctness. 😉 Take a look if you wish.

Acknowledgements

The free Wolfram Alpha website is a valuable resource. I am unsure, though if—with the march of time—its multitudinous functions will be gradually furled up behind a paywall.

Feedback

Please email me your comments and corrections.

A PDF version of this article is available for download here:

References

[1]
D’Arcy Wentworth Thompson. 1992. On growth and form (The Complete Revised Edition ed.). Dover Publications.
[2]
Stefan Hildebrandt and Anthony Tromba. 1996. The Parsimonious Universe: Shape and Form in the Natural World (1st ed.). Copernicus Books.
[3]
Wikipedia contributors. 2023. Leopold Kronecker—Wikipedia, The Free Encyclopedia. Retrieved 6 December 2023 from https://en.wikipedia.org/wiki/Leopold_Kronecker
[4]
—. 2023. Square Root of 2. Retrieved 9 December 2023 from https://www.cuemath.com/algebra/square-root-of-2/
[5]
Ujjwal Singh. 2021. The Square Root Algorithm. Retrieved 8 December 2023 from https://www.cantorsparadise.com/the-square-root-algorithm-f97ab5c29d6d
[6]
Richard Courant and Herbert Robbins. 1996. What is Mathematics?: An Elementary Approach to Ideas and Methods (2nd ed.). Oxford University Press.
[7]
C D Olds. 1963. Continued Fractions. Random House.
[8]
Ian Niven and Herbert S Zuckerman and Hugh L Montgomery. 1991. An Introduction to the Theory of Numbers (5th ed.). John Wiley & Sons.
[9]
Harold Davenport and James H Davenport. 2008. The Higher Arithmetic: An Introduction to the Theory of Numbers (8th ed.). Cambridge University Press.
[10]
Andrew J Simoson. 2019. Exploring Continued Fractions: From the Integers to Solar Eclipses. MAA Press/American Mathematical Society.
[11]
Paul Loya. 2017. Amazing and Aesthetic Aspects of Analysis. Springer.
[12]
Aslan986, Ross Millikan, and Bill Dubuque. 2012. Compute the period of a decimal number a priori. Retrieved 13 December 2023 from https://math.stackexchange.com/questions/140583/compute-the-period-of-a-decimal-number-a-priori

  1. Binary for 5.↩︎

  2. RHS and LHS stand for Right Hand Side and Left Hand Side resectively.↩︎

Copyright © 2006 – , R (Chandra) Chandrasekhar. All rights reserved.