In
mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, the greedy algorithm for Egyptian fractions is a
greedy algorithm
A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locally ...
, first described by
Fibonacci
Fibonacci (; also , ; – ), also known as Leonardo Bonacci, Leonardo of Pisa, or Leonardo Bigollo Pisano ('Leonardo the Traveller from Pisa'), was an Italian mathematician from the Republic of Pisa, considered to be "the most talented Western ...
, for transforming
rational number
In mathematics, a rational number is a number that can be expressed as the quotient or fraction of two integers, a numerator and a non-zero denominator . For example, is a rational number, as is every integer (e.g. ). The set of all ration ...
s into
Egyptian fraction
An Egyptian fraction is a finite sum of distinct unit fractions, such as
\frac+\frac+\frac.
That is, each fraction in the expression has a numerator equal to 1 and a denominator that is a positive integer, and all the denominators differ from each ...
s. An Egyptian fraction is a representation of an
irreducible fraction
An irreducible fraction (or fraction in lowest terms, simplest form or reduced fraction) is a fraction in which the numerator and denominator are integers that have no other common divisors than 1 (and −1, when negative numbers are considered). ...
as a sum of distinct
unit fraction
A unit fraction is a rational number written as a fraction where the numerator is one and the denominator is a positive integer. A unit fraction is therefore the reciprocal of a positive integer, 1/''n''. Examples are 1/1, 1/2, 1/3, 1/4, 1/5, et ...
s, such as . As the name indicates, these representations have been used as long ago as
ancient Egypt, but the first published systematic method for constructing such expansions was described in 1202 in the ''
Liber Abaci
''Liber Abaci'' (also spelled as ''Liber Abbaci''; "The Book of Calculation") is a historic 1202 Latin manuscript on arithmetic by Leonardo of Pisa, posthumously known as Fibonacci.
''Liber Abaci'' was among the first Western books to describe ...
'' of
Leonardo of Pisa
Fibonacci (; also , ; – ), also known as Leonardo Bonacci, Leonardo of Pisa, or Leonardo Bigollo Pisano ('Leonardo the Traveller from Pisa'), was an Italian mathematician from the Republic of Pisa, considered to be "the most talented Western ...
(Fibonacci). It is called a greedy algorithm because at each step the algorithm chooses greedily the largest possible
unit fraction
A unit fraction is a rational number written as a fraction where the numerator is one and the denominator is a positive integer. A unit fraction is therefore the reciprocal of a positive integer, 1/''n''. Examples are 1/1, 1/2, 1/3, 1/4, 1/5, et ...
that can be used in any representation of the remaining fraction.
Fibonacci actually lists several different methods for constructing Egyptian fraction representations. He includes the greedy method as a last resort for situations when several simpler methods fail; see
Egyptian fraction
An Egyptian fraction is a finite sum of distinct unit fractions, such as
\frac+\frac+\frac.
That is, each fraction in the expression has a numerator equal to 1 and a denominator that is a positive integer, and all the denominators differ from each ...
for a more detailed listing of these methods. As Salzer (1948) details, the greedy method, and extensions of it for the approximation of irrational numbers, have been rediscovered several times by modern mathematicians, earliest and most notably by A closely related expansion method that produces closer approximations at each step by allowing some unit fractions in the sum to be negative dates back to .
The expansion produced by this method for a number
is called the greedy Egyptian expansion, Sylvester expansion, or Fibonacci–Sylvester expansion of
. However, the term ''Fibonacci expansion'' usually refers, not to this method, but to representation of integers as sums of
Fibonacci number
In mathematics, the Fibonacci numbers, commonly denoted , form a sequence, the Fibonacci sequence, in which each number is the sum of the two preceding ones. The sequence commonly starts from 0 and 1, although some authors start the sequence from ...
s.
Algorithm and examples
Fibonacci's algorithm expands the fraction
to be represented, by repeatedly performing the replacement
(simplifying the second term in this replacement as necessary). For instance:
in this expansion, the denominator 3 of the first unit fraction is the result of rounding up to the next larger integer, and the remaining fraction is the result of simplifying = . The denominator of the second unit fraction, 8, is the result of rounding up to the next larger integer, and the remaining fraction is what is left from after subtracting both and .
As each expansion step reduces the numerator of the remaining fraction to be expanded, this method always terminates with a finite expansion; however, compared to ancient Egyptian expansions or to more modern methods, this method may produce expansions that are quite long, with large denominators. For instance, this method expands
while other methods lead to the much better expansion
suggests an even more badly-behaved example, . The greedy method leads to an expansion with ten terms, the last of which has over 500 digits in its denominator; however, has a much shorter non-greedy representation, .
Sylvester's sequence and closest approximation
Sylvester's sequence
In number theory, Sylvester's sequence is an integer sequence in which each term of the sequence is the product of the previous terms, plus one. The first few terms of the sequence are
:2, 3, 7, 43, 1807, 3263443, 10650056950807, 11342371305542184 ...
2, 3, 7, 43, 1807, ... () can be viewed as generated by an infinite greedy expansion of this type for the number 1, where at each step we choose the denominator instead of . Truncating this sequence to ''k'' terms and forming the corresponding Egyptian fraction, e.g. (for ''k'' = 4)
results in the closest possible underestimate of 1 by any ''k''-term Egyptian fraction.
[; ] That is, for example, any Egyptian fraction for a number in the open interval (, 1) requires at least five terms. describes an application of these closest-approximation results in lower-bounding the number of divisors of a
perfect number
In number theory, a perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6 has divisors 1, 2 and 3 (excluding itself), and 1 + 2 + 3 = 6, so 6 is a perfect number.
T ...
, while describes applications in
group theory
In abstract algebra, group theory studies the algebraic structures known as group (mathematics), groups.
The concept of a group is central to abstract algebra: other well-known algebraic structures, such as ring (mathematics), rings, field ...
.
Maximum-length expansions and congruence conditions
Any fraction requires at most ''x'' terms in its greedy expansion. and examine the conditions under which the greedy method produces an expansion of with exactly ''x'' terms; these can be described in terms of congruence conditions on ''y''.
* Every fraction requires one term in its greedy expansion; the simplest such fraction is .
* Every fraction requires two terms in its greedy expansion if and only if ; the simplest such fraction is .
* A fraction requires three terms in its greedy expansion if and only if , for then and is odd, so the fraction remaining after a single step of the greedy expansion,
is in simplest terms. The simplest fraction with a three-term expansion is .
* A fraction requires four terms in its greedy expansion if and only if , for then the numerator of the remaining fraction is 3 and the denominator is . The simplest fraction with a four-term expansion is . The
Erdős–Straus conjecture
The Erdős–Straus conjecture is an unproven statement in number theory. The conjecture is that, for every integer n that is 2 or more, there exist positive integers x, y, and z for which \frac=\frac+\frac+\frac.
In other words, the number 4/n ...
states that all fractions have an expansion with three or fewer terms, but when such expansions must be found by methods other than the greedy algorithm, with the case being covered by the congruence relationship .
More generally the sequence of fractions that have ''x''-term greedy expansions and that have the smallest possible denominator ''y'' for each ''x'' is
Approximation of polynomial roots
and describe a method of finding an accurate
approximation for the roots of a polynomial based on the greedy method. Their algorithm computes the greedy expansion of a root; at each step in this expansion it maintains an auxiliary polynomial that has as its root the remaining fraction to be expanded. Consider as an example applying this method to find the greedy expansion of the
golden ratio
In mathematics, two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Expressed algebraically, for quantities a and b with a > b > 0,
where the Greek letter phi ( ...
, one of the two solutions of the polynomial equation . The algorithm of Stratemeyer and Salzer performs the following sequence of steps:
#Since for ''x'' = 1, and for all , there must be a root of ''P''
0(''x'') between 1 and 2. That is, the first term of the greedy expansion of the golden ratio is . If ''x''
1 is the remaining fraction after the first step of the greedy expansion, it satisfies the equation , which can be expanded as .
#Since for ''x'' = , and for all , the root of ''P''
1 lies between and 1, and the first term in its greedy expansion (the second term in the greedy expansion for the golden ratio) is . If ''x''
2 is the remaining fraction after this step of the greedy expansion, it satisfies the equation , which can be expanded as .
#Since for ''x'' = , and for all , the next term in the greedy expansion is . If ''x''
3 is the remaining fraction after this step of the greedy expansion, it satisfies the equation , which can again be expanded as a polynomial equation with integer coefficients, .
Continuing this approximation process eventually produces the greedy expansion for the golden ratio,
Other integer sequences
The length, minimum denominator, and maximum denominator of the greedy expansion for all fractions with small numerators and denominators can be found in the
On-Line Encyclopedia of Integer Sequences
The On-Line Encyclopedia of Integer Sequences (OEIS) is an online database of integer sequences. It was created and maintained by Neil Sloane while researching at AT&T Labs. He transferred the intellectual property and hosting of the OEIS to the ...
as sequences , , and , respectively. In addition, the greedy expansion of any
irrational number
In mathematics, the irrational numbers (from in- prefix assimilated to ir- (negative prefix, privative) + rational) are all the real numbers that are not rational numbers. That is, irrational numbers cannot be expressed as the ratio of two integ ...
leads to an infinite increasing sequence of integers, and the OEIS contain
expansions of several well known constants Som
additional entries in the OEIS though not labeled as being produced by the greedy algorithm, appear to be of the same type.
Related expansions
In general, if one wants an Egyptian fraction expansion in which the denominators are constrained in some way, it is possible to define a greedy algorithm in which at each step one chooses the expansion
where
is chosen, among all possible values satisfying the constraints, as small as possible such that
and such that
is distinct from all previously chosen denominators. For instance, the
Engel expansion The Engel expansion of a positive real number ''x'' is the unique non-decreasing sequence of positive integers \ such that
:x=\frac+\frac+\frac+\cdots = \frac\left(1+\frac\left(1+\frac\left(1+\cdots\right)\right)\right)
For instance, Euler's cons ...
can be viewed as an algorithm of this type in which each successive denominator must be a multiple of the previous one. However, it may be difficult to determine whether an algorithm of this type can always succeed in finding a finite expansion. In particular, the
odd greedy expansion
In number theory, the odd greedy expansion problem asks whether a greedy algorithm for finding Egyptian fractions with odd denominators always succeeds. , it remains unsolved.
Description
An Egyptian fraction represents a given rational number as ...
of a fraction
is formed by a greedy algorithm of this type in which all denominators are constrained to be odd numbers. Whenever
is odd, there is a finite Egyptian fraction expansion in which all denominators are odd, but it is not known whether the odd greedy expansion is always finite.
Notes
References
*.
*.
*.
*.
*.
*.
*.
*.
*.
*.
*.
*.
*.
*.
{{Fibonacci
Egyptian fractions
Greedy algorithms