1

Consider formula $ (*) \ln(x) = \sum_{k=1}^{\infty} (-1)^{k-1}\cdot \frac{(x-1)^k}{k}$. If you calculate $ \ln2 $ with error less then $ \frac{1}{2} \cdot 10^{-6} $ we need more than two milion element's series $ (*) $. Prove that $ \ln2 = \ln[e(2/e)] $ is much faster.

Idea:
I guess, that formula $ (*) $ is correct for very small interval, $x \in (-1,1) $
So $ \ln[e(2/e)]=\ln e+\ln(2/e) = 1 + \ln(2/e) $

And know:
- how prove that $ \ln(2/e) \in (-1,1) $
- I must consider something else? Is in the idea is a trap?

Boris Novikov
  • 17,470
  • I can see that the power series for $\ln(2/e)$ converges more rapidly than for $\ln 2$, since $2/e$ lies closer to the expansion point $x=1$ than $2$ does. However it requires an accurate value of $1/e$, so that adds something to your cost of computation. – hardmath Oct 07 '13 at 16:02
  • Your series (*) converges for $x \in (0,2]$, so $x-1 \in (-1,1]$ is how your "idea" should be phrased. – hardmath Oct 07 '13 at 16:04
  • @hardmath maybe you know answer on my questions :-) ? The most important is "about the trap". And yes it's my fault with $ x \in (0, 2] $ – user99364 Oct 07 '13 at 16:05
  • The idea (about faster convergence) is correct. The only "trap" would be how you come up with $2/e$ in order to compute with six digits of precision. – hardmath Oct 07 '13 at 16:07
  • Could you write something more about this "trap" ? – user99364 Oct 07 '13 at 16:10
  • Done. See also the continued fraction for $ln 2$ that is described at the end of my linked Answer, which gives the required accuracy in about eight nested divisions. – hardmath Oct 07 '13 at 16:40

1 Answers1

1

The transcendental constant $\ln 2$ is useful in many applications, cf. range reduction in computing $e^x$ or converting between natural logarithms and logarithms base two.

It might be more difficult to compute $e$ or its inverse "from scratch" to six decimal places than to use some other method of improving a rate of convergence.

Let's consider how close $2/e$ gets us to the expansion point around $x=1$:

$$ | 2/e - 1 | \approx 0.264 $$

Another approach would be to take advantage of square roots, since $\ln 2^\frac{1}{2} = \frac{1}{2} \ln 2$:

$$ | 2^{\frac{1}{2}} - 1 | \approx 0.414 $$

and taking a fourth root would allow:

$$ | 2^{\frac{1}{4}} - 1 | \approx 0.189 $$

So computing $\ln 2^{\frac{1}{4}}$ by the power series expansion will converge more rapidly than for $\ln(2/e)$ and avoids computing $2/e$ in advance by taking a couple of square roots (to six digits of precision).

Of course they have calculators (in software) that run circles around us chemical computers these days!


Now if we have to compute $2/e$ from scratch, it is not a terribly difficult task. Certainly it does not require "more than two mil[l]ion" terms in the exponential series.

In fact we can compute $e^{-1}$ using the Taylor series expansion:

$$ e^{-1} = \sum_{k=0}^\infty \frac{(-1)^k}{k!} $$

and by the Alternating Series Theorem, the error of truncation after the $k$th term of this series is less than the (absolute value of the) $k+1$st term. Summing through $k=10$ should get you almost the desired precision; using $k=11$ should safeguard your accuracy.

It's a bit of work, but with care it will easily fit on one sheet of paper. Then:

$$ 2/e = e^{-1} + e^{-1} $$

and we are ready to use the power series expansion of logarithm (on $(2/e) - 1$).

The other detail to be fastidious about is how many terms of the logarithm's power series you will actually need. Consult Taylor's Theorem with Remainder for details of how many terms are needed to shrink the error of truncation, and bear in mind that if you have approximated $2/e$, this error must be combined with the error of truncation in approximating $\ln(2/e)$ to get a true estimate of accuracy.

hardmath
  • 37,015
  • Hint from my teacher: " You must show, that if I use $ log(a \cdot b) = log(a) + log(b) $ - so we sum up fewer value, but carefully, because in this task is a trap. " I unfortunately don't know what kind of trap, maybe you know? – user99364 Oct 07 '13 at 17:24
  • Did you read what I wrote about computing 2/e? How would you do this? You would need to do this first, before you can apply the power series for logarithm to it. Of course, you have the advantage of knowing what level of math you are studying, where I am only able to guess. – hardmath Oct 07 '13 at 18:52
  • I've added a discussion about computing $2/e$ to my Answer. I can't tell from your lack of response every time I raised that topic whether you don't see its significance or you just cannot articulate how you'd do the computation. Hence you leave me guessing what level of math you are studying. – hardmath Oct 07 '13 at 21:33