# Intro

In this post I am going to talk a bit about Kelly betting, since today I was flabbergasted that I did not write anything about it yet. Kelly betting is a strategy how to allocate money to bets.

## Problem

Assume we are playing a game. I am going to flip a coin. You can bet an amount $x$$on the result of the coinflip. If you are right, you win $x$$. If you are wrong, you lose your $x$\$. Let us say that you know that my coin is nonrandom and lands on head with probability $p>0.5$. To further ease the problem assume that you are always betting the same fraction $f$ of your capital. Now, how should you choose $f$ to get returns bigger than any other strategy? Another way of formulating the problem would be to maximize the expected return.

Get out and try it before reading on. And I hope you will come back with the right solution or at least utterly frustrated and nearly crying.

## Solution

The expected return is $(1+f)$ each time we win and $(1-f)$ each time we lose. Now putting those nasty probabilities in we get a return of $(1+f)^p+(1-f)^{1-p}$. We need to find the maximal value of that expression. To make things easier we can also find the maximal value of the logarithm of that expression

since the logarithm is increasing monotonically. So we have to set teh derivative to zero. Observe that

You can plug some sensible values for $p$ in it to check correctness.

Now, let us generalize this problem because of mathematical elitism. Let us say if you win with probability $p$, you win a proportion $a$ of your initial bet and if you loose, then you win a proportion $b$, where $b$ is possibly negative. So our returns are $(1+fa)^p+(1+fb)^{1-p}$. Note that this is essentially the same as before if we take $a=1$ and $b=-1$. Now let us again maximize this, more exactly let us maximize the logarithm. So we again set the derivative to zero.

This is equal to zero if and only if

If we would now plug in the values for our first exercise $a=1$ and $b=-1$, we would get the same result.

20 May 2015

Brainteaser