Fibonacci's Composed Fractions

Leonardo of Pisa (c1170-1241+), better known as Fibonacci, wrote Liber Abaci to introduce and advocate the adoption of “Indian figures” (Hindu-Arabic numerals) to Italy. The book explains how to perform arithmetic and common business problems using the digits and a positional number system. Leonardo uses a composed fractions (aka composite fractions, aka linked fractions) notation to express mixed radix quantities (i.e. positional numbers where the base varies by position). This notation lasted about 300 years until the adoption of decimal fractions. Drawing from his examples, we derive algorithms for the arithmetic operations in recipe and in formal Typescript representations.

Liber Abaci page 2v, introducing Indian numbers (Source: Museo Galileo)

Background

Little is known about Leonardo of Pisa’s life. (Also known as Leonardo Pisano, which just means Leonardo of Pisa.) He provides a short biographical note in Liber Abaci (an unusual touch) where he notes he traveled to Bugia (today’s Béjaïa, Algeria) to work with his father who was a public official in the customshouse. In Bugia, he learned about Indian figures (Hindu-Arabic numerals), Arabic mathematics, Pythagorean arcs, Euclid’s algorithm for computing the greatest common divisor, and Euclidean geometry. Later, he traveled extensively learning more mathematics. Back in Pisa, Leonardo had access to multiple high-quality mathematical works (at least some in Latin translation). He was inspired to write a work introducing the Italian people to these figures and the new methodology.

Liber Abaci (the Book of Calculation) is a thick manuscript of fifteen chapters (the Sigler translation is over 600 pages) written in Latin. The first edition was written in 1202 (no extant copies) and the second edition in 1228 (nineteen known copies). The first chapter introduces Hindu-Arabic numerals and compares them with Roman numerals (who Leonardo’s audience were used to working). The next four chapters cover multiplication, addition, subtraction, and division of integral numbers. This is followed by two chapters on fractions. Four chapters on business problems then follow, such as bartering, assigning profits to shareholders, and the alloying of metals. Chapter 12 contains many miscellaneous problems touching on topics in algebra and linear equations and includes the famous rabbits problem that leads to the Fibonacci sequence (see Aside below). Chapter 13 concerns an iterative method for solving equations. Chapter 14 concerns finding roots of equations and the final chapter discusses geometry.

The book is focused on practical concerns for merchants and other business people, with examples drawn from trade and finance. The book fulfilled a need. Pisa was an international trade hub and, even though it would lose that status soon in a war with Genoa, the various Italian city states were in the middle of a trade revolution. Hundreds of schools and textbooks were created over the next four centuries to teach calculation under the new method. This Abbacus School tradition focused on training students in mathematics useful for business and trade. The training used Hindu-Arabic numerals and arithmetic and followed the techniques found in Liber Abaci.

While historians differ on the precedence and impact of Liber Abaci to the Abbacus tradition and the Arithmetic Revolution (e.g. Høyrup 2022, Devlin 2011 Chapter 8), of the extant volumes known, Liber Abaci is the most comprehensive and mathematically sophisticated, by including proofs, more advanced problems and topics, and featuring far fewer errors.

Notation

Leonardo wrote fractional values in a composed or linked form. This notation is found, with variations, in earlier Arabic sources (Abdeljaouad 2004), so did not originate with Leonardo. The notation uses a horizontal bar to separate a list of numerator values (in ascending scale or “little-endian” order) with a list of corresponding denominator values. The denominators represent the base or radix of the number. Numerator values include zero and, in “proper” form (although he did not use the term), range from zero to one less than the base.

For example, \(\frac{1\ 4}{2\ 7}\) means, in modern notation, \(\frac{1}{2\times7} + \frac{4}{7}=\frac{9}{14}\). Similarly, \(\frac{1\ 5\ \ 7}{2\ 6\ 10}\) equals \(\frac{1}{2\times6\times10} + \frac{5}{6\times10} + \frac{7}{10} = \frac{185}{120} = 1 \frac{13}{24}\).

Integral values follow the fractional part, such as \(\frac{3}{4}15\) meaning \(15\frac{3}{4}\). Ordering numbers in ascending scale may have been influenced by Arabic’s right-to-left reading order, but this is conjectural. Modern readers may interpret these numbers as being multiplied by each other, but Leonardo used the sum as the implicit operator, rather than today’s multiplication (i.e. \(\frac{1}{3}\frac{1}{4}=\frac{1}{3}+\frac{1}{4}\), note the space between the two fractions rather than a single horizontal bar).

