Numeracy for Traders- Lesson 1 – Fractions

Fractions is a topic from elementary mathematics but surprisingly even some Ph.Ds in math have problems with them. After this lesson you will be able to read pie diagrams, calculate portfolio weights and weighted average returns. This lesson does not substitute systematic learning but helps you to recall fractions and demonstrates their usage in trading context.

To understand fractions is a non-trivial challenge, I myself had problems with them in the secondary school. Moreover, a prominent mathematician Vladimir Arnold has reported that his Ph.D. students in France did have problems with fractions. Most likely this is because fractions are introduced in a secondary school and a teacher usually gives rules how to manipulate them but does not explain the motivation behind. But the mathematical genius Henri Poincaré used to say: it is impossible to master the fractions without (mentally) cutting up an apple or a pie.

Let us first (equally) share a pie among seven friends. Had we seven pies the operation would be elementary: 7:7 = 1. But we have only one pie, so we need to cut it equally as shown at Figure 1a (by the way, such charts are called pie diagrams). In this sense the fraction is to understand as a directive to divide: i.e. 1:7 and \frac{1}{7} is essentially the same. In this sense the numerator and the denominator are nothing else but, respectively, the dividend and the divisor.

a pie chat - seven of one seventh b A pie cut into 1-7, 2-7 and 4-7
c sevence of pie - how to add fractions with the same denominator
Figure 1:
a) equally sharing a pie in 7 parts
b) non-equal shares with (common) denominator 7
c) a hint how to add fractions with common denominator

A little bit more complicated case is a non-equal pie sharing. A "pie" may be e.g. the initial capital of a firm: if the first partner invests $10000, the second invests $20000 and the third one invests $40000 then the total capital is \$10000 + \$20000 + \$40000 = \$70000 and their shares are, respectively, \frac{\$10000}{\$70000} = \frac{1}{7}\frac{\$20000}{\$70000} = \frac{2}{7} and \frac{\$40000}{\$70000} = \frac{4}{7}. Along the way we used an important rule: if the numerator and the denominator have common divisor (in our case it is 10000), we can cancel it. Indeed, the partners' shares remains the same whether they invest $10000, $20000, $40000 or $1, $2, $4. Also from mathematical point of view: a fraction is a directive for division, the result does not change if we multiple both dividend and divisor with a common factor, i.e.our case in (1 \cdot 10000) : (7 \cdot 10000)   = \frac{1 \cdot 10000}{7 \cdot 10000} =  \frac{1}{7}.

Now you also (should) easily understand how to multiply fractions: once again, a fraction is a directive to divide, hence \frac{a}{b} \cdot \frac{c}{d} = (a:b) \cdot (c:d) = (a \cdot c) : (b \cdot d) = \frac{ac}{bd}
Example 1: if you invest \frac{1}{4} of you capital in a stock index and leave \frac{3}{4} in cash (by zero interest rate, which is not uncommon nowadays) and the index grows by 20\% = \frac{20}{100} = \frac{20}{20 \cdot 5} = \frac{1}{5} then the total return on your capital is equal to \frac{1}{4} \frac{1}{5} = \frac{1}{20} = \frac{5}{100} = 0.05 = 5\%

In Example 1 you have also seen how we can convert between common and decimal fractions. In order to convert to a decimal fraction you need to obtain 10, 100, 1000, etc in denominator by multiplying or dividing both denominator and numerator by a common factor. Finding this factor may be a little bit challenging, e.g \frac{1}{8} =\frac{125}{8 \cdot 125} = \frac{125}{1000} = 0.125 but don't worry, in practice a calculator or a computer will always do this task for you. As to conversion from a decimal to a common fraction, it is easier: just write in the numerator the digits starting with the first non-zero after the decimal point and in the denominator the factor of 10 with as much zeros as there are digits after the decimal point. E.g. for 0.00105 we write 105 in the numerator (zeros in .00 are omitted, zero in 105 has a non-zero digit left from it, so it is not omitted). There are five digits after the decimal point, so in denominator we write 100000. Finally we may cancel for a common factor 5, so 0.00105 =\frac{105}{100000} = \frac{21}{20000}

As to division by a fraction, it is less intuitive (indeed, dividing a pie among "one half" or "two thirds" persons hardly makes sense). But as a mathematical operation it is not uncommon and can be easily formalized: \frac{a}{b} : \frac{c}{d} = (a:b) : (c:d) = (a\cdot d) : (b \cdot c) = \frac{ad}{bc} = \frac{a}{b} \cdot \frac{d}{c} So dividing by \frac{c}{d} is equivalent to multiplying by \frac{d}{c}!

The last rule we need to understand is how to add the fractions with different denominators.

1/2 = 3/6
1/2 = 3/6

1/3 = 2/6
1/3 = 2/6
Figure 2: bringing fractions to a common denominator

