Approximating the value of Euler's constant?

469 Views Asked by At

I'm asked the following:

Using the series that defines $\gamma$, Euler's constant, what's the minimum number of terms that we have to sum in order to calculate $\gamma$ with an error less than $2 \cdot 10^{-3}$?

$\gamma$ is the difference between the harmonic series and the natural logaritm:

$$\gamma := \lim_{n \to \infty} \left( H_n - \log n\right)$$

I rearrange and managed to get this expression:

$$\sum_{n=k}^{\infty} \frac{1}{n} - \int_k^{\infty} \frac{1}{t} \ dt \lt 2 \cdot 10^{-3}, \text{ for some value of } k.$$

But I don't know how to continue, and I suspect that there is a much simpler way of going on about it, as the question wasn't suppose to be very long.

2

There are 2 best solutions below

0
On

Hint: You can write $$\log n=\sum_{k=2}^n (\log k -\log(k-1))=\sum_{k=2}^n\int_{k-1}^k \frac1x \ dx,$$ while you can write $$H_n=\sum_{k=1}^n \frac1k=\sum_{k=1}^n \int_{k-1}^k\frac1k\ dx$$ Try to get a bound for the difference $\frac1k-\frac1x$ on the interval $x\in[k-1,k]$.

6
On

EDIT

It has been pointed out that the OP's problem statement reflects fundamental misunderstandings of the material; I agree. Therefore, the problem statement should be clarified as follows:

At what minimum value of $n$ does the following relation become true?

$$H_n - \log{n} - \gamma \le 2 \cdot 10^{-3}$$


It turns out that the result is quite simple. I will begin by defining the digamma function

$$\psi(z) = \frac{d}{dx} \log{\Gamma(z)} $$

When $z$ is a positive integer, $\psi(n+1) = H_n-\gamma$. Better yet, there is a nice asymptotic approximation to determine the expected error as a function of $n$:

$$\psi(z) = \log{z} - \frac1{2 z} + O \left ( \frac1{z^2} \right ) $$

This may be seen as a consequence of Stirling's series for the Gamma function, although I am hesitant to assume that one may derive the asymptotic series of $\psi$ by taking the derivative of the Stirling series.

It then follows immediately that

$$\begin{align}H_n -\gamma= \psi(n+1) &= \log{(n+1)} - \frac1{2 (n+1)} + O \left ( \frac1{(n+1)^2} \right ) \\ &= \log{n} + \log{\left ( 1+\frac1{n} \right )} - \frac1{2 n} \frac1{1+\frac1{2 n}} + O \left ( \frac1{n^2} \right ) \\ &= \log{n} +\frac1{2 n} + O \left ( \frac1{n^2} \right )\end{align}$$

That is,

$$(H_n - \log{n})-\gamma = \frac1{2 n} + O \left ( \frac1{n^2} \right ) $$

Thus, the error as a function of $n$ is about $1/(2 n)$. So the number of terms needed to achieve an error of $2 \cdot 10^{-3}$ is about $1/(4 \cdot 10^{-3}) = 250$.