Lecture 35: Continued Fractions

Summary

Today we discussed a variety of topics concerning continued fractions. This included finite and infinite continued fractions, convergents, as well as applications of each.

Finite Continued Fractions

We started out with the following definition:

Definition: An expression of the form $a_0 + \cfrac{1}{a_1+\cfrac{1}{a_2 + \ddots \cfrac{1}{a_{n-1} +\cfrac{1}{a_n}}}}$ where $a_0, a_1, a_2, \cdots , a_n \in \mathbb{R^+}$ is said to be a $\textbf{finite continued fraction}$ and is denoted by $[a_0, a_1, a_2, \cdots, a_n]$. It is said to be $\textbf{simple}$ if $a_0, a_1, a_2, \cdots , a_n \in \mathbb{Z}$.

An Example:

Suppose we want to express $\dfrac {7}{10}$ as a finite simple continued fraction. We begin by applying the division algorithm.
7 = 0*10 + 7
10 = 1*7 + 3
7 = 2*3 + 1
3 = 3*1 + 0

$\dfrac {7}{10} = 0 +\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{3}}} = [0,1,2,3]$

Note that since the division algorithm terminates at 0, there is no need to tack on extra zeroes. Also note that if we tried to have 0 as the last term, we'd have $\frac{1}{0}$, which would be bad.

We then proved the following proposition on rational numbers:

Proposition: Let $\alpha \in \mathbb{R}$. Then $\alpha \in \mathbb{Q}$ iff $\alpha$ is expressible as a finite simple continued fraction.

Proof:

($\Rightarrow direction$): Assume $\alpha \in \mathbb{Q}$. Then $\alpha = \frac{a}{b}$ for some a,b $\in \mathbb{Z}$ with b $\neq 0$. Without loss of generality, we can assume that b>0.
By applying the division algorithm we get:
a = b$q_0 + r_0, \hspace{7mm} 0<r_0<b$ (1)
b = $r_0 q_1 + r_1, \hspace{6 mm} 0<r_1<r_0$ (2)
$r_0 = r_1 q_2 + r_2, \hspace{5 mm} 0<r_2<r_1$
$\vdots$
$r_{n-3} = r_{n-2} q_{n-1} + r_{n-1,} \hspace{5mm} 0<r_{n-1}<r_{n-2}$
$r_{n-2} = r_{n-1}q_n$
Where $q_0, q_1, \cdots , q_n \in \mathbb{Z^+}$
We now begin dividing both sides of (1) by b to get:
$\dfrac{a}{b} = q_0 + \dfrac{r_0}{b} = q_0 + \dfrac{1}{\left(\dfrac{b}{r_0}\right)}$
Next, divide both sides of (2) by $r_0:$
$\dfrac{b}{r_0} = q_1 + \dfrac{r_1}{r_0} = q_1 + \dfrac{1}{\left(\dfrac{r_0}{r_1}\right)}$
Continuing this process results in the following:
$\hspace*{15mm} $\dfrac{r_{n-3}}{r_{n-2}} = q_{n-1} + \dfrac{r_{n-1}}{r_{n-2}} = q_{n-1} + \dfrac{1} {\left(\dfrac{ r_{n-2}}{r_{n-1}}\right)}$
$\dfrac{r_{n-2}}{r_{n-1}} = q_n$
Substituting the expression for b/${r_0}$ into (1), we get:
$\dfrac{a}{b} = q_0 + \cfrac{1}{q_1 + \cfrac{1}{\left(\dfrac{r_0}{r_1}\right)}}$
Continuing in this manner yields:
$\dfrac{a}{b} = q_0 + \cfrac{1}{q_1 + \cfrac{1}{q_2+ \ddots \cfrac{1}{q_{n-1} + \cfrac{1}{q_n}}}}$
$=[q_0, q_1, q_2, ... , q_n]$ as desired.

$(\Leftarrow direction)$: Let $\alpha$ be expressible as a finite simple continued fraction, $\alpha = [a_0, a_1, \cdots, a_n]$ where $a_0, a_1, \cdots , a_n \in \mathbb{Z^+}$. We'll prove our claim by induction on n.
$\textit{Base case}$: If n=0 we have $\alpha = a_0 \in \mathbb{Z} \subseteq{\mathbb{Q}}$ $\checkmark$

