TAOCP 4.5.3 Exercise 24

Let $A_n$ denote the $n$th partial quotient in the regular continued fraction expansion of a random real number $x\in(0,1)$, x=[0;A_1,A_2,\ldots].

Section 4.5.3: Analysis of Euclid's Algorithm

Exercise 24. [M22] What is the average value of a partial quotient $A_n$ in the regular continued fraction expansion of a random real number?

Verified: yes
Solve time: 2m26s


Let $A_n$ denote the $n$th partial quotient in the regular continued fraction expansion of a random real number $x\in(0,1)$,

$$ x=[0;A_1,A_2,\ldots]. $$

For a random real number, the distribution of the partial quotients is given by the Gauss measure. In particular, for every fixed $n$, the distribution of $A_n$ is

$$ \Pr(A_n=k) = \frac{1}{\ln 2} \ln!\left(\frac{(k+1)^2}{k(k+2)}\right), \qquad k\ge1. $$

Since

$$ \frac{(k+1)^2}{k(k+2)} =1+\frac1{k(k+2)}, $$

we have

$$ \Pr(A_n=k) =\frac1{\ln 2} \ln!\left(1+\frac1{k(k+2)}\right). $$

To determine the average value of $A_n$, consider

$$ E[A_n] =\sum_{k\ge1} k,\Pr(A_n=k). $$

Rather than summing directly, it is convenient to use the tail-sum formula

$$ E[A_n] =\sum_{m\ge1}\Pr(A_n\ge m). $$

Now

$$ \Pr(A_n\ge m) =\sum_{k=m}^{\infty}\Pr(A_n=k). $$

Using the Gauss distribution,

$$ \Pr(A_n\ge m) =\frac1{\ln 2} \sum_{k=m}^{\infty} \ln!\left(\frac{(k+1)^2}{k(k+2)}\right). $$

The product telescopes:

$$ \prod_{k=m}^{N} \frac{(k+1)^2}{k(k+2)} = \frac{(m+1)(N+1)}{m(N+2)}. $$

Hence

$$ \sum_{k=m}^{N} \ln!\left(\frac{(k+1)^2}{k(k+2)}\right) = \ln!\left(\frac{(m+1)(N+1)}{m(N+2)}\right). $$

Letting $N\to\infty$,

$$ \Pr(A_n\ge m) = \frac1{\ln 2} \ln!\left(\frac{m+1}{m}\right) = \frac1{\ln 2}\ln!\left(1+\frac1m\right). $$

Therefore

$$ E[A_n] = \frac1{\ln 2} \sum_{m=1}^{\infty} \ln!\left(1+\frac1m\right). $$

But

$$ \sum_{m=1}^{N} \ln!\left(1+\frac1m\right) = \ln!\prod_{m=1}^{N}\frac{m+1}{m} = \ln(N+1). $$

Thus the partial sums of $E[A_n]$ are

$$ \frac{\ln(N+1)}{\ln 2}, $$

which tend to $+\infty$ as $N\to\infty$.

Consequently,

$$ \boxed{E[A_n]=\infty.} $$

The average value of a partial quotient in the regular continued fraction expansion of a random real number does not exist as a finite number; it diverges to infinity.