Decimal fractions, such as \(\frac{271,828}{100,000}\) can be represented as a special case of composed fractions with repeated bases of 10: \(\frac{8\ \ 2\ \ \ 8\ \ \ 1\ \ \ 7}{10\ 10\ 10\ 10\ 10}2\). Leonardo includes examples where the bases are the same number, such as 4, 8, and 10 (Sigler 2002, e.g. 439-443), but these are examples and he does not advocate for them generally.

Decimal fractions, which retain the placement value advantages already found in the integral portion of the numbers, began to be adopted and popularized in the 15th century. (The decimal point also largely dates to the 15th century, although there are earlier examples (Van Brummelen 2024)).

The “delay” in adopting decimal fractions may have less to do with the unpredictability of the discovery process but more as the result that practical uses of decimals were quite rare in the Renaissance world and that mixed radix numbers were the norm.

For example, money. The Pisa monetary system, similar to English currency pre-decimalization, featured denari, twelve denari made a solidus, and twenty solidi made a libra. (Individual cities minted their own money, so conversions were required between Pisa and Genoa, among others.) Money values could thus be represented as:

\[ \frac{d\ s}{12\ 20}l \]

Weights and measures. The Venetian’s gross weight system featured 100 pounds to the hundredweight, 12 ounces to the pound, and 194 carats to the ounce, and 4 grains to the carat. This is represented as:

\[ \frac{g\ \ \ c\ \ \ o\ \ \ l}{4\ 194\ 12\ 100}h \]

Time. Since the French attempt at decimalization of the calendar did not catch on, we continue to use a mixed radix approach.

\[ \frac{s\ \ m\ \ h\ \ d}{60\ 60\ 24\ 7}w \]

In Simon Stevin’s pamphlet On Decimal Fractions (1585), which advocates for an early decimal notation, he provides example applications for surveying, measuring length, measuring volume, computing with angles, and money. Tellingly, he argues that each of these applications should convert their units to decimal units, rather than showing how the values would need to be translated into decimals and back to a mixed radix representation. Full adoption of decimals required two revolutions.

Opposition and Adoption

Although the growth in Abbacus schools and the proliferation of manuals teaching arithmetic with Hindu-Arabic numerals speaks to the strong demand within Italy, adoption was opposed by several forces.

Roman numerals were considered easier to read and more resistant to fraud than decimals. A Venetian bookkeeping manual stated “The old figures alone are used because they cannot be falsified as easily as those of the new art of computation, of which one can, with ease, make one out of another, such as turning the zero into a 6 or a 9, and similarly many others can be falsified.” (Devlin 2011, pg 113).

Those trained the abacus also resisted because the productivity gains of place value arithmetic threatened the value prop of the abacus. The Guild of Money Changers in Florence forbade their members from using the new figures in 1299 (ibid.).

As a measure of adoption, Hindu-Arabic numerals start appearing in the Medici account books in 1406 within the “description” column. In 1439, they begin to be used in the primary accounts and all but one ledger are converted by 1482. In 1494, all ledgers use the numerals (ibid, pg 115).

Aside: Fibonacci Sequence

Leonardo is best known by the Fibonacci Sequence (1, 1, 2, 3, 5, 8, 13, …; OES A000045). The sequence appears in an example problem in chapter 12 of the work (Sigler 2002, pg. 404-405) about rabbits. He poses the question of how many pairs of rabbits will exist by year end, if you start with one breeding pair:

A certain man had one pair of rabbits together in a certain enclosed place, and one wishes to know how many are created from the pair in one year when it is the nature of them in a single month to bear another pair, and in the second month those born to bear also. Because the abovewritten pair in the first month bore, you will double it; there will be two pairs in one month. […]

In a long run-on sentence, Leonardo describes the increase month-by-month, annotating the description with a table (see figure).

Leonardo's table for the number of rabbit pairs by month (Source: OES, photo by David Singmaster)

He summarizes the process:

You can indeed see in the margin how we operated, namely that we added the first number to the second, namely the 1 to the 2, and the second to the third, and the third to the fourth, and the fourth to the fifth, and thus one after another until we added the tenth to the eleventh, namely the 144 to the 233, and we had the abovewritten sum of rabbits, namely 377, and thus you can in order find it for an unending number of months.

The entire entry is less than a page in length and is sandwiched between problems about finding perfect numbers and a system of linear equations problem (as it is known today). Overall, we would describe chapter 12 as a “miscellaneous” problem chapter given the range of problems. Leonardo does not dig deeper into numerical sequences or recurrence functions within the book.

