Variance equations that yield inconsistent results

69 Views Asked by At

Consider a game of chance were a player places a bet, and coin is flipped if the coin lands on heads the player wins $2b$ where $b$ is the bet value. If the coin lands on tails the player looses the bet. $E[V] = \mu= 1$ for this game, where $V$ is the random amount we win. The $\sigma^2 = 2.5$ for a bet of 1 according to the following equation: $$\sigma^2 = \sum p_i(x_i-\mu_x)^2 = \frac{1}{2}(2-\mu)^2 + \frac{1}{2}(-1 -\mu)^2$$

How ever simulations have shown a convergence to $\sigma^2 = 1$ or more generally $\sigma^2$ converges according to (in the simulations):

$$\sigma^2 = \frac{1}{2}(2-\mu)^2 + \frac{1}{2}(-\mu)^2$$

Where $w$ is the winning value and $b$ is the bet value. This is inconsistent and I'm sure i'm going wrong somewhere. Most probably in the way I'm calculating the actual variance. But I'm not sure how. Please can someone point out what I'm doing wrong and what would be the correct way.

The equations used in the simulation are as follows:

Equation used in computing the mean $$\overline{x}=\frac{1}{n}\sum_{i=1}^{n}{\frac{w_i}{b_i}}$$ Where $\overline{x}$ is the actual mean, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$.

Equation used in computing the actual variance $$\overline\sigma^2 = \frac{\sum_{i=1}^{n}{(\frac{w_i}{b_i})^2}}{n}-\overline{x}^2$$

Where $\overline\sigma^2$ is the actual variance, $n$ is the number of trials or rounds(flips), $w_i$ is the winning value of a flip on round $i$. $b_i$ is the bet placed on round $i$ and $\overline{x}$ is the actual mean as calculated above.

Note: The equation for calculating the actual variance is derived from the equation $\sigma^2 = \sum(x_i-\mu_x)^2$ as to eliminate the need for the simulator to store a history of each rounds bet and winning values.

1

There are 1 best solutions below

0
On

Clear and precise notation is necessary, and you have made certain claims but then allow the notation to obfuscate the meaning.

Define $X_1, X_2, \ldots,$ to be a sequence of independent and identically distributed Bernoulli random variables, each with $\Pr[X_i = 1] = p$ for $i = 1, 2, \ldots$, and that $X_i = 1$ if the outcome of the $i^{\rm th}$ toss corresponds to a win.

The expected value of the outcome of a single toss is $\operatorname{E}[X_i] = p$. The variance of the outcome of a single toss is $\operatorname{Var}[X_i] = p(1-p).$ This much should not be in question.

If the bet amount is $b$ for each toss, then define the random variable $$Y_i = (3X_i - 1)b = \begin{cases} 2b, & X_i = 1 \\ -b, & X_i = 0. \end{cases}$$ You may easily verify by substitution that this is true. Then $$\operatorname{E}[Y_i] = \operatorname{E}[(3X_i-1)b] = \operatorname{E}[3X_i - 1]b = \left(\operatorname{E}[3X_i] - 1\right)b = (3 \operatorname{E}[X_i] - 1)b = (3p-1)b.$$ The variance is $$\operatorname{Var}[Y_i] = b^2 \operatorname{Var}[3X_i - 1] = b^2 \operatorname{Var}[3X_i] = 9b^2 \operatorname{Var}[X_i] = 9b^2 p(1-p).$$ Again, these are for a single toss, for some general fixed win probability parameter $p \in [0,1]$ and fixed ante $b$.

If we set $p = 1/2$ so the coin is fair, and $b = 1$, the expected value of the random amount won in a single toss is simply $\operatorname{E}[Y_i] = (3(1/2)-1)(1) = 1/2$, and the variance of the random amount won in a single toss is $\operatorname{Var}[Y_i] = 9(1^2)(1/2)(1 - 1/2) = 9/4$. This is not, as you claim, $\mu = 1$ and $\sigma^2 = 2.5 = 5/2$, as you apparently have not considered that the loss of ante represents a negative outcome for the random variable $Y_i$.

If, however, you are not concerned about the loss of ante--in other words, bets are risk free, then you can easily define another set of random variables, say $$W_i = 2bX_i,$$ that simply represents the winnings irrespective of losses--so in particular, $W_i = 0$ if $X_i = 0$ and the ante is not taken (which does not really amount to a bet). Then $\operatorname{E}[W_i] = 2bp$ and $\operatorname{Var}[W_i] = 4b^2 p(1-p)$ and this is neither difficult nor very interesting to analyze. For $b = 1$ and $p = 1/2$ you get $\operatorname{E}[W_i] = 1$ and $\operatorname{Var}[W_i] = 1$, so even in this case, your calculations of the mean and variance are inconsistent.

For a sample of fixed size $n$, the net winnings is $$S_Y = \sum_{i=1}^n Y_i$$ and the total amount won, ignoring losses, is $$S_W = \sum_{i=1}^n W_i.$$ The sample means of the net winnings and total amount won ignoring losses, are $$\bar Y = \frac{S_Y}{n} = \frac{1}{n} \sum_{i=1}^n Y_i, \quad \bar W = \frac{S_W}{n} = \frac{1}{n}\sum_{i=1}^n W_i,$$ respectively. The expected values and variances of these random variables are, by linearity of expectation and linearity of independent variances, $$\operatorname{E}[S_Y] = n\operatorname{E}[Y_i] = (3p-1)nb, \quad \operatorname{E}[S_W] = n\operatorname{E}[W_i] = 2npb, \\ \operatorname{Var}[Y_i] = n\operatorname{Var}[Y_i] = 9b^2 np(1-p), \quad \operatorname{Var}[W_i] = n\operatorname{Var}[W_i] = 4b^2 np(1-p), \\ \operatorname{E}[\bar Y] = \operatorname{E}[S_Y/n] = \operatorname{E}[Y_i], \quad \operatorname{E}[\bar W] = \operatorname{E}[W_i], \\ \operatorname{Var}[\bar Y] = \operatorname{Var}[S_Y/n] = \operatorname{Var}[Y_i]/n, \quad \operatorname{Var}[\bar W] = \operatorname{Var}[S_W/n] = \operatorname{Var}[W_i]/n.$$

If you are not getting these results via simulation, your simulation is done improperly or you are computing the wrong statistic from your simulations, or you are interpreting the results incorrectly. I cannot speak to how you have implemented such a simulation. One rather obvious mistake, however, is that you seem to be using formulas without really understanding what they are for, what they represent, and how they apply to your problem; because you have not properly explained where they came from nor justified their use.