Q: So what's the difference between a slot machine with a low variance and one with a high variance?
A: A slot machine with a high variance means that there's a lot more variability in your overall winnings. The amount you could win overall is less predictable. In general, the smaller the variance is, the closer your average winnings per game are likely to be to the expectation. If you play on a slot machine with a larger variance, your overall winnings will be less reliable.
</WRAP>
Pool puzzle
\begin{eqnarray*} X & = & (\text{original win}) - (\text{original cost}) \\ & = & (\text{original win}) - 1 \\ (\text{original win}) & = & X + 1 \\ \\ Y & = & 5 * (\text{original win}) - (\text{new cost}) \\ & = & 5 * (\text{X + 1}) - 2 \\ & = & 5 * X + 5 - 2 \\ & = & 5 * X + 3 \\ \end{eqnarray*}
E(X) = -.77 and E(Y) = -.85. What is 5 * E(X) + 3?
$ 5 * E(X) = -3.85 $
$ 5 * E(X) + 3 = -0.85 $
$ E(Y) = 5 * E(X) + 3 $
$ 5 * Var(X) = 13.4855 $
$ 5^2 * Var(X) = 67.4275 $
$ Var(Y) = 5^2 * Var(X) $
\begin{eqnarray*} E(aX + b) & = & a \cdot E(X) + b \\ Var(aX + b) & = & a^{2} \cdot Var(X) \\ E(X + Y) & = & E(X) + E(Y) \\ Var(X + Y) & = & Var(X) + Var(Y) \\ \end{eqnarray*}
\begin{eqnarray*} E(X1 + X2 + \ldots Xn) & = & nE(X) \\ Var(X1 + X2 + \ldots Xn) & = & nVar(X) \\ \end{eqnarray*}
\begin{eqnarray*} E(X + Y) & = & E(X) + E(Y) \\ Var(X + Y) & = & Var(X) + Var(Y) \\ E(X - Y) & = & E(X) - E(Y) \\ Var(X - Y) & = & Var(X) + Var(Y) \\ E(aX + bY) & = & aE(X) + bE(Y) \\ Var(aX + bY) & = & a^{2}Var(X) + b^{2}Var(Y) \\ E(aX - bY) & = & aE(X) - bE(Y) \\ Var(aX - bY) & = & a^{2}Var(X) + b^{2}Var(Y) \\ \end{eqnarray*}
A restaurant offers two menus, one for weekdays and the other for weekends. Each menu offers four set prices, and the probability distributions for the amount someone pays is as follows:
Weekday: | ||||
x | 10 | 15 | 20 | 25 |
P(X = x) | 0.2 | 0.5 | 0.2 | 0.1 |
Weekend: | ||||
y | 15 | 20 | 25 | 30 |
P(Y = y) | 0.15 | 0.6 | 0.2 | 0.05 |
Who would you expect to pay the restaurant most: a group of 20 eating at the weekend, or a group of 25 eating on a weekday?
x1 <- c(10,15,20,25) x1p <- c(.2,.5,.2,.1) x2 <- c(15,20,25,30) x2p <- c(.15,.6,.2,.05) x1n <- 25 x2n <- 20 x1mu <- sum(x1*x1p) x2mu <- sum(x2*x2p) x1e <- x1mu*x1num x2e <- x2mu*x2num x1e x2e
> x1e [1] 400 > x2e [1] 415 >
x2e will spend more.
====== e.g. ======
Sam likes to eat out at two restaurants. Restaurant A is generally more expensive than
restaurant B, but the food quality is generally much better.
Below you’ll find two probability distributions detailing how much Sam tends to spend at each
restaurant. As a general rule, what would you say is the difference in price between the two
restaurants? What’s the variance of this?
Restaurant A: | ||||
x | 20 | 30 | 40 | 45 |
P(X = x) | 0.3 | 0.4 | 0.2 | 0.1 |
Restaurant B: | |||
y | 10 | 15 | 18 |
P(Y = y) | 0.2 | 0.6 | 0.2 |
x3 <- c(20,30,40,45) x3p <- c(.3,.4,.2,.1) x4 <- c(10,15,18) x4p <- c(.2,.6,.2) x3e <- sum(x3*x3p) x4e <- sum(x4*x4p) x3e x4e ## difference in price between the two x3e-x4e x3var <- sum(((x3-x3e)^2)*x3p) x4var <- sum(((x4-x4e)^2)*x4p) x3var x4var ## difference in variance between the two ## == variance range x3var+x4var
> x3 <- c(20,30,40,45) > x3p <- c(.3,.4,.2,.1) > x4 <- c(10,15,18) > x4p <- c(.2,.6,.2) > > x3e <- sum(x3*x3p) > x4e <- sum(x4*x4p) > > x3e [1] 30.5 > x4e [1] 14.6 > ## difference in price between the two > x3e-x4e [1] 15.9 > > > x3var <- sum(((x3-x3e)^2)*x3p) > x4var <- sum(((x4-x4e)^2)*x4p) > > x3var [1] 72.25 > x4var [1] 6.64 > ## difference in variance between the two > ## == variance range > x3var+x4var [1] 78.89
====== e.g. ======
E(aX + b) | $aE(X) + b$ |
Var(aX + b) | $a^{2}Var(X)$ |
E(X) | $\sum{x} \cdot P(X=x) $ |
E(f(X)) | $\sum{f(X)} \cdot P(X=x)$ |
Var(aX - bY) | $a^{2}Var(X) + b^{2}Var(Y)$ see 1 |
Var(X) | $E(X-\mu)^{2} = E(X^{2})-\mu^{2}$ |
E(aX - bY) | $aE(X)-bE(Y)$ |
E(X1 + X2 + X3) | $3E(X)$ |
Var(X1 + X2 + X3) | $3Var(X)$ |
E(X2) | $\sum{X^{2}}\cdot P(X=x)$ |
Var(aX - b) | $a^{2}Var(X)$ |
\begin{eqnarray*} Var(aX - bY) & = & Var(aX + -bY) \\ & = & Var(aX) + Var(-bY) \\ & = & a^{2}Var(X) + b^{2}Var(Y) \end{eqnarray*}
see also why n-1