Say we have a gambler who makes money through sports betting. My aim is to develop a model to help our gambler maximise his winnings and minimize losses.

In my model, rather than betting a fixed amount of money, the gambler bets a certain fraction $0 < r < 1$ of his current betting fund. He continues betting that fraction as his betting fund increases or decreases until he cashes out after a certain number of sessions $n$.

The gambler's initial fund shall be $F_0$. His fund after $i$ sessions shall be $F_i$.

His probability of making a correct prediction shall be $0 < p < 1$. If our gambler had a $p$ of $0$ or $1$, then the entire model would be useless.

The average odds with which our gambler deals with is $a > 1$.

The gambler's minimum desired profit upon cash out is $T$.

$$T \le F_n - F_0 \tag{1}$$

If we expressed everything as a multiple of $F_0$, $(1)$ can be rewritten as:

$$T \le F_n - 1 \tag{1.1}$$

It follows that the following are known: $T$, $a$, $F_0$, $p$.

Should our gambler lose a particular session say $i+1$,

$$F_{i+1} = (1-r)F_i \tag{2.1}$$

Should he win that particular session

$$F_{i+1} = F_i(1-r + ra) \tag{2.2}$$

Given that the gambler plays $n$ sessioms before cashing out.

His expected number of wins = $p*n$ $(3.1)$

His expected number of losses = $(1-p)*n$ $(3.2)$

Now there are many different ways to distribute the gambler's losses and wins{$n \Bbb P pn$} and while calculating all scenarios and finding average $F_n$ may be ideal, it is computationally very expensive. So I decided to model the problem assuming the losses take place in the worst way possible( back to back at the very beginning of the match).

The gambler's revenue after $n$ matches is given by the formula:

$F_n = (1-r)^{(1-p)n}\{(1-r)+ra\}^{pn}$ $(4)$

Now we know that our gambler wants to make a minimum profit of $T$ so we transform $(4)$ into an inequality using $(1.1)$

We get:

$(1-r)^{(1-p)n}\{(1-r)+ra\}^{pn}$ $ \ge T + 1$ $(4.1)$

Taking the Natural logarithm of both sides, I get:

$ln(1-r)*(1-p)(n) + ln(1-r + ra)*pn \ge ln(T+1)$ $(4.2)$

$n\{ln(1-r)(1-p) + ln(r(a-1)+1)(p) \} \ge ln(T+1)$ $(4.3)$

Giving the constraints on the variables and constants, I want to determine the minimum value of $n$ and maximum value of $r$ that satisfies $(4.1) / (4.3)$ (whichever is easier to solve) for any given $T$, $a$, $p$.


Thanks to @Rodrigo de Azevedo, I discovered Kelly's Criterion. I was sold on it, and decided to implement it into my gambling method.

For the purposes of my method Kelly's criterion is given by:

$r_i = p - $ ${1 - p}\over{a_i - 1}$ $(5)$


$r_i$ is the ratio at session $i$

$a_i$ is the odds at session $i$

Now $r: 0 \lt r \lt 1$ $(5.1)$

Applying $(5.1)$ to $(5)$ we get:

${p(a - 1) - (1 -p)}\over{a - 1}$ $ \gt \frac{0}{1}$

Cross multiply.

$p(a-1) - (1 - p) \gt 0(a-1)$

$pa - p - 1 + p \gt 0$

$pa - 1 > 0$

$pa > 1$

$p > 1/a$ $(5.2)$

Now that that's out of the way, we still have the problem of determining minimum $n$ such that we make a profit $ \ge T$.

In order to do this, we'll assume a "mean" value for $a$ then find the minimum value for $n$ that satisfies $(4.1)$

