8.3: Continued fractions
- Page ID
- 7621
This page is a draft and is under active development.
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Definition: Continued fractions
A simple continued fraction is of the form, denoted by \([a_0,a_1,\ldots]\), \[a_0 + \frac{1}{a_1+\frac{\displaystyle 1}{\displaystyle a_2+ \ldots}},\] where \(a_0\), \(\ a_1\), \(\ a_2\), \(\ldots\) \(\in \mathbb{Z}\). Continued fraction has been studied extensively, but we will only explore some of them in this class.
Example \(\PageIndex{1}\):
A simple finite continued fraction \[ \frac{1}{2}=[1,1]=0+\frac{1}{1+\frac{1}{1}}\]
A simple infinite continued fraction: Golden Ratio \[ \phi =\frac{1+\sqrt{5}}{2}=[1,1,\ldots]=1+\frac{1}{1+\frac{1}{1+\ldots}},\]which can be found using \(x=1+\dfrac{1}{1+x}\).
Rational numbers have a simple finite continued fraction, and irrational numbers have an infinite continued fraction.
Writing Continued Fractions
Let’s explore the process of writing continued fractions using two examples:
Starting with the fraction \[ \frac{47}{17} = 2 + \frac{13}{17} \]
This expression indicates that \[ \frac{47}{17} \text{ is equivalent to the whole number } 2 \text{ plus a fraction } \frac{13}{17}. \]
Next, we can express it as \[ \frac{47}{17} = 2 + \frac{1}{\frac{17}{13}} \]
Here, we’ve written \[ \frac{47}{17} \text{ as the whole number } 2 \text{ plus the reciprocal of the fraction } \frac{17}{13}. \]
Continuing, we have \[ \frac{47}{17} = 2 + \frac{1}{1 + \frac{4}{13}} \]
Now, the continued fraction form includes the whole number \( 2 \) and a fraction where the denominator is the sum of \( 1 \) and \( \frac{4}{13} \).
\[ \frac{47}{17} = 2 + \frac{1}{1 + \frac{1}{13}} \] Here, we express \[ \frac{47}{17} \text{ as } 2 \text{ plus a fraction where the denominator itself is a continued fraction.} \] We can further express it as \[ \frac{47}{17} = 2 + \frac{1}{1 + \frac{1}{3 + \frac{1}{4}}} \tag{9} \] The final form illustrates the continued fraction expansion of \(\frac{47}{17}\) with multiple levels of nesting.
Now, let’s consider the square root of 2: \[ \sqrt{2} = 1 + (\sqrt{2} - 1) \tag{10} \] Here, we expressed that the square root of 2 equals \(1 + (\sqrt{2} - 1)\). Next, we write: \[ \sqrt{2} = 1 + \frac{1}{1 + \sqrt{2}} \tag{11} \] In this form, the square root of 2 is written as 1 plus the reciprocal of the quantity \(1 + \sqrt{2}\). Now replace \(\sqrt{2}\) with what we proved it to equal in equation (11): \[ \sqrt{2} = 1 + \frac{1}{1 + 1 + \frac{1}{1 + \sqrt{2}}} \tag{12} \] Simplifying gives us: \[ \sqrt{2} = 1 + \frac{1}{2 + \frac{1}{1 + \sqrt{2}}} \tag{13} \] Continue with replacing \(\sqrt{2}\) with what we proved it to equal in equation (11): \[ \sqrt{2} = 1 + \frac{1}{2 + \frac{1}{1 + 1 + \frac{1}{1 + \sqrt{2}}}} \tag{14} \] This leads to: \[ \sqrt{2} = 1 + \frac{1}{2 + \frac{1}{2 + \frac{1}{1 + \sqrt{2}}}} \tag{15} \] Finally, we have: \[ \sqrt{2} = 1 + \frac{1}{2 + \frac{1}{2 + \frac{1}{\ldots}}} \tag{16} \] This final form illustrates the continued fraction expansion of the square root of 2 with repeated nesting. The ellipsis (\(\ldots\)) represents an infinite continuation of the pattern.
Using the Euclidean algorithm to find a simple finite continued fraction
Let's explore the following example:
Consider \(\dfrac{2520}{154}\).
By Euclidean algorithm we have,
\(2520=({16})(154)+56\)
\(154=(2)(56)+42\)
\(56=(1)(42)+14\)
\(42=(3)(14)+0\).
The quotients give us the simple finite continued fraction \([16, 2, 1, 3]\). That is
\[ \frac{2520}{154}= 16 + \frac{1}{2+ \frac{1}{1+ \frac{1}{3}}}.\]
Continued fractions are more structured and easier to manipulate for certain mathematical operations, especially in number theory problems. While familiar, decimals can be challenging for analysis and computation.