In
mathematics, a continued fraction is an
expression
Expression may refer to:
Linguistics
* Expression (linguistics), a word, phrase, or sentence
* Fixed expression, a form of words with a specific meaning
* Idiom, a type of fixed expression
* Metaphorical expression, a particular word, phrase, o ...
obtained through an
iterative
Iteration is the repetition of a process in order to generate a (possibly unbounded) sequence of outcomes. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration. ...
process of representing a number as the sum of its
integer part
In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
and the
reciprocal
Reciprocal may refer to:
In mathematics
* Multiplicative inverse, in mathematics, the number 1/''x'', which multiplied by ''x'' gives the product 1, also known as a ''reciprocal''
* Reciprocal polynomial, a polynomial obtained from another pol ...
of another number, then writing this other number as the sum of its integer part and another reciprocal, and so on. In a finite continued fraction (or terminated continued fraction), the iteration/
recursion
Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathemati ...
is terminated after finitely many steps by using an integer in lieu of another continued fraction. In contrast, an infinite continued fraction is an
infinite expression. In either case, all integers in the sequence, other than the first, must be
positive
Positive is a property of positivity and may refer to:
Mathematics and science
* Positive formula, a logical formula not containing negation
* Positive number, a number that is greater than 0
* Plus sign, the sign "+" used to indicate a posi ...
. The integers
are called the
coefficients or terms of the continued fraction.
It is generally assumed that the
numerator
A fraction (from la, fractus, "broken") represents a part of a whole or, more generally, any number of equal parts. When spoken in everyday English, a fraction describes how many parts of a certain size there are, for example, one-half, eight ...
of all of the fractions is 1. If arbitrary values and/or
functions are used in place of one or more of the numerators or the integers in the denominators, the resulting expression is a
generalized continued fraction In complex analysis, a branch of mathematics, a generalized continued fraction is a generalization of regular continued fractions in canonical form, in which the partial numerators and partial denominators can assume arbitrary complex values.
A ge ...
. When it is necessary to distinguish the first form from generalized continued fractions, the former may be called a simple or regular continued fraction, or said to be in canonical form.
Continued fractions have a number of remarkable properties related to the
Euclidean algorithm for integers or
real number
In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every ...
s. Every
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 rat ...
has two closely related expressions as a finite continued fraction, whose coefficients can be determined by applying the Euclidean algorithm to
. The numerical value of an infinite continued fraction is
irrational
Irrationality is cognition, thinking, talking, or acting without inclusion of rationality. It is more specifically described as an action or opinion given through inadequate use of reason, or through emotional distress or cognitive deficiency. T ...
; it is defined from its infinite sequence of integers as the
limit of a sequence of values for finite continued fractions. Each finite continued fraction of the sequence is obtained by using a finite
prefix of the infinite continued fraction's defining sequence of integers. Moreover, every irrational number
is the value of a ''unique'' infinite regular continued fraction, whose coefficients can be found using the non-terminating version of the Euclidean algorithm applied to the
incommensurable values
and 1. This way of expressing real numbers (rational and irrational) is called their ''continued fraction representation''.
The term ''continued fraction'' may also refer to representations of
rational functions, arising in their
analytic theory. For this use of the term, see
Padé approximation and
Chebyshev rational functions
In mathematics, the Chebyshev rational functions are a sequence of functions which are both rational and orthogonal. They are named after Pafnuty Chebyshev. A rational Chebyshev function of degree is defined as:
:R_n(x)\ \stackrel\ T_n\left( ...
.
Motivation and notation
Consider, for example, the
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 rat ...
, which is around 4.4624. As a first
approximation, start with 4, which is the
integer part
In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
; . The fractional part is the
reciprocal
Reciprocal may refer to:
In mathematics
* Multiplicative inverse, in mathematics, the number 1/''x'', which multiplied by ''x'' gives the product 1, also known as a ''reciprocal''
* Reciprocal polynomial, a polynomial obtained from another pol ...
of which is about 2.1628. Use the integer part, 2, as an approximation for the reciprocal to obtain a second approximation of .
The remaining fractional part, , is the reciprocal of , and is around 6.1429. Use 6 as an approximation for this to obtain as an approximation for and , about 4.4615, as the third approximation; . Finally, the fractional part, , is the reciprocal of 7, so its approximation in this scheme, 7, is exact () and produces the exact expression for .
The expression is called the continued fraction representation of . This can be represented by the abbreviated notation =
; 2, 6, 7 (It is customary to replace only the ''first'' comma by a semicolon.) Some older textbooks use all commas in the -tuple, for example,
, 2, 6, 7
If the starting number is rational, then this process exactly parallels the
Euclidean algorithm applied to the numerator and denominator of the number. In particular, it must terminate and produce a finite continued fraction representation of the number. The sequence of integers that occur in this representation is the sequence of successive quotients computed by the Euclidean algorithm. If the starting number is
irrational
Irrationality is cognition, thinking, talking, or acting without inclusion of rationality. It is more specifically described as an action or opinion given through inadequate use of reason, or through emotional distress or cognitive deficiency. T ...
, then the process continues indefinitely. This produces a sequence of approximations, all of which are rational numbers, and these converge to the starting number as a limit. This is the (infinite) continued fraction representation of the number. Examples of continued fraction representations of irrational numbers are:
* . The pattern repeats indefinitely with a period of 6.
* . The pattern repeats indefinitely with a period of 3 except that 2 is added to one of the terms in each cycle.
* . No pattern has ever been found in this representation.
* . 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 ( ...
, the irrational number that is the "most difficult" to approximate rationally. See:
A property of the golden ratio φ
A, or a, is the first letter and the first vowel of the Latin alphabet, used in the modern English alphabet, the alphabets of other western European languages and others worldwide. Its name in English is ''a'' (pronounced ), plural ''aes'' ...
.
* . The
Euler–Mascheroni constant
Euler's constant (sometimes also called the Euler–Mascheroni constant) is a mathematical constant usually denoted by the lowercase Greek letter gamma ().
It is defined as the limiting difference between the harmonic series and the natural l ...
, which is expected but not known to be irrational, and whose continued fraction has no apparent pattern.
Continued fractions are, in some ways, more "mathematically natural" representations of a
real number
In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every ...
than other representations such as
decimal representation
A decimal representation of a non-negative real number is its expression as a sequence of symbols consisting of decimal digits traditionally written with a single separator:
r = b_k b_\ldots b_0.a_1a_2\ldots
Here is the decimal separator, i ...
s, and they have several desirable properties:
* The continued fraction representation for a real number is finite if and only if it is a rational number. In contrast, the decimal representation of a rational number may be finite, for example , or infinite with a repeating cycle, for example
* Every rational number has an essentially unique simple continued fraction representation. Each rational can be represented in exactly two ways, since . Usually the first, shorter one is chosen as the
canonical representation.
* The simple continued fraction representation of an irrational number is unique. (However, additional representations are possible when using ''generalized'' continued fractions; see below.)
* The real numbers whose continued fraction eventually repeats are precisely the
quadratic irrational In mathematics, a quadratic irrational number (also known as a quadratic irrational, a quadratic irrationality or quadratic surd) is an irrational number that is the solution to some quadratic equation with rational coefficients which is irreducibl ...
s. For example, the repeating continued fraction is 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 ( ...
, and the repeating continued fraction is the
square root of 2. In contrast, the decimal representations of quadratic irrationals are apparently
random
In common usage, randomness is the apparent or actual lack of pattern or predictability in events. A random sequence of events, symbols or steps often has no order and does not follow an intelligible pattern or combination. Individual ra ...
. The square roots of all (positive) integers that are not perfect squares are quadratic irrationals, and hence are unique periodic continued fractions.
* The successive approximations generated in finding the continued fraction representation of a number, that is, by truncating the continued fraction representation, are in a certain sense (described below) the "best possible".
Basic formula
A (
generalized) continued fraction is an expression of the form
:
where ''a
i'' and ''b
i'' can be any complex numbers.
When ''b
i'' = 1 for all ''i'' the expression is called a ''simple'' continued fraction.
When the expression contains finitely many terms, it is called a ''finite'' continued fraction.
When the expression contains infinitely many terms, it is called an ''infinite'' continued fraction.
When the terms eventually repeat from some point onwards, the expression is called a
periodic continued fraction
In mathematics, an infinite periodic continued fraction is a continued fraction that can be placed in the form
:
x = a_0 + \cfrac
where the initial block of ''k'' + 1 partial denominators is followed by a block 'a'k''+1, ''a'k''+2,.. ...
.
Thus, all of the following illustrate valid finite simple continued fractions:
For simple continued fractions of the form
the
term can be calculated using the following recursive formula:
where
and
From which it can be understood that the
sequence stops if
.
Calculating continued fraction representations
Consider a real number .
Let
be the
integer part
In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
of and let
be the
fractional part of .
Then the continued fraction representation of is