$\textit{Inductive Step}$: Assume that k$\geq$1 and that the desired result holds for n=k. That is, any finite simple continued fraction of length k+1 is a rational number. We'll show that it holds for n = k+1. Consider the finite simple continued fraction $[a_0, a_1, ..., a_k, a_{k+1}]$, where $a_0, a_1, \cdots , a_{k+1} \in \mathbb{Z^+}$.
$[a_0, a_1, \cdots, a_{k+1}] = a_0 + \dfrac{1}{[a_1, a_2, \cdots, a_{k+1}]}$
By the inductive hypothesis, $[a_1, a_2, \cdots, a_{k+1}] \in \mathbb{Q}$ so
$[a_1, a_2, \cdots, a_{k+1}] = \dfrac{a}{b}$ for some $a,b \in \mathbb{Z} , b\neq 0$ Then
$[a_0, a_1, a_2, \cdots, a_{k+1} = a_0 + \dfrac{1}{\left(\dfrac{a}{b}\right)} = \dfrac{a_0 a + b}{a} \in \mathbb{Q}$ as desired. $\square$

We note that the finite simple continued fraction representation of a number is not unique by example: $\dfrac{803}{154}$ = [5,4,1,2] = [5,4,1,1,1]. (This is easily verified.)
In fact, for any $[a_0, a_1, \dots, a_n]$ if $a_n > 1$ then we can write $\alpha$ as $[a_0, a_1, \dots, a_n -1, 1]$. And if $a_n = 1$ then $\alpha = [a_0, a_1, \dots, a_{n-1} +1]$.

Convergents

Next, we talked about convergents, which brings us to the following definition:

Definition: Let $\alpha = [a_0, a_1, \cdots, a_n]$ be a finite continued fraction. The finite continued fraction $C_i = [a_0, a_1, \cdots, a_i], 0\leq i\leq n$ is said to be the ith $\textbf{convergent}$ of $\alpha$.

Example:

Let $\alpha$ = [3,1,4,1]. Then the four convergents of $\alpha$ are:
$C_0$ = [3] = 3
$C_1 = [3,1] = 3 +\dfrac{1}{1} =4$
$C_2 = [3,1,4] = 3 +\cfrac{1}{1+\cfrac{1}{4}} = \dfrac{19}{5}$
$C_3 = [3,1,4,1] = 3 +\cfrac{1}{1+\cfrac{1}{4+\cfrac{1}{1}}} = \dfrac{23}{6}$

We note that the reason why convergents are named as such is because each convergent comes closer to approximating $\alpha$ than the next. That is, they "converge" to $\alpha$.

Infinite Continued Fractions

So far, we know that rational numbers are expressible as finite continued fractions. But an interested student might wonder if continued fractions serve any other purpose. And that motivates the next proposition:

Proposition: Let $a_0, a_1, a_2, \cdots \in \mathbb{Z^+}$ and let $C_i = [a_0, a_1, \cdots, a_i], i\geq0.$ Then $\displaystyle\lim_{i\to\infty}C_i$ exists and is said to be the value of the $\textbf{infinite simple continued fraction}$ $[a_0, a_1, a_2, \cdots]. C_i$ is the ith convergent of this infinite simple continued fraction. (Due to lack of time, we will not be proving this, but this particular proof begins on page 203 of the textbook.)

Proposition: Let $\alpha \in \mathbb{R}.$ Then $\alpha \in \mathbb{R -Q}$ iff $\alpha$ is expressible as an infinite simple continued fraction.

We note that this means that all real numbers are expressible as simple continued fractions!

Another Proposition: Let $\alpha \in \mathbb{R-Q}$. Then the expression of $\alpha$ as an infinite simple continued fraction is unique.

Next we explained the process for finding the simple infinite continued fraction for an irrational number $\alpha$ by the following recurrence relation:

Let $\alpha_0 = \alpha$
$a_i = \lfloor \alpha_i \rfloor , i\geq0$.
and $\alpha_{i+1} = \dfrac{1}{\alpha_i - a_i}$.

Example:

Find the infinite simple continued fraction expansion of $e$:
$\alpha = \alpha_0 = e = 2.71828 \cdots$
$a_0 = \lfloor \alpha_0 \rfloor = 2 \hspace{10mm} \alpha_1 = \dfrac{1}{\alpha_0 - a_0} = 1.39221 \cdots$
$a_1 = \lfloor \alpha_1 \rfloor = 1 \hspace{10mm} \alpha_2 = \dfrac{1}{\alpha_1 - a_1} = 2.54964 \cdots$
$a_2 = \lfloor \alpha_2 \rfloor = 2 \hspace{10mm} \alpha_3 = \dfrac{1}{\alpha_2- a_2} = 1.81935 \cdots$
$a_3 = \lfloor \alpha_3 \rfloor = 1 \hspace{10mm} \alpha_4 = \dfrac{1}{\alpha_3 - a_3} = 1.22047 \cdots$
$a_4 = \lfloor \alpha_4 \rfloor = 1 \hspace{10mm} $\alpha_5 = \dfrac{1}{\alpha_4 - a_4} = 4.53557 \cdots$
So that the infinite simple continued fraction of $e$ is [2,1,2,1,1,$\dots$] with no repeating pattern.

We had to introduce some more notation for this next proposition:
If $C_i$ is the ith convergent of $\alpha = [a_0, a_1, \dots]$ then $C_i = \dfrac{p_i}{q_i}$. Where $p_i, q_i$ are defined by recurrence relations given in the text, but since we will not explicitly be using them, we will not define them here.

Proposition: Let $\alpha \in \mathbb{R-Q}$ and let $p_i/q_i$, i =0,1,2,$\dots$, be the convergents of the infinite simple continued fraction expansion of $\alpha$. If $a,b \in \mathbb{Z}$ and $0<b<q_{i+1}$, then $\left| q_i\alpha - p_i \right| \leq \left| b \alpha - a \right|$

Corollary: Let $\alpha \in \mathbb{R-Q}$ and let $p_i/q_i$, i = 0,1,2, $\dots$, be the convergents of the infinite simple continued fraction expansion of $\alpha$. If $a,b \in \mathbb{Z}$ and $1\leq b \leq q_i$, then $\left| \alpha - \dfrac{p_i}{q_i} \right| \leq \left| \alpha - \dfrac{a}{b} \right|$

So what does all this really mean? Given an irrational number $\alpha$ the convergents of the infinite simple continued fraction expression of $\alpha$ give a sequence of the best rational approximations to $\alpha$. That is, the ith convergent $p_i/q_i$ of $\alpha$ is the closest rational number to $\alpha$ among all rational numbers with positive denominator $q_i$ or less. We'll illustrate this with an example:

Example:

The tenth convergent of $e$ is $\frac{2721}{1001}$. Thus, no rational number with a denominator less than or equal to 1001 comes closer to $e$ than $\frac{2721}{1001}$. And, any rational approximation closer to $e$ must have a denominator greater than 1001.

Some Extras:

Now that we know that we can express any real number as a continued fraction, one might wonder if there are any properties of continued fractions worth nothing.

Definition: Let $\alpha \in \mathbb{R-Q}$ and let $\alpha = [a_0, a_1, a_2, \dots]$ be the expression of $\alpha$ as an infinite simple continued fraction. If there exist $\rho, N \in \mathbb{Z^+}$ such that $a_n = a_{n+\rho}$ for all n$\geq$N, then $\alpha$ is said to be $\textbf{eventually periodic}$.

Definition: Let $\alpha \in \mathbb{R-Q}$. Then $\alpha$ is said to be a $\textbf{quadratic irrational number}$ if $\alpha$ is a root of a quadratic polynomial $Ax^2 + Bx + C$ with $A,B,C \in \mathbb{Z}$ and $A \neq 0$.

Example:

So an obvious eventually periodic fraction is [1,1,1,1 $\dots$]. And this proves to be a more interesting example than one might think.
To see this, we'll let
$x =[\bar{1}] = 1+\cfrac{1}{1+\cfrac{1}{1 + \cfrac{1}{1}\dots}}$

Then,
$x -1 = \cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1}\dots}}$

