3

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.

Gonate
  • 558

2 Answers2

2

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$.

Ron Gordon
  • 138,521
  • The number of terms in which series? – hmakholm left over Monica Mar 15 '15 at 15:00
  • @HenningMakholm: I see you have a problem with the OP's problem statement. OK, but I don't see how I could be more clear. $H_n$ is standard notation for

    $$\sum_{k=1}^n \frac1{k} $$

    What else is there to say?

    – Ron Gordon Mar 15 '15 at 15:01
  • @HenningMakholm: I edited my comment once I saw yours. Again, so that nobody misunderstands, the "series that defines gamma" according to the OP is $H_n-\log{n}$. The OP clearly meant this. – Ron Gordon Mar 15 '15 at 15:07
  • x @RonGordon: "The series that defines $\gamma$" is a quote from the OP's homework. He said in comments that he doesn't understand which series that means, and instead tried to work from the only definition of $\gamma$ he knows, namely the limit of $H_n-\log n$. However, "$H_n-\log n$" is not a series, and can't therefore have been what the author of the homework exercise meant. The first step in solving the exercise has to be identifying which series the author had in mind. We can't just ask the OP to clarify that, because he doesn't know what the author meant! – hmakholm left over Monica Mar 15 '15 at 15:09
  • @HenningMakholm: I understand the ridiculousness of the phrase in question. There are lots of series "defining", i.e., involving $\gamma$. But the OP did write was he meant in the first equation. I think that leaves no room for misinterpretation. (Yes, $H_n$ is the output of a series, although $H_n-\gamma$ is a sequence.) However, whatever the OP tried to say, I do not see how what I wrote could be misunderstood, or that the OP meant something else. Maybe you have an alternative that the OP might have meant? In any case, I will clarify. – Ron Gordon Mar 15 '15 at 15:15
  • x @RonGordon: Why do you keep assuming that the OP has a meaning for "the series that defines $\gamma$"? He just quoted that phrase from his homework, and afterwards explicitly said in comments that he doesn't know what it is supposed to mean. I don't know what it means either. All I know is that it can't possibly mean $\lim H_n-\log n$ because that is not a series. – hmakholm left over Monica Mar 15 '15 at 15:18
0

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]$.

Brent Kerby
  • 5,539