In order to add \frac{a}{b} and \frac{c}{d} you need first to bring them to the common denominator. You can always do it as follows: \frac{a}{b} \cdot \frac{d}{d} + \frac{c}{d} \cdot \frac{b}{b} = \frac{ad + bc}{bd}.
Bringing to a common factor essentially means further (finer) division (or better to say split), as Figure 2 shows. For example, in order to sum \frac{1}{2} and \frac{2}{3} we bring them to the common denominator 2 \cdot 3 = 6, which means that one half is split in three parts (so we get three sixths) and two third is split in two, so we get (four sixths) and finally \frac{1}{2} + \frac{2}{3} = \frac{3}{6} + \frac{4}{6} = \frac{3 + 4}{6} = \frac{7}{6} = \frac{6 + 1}{6} = \frac{6}{6} + \frac{1}{6} = 1 + \frac{1}{6} = 1 \frac{1}{6}

Sometimes b and d have a common factor, e.g. you can add \frac{1}{2} and \frac{1}{4} as follows: \frac{1}{2} + \frac{1}{4} = \frac{2}{4} + \frac{1}{4} = \frac{3}{4}. But doing \frac{a}{b} \cdot \frac{d}{d} + \frac{c}{d} \cdot \frac{b}{b} = \frac{ad + bc}{bd} is always correct, e.g. in our case \frac{1}{2} \cdot \frac{4}{4} + \frac{1}{4} \cdot \frac{2}{2} = \frac{1 \cdot 4 + 1 \cdot 2}{2 \cdot 4} = \frac{6}{8} = \frac{3}{4}.

Finally, let us apply our skill to a task from portfolio management.
Assume a financial (robo) advisor tells you that you should invest \frac{1}{3} in stocks, \frac{1}{2} in bonds and the rest (which is 1 - \frac{1}{3} - \frac{1}{2} = 1 - \frac{2}{6} - \frac{3}{6} = \frac{6}{6} - \frac{2}{6} - \frac{3}{6} = \frac{1}{6}) in gold.
Further assume that the stocks grew by 20%, the bonds gave you 2% of return and the gold grew by 50%. So what is the average return on your investments (or in other words, what is the total return of your portfolio)?!
A naive (innumerate) investor would probably state it is (20% + 2% + 50%) / 3 = 24%. This is, however, wrong. It would be correct if the shares (=weights) of all assets were equal. But generally they are not and we have to calculate the weighted average as follows: \frac{1} {3} \cdot 20\% +  \frac{1} {2} \cdot 2\%  + \frac{1} {6} \cdot 50\% = \frac{1} {3} \frac{20} {100} + \frac{1} {2} \frac{2} {100}+\frac{1} {6} \frac{50} {100} =  \frac{2} {6} \frac{20} {100} + \frac{3} {6} \frac{2} {100}+\frac{1} {6} \frac{50} {100} \\ \\  = \frac{2 \cdot 20+3 \cdot 2 + 1 \cdot 50} {6 \cdot 100} = \frac{40 + 6+ 50} {6 \cdot 100} = \frac{96} {6 \cdot 100} = \frac{6 \cdot 16 } {6 \cdot 100} = \frac{16 } {100} = 0.16 = 16\%

Let's check the correctness of our approach with some concrete numbers. Assume (for computational simplicity) that the initial capital was $60000.
So we put $20000 in stocks, $30000 in bonds and $10000 in gold. These investments, respectively, yielded 20% * $20000 = $4000, 2% * $30000 = $600 and 50% * $10000 = $5000. Total gain in $4000 + $600 + $5000 = $9600. And 9600 / 60000 = 0.16 = 16%, as expected.

Finally, let us visualize our computations by means of the pie diagrams

Figure 3: Visualization of initial portfolio weights and their contribution to the total return
Figure 3: Visualization of initial portfolio weights and their contribution to the total return

To create Figure 3 I used the following R-code:

#Left-hand pie diagram (initial portfolio weights)
par(mfrow=c(1,2)) #split panel in two (left-right)
slices <- c(1/3, 1/2, 1/6)
lbls <- c("Stocks", "Bonds", "Gold")
pie(slices, labels = lbls, main="portfolio weights")
#right-hand pie diagram (yield contribution)
slices <- c((1/3 * 0.2), (1/2 * 0.02), (1/6 * 0.5))
lbls <- c("Stocks", "Bonds", "Gold")
pie(slices, labels = lbls, main="yield contribution")

Note, however, that the application of the pie diagrams is limited. They are very convenient when you have to visualize the size of shares of a unit, of something holistic. But if some assets had brought a negative return, it would be impossible to use the pie diagram because we cannot visualize negative numbers on them. Moreover, if a unit consists of many parts and some of them have small weights, they may become hardly visible. Thus I, for one, usually prefer the bar plots.

Like this post and wanna learn more? Have a look at Knowledge rather than Hope: A Book for Retail Investors and Mathematical Finance Students

FinViz - an advanced stock screener (both for technical and fundamental traders)