Wikipedia:Reference desk/Archives/Mathematics/2019 November 19

= November 19 =

Continuous compounding vs every second
How much money would you need to gain an extra 1.0 cent from continous compounding instead of 60 (infinite precision) compound interest payments per minute?

Let's say within a century and 3 to 6 percent interest. Internet calculator shows more for secondly than continous so the billions of multiplications by numbers extremely close to one are fucking up the applet. Sagittarian Milky Way (talk) 03:07, 19 November 2019 (UTC)


 * What are your formulae for continuous and periodic compounding? The formula in Compound_interest will clearly give you more than continuous compounding. For a 6% interest rate over a century I get 339-fold increase at continuous compounding and 403-fold for compounding 31536000 times per year per that formula. 93.136.31.83 (talk) 03:38, 19 November 2019 (UTC)
 * Disregard this, assumed that continuous compounding is n=1. I've never seen the e^rt formula before. 93.142.92.186 (talk) 22:54, 20 November 2019 (UTC)
 * I edited the section header to make the TOC more reasonable. Assuming a year is exactly 365 days, then you get 31,536,000 compounding periods per year (which isn't exactly right, but whatever). The formulas for compound interest show that you need a principal, $P$, of
 * $$P = \dfrac{0.01}{e^{100r} - \left(1 + \frac{r}{31536000}\right)^{100\cdot 31536000}},$$
 * where $r$ is the annual interest rate. For 3%, you get $348,908, and for 6%, you get $4,343 (both rounded to the nearest dollar). –Deacon Vorbis (carbon &bull; videos) 19:38, 19 November 2019 (UTC)
 * Agrees with the numbers I get in Wolfram Alpha: 348907.78 and 4342.77 93.142.92.186 (talk) 22:57, 20 November 2019 (UTC)
 * But it's no use trying to evaluate that with a calculator as, in that form, rounding error will dominate the denominator. catslash (talk) 20:16, 19 November 2019 (UTC)
 * Depends on the calculator; I did this with plain old Windows calc, and it was fine. –Deacon Vorbis (carbon &bull; videos) 20:18, 19 November 2019 (UTC)
 * , Windows calculator uses 32-bit floats, per it's source code.
 * I strongly recommend you recalculate it in a better calculator, preferably a actual CAS, which usually do not suffer from numerical imprecision nearly as much. MoonyTheDwarf (Braden N.) (talk) 20:22, 19 November 2019 (UTC)
 * Ten seconds more research and I would've realised it instead used it's own inhouse rational implementation. . --MoonyTheDwarf (Braden N.) (talk) 20:24, 19 November 2019 (UTC)


 * For note, it as 128 digits of precision by default. MoonyTheDwarf (Braden N.) (talk) 20:28, 19 November 2019 (UTC)
 * If you have high-enough-precision floating point, yes, you can just plug-and-chug on the formulas, but with just a little thought you can get more robust answers (not requiring special kinds of float, for example) that will also be more enlightening and give you practice in useful general techniques.
 * Try this: Let r be the interest rate per year (e.g. 10% per annum would correspond to an r of 0.10). Then if you start with $1, with yearly compounding you would have $1&middot;(1+r) after a year, whereas with continuous compounding you'd have $1&middot;er.
 * Good so far? More generally, after N years, compounding n times per year, you'd have $1&middot;(1+r/n)nN, against $1&middot;erN with continuous compounding.
 * Now let's take the logarithm of everything, so we can apply infinite series and get an approximation. I don't know what the logarithm of a dollar is, so we'll drop that part and just take logs of the ratio by which your money increases.  The log of the increase ratio after N years using continuous compounding is just rN, as we saw.  For compounding n times per year, the log of the ratio is
 * $$\log\left[\left(1+\frac{r}{n}\right)^{nN}\right]=nN\log\left(1+\frac{r}{n}\right)$$
 * $$=nN\left(\frac{r}{n}-\frac{r^2}{2n^2}+\frac{r^3}{3n^3}-\ldots\right)$$
 * $$=rN-N\left(\frac{r^2}{2n}-\frac{r^3}{3n^2}+\ldots\right)$$
 * Note that the first term of the last line is rN, the same as the value for continuous compounding, and the infinite series in the second term is an alternating series, which makes it easy to compute error bounds (the error does not exceed the first omitted term).
 * From here it should not be difficult to get a rigorous answer to your question, without relying on very-high-precision floating point. --Trovatore (talk) 01:49, 20 November 2019 (UTC)


 * This is probably about to get archived, so let me just finish the thought. If we feel that r/n is small enough that we can drop terms at least quadratic in it, then the log of the ratio is $$rN-N\left(\frac{r^2}{2n}\right)$$, so for a principal of P, the non-continuously-compounded final value is $$Pe^{rN-N\left(\frac{r^2N}{2n}\right)}$$, as opposed to $$Pe^{rN}$$ for continuous compounding, so non-continuous compounding is worse by a ratio of $$e^{\frac{r^2N}{2n}}\approx1-\frac{r^2N}{2n}$$.  So if we represent your one cent by $$\Delta V$$, we want
 * $$Pe^{rN}=Pe^{rN}\left(1-\frac{r^2N}{2n}\right)+\Delta V$$
 * $$Pe^{rN}\cdot \frac{r^2N}{2n}=\Delta V$$
 * $$P=\Delta V\left(\frac{2n}{r^2Ne^{rN}}\right)$$
 * You can plug in values here and verify that they closely approximate the earlier answers, but more to the point you now can see how the answer depends on the inputs, which wasn't obvious from the earlier answers. --Trovatore (talk) 02:11, 27 November 2019 (UTC)