ShareButton

Thursday, April 17, 2014

The Two Strategies


submit to reddit
Q: You are in a game where you get to toss a pair of coins once. There are two boxes (A & B) holding a pair each. Box A's coins are fair however B's coins are biased with probability of heads being \(0.6\) and \(0.4\) respectively. You are paid for the expected number of heads you will win. Which of the boxes should you pick?

Machine Learning: The Art and Science of Algorithms that Make Sense of Data

A: The expected number of heads if you chose box A is easy to calculate as
$$
E(\text{heads}| A) = \frac{1}{2} + \frac{1}{2} = 1
$$
However the expected number of heads if you chose box B is also the same
$$
E(\text{heads}| B) = \frac{4}{10} + \frac{6}{10} = 1
$$
The average yield being the same could make one think that both boxes yield the same. However there is one difference, its the variance. The variance of a distribution of a random variable \(X\) is defined as
$$
Var(X) = \sum_{i=0}^{N} (x_i - \bar{x})^{2}p_i
$$
where \(p_i\) is the probability of \(x_i\). Given this, lets compute the variance of each strategy
$$
Var(X | \text{Box=A}) = (\frac{1}{2} - 1)^2 \frac{1}{2} + (\frac{1}{2} - 1)^2 \frac{1}{2} = \frac{1}{4} = 0.25 \\
Var(X | \text{Box=B}) = (\frac{2}{5} - 1)^2 \frac{2}{5} + (\frac{3}{5} - 1)^2 \frac{3}{5} = \frac{6}{25} = 0.24
$$
The variance for box B is slightly tighter than box A which makes choosing the coins in box B a better strategy.

If you are looking to buy some books on probability theory here is a good list.

No comments:

Post a Comment