The “rabbit problem” is unusual within the book both because of its nature (a number sequence) and because of its subject matter. Leonardo’s example problems tend to draw on practical, commercial problems such as calculating prices for various volumes of goods and how to share profits among partners with different stakes. Thus, a question about breeding rabbits is memorable, although not unique as he has a few other whimsical problems.

However, his name does not deserve the link. He was not the earliest mathematician to describe the sequence nor provided much mathematical insight into the specific or general notion of the recurrence function. To Leonardo’s credit, he did not claim discovery of the sequence. Linking Leonardo to the sequence, under the name Fibonacci, was the work of Edouard Lucas, a 19th century French number theorist who extensively studied recursive series. Precedence of discovery is a messy basis for naming things and always subject to revision.

Arithmetic

Leonardo used series of examples to demonstrate the process or recipe for solving a problem and expected the reader to infer the algorithm. Our descriptions below for the arithmetic operations are thus our understanding of the algorithm, drawn from Leonardo’s examples and, unavoidably, modern understanding.

Representation

A composed fraction of the form:

\[ \frac{a_1\ a_2\ \cdots a_n}{b_1\ b_2\ \cdots b_n}a_0 \]

is equivalent to (in modern representation):

\[ a_0 + \frac{a_n}{b_n} + \frac{a_{n-1}}{b_n \times b_{n-1}} + \frac{a_{n-2}}{b_n \times b_{n-1} \times b_{n-2}} + \ldots + \frac{a_1}{\prod_{1}^{n}{b_i}} \]

We can represent the composed fraction in Typescript via an immutable class, with a field for the integer portion (a0) and arrays to store the fractional numerators and denominators (as and bs).

/**
 * Fibonacci Composed Fractions
 */
export class FCF {

    /**
     * Integer portion of the fraction
     * @private
     */
    private readonly a0: bigint

    /**
     * Numerators of the composed fraction in little-endian order. First element is a1.
     * @private
     */
    private readonly as: bigint[]

    /**
     * Denominators (bases or radix) of the composed fraction in little-endian order. First
     * element is b1. Since a0 is always integral, b0 is not required.
     * @private
     */
    private readonly bs: bigint[]

    constructor(a0: bigint, as?: bigint[], bs?: bigint[]) {
        this.a0 = a0;
        this.as = as || [];
        this.bs = bs || [];

        if (this.as.length !== this.bs.length) {
            throw new Error("Length of as must equal the length of bs");
        }
    }

Multiplication

Leonardo introduces multiplication before addition, so we follow his lead. His approach for multiplying whole numbers by each other is effectively the same as the modern recipe, so we will not repeat it. For fractions, he converts numbers to a singular fraction (our term) such that there is a single number in the numerator and a single number in the denominator without any integral portions. The result is the product of the two numerators, divided by the product of the denominators, simplified.

In recipe form:

  1. If both numbers are whole, multiply them via the place-value method.
  2. If either numbers have a fractional component:
    1. Transform each to a fraction with a single numerator and denominator
    2. Multiply each numerator together for the new numerator
    3. Multiply each denominator together for the new denominator
    4. Simplify as required

More formally in Typescript (without simplification step):

    mult(b: FCF): FCF {
        if(this.isIntegralOnly()) {
            return new FCF(this.a0 * b.a0);
        } else {
            const m1 = this.asSingularFraction();
            const m2 = b.asSingularFraction();
            return new FCF(0n, [m1.as[0] * m2.as[0]], [m1.bs[0] * m2.bs[0]]);
        }
    }
    /**
     * Return a singular fraction (a/b) in the form FCF(0, [a], [b])
     */
    asSingularFraction(): FCF {
        const a = this.as.reduceRight((prev, curr, idx) => curr + prev * this.bs[idx], this.a0);
        const b = this.bs.reduce((a, b) => a * b, 1n);
        return new FCF(0n, [a], [b]);
    }

Addition

Similar to multiplication of whole numbers, Leonardo’s approach to adding whole numbers is effectively the same as the modern school child method. If the two numbers contain fractions of differing bases, Leonardo finds the factors of the denominators in order to find the least common multiple (LCM). He then transforms the numbers into simple mixed fractions with an integer portion and a single numerator and denominator, with the denominators of each number being the same.

In recipe form:

  1. If both numbers are whole, sum them via the place-value method.
  2. If either numbers have a fractional component:
    1. Find the least common multiple of the denominators
    2. Transform each fraction to having the LCM as the sole denominator
    3. Sum the fractions and integers
    4. Simplify as required

Leonardo does not include any examples with addition of two fractional numbers with the same bases, but we are confident that he would use a place value approach like in whole numbers. In the Typescript form, the differing bases case is the third clause.