Due to the fact, that you do not know the odds for the matches in advance, your mean odds at $i$ say $a_{\mu i}$ may not be the mean odds at $n$ $a_{\mu n}$. In order to protect against this(and because I'm not a very big risk taker), I'll assume a value for $a_{\mu}$, that is less than $a_{\mu}$ called $a_{det}$.

$a_{det} = a_{\mu} - k\sigma$

Where $a_{\mu}$ is the Geometric Mean as opposed to the arithmetic mean of the odds and $\sigma$ is associated S.D

Using Chebyshev's Inequality, at least $k^{2} - 1 \over k^2$ of the distribution of the odds lie above $a_{det}$.

Picking a $k$ of $2.5$

$2.5^{2}-1\over 2.5^{2}$


So our $a_{det}$ is lower than at least $84$% of the distribution of the odds. This is safe enough for me.

$a_{det} = a_{\mu} - 2.5\sigma$

Using $a_{det}$, we'll calculate the minimum $n$ that satisfies $(4.1)$

Subbing $5$ and $a_{det}$ into $(4.1)$ we get:

$\left(1-\left(p - \frac{1-p}{a_{det}-1} \right) \right)^{n - np} \cdot \left(\left(p - \frac{1-p}{a_{det}-1} \right)\cdot(a_{det} - 1)\right)^{np}$ $ \ge T + 1$ $(6.0)$

This can be simplified further to: $\left({a_{det}-1-(pa_{det}-1)}\over{a_{det}-1}\right)^{n(1-p)}\cdot\left(pa_{det}-1+1\right)^{np}$


$\left(\left(\frac{a_{det}*(1-p)}{a_{det}-1}\right)^{n(1-p)}\cdot\left(pa_{det}\right)^{np}\right)$ $(6.1)$

P.S due to my particularly low $a_{det}$ we'll likely make much more profit than $T$, but that's loads better than choosing a higher $a_{det}$ and making less.

  • $\begingroup$ Average odds? Shouldn't the odds be fixed? $\endgroup$ – Rodrigo de Azevedo Nov 26 '16 at 10:48
  • $\begingroup$ Do you try sports betting? If you do, you'd know thst the odds vary from match to match. It's possible to find matches with exactly the same odds, but unless you're dealing with completely fixed leagues you won't be gambling on such matches. I've never done sports betting before, but I did do research before trying to model it. $\endgroup$ – Tobi Alafin Nov 26 '16 at 12:35
  • $\begingroup$ Wouldn't it be easier to focus on bets with fixed odds, like roulette? $\endgroup$ – Rodrigo de Azevedo Nov 26 '16 at 12:54
  • $\begingroup$ The odds change, but when you place a bet, you know what the odds are. Hence, shouldn't the time-varying odds $a_0, a_1, \dots, a_{n-1}$ be inputs? $\endgroup$ – Rodrigo de Azevedo Nov 26 '16 at 12:55
  • $\begingroup$ You're right, but this model needs to determine your ratio and number of sessions before you start betting. At session $i$, you don't know yet what odds session $i+k$ will have. So we find the average odds of the matches you bet on. S.D should be very small. Bet on matches with similar odds. $\endgroup$ – Tobi Alafin Nov 26 '16 at 14:21


  • odds $\omega_1, \omega_2, \dots, \omega_n > 1$.
  • probabilities of winning $p_1, p_2, \dots, p_n \in [0,1]$.


  • $X_0, X_1, \dots, X_n$ be random variables that denote the fund's size at step $k$.
  • $u_k \in [0,1]$ be the fraction of the fund to be put at stake at step $k$. Let $u_k$ depend solely on $\omega_k$ and $p_k$, and not on $X_{k-1}$. Hence, $u_k$ is not a random variable.

Hence, we have the discrete-time stochastic process

$$X_k = \begin{cases} (1 + (\omega_k - 1) \, u_k) \, X_{k-1} & \text{with probability } p_k\\\\ (1 - u_k) \, X_{k-1} & \text{with probability } 1-p_k\end{cases}$$

Maximizing the expected return

The return at step $k$ is, thus,

$$R_k := \frac{X_k - X_{k-1}}{X_{k-1}} = \frac{X_k}{X_{k-1}} - 1 = \begin{cases} (\omega_k - 1) \, u_k & \text{with probability } p_k\\\\ - u_k & \text{with probability } 1 - p_k\end{cases}$$

Taking the expected value of the return, we obtain

$$\mathbb E (R_k) = (\omega_k - 1) \, u_k \, p_k - u_k \, (1 - p_k) = (\omega_k \, p_k - 1) \, u_k$$

Maximizing the expected value of the return,

$$\bar{u}_k := \arg \max_{u_k \in [0,1]} \mathbb E \left( R_k \right) = \arg \max_{u_k \in [0,1]} (\omega_k \, p_k - 1) \, u_k = \begin{cases} 1 & \text{if } \omega_k \, p_k - 1 > 0\\ 0 & \text{if } \omega_k \, p_k - 1 \leq 0\end{cases}$$

where $\omega_k \, p_k - 1$ is the expected profit per unit bet at step $k$. Thus, the optimal betting policy, $\bar{u}_k = \pi (\omega_k, p_k)$, is

$$\boxed{\pi (\omega, p) := \begin{cases} 1 & \text{if } \omega \, p > 1\\ 0 & \text{if } \omega \, p \leq 1\end{cases}}$$

In words,

  • when the expected profit is non-positive, we bet nothing.
  • when the expected profit is positive, we go all in.

Needless to say, this is an extremely aggressive betting policy. It would be wise to maximize another objective function.

Maximizing the expected logarithmic growth

Taking the expected value of the logarithm of the growth at step $k$,

$$\mathbb E \left[ \log \left( \frac{X_k}{X_{k-1}} \right) \right] = \mathbb E \left[\log (1 + R_k)\right] = p_k \log \left( 1 + (\omega_k - 1) \, u_k \right) + (1 - p_k) \log \left( 1 - u_k \right)$$

Using SymPy to find where the derivative with respect to $u_k$ vanishes,

>>> from sympy import *
>>> p, u, w = symbols('p u w')
>>> f = p * log(1 + (w-1) * u) + (1 - p) * log(1 - u) 
>>> diff(f,u)
  p*(w - 1)     -p + 1
------------- - ------
u*(w - 1) + 1   -u + 1
>>> solve(diff(f,u),u)
 p*w - 1 
  w - 1  


$$\bar{u}_k := \arg \max_{u_k \in [0,1]} \mathbb E \left[ \log \left( \frac{X_k}{X_{k-1}} \right) \right] = \begin{cases} \dfrac{\omega_k \, p_k - 1}{\omega_k - 1} & \text{if } \omega_k \, p_k - 1 > 0\\\\ 0 & \text{if } \omega_k \, p_k - 1 \leq 0\end{cases}$$

where $\omega_k \, p_k - 1$ is the expected profit per unit bet at step $k$. This is the Kelly betting policy [0]

$$\boxed{\pi (\omega, p) := \begin{cases} \dfrac{\omega \, p - 1}{\omega - 1} & \text{if } \omega \, p > 1\\\\ 0 & \text{if } \omega \, p \leq 1\end{cases}}$$

We again bet nothing when the expected profit is non-positive, but we no longer go all in when the expected profit is positive. Note that

$$\dfrac{\omega \, p - 1}{\omega - 1} = 1 - \left(\frac{\omega}{\omega - 1}\right) (1 - p) \leq 1$$


[0] Edward O. Thorp, The Kelly Criterion in Blackjack, Sports Betting, and the Stock Market, The 10th International Conference on Gambling and Risk Taking, Montreal, June 1997.

  • $\begingroup$ I am assuming the gambler has a fixed probability of getting any game right $p$. NOT varying probabilities on each game. The gambler only places bets on matches they're sure om $\endgroup$ – Tobi Alafin Nov 28 '16 at 17:15
  • $\begingroup$ Some of your calcs are Greek to me. Regardless, your conclusion seems weird to me. The aim is NOT to maximise return at $X_k$, but maximise return only at $X_n$. We're looking at maximising returns after $n$ rounds. A formula to calculate $r$ at each round $k$ with odds $\mu_k$ and probability $p$. I offered something I thought might work in a comment to the question. $\endgroup$ – Tobi Alafin Nov 28 '16 at 17:28
  • $\begingroup$ I looked at the Kelly criterion. I love it. Just one problem that I have: The Kelly criterion tells me nothing of my $n$. I know from brute force simulation with Excel, that the optimum $r$ for different $n$ changes even while $n$ is constant. Is there any way for us yo extend the Kelly criterion. $\endgroup$ – Tobi Alafin Nov 28 '16 at 17:47
  • 1
    $\begingroup$ I wasn't criticising you. My math is grossly insufficient, and I've been working on improving it. I'm currently trying to test the Kelky criterion recommended $r$ over my brute-forced solutions for $r$ for any given $n$. $\endgroup$ – Tobi Alafin Nov 28 '16 at 18:11
  • 1
    $\begingroup$ The Kelly criterion maximizes your expected return over "the long term." And the conclusion to wager $\frac {edge}{odds}$ works even if your edge and odds are changing. There is a softer interpretation that says to never wager more than than the Kelly formula, but it is okay to wager less. That is wagering more increases risk ($\sigma$) without increasing return ($\mu$) which would be irrational. While wagering less reduces both risk and return, which may be rational depending on your risk tolerance. $\endgroup$ – Doug M Nov 29 '16 at 0:20

To find the minimum $n$ that satisfies $(6.1)$.

$\left(\left(\frac{a_{det}∗(1−p)}{a_{det}−1}\right)^{n(1−p)}\cdot\left(pa_{det}\right)^{np}\right) \ge T+1$ $(6.1)$

On the LHS, $n$ is a common exponent. Take the natural logarithm of both sides

$ln\left(\frac{a_{det}∗(1−p)}{a_{det}−1}\right)\cdot{n(1−p)} + ln\left(pa_{det}\right)\cdot{np} \ge ln(T+1)$

Factorise LHS with $n$.

$n\left(ln\left(\frac{a_{det}∗(1−p)}{a_{det}−1}\right)\cdot(1−p) + ln\left(pa_{det}\right)\cdot p\right) \ge ln(T+1)$ $(6.2)$

Rewriting $(6.2)$

$n \ge \left({ln(T+1)}\over{ln\left(\frac{a_{det}∗(1−p)}{a_{det}−1}\right)\cdot(1−p) + ln\left(pa_{det}\right)\cdot p}\right)$ $(6.3)$


I realised this worked because Kelly's criterion aimed to maximise expected logarithmic growth.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.