---
title: "Mental Arithmetic"
book: "The Interview Book"
subject: quant
language: en
chapter: 8
exercises: 0
source: https://one-course.com/books/quant/18/en/chapter/8-mental-arithmetic
---

# Chapter 8 — Mental Arithmetic

Across the desk: “Seven per cent of 340 million, spread over 250 trading days, per day?” The answer, about 95 thousand, comes back in five seconds from the candidate who turned seven per cent over 250 days into 2.8 basis points a day, and 2.8 basis points of 340 million into 340 times 280; the one who started long multiplication in her head is still carrying digits. Speed in arithmetic is not a talent for carrying digits; it is a small set of rewrites that turn a hard calculation into an easy one, practised until they are automatic, and a habit of checking the result.

## 8.1 Products and squares

Most fast products use one of four rewrites. Each replaces a multiplication by one that is done in a step.

**Method 8.1 (Four rewrites for products).**

1. *Difference of squares* : $(a+d)(a-d) = a^2 - d^2$ when the factors are equally spaced around a round number: $43 \times 37 = 40^2 - 3^2 = 1\,591$ .
2. *Near a hundred* : $(100+a)(100+b) = 100(100 + a + b) + ab$ , valid for negative $a, b$ too: $103 \times 108 = 11\,100 + 24 = 11\,124$ .
3. *Squares ending in 5* : $(10n + 5)^2 = 100\,n(n+1) + 25$ : $85^2 = 7\,200 + 25 = 7\,225$ .
4. *Friendly factors* : multiply by 25 as by 100 then divide by 4, by 125 as by 1000 then divide by 8, by 5 as by 10 then halve: $48 \times 25 = 4\,800/4 = 1\,200$ .

A product of two numbers that fit none of these is split: $67 \times 38 = 67 \times 40 - 67 \times 2 = 2\,680 -
134 = 2\,546$. The choice of split is the skill: subtract from the nearest round number rather than add partial products.

## 8.2 Fractions, percentages and reciprocals

Desk arithmetic is mostly percentages of large numbers and conversions between rates. Three facts make it fast. A percentage is symmetric: $a\%$ of $b$ equals $b\%$ of $a$, so 18% of 50 is 50% of 18, which is 9. A basis point is $10^{-4}$, so a rate in basis points times a notional in millions is a number of hundreds of currency units: 2.8 basis points of 340 million is $2.8 \times 340 \times 100 = 95\,200$. And a small table of reciprocals turns every division by a small integer into a multiplication.

| $n$ | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 16 | 17 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| $1/n$ | 0.1667 | 0.1429 | 0.125 | 0.1111 | 0.0909 | 0.0833 | 0.0769 | 0.0625 | 0.0588 |

*Reciprocals worth knowing; $1/7 = 0.\overline{142857}$ repeats with period six and $1/19 \approx
0.0526$ is the next one to learn.*

## 8.3 Roots, logarithms and compounding

A square root near a known square is linear to first order: $\sqrt{a^2 + d} \approx a + d/(2a)$, with an error below $d^2/(8a^3)$ for $d \ge 0$. $\sqrt{103} \approx 10 + 3/20 = 10.15$, against the true 10.1489. For logarithms, three values and one series cover most questions: $\ln 2 \approx 0.693$, $\ln 3 \approx 1.099$, $\ln 10 \approx 2.303$, and $\ln(1 + x) = x - x^2/2 + x^3/3 - \dots$ for small $x$.

**Definition 8.2 (Rule of 72).**

The *rule of 72* approximates the number of periods an amount takes to double at a rate of $r$ per cent a period, compounded once a period, by $72/r$. The exact doubling time is $\ln 2 / \ln(1 +
r/100)$.

**Proposition 8.3 (Where the rule of 72 is exact).**

