# Mathematical standard deviation & risk assessment

The mathematical expectation is the value that we expect to obtain, on average, if we repeat the same random experiment a large number of times. More precisely, the expectation is an estimate of the average winnings obtained over a large number of bets and games.

If we thus know what to expect, on the average gain after a certain number of bets, we do not give any estimate of the risk taken: before moving towards the expected average value, will I risk losing once, 2 times, 10 times or 100 times more? (and conversely expect to temporarily win once, twice, 10 times more?).

Another common question from the player: in a risky game whose expectation is 10 euros, for example, a player wins after multiple games 12 euros. Should he continue to play? At the risk of losing everything, or of course gaining even more? It is the **standard deviation** of the game which makes it possible to mathematically answer this question of stopping the game.

**The essential:**

- Standard deviation measures the degree dispersion, or the scatter, of a data set relative to its mean, or in probability terms, the dispersion of random outcomes relative to their expectation.
- In a financial context, an asset with a large standard deviation is said to be highly volatile, while an asset with a low standard deviation is low volatile and recognized as being stable.
- In a random game or a financial investment, a high standard deviation is synonymous with both risk: the losses can be significant before reaching the expectation, and at the same time with significant profit since we can also go through important profits before coming back, on average, to the expectation.

## Standard deviation definition

In statistical analysis, standard deviation is an indicator measuring the degree of dispersion, or scatter, of a data set.

In probability, the standard deviation is an indicator estimating the probable scattering of results.

The standard deviation tells the extent to which random data or results deviate from their mean: a large standard deviation for a large dispersion, a large amplitude of variation around the mean. Conversely, a very low standard deviation describes very small variations, therefore very little risk of the unexpected.

When looking for long-term profits in wagering, sports betting for example, we first focus on the mathematical expectation: the average profit, or ROC.
Knowing the standard deviation of our strategy is equally interesting because it provides an indicator of stability, a fundamental indicator when looking for **long-term profits**.

## Mathematical expectation formula

To compute the mathematical standard deviation, that is to say the degree of dispersion or the risk taken in relation to the expected average, computing the average or mathematical expectation is first required.To explain these calculations, we use the example of the game used to calculate the expectation: we bet one euro and we throw a balanced six-sided die and

- if we get a 6 we win 5 times our stake
- if we get a 5 we win twice our stake
- otherwise, we lose our stake

Gain (euros) | 5 | 2 | 0 |

Probability | 1/6 | 1/6 | 4/6 |

**mathematical expectation**is calculated as

**the average weighted by the probabilities**

*E*= 16×5 + 16×2 + 46×0 ≃ 1,16

**on average**around 1.16 cents per game

**over a large number of games**, or 0.16 cents in net profits (0,16 cents more after getting back our stakes).

## Standard deviation mathematical formula

In order to compute the standard deviation, we first calculate the**variance**, which is the "mean of the squares of the deviations from the mean", here

*V*= 16×(5−1,16)

^{2}+ 16×(2−1,16)

^{2}+ 46×(0−1,16)

^{2}≃2,8

*V*≃ 1,7

The calculations of the expectation and the standard deviation are not the most exciting, and the following calculator provides a simulator for a random game (like in sports betting), and precisely calculates the expectation and the standard deviation and simulates the winnings over a certain number of games.

In the example of the previous game, over for example 100 games, we can hope to win around 100×E≃116 euros.

The scattering will be around a few standard deviations, 2 standard deviations, or around 5 euros.

## Simulation of random game and profits

Following calculator simulates, randomly, a game with*n*possible results (3 in the previous example of the dice), and for which we can freely indicate the gain associated with each result as well as the probability of the result.

Results for a certain number of randomly simulated games are then displayed, with the corresponding profit.

The results for a certain number of randomly simulated games is thus displayed, and the associated mathematical expectation.

The more the number of games increases, the more the total profit stabilizes around the mathematical expectation: for a large number of games, we should not expect a very significant profit (nor a loss) compared to the calculated expectation. This is a direct illustration to the the Law of Large Numbers.

## Calculator

Knowledge of the standard deviation also makes it possible to mathematically answer two fundamental questions in a repetition of random games.

## Estimate how much I can lose: risk assessment

In a random game, we can consider that we have definitively lost when our stack, our bankroll, our prize pool, ... in short, we no longer have enough to wager and play a new game.To prevent this situation from happening, if we cannot predict future losses (it's chance! It's impossible with certainty!) we can at least estimate them.

The Bienaymé-Tchebychev inequality is a mathematical formula which makes it possible to estimate the scattering probability of random results.

To sum up, this formula tells us that the probability of being deviated from the mean more than

*k*times the standard deviation is less than the inverse of the square of

*k*.

For example, if the average expected gain is 10 euros and the standard deviation is 2 euros,

- the probability of a gain less than 6 euros or more than 14 euros is smaller than 1/4 = 25 %
- the probability of a gain less than 4 euros or more than 16 euros is smaller than 1/9 ≃ 11 %
- the probability of a gain less than 2 euros or more than 18 euros is smaller than 1/16 ≃ 6 %
- and finally, for 5 stanard deviations, probability of a gain less than 0 euro (net loss) or more than 20 euros is smaller than 1/25 ≃ 4 %
- …

The previous betting simulator computes the average (mathematical expectation) and standard deviation: try playing (for free and without risk!) with to observe the influence of the value of the standard deviation on the scattering of winnings around the average.

## Mathematically estimate "when to stop betting"

According to the previous example: with 10 euros expected gain and 2 euros standard deviation, we also saw that the probability of earning more than more than 14 euros, more than 16 euros, more than 18 euros... has a probability which decreases rapidly (around 25%, 11%, 6%, ...).So, if it is exhilarating to win at a random game, predicting the random futur !, on must be able to quit, that is to say rationally be able to estimate the best moment, the one with the greatest gain where he just stop and leave and enjoy his winnings.

Here too, the standard deviation is the mathematical formula which answers this question: the probability of winning more than 3 standard deviations above the average becomes as low as a few percent or even lower, and therefore in a reasonable strategy it would be necessary to stop a series just after we have reached 2 or 3 standard deviations above the expected average.

To sum up, still for example with a game whose expectation is 10 euros and standard deviation is 2 euros:

- I must be able to expect, in a dark series, to lose a few standard deviations, at least 5, or 10 euros of loss (a few percent probability: this can and will happen, not counting on it is a mistake)
- after a winning series allowing me to reach an average gain of 14 euros, I must stop playing this game

See also: