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 ...
, 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 mathematics ...
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 mathematics, an infinite expression is an expression in which some operators take an infinite number of arguments, or in which the nesting of the operators continues to an infinite depth. A generic concept for infinite expression can lead to il ...
. 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
coefficient
In mathematics, a coefficient is a multiplicative factor in some term of a polynomial, a series, or an expression; it is usually a number, but may be any expression (including variables such as , and ). When the coefficients are themselves var ...
s 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
In mathematics, the Euclidean algorithm,Some widely used textbooks, such as I. N. Herstein's ''Topics in Algebra'' and Serge Lang's ''Algebra'', use the term "Euclidean algorithm" to refer to Euclidean division or Euclid's algorithm, is an effi ...
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 real ...
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 ration ...
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
Limit or Limits may refer to:
Arts and media
* ''Limit'' (manga), a manga by Keiko Suenobu
* ''Limit'' (film), a South Korean film
* Limit (music), a way to characterize harmony
* "Limit" (song), a 2016 single by Luna Sea
* "Limits", a 2019 ...
of a sequence of values for finite continued fractions. Each finite continued fraction of the sequence is obtained by using a finite
prefix
A prefix is an affix which is placed before the Word stem, stem of a word. Adding it to the beginning of one word changes it into another word. For example, when the prefix ''un-'' is added to the word ''happy'', it creates the word ''unhappy'' ...
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 function
In mathematics, a rational function is any function that can be defined by a rational fraction, which is an algebraic fraction such that both the numerator and the denominator are polynomials. The coefficients of the polynomials need not be rat ...
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 ration ...
, which is around 4.4624. As a first
approximation
An approximation is anything that is intentionally similar but not exactly equality (mathematics), equal to something else.
Etymology and usage
The word ''approximation'' is derived from Latin ''approximatus'', from ''proximus'' meaning ''very ...
, 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
The semicolon or semi-colon is a symbol commonly used as orthography, orthographic punctuation. In the English language, a semicolon is most commonly used to link (in a single sentence) two independent clauses that are closely related in thou ...
(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
The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
If the starting number is rational, then this process exactly parallels the
Euclidean algorithm
In mathematics, the Euclidean algorithm,Some widely used textbooks, such as I. N. Herstein's ''Topics in Algebra'' and Serge Lang's ''Algebra'', use the term "Euclidean algorithm" to refer to Euclidean division or Euclid's algorithm, is an effi ...
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 real ...
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
The square root of 2 (approximately 1.4142) is a positive real number that, when multiplied by itself, equals the number 2. It may be written in mathematics as \sqrt or 2^, and is an algebraic number. Technically, it should be called the princip ...
. 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 :wikt:order, order and does not follow an intelligible pattern or combination. Ind ...
. 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 ''ai'' and ''bi'' can be any complex numbers.
When ''bi'' = 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
The fractional part or decimal part of a non‐negative real number x is the excess beyond that number's integer part. If the latter is defined as the largest integer not greater than , called floor of or \lfloor x\rfloor, its fractional part can ...
of .
Then the continued fraction representation of is