The [rule of 72](#def-iv-mental-arithmetic-rule72) is exact at a rate of about 7.85%, overestimates the doubling time below it and underestimates above it. The rule of 70 is exact near 2%. The rule of 69.3 is exact for continuously compounded rates ($100\ln 2 \approx 69.3$) and always underestimates for rates compounded once a period.

**Proof.** $\ln(1 + x) < x$ for $x > 0$, so $\ln 2/\ln(1+x) > \ln 2/x$, which is the last statement. The numerator 72 exceeds $100 \ln 2$ to compensate for $\ln(1+x) < x$; the two effects balance where $72/(100x) = \ln 2/\ln(1+x)$, solved numerically at $x \approx 0.0785$, and the relative error is monotone in $x$ ([Figure 8.1](#fig-iv-mental-arithmetic-rule72)). ∎

![Relative error of three rules for the doubling time against the exact 2/ (1+r), for rates compounded once a period. The rule of 72 crosses zero near 7.85%, the rule of 70 near 2%; the rule of 69.3 is always below. Data: fig_iv_rule72.py.](https://one-course.com/images/onecourse/chapters/quant-18/iv-mental-arithmetic/fig-e983355965ac.svg)

***Figure 8.1.** Relative error of three rules for the doubling time against the exact $\ln 2/\ln(1+r)$, for rates compounded once a period. The [rule of 72](#def-iv-mental-arithmetic-rule72) crosses zero near 7.85%, the rule of 70 near 2%; the rule of 69.3 is always below. Data: `fig_iv_rule72.py`.*

**Example 8.4 (Compounding by logarithms).**

$1.03^{10} = e^{10\ln 1.03}$, and $\ln 1.03 \approx 0.03 - 0.00045 = 0.02955$, so the exponent is about 0.2955 and the result about $e^{0.3} e^{-0.0045} \approx 1.350 \times 0.9955 \approx 1.344$.

## 8.4 Checking an answer

A fast answer is useful only if it is checked as fast. Three checks cost a second each: the order of magnitude (count the digits, or compare with a round product), the last digit (it is the last digit of the product of the last digits), and the residue modulo 9.

**Definition 8.5 (Casting out nines).**

*Casting out nines* checks an integer calculation by replacing each number with the remainder of its digit sum on division by 9, which is the number’s residue modulo 9, and checking that the calculation holds for the residues.

A product passes if the residues of the factors multiply to the residue of the result: $5\,824$ has digit sum 19, residue 1. The check fails to see errors that change the result by a multiple of 9, including the commonest slip, the transposition of two digits ([Interview question 8.9](#iq-iv-mental-arithmetic-9)): a passed check is evidence, a failed check is proof.

## 8.5 Worked answers

**Example 8.6 (A P&L in mixed units).**

*“You bought 1 250 contracts; each tick is worth 12.50; the market moved three ticks in your favour. What did you make?”* Both factors are eighths of powers of ten: $1\,250 = 10\,000/8$ and $12.5 = 100/8$, so $1\,250 \times 12.5 =
10^6/64 = 15\,625$, and three ticks make $46\,875$. *Check:* the answer lies between $1\,000 \times 10 \times 3 =
30\,000$ and $1\,300 \times 13 \times 3 = 50\,700$, and closer to the top because both factors were rounded down by more than they were rounded up. Saying the bounds takes three seconds and catches a slipped zero.

**Example 8.7 (Fees on a fund’s return).**

*“A fund charges 2% of starting assets and 20% of the gain above that fee. It made 12% before fees. What did the investor make, and what gross return would net 10%?”* On 100: the fee takes 2, leaving a gain of 10, of which 20% is 2, so the investor nets 8%. In general the net is $0.8(g - 2)$ for a gross gain of $g$ per 100, so netting 10 needs $g - 2
= 12.5$: a gross return of 14.5%. *Check:* at $g = 2$ the investor nets zero and the fund keeps everything, which is what the formula says. Fee structures differ in the order of the two fees and in hurdles; state the one assumed.

**Example 8.8 (From a monthly to a yearly return).**

*“A strategy returns 1.5% a month. What is that compounded over a year?”* Take logarithms: $\ln 1.015 \approx 0.015 - 0.015^2/2 = 0.0148875$; twelve months give $0.17865$; then $e^{0.17865} \approx 1 + 0.17865 +
0.01596 + 0.00095 \approx 1.1956$, so about 19.6% a year, against 18% for the simple sum. The exact value is $1.015^{12} = 1.19562$ to five decimals. *Check:* compounding must add something to $12 \times 1.5\% = 18\%$, and the excess, about $\binom{12}{2} \times 0.015^2 \approx 1.5\%$, matches the first cross term.

## 8.6 Question bank

**Interview question 8.1 ★ trader • market maker.**

$47 \times 53$.

**Solution of Interview question 8.1.**

$47 \times 53 = 50^2 - 3^2 = 2\,500 - 9 = 2\,491$.

*What the interviewer is looking for: spotting the difference of squares at once.*

**Interview question 8.2 ★ trader • market maker.**

$96 \times 104$ and $98 \times 97$.

**Solution of Interview question 8.2.**

$96 \times 104 = 100^2 - 4^2 = 9\,984$. $98 \times 97 = 100(100 - 2 - 3) + (-2)(-3) = 9\,500 + 6 = 9\,506$.

*What the interviewer is looking for: the near-hundred rewrite, including negative offsets.*

**Interview question 8.3 ★ trader, risk • proprietary firm.**

$65^2$, and without writing anything, $75^2 - 65^2$.

**Solution of Interview question 8.3.**

$65^2 = 100 \times 6 \times 7 + 25 = 4\,225$. $75^2 - 65^2 = (75 - 65)(75 + 65) = 10 \times 140 = 1\,400$.

*What the interviewer is looking for: the squares-ending-in-5 rule and factoring a difference of squares rather than computing both.*

**Interview question 8.4 ★ trader, bank • bank.**

12.5% of 360, then 36% of 25.

**Solution of Interview question 8.4.**

12.5% is $\tfrac18$: $360/8 = 45$. 36% of 25 is 25% of 36: 9.

*What the interviewer is looking for: percentages as fractions, and the symmetry of a percentage.*

**Interview question 8.5 ★ trader, researcher • any.**

$\tfrac37$ and $\tfrac5{13}$ as decimals to three places.

**Solution of Interview question 8.5.**

$\tfrac37 = 3 \times 0.142857 \approx 0.429$. $\tfrac5{13} = 5 \times 0.0769 \approx 0.385$.

*What the interviewer is looking for: a reciprocal table used as multiplication.*

**Interview question 8.6 ★★ researcher, trader • any.**

$\sqrt{50}$ to four decimal places, with a bound on your error.

**Solution of Interview question 8.6.**

$\sqrt{49 + 1} \approx 7 + \tfrac1{14} \approx 7.0714$, with error below $1/(8 \times 343) \approx 0.00036$; the true value is $7.0711$, so the estimate is $0.0003$ high, inside the bound. (A second-order term, $-1/(8 \times
343)$, corrects it to $7.0711$.)

*What the interviewer is looking for: linearisation around a known square and a stated error bound.*

**Interview question 8.7 ★★ trader, bank • bank.**

By the [rule of 72](#def-iv-mental-arithmetic-rule72), how long does money take to double at 1%, 6% and 24% a year? Which of the three answers is furthest from the exact value, and in which direction?

**Solution of Interview question 8.7.**

The rule gives 72, 12 and 3 years; the exact values are 69.7, 11.9 and 3.22. The 24% answer is furthest in relative terms (about 7% short); the 1% answer is about 3.4% long. The rule overestimates below about 7.85% and underestimates above it ([Proposition 8.3](#prop-iv-mental-arithmetic-rule72)).

*What the interviewer is looking for: the rule, the exact formula, and knowing the direction of the error.*

**Interview question 8.8 ★★ trader • market maker.**

A strategy earns 3.2 basis points on a daily turnover of 250 million. What does it earn a day, and in a year of 252 trading days?

**Solution of Interview question 8.8.**

3.2 basis points of 250 million is $3.2 \times 250 \times 100 = 80\,000$ a day; over 252 days, $80\,000 \times
252 = 20.16$ million.

*What the interviewer is looking for: basis points of millions as hundreds, and a clean multiplication by 252 ($250 + 2$).*

**Interview question 8.9 ★★ trader, developer • proprietary firm.**

Check $3\,847 \times 29 = 111\,563$ by [casting out nines](#def-iv-mental-arithmetic-nines). A colleague wrote $111\,653$; does it pass? What does this tell you about the check?

**Solution of Interview question 8.9.**

Residues: $3\,847 \to 22 \to 4$, $29 \to 2$, product residue 8; $111\,563 \to 17 \to 8$: it passes, and it is right. $111\,653$ has the same digits, so the same residue: it passes too, and it is wrong. [Casting out nines](#def-iv-mental-arithmetic-nines) cannot see a transposition or any error by a multiple of 9; add the last-digit check ($7 \times 9$ ends in 3, which both pass) and a magnitude check, or recompute one partial product.

*What the interviewer is looking for: the check and, more important, its blind spot.*

**Interview question 8.10 ★★ trader, risk • any.**

A price rises 20% then falls 20%. Where is it relative to its start? What fall, after a 25% rise, brings it back exactly?

**Solution of Interview question 8.10.**

$1.2 \times 0.8 = 0.96$: 4% below the start. After a 25% rise the price is $\tfrac54$ of the start, so a fall of $\tfrac15$, 20%, brings it back: $1.25 \times 0.8 = 1$.

*What the interviewer is looking for: multiplicative returns and the asymmetry of percentage moves.*

**Interview question 8.11 ★★★ trader, bank • bank.**

$\ln 1.07$ to four decimal places without a calculator, and from it the exact doubling time at 7% a year to two decimals.

**Solution of Interview question 8.11.**

$\ln 1.07 = 0.07 - 0.00245 + 0.000114 - \dots \approx 0.0677$ (to four decimals; the exact value is $0.06766$). The doubling time is $0.6931/0.06766 \approx 10.24$ years, against 10.29 from the [rule of 72](#def-iv-mental-arithmetic-rule72).

*What the interviewer is looking for: three terms of the series and a clean division.*

**Interview question 8.12 ★★★ trader, researcher • market maker.**

$1.03^{10}$ to three decimal places.

**Solution of Interview question 8.12.**

$10 \ln 1.03 = 10(0.03 - 0.00045 + 0.000009) \approx 0.2956$; $e^{0.2956} = e^{0.3} e^{-0.0044} \approx 1.3499
\times 0.9956 \approx 1.344$ (exactly $1.3439$).

*What the interviewer is looking for: compounding through logarithms, with $e^{0.3}$ known or derived.*

**Interview question 8.13 ★★★ trader • market maker.**

$0.0625 \times 4.8 \times 125$, in under ten seconds. Say the rewrite you used.

**Solution of Interview question 8.13.**

$0.0625 = \tfrac1{16}$ and $4.8 \times 125 = 600$ (125 is $\tfrac{1000}8$, and $4.8/8 = 0.6$), so the product is $600/16 = 37.5$.

*What the interviewer is looking for: recognising friendly factors before multiplying.*

**Interview question 8.14 ★★★ researcher, bank • any.**

Explain why the [rule of 72](#def-iv-mental-arithmetic-rule72) uses 72 rather than 69.3, and estimate the rate at which it is exact. Which rule would you use for continuously compounded rates?

**Solution of Interview question 8.14.**

For annual compounding the exact doubling time is $\ln 2/\ln(1 + r)$ and $\ln(1+r) < r$, so $69.3/r$ is always too short; a larger numerator compensates, and 72 also has many divisors (2, 3, 4, 6, 8, 9, 12). The rule is exact where $72/(100r) = \ln 2/\ln(1+r)$, about $r = 7.85\%$: near the rates at which it is usually applied. For continuous compounding, $\ln 2/r$ is exact, so the rule of 69.3.

*What the interviewer is looking for: the source of the rule’s error and why its constant is a compromise.*

Sources and further reading

- The rules of the chapter are elementary; the error bound of the linearised square root is the Lagrange remainder of the Taylor series.
- One Quant Book 1, chapter 7 (carry and P&L arithmetic); One Quant Book 2, chapter 3 (compounding conventions).
