So I am solving some probability/finance books and I've gone through two similar problems that conflict in their answers.
Paul Wilmott
The first book is Paul Wilmott's Frequently Asked Questions in Quantitative Finance. This book poses the following question:
Every day a trader either makes 50% with probability 0.6 or loses 50% with probability 0.4. What is the probability the trader will be ahead at the end of a year, 260 trading days? Over what number of days does the trader have the maximum probability of making money?
Solution:
This is a nice one because it is extremely counterintuitive. At first glance it looks like you are going to make money in the long run, but this is not the case. Let n be the number of days on which you make 50%. After $n$ days your returns, $R_n$ will be: $$R_n = 1.5^n 0.5^{260−n}$$ So the question can be recast in terms of finding $n$ for which this expression is equal to 1.
He does some math, which you can do as well, that leads to $n=164.04$. So a trader needs to win at least 165 days to make a profit. He then says that the average profit per day is:
$1−e^{0.6 \ln1.5 + 0.4\ln0.5}$ = −3.34%
Which is mathematically wrong, but assuming he just switched the numbers and it should be:
$e^{0.6 \ln1.5 + 0.4\ln0.5} - 1$ = −3.34%
That still doesn't make sense to me. Why are the probabilities in the exponents? I don't get Wilmott's approach here.
*PS: I ignore the second question, just focused on daily average return here.
Mark Joshi
The second book is Mark Joshi's Quant Job Interview Question and Answers which poses this question:
Suppose you have a fair coin. You start off with a dollar, and if you toss an H your position doubles, if you toss a T it halves. What is the expected value of your portfolio if you toss infinitely?
Solution
Let $X$ denote a toss, then: $$E(X) = \frac{1}{2}*2 + \frac{1}{2}\frac{1}{2} = \frac{5}{4}$$ So for $n$ tosses: $$R_n = (\frac{5}{4})^n$$ Which tends to infinity as $n$ tends to infinity
Uhm, excuse me what? Who is right here and who is wrong? Why do they use different formula's? Using Wilmott's (second, corrected) formula for Joshi's situation I get the average return per day is:
$$ e^{0.5\ln(2) + 0.5\ln(0.5)} - 1 = 0% $$
I ran a Python simulation of this, simulating $n$ days/tosses/whatever and it seems that the above is not correct. Joshi was right, the portfolio tends to infinity. Wilmott was also right, the portfolio goes to zero when I use his parameters.
Wilmott also explicitly dismisses Joshi's approach saying:
As well as being counterintuitive, this question does give a nice insight into money management and is clearly related to the Kelly criterion. If you see a question like this it is meant to trick you if the expected profit, here 0.6 × 0.5 + 0.4 × (−0.5) = 0.1, is positive with the expected return, here −3.34%, negative.
So what is going on?
Here is the code:
import random
def traderToss(n_tries, p_win, win_ratio, loss_ratio):
SIM = 10**5 # Number of times to run the simulation
ret = 0.0
for _ in range(SIM):
curr = 1 # Starting portfolio
for _ in range(n_tries): # number of flips/days/whatever
if random.random() > p_win:
curr *= win_ratio # LINE 9
else:
curr *= loss_ratio # LINE 11
ret += curr # LINE 13: add portfolio value after this simulation
print(ret/SIM) # Print average return value (E[X])
Use: traderToss(260, 0.6, 1.5, 0.5) to test Wilmott's trader scenario.
Use: traderToss(260, 0.5, 2, 0.5) to test Joshi's coin flip scenario.
Thanks to the followup comments from Robert Shore and Steve Kass below, I have figured one part of the issue. Joshi's answer assumes you play once, therefore the returns would be additive and not multiplicative. His question is vague enough, using the word "your portfolio", suggesting we place our returns back in for each consecutive toss. If this were the case, we need the geometric mean not the arithmetic mean, which is the expected value calculation he does.
This is verifiable by changing the python simulation to:
import random
def traderToss():
SIM = 10**5 # Number of times to run the simulation
ret = 0.0
for _ in range(SIM):
if random.random() > 0.5:
curr = 2 # Our portfolio becomes 2
else:
curr = 0.5 # Our portfolio becomes 0.5
ret += curr
print(ret/SIM) # Print single day return
This yields $\approx 1.25$ as in the book.
However, if returns are multiplicative, therefore we need a different approach, which I assume is Wilmott's formula. This is where I'm stuck. Because I still don't understand the Wilmott formula. Why is the end of day portfolio on average:
$$ R_{day} = r_1^{p_1} * r_2^{p_2} * .... * r_n^{p_n} $$
Where $r_i$, $p_i$ are the portfolio multiplier, probability for each scenario $i$, and there are $n$ possible scenarios. Where does this (generalized) formula come from in probability theory? This isn't a geometric mean. Then what is it?
Joshi's problem is a much easier problem and he is correct. Wilmott's problem is a little bit more subtle, and I think he is misleading about what he is computing. The main point is that returns are not additive, so the trap is to compute expectation of the return on a given day and then "add it up" to conclude that you are expected to win overall. It's counterintuitive that this does not work.
So Wilmott is correct when he says that the expected profit on day 1 is $$ 0.6 \times (1.5 - 1) + 0.4 \times (0.5 - 1) = 0.1. $$ If we write $X$ for the return on day 1, then: $$ \mathbb{E}(1+X) = 0.6 \times 1.5 + 0.4 \times 0.5 = 1.1. $$
I think Wilmott's language is misleading for the newcomer (which is annoying as he's supposed to be famous for teaching basic quant principles to newcomers). By "average profit per day" in the sentence you quote he seems to be referring to something like "expected daily rate of profit". To shed a bit more light on what he means, suppose you want to compute the expected return after $n$ days: To do this, let $X_1,\dots, X_n$ be i.i.d. random variables where $X_k$ is defined as the return on day $k$. These are not additive: The return after $n$ days is given by the random variable $R_n = (1+X_1)(1+X_2)\cdots (1+X_n)$. But log-returns are additive: $$ \log R_n = \sum_{i=1}^n \log (1+X_i), $$ so that by linearity of expectation (and i.i.d. assumption) we can compute the expectation of the log-return now as: $$ \mathbb{E}(\log R_n) = n \mathbb{E}(\log (1+X)) = n\Bigl(0.6 \log 1.5 + 0.4 \log 0.5\Bigr). $$ So you can see that what matters in the long run for the expected log-return is the whether the expression in the brackets on the right-hand side is bigger than zero or not.
Wilmott seems to use the value of $$ e^{\mathbb{E}(\log R_1)} - 1 = e^{(0.6 \log 1.5 + 0.4 \log 0.5)} - 1 $$ to make the same point I am making above. But since we've taken an expectation, we can't pull the $\mathbb{E}$ through a logarithm or exponential to "convert" easily back to $\mathbb{E}(R)$. I don't know... this might be one of this quant things that is used as a measure of rate of return but isn't the same as $\mathbb{E}(R)$.