I was recently doing some finance trainings for my new job, and I thought it would be interesting to demonstrate how you can derive useful financial approximations using Taylor polynomials. These rules of thumb can get you close enough to the truth to do napkin math. In this post, I'll work through some examples.

## Calculating Bond Yields

### Prerequisite Knowledge

For the purpose of this section, a bond (loan) is a financial instrument where you pay some price \($P\), and every year you receive dollar amounts \($C\) (called coupons). At the end of the loan (\(n\) years) you receive back what's called the par value \($V\).

One metric that investors are interested in is called the yield \(y\) of the bond. This is essentially a measure of the bond's rate of return, or the percent yearly return you'd have to make on another investment in order to be indifferent between that other investment and this bond. We find the yield by solving for \(y\) in: $$P = \frac{C}{(1 + y)^1} +\ ...\ + \frac{C}{(1 + y)^n} + \frac{V}{(1 + y)^n}$$

Since in general \(y > 0\), we are valuing payments lower the further they are in the future (called "discounting").

### The Approximation

Here is an approximation for the bond's yield: $$y \approx \frac{C}{V} + \frac{\frac{V - P}{V}}{n}$$

The intuitive understanding is that the coupon payments contribute \(\frac{C}{V}\) to the yield every year. To explain the other term, you initially paid \(P\) and you ultimately receive \(V\), contributing about \(\frac{V - P}{V}\) to the yield over the entire course of the bond. So for each year, it's about \(\frac{\frac{V - P}{V}}{n}\) in yield.

Why does this approximation work? We start with the normal equation for calculating bond yield, but we don't discount the coupon payments - that is, we pretend like we don't care about when the coupon payments are made: $$P \approx \underbrace{C +\ ...\ + C}_{n\ \text{times}} + \frac{V}{(1 + y)^n}$$ $$= n * C + V * \frac{1}{(1 + y)^n}$$

To simplify the remainder of the equation, we recall the first-order Taylor approximation centered on 0. That is: $$f(y) \approx f(0) + f'(0) * y$$

We'll just use the Taylor approximation as a tool in this post rather than discussing it at length. We see that: $$\frac{d}{dy}\frac{1}{(1 + y)^n} = \frac{-n}{(1 + y)^{n + 1}}$$ $$\implies \frac{1}{(1 + y)^n} \approx 1 + \frac{-n}{(1 + 0)^{n + 1}} * y = 1 - n * y$$

So after simplifying and isolating for \(y\):

$$(P \approx n * C + V * (1 - n * y))$$ $$\implies (y \approx \frac{C}{V} + \frac{\frac{V - P}{V}}{n})$$## Time For Money To Double: The Rule Of 72

### Prerequisite Knowledge

Let's say that you have an investment that grows by \(r\%\) every year. So for some initial investment \(P\), after \(n\) years, you'll have \((1 + r)^{n} * P\). The question: after how many years does your investment double?

### The Approximation

The common approximation given is that you divide 72 by your rate of return, and that gives you the number of years it takes to double. So for an investment that gives a 6% return, it should take about 12 years to double.

We start with the exact equation: $$2 * P = (1 + r)^n * P$$

$$\implies 2 = (1 + r)^n$$ $$\implies ln(2) = n * ln(1 + r)$$First we observe that \(ln(2) \approx .693\). Then we calculate the first-order Taylor approximation centered on 0 of the right-hand side:

$$\frac{d}{dr}ln(1 + r)$$ $$= \frac{1}{1 + r}$$ $$\implies ln(1 + r) \approx \frac{1}{1 + 0} * r + 0 = r$$So we finally get:

$$n \approx \frac{.693}{r}$$where .693 is frequently substituted with .72 to keep the math simple, since 72 is easily divisible by many numbers. To see when it is most accurate, we can see when this function is equal to the second-order Taylor approximation:

$$\frac{d}{dr}\frac{1}{1 + r}$$ $$= -\frac{1}{(1 + r)^2}$$ $$\implies ln(1 + r) \approx r - \frac{r^2}{2}$$

so we solve for:

$$\frac{ln(2)}{r - \frac{r^2}{2}} = \frac{.72}{r}$$which simplifies to a linear equation. By solving for \(r\), we see that the rule is most accurate for rates around 7.46%.

## Chance Of Winning A Poker Hand: The Rule Of Fours

### Prerequisite Knowledge

This is a fun one. In a standard game of Texas hold'em, you're holding on to two cards, and there are some cards on the table. Your goal is to make the best hand possible out of the cards in your hand plus the cards on the table. Once five cards are on the table, no more cards will be drawn. So you might be curious what your chance of winning is if there are three cards out (and two to go, known as the flop).

### The Approximation

The common rule is that you count the number of cards that would lead to your win (called "outs") and multiply that number by 4 for your approximate chance of winning.

For example, if you have a 3, 4, 5, and 6, then you are hoping for a 2 or a 7 to complete your straight. There are four 2's and four 7's, so you have roughly a \(8 * 4 \implies 32\%\) chance of getting the straight.

We start with the exact probability as usual. Since you have two cards in your hand and three on the table, there are \(52 - 5 = 47\) cards remaining. The easiest way to calculate your chance of winning is to calculate \(1 - \text{Pr[you lose]}\). Since there are \(k\) cards that would lead to your win, there are \(47 - k\) cards that would not lead to you winning after the next card is drawn, or a \(\frac{47 - k}{47}\) chance. The final card has a \(\frac{46 - k}{46}\) chance of you not winning by the same reasoning. So:

$$\text{Pr[you win]} = 1 - \frac{47 - k}{47} * \frac{46 - k}{46}$$ $$= 1 - \frac{47 * 46 - 93 * k + k^2}{47 * 46}$$ $$= \frac{93 * k}{47 * 46} - \frac{k^2}{47 * 46}$$Since this is a polynomial, the first-order Taylor approximation is just the first term of the polynomial:

$$\approx \frac{93 * k}{47 * 46} \approx .043 * k \approx .04 * k$$To see for how many outs \(k\) the approximation \(4\% * k\) is most accurate, we compare it to the exact solution and solve for \(k\):

$$.04 * k = \frac{93 * k}{47 * 46} - \frac{k^2}{47 * 46}$$which gives about \(k = 6.52\).