The expectation of a Random Variable

Suppose you play the following game: you draw a ball from a box with 3 red and 2 green balls. If the ball is green you win 1 euro, if the ball is red you need to pay one euro:

Untitled

Would you try your luck and play this game? As there is a higher probability to get a red ball ($\frac{3}{5}>\frac{2}{5}$), you shouldn’t play the game: you will probably lose money.

Suppose the rules of the game are slightly stretched: you may continue drawing balls, without replacing them, and you decide when is the best to stop. Again, if you get a green ball you win 1 euro else you pay 1 euro. The difference is this new situation is that you can now base your decision in the balls you have drawn so far.

Can you think of a strategy to trun the initial disadvantage into an advantage?

In fact, the analysis of the second game will lead to the definition of expectation of random variables. The question then, becomes: is there a strategy for which the expectation is positive?

Let’s consider the following strategy: if the first ball drawn is green, you stop and take your game. If the first ball is red, you continue drawing balls until you pick both green balls. We then get the following graph of the game:

Untitled

With this strategy, the game’s result (amount of won euros) can only take values $1,0,-1$, as shown in the upper image.

Check the graph again, can you see the scenarios (paths) leading to a positive victory?

Untitled

The probability of an scenario is the sum of the probabilities along the way. So, the desired probability for a game of $1$ will be $P(X=1)=\frac{2}{5}+\frac{3}{5}\frac{2}{4}\frac{1}{3}=\frac{1}{2}$.

Note that in the formula I have added the random variable $X$ to denote the game’s result. If we calculate the other probabilities, we get the following table:

Untitled

It definitely looks that, with this strategy, the game is favorable to you. The probability of winning 1 euro is larger than the probability of losing one.

What happens if you play 100 games? You might expect to win about 50 times and lose 30 times, so you net gain will be around 20 euros in total. That is, on average, $20/100=0.2$ euros per game.

$\text{total gain}\approx 501+200+30*(-1)=20$

$\text{average gain} \approx \frac{501+200+30*(-1)}{100}=\frac{20}{100}=0.2$