Suppose I have a well shuffled deck and I am trying to find the variance of 26 cards randomly chosen without replacement from a deck, assuming the values are from 1 to 13 for the cards. Since the mean is 7, I calculate the variance as such: $$ \frac{2 \sum_{i=1}^{13} (i-7)^2}{26} = 14 $$ However when I do a monte carlo simulation the variance turns out to be $13.72$. Which is the right variance?
2026-03-26 17:46:13.1774547173
On
variance of 26 cards chosen from a deck
3.3k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
1
On
Are you choosing the cards with or without replacement? If you do it without replacement, then the variance is going to be lower. You can observe this phenomenon when e.g. you compare the variances of Binomial and Hypergeometric distributions.
In other words, the simulated answer seems right (provided the simulation is done correctly). Run the simulation a few more times to be sure it stays below 14... ;0
Let $X$ be the sum of the values of the cards. The value of the mean that you give indicates that you are interested in the mean and variance of $\frac{X}{26}$. We look instead at the variance of $X$. For the variance of $\frac{X}{26}$, divide the variance of $X$ by $26^2$.
We outline the computation. It is somewhat unpleasant but quite doable. Assume the cards are drawn one at a time. Let $X_i$ be the value of the $i$-th card. Then $X=X_1+X_2+\cdots+X_{26}$. Recall that $\text{Var}(X)=E(X^2)-(E(X))^2$.
We have $E(X)=E(X_1+\cdots+X_{26})=E(X_1)+\cdots +E(X_{26})=(7)(26)$.
It remains to find $E(X^2)$. By the linearity of expectation, this is $$\sum_{i=1}^{26} E(X_i^2)+2\sum_{1\le i\lt j\le 26} E(X_iX_j).$$ The calculation of the first sum is straightforward. For the second sum, all the expectations are equal, so that sum is $(26)(25)E(X_1X_2)$.
The random variable $X_1$ takes values $1$ to $13$, each with probability $\frac{1}{13}$. So $$E(X_1X_2)=\frac{1}{13}\sum_{k=1}^{13} kE(X_2|X_1=k).$$ To calculate $E(X_2|X_1=k)$, note that given $X_1=k$, the random variable $X_2$ takes on all values other than $k$ with probability $\frac{4}{51}$, and value $k$ with probability $\frac{3}{51}$. Calculate. We get $E(X_2|X_1=k)=\frac{(4)(91)-k}{51}$.
The rest is just computation. Indeed we can get a closed form if the cards in the deck take on values $1$ to $m$, with each value taken on $d$ times, and we deal out a hand of $n$ cards.