    add(b: FCF): FCF {
        if (this.isIntegralOnly() && b.isIntegralOnly()) {
            return new FCF(this.a0 + b.a0);
        } else if (this.equalsBase(b)) {
            let carry = 0n;
            const r_as = zip(this.as, b.as).map((([ai, bi], idx) => {
                const sum = ai + bi + carry;
                carry = sum / this.bs[idx];  // side effect mutation
                return sum % this.bs[idx];  // remainder
            }));
            return new FCF(this.a0 + b.a0 + carry, r_as, this.bs);
        } else {
            const [std_a, std_b] = this.stddenom(b);
            return new FCF(this.a0 + b.a0, [std_a.as[0] + std_b.as[0]], [std_a.bs[0]]);
        }
    }

Leonardo does not use the term “least common multiple” but his use of factors implies the same concept.

    protected stddenom(b: FCF): [FCF, FCF] {
        const lcm_denom: bigint = chain(this.bs, b.bs).reduce((acc, denom) => lcm(acc, denom));
        const a_num_lcm: bigint = this.as.reduce((acc, num, idx) => acc + num * (lcm_denom / this.bs[idx]), 0n);
        const b_num_lcm: bigint = b.as.reduce((acc, num, idx) => acc + num * (lcm_denom / b.bs[idx]), 0n);
        return [new FCF(this.a0, [a_num_lcm], [lcm_denom]), new FCF(b.a0, [b_num_lcm], [lcm_denom])];
    }

Subtraction

Subtraction is a mirror of addition. In all his examples, subtraction is always a greater number minus a less number, so his work does not discuss negative numbers. Negative numbers were first explained in print in Luca Pacioli’s Summa de arithmetica, geometria, proportioni et proportionalita in 1494. Similar to Liber Abaci, Pacioli’s work is both a theoretical and practical work, focused on problems on business, and notably described double-entry accounting (Devlin 2011, pg. 106).

Division

The process for division for whole numbers is similar to long division except that Leonardo uses a box notation that is compact but harder to follow. For fractions, division is a mirror of multiplication but inverting the divisor.

  1. If both numbers are whole, divide them via the box method.
  2. If either numbers have a fractional component:
    1. Transform each to a fraction with a single numerator and denominator
    2. Multiply the left’s numerator with the right’s denominator for the new numerator
    3. Multiply the left’s denominator with the right’s numerator for the new denominator
    4. Simplify as required

In Typescript:

    divide(b: FCF): FCF {
        if (b.isZero()) {
            throw new RangeError("Division by zero");
        } else {
            const dividend = this.asSingularFraction();
            const divisor = b.asSingularFraction();
            return new FCF(0n, [dividend.as[0] * divisor.bs[0]], [dividend.bs[0] * divisor.as[0]]);
        }
    }

We were unable to find any mention of division by zero in Liber but assume Leonardo would treat it as an error.

Conclusion

The composed fraction notation met the needs of the time by matching the reality of non-decimalization measures used in almost every aspect of business. The notation is explicit and suggests a universality. Writing the currency value of £2 3s 4d as \( \frac{4\ \ 3}{12\ 20}2 \) is not only explicit in the proportions between librae, solidi, and denarii but also suggests quantities exist independent of their units. Place value arithmetic, described comprehensively and rigorously by Leonardo in the book, was superior to Roman numerals and calculating via the abacus.

References

(Abdeljaouad 2004) Abdeljaouad, Mahdi. 2004. “The Eight Hundred Anniversary of the Death of Ibn al-Yasamin: Bilaterality as part of his thinking and practice” in Huitième Colloque Maghrébin sur l’histoire des mathématiques arabes (Tunis).

(Devlin 2011) Devlin, Keith. 2011. The Man of Numbers: Fibonacci’s Arithmetic Revolution. Walker & Company.

(Høyrup 2022) Høyrup, Jens. 2022. The World of the Abbaco: Abbacus mathematics analyzed and situated historically between Fibonacci and Stifel. (2022-03-01 version, manuscript in progress).

(Sigler 2002) Sigler, L.E. 2002. Fibonacci’s Liber Abaci: Leonardo Pisano’s Book of Calcuation. Springer-Verlag.

(Van Brummelen 2024) Van Brummelen, Glen. 2024. “Decimal fractional numeration and the decimal point in 15th-century Italy” in Historia Mathematica (Volume 66, Pages 1-13). https://doi.org/10.1016/j.hm.2024.01.001