Now,
$\dfrac{1}{x-1}= 1+\cfrac{1}{1+\cfrac{1}{1 + \cfrac{1}{1}\dots}}$ = x.
So we're left with the equation $\dfrac{1}{x-1} = x.$

Solving for x yields x = $\dfrac{1 + \sqrt{5}}{2}$, better known to some as the golden ratio!

This brings us to our final theorem.

Theorem: Let $\alpha \in \mathbb{R-Q}$. Then the expression of $\alpha$ as an infinite simple continued fraction is eventually periodic iff $\alpha$ is a quadratic irrational number.

And here's one last neat example.

Example:

Find the quadratic irrational number represented by the eventually periodic infinite simple continued fraction (what a mouthful!) $[3, \overline{2,1}]$.
We first find the quadratic irrational number represented by the periodic infinite simple continued fraction $\alpha = [\overline{2,1}]$. We can cleverly write this as:
$\alpha =[2,1, \overline{2,1}] = [2,1,\alpha]$ so that
$\alpha = 2 + \cfrac{1}{1+\cfrac{1}{\alpha}}$.
And simplifying this equations yields $\alpha^2 -2\alpha -2 =0$ so that $\alpha = 1 + \sqrt{3}$.
So now we can write $[3,\overline{2,1}] = [3,\alpha] = [3,1+\sqrt{3}]$

$= 3+\dfrac{1}{1+\sqrt{3}} = \dfrac{4+3\sqrt{3}}{1+\sqrt{3}} = \dfrac{5+\sqrt{3}}{2}$ and so $[3,\overline{2,1}] = \frac{5+\sqrt{3}}{2}.$

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License