How can I get a good estimation of the following function

142 Views Asked by At

The function is $$ f(n) = \sum_{i=1}^{n} \frac{1}{2i-1}$$ How can I compute for example $f(20)$ or $f(50)$ without using a calculator. I want to have an approximation

2

There are 2 best solutions below

0
On BEST ANSWER

It's a harmonic sum with odd terms: $$ S_n = 1 + \frac{1}{3} + \ldots \frac{1}{2n-1} = 1 +\frac{1}{2}+\frac{1}{3} + \ldots \frac{1}{2n} - \frac{1}{2}-\frac{1}{4} -\ldots \frac{1}{2n} = H_{2n}-\frac{1}{2}H_n $$ and each $H_{k} \sim \log k +\gamma$.

EDIT: Since $H_{2n} \sim \log 2n + \gamma = \log 2 + \log n + \gamma$ this whole expression reduces to $\frac{1}{2} \log n +\log 2 +\frac{\gamma}{2}$

2
On

It is possible to show that $$f(n) = \sum_{i=1}^{n} \frac{1}{2i-1}=\frac{1}{2} \left(\psi ^{(0)}\left(n+\frac{1}{2}\right)-\psi ^{(0)}\left(\frac{1}{2}\right)\right)$$ where appears the polygamma function. For large values of $n$, you have as an approximation $$f(n) =\left(-\frac{1}{2} \log \left(\frac{1}{n}\right)-\frac{\psi ^{(0)}\left(\frac{1}{2}\right)}{2}\right)+O\left(\left(\frac{1}{n}\right)^2\right)$$ where $$\psi ^{(0)}\left(\frac{1}{2}\right) \simeq -1.96351$$ So $$f(n) \simeq \frac{1}{2} \log(n)+0.981755$$ will be a good approximation.

Let us try with you numbers : for $n=20$, the exact value is $2.479673210$ while the approxiamtion leads to $2.479621150$; for $n=50$, the corresponding values are $2.937774848$ and $2.937766516$.