There are n husbands and n wives to be seated at... Find var(X)

93 Views Asked by At

There are n husbands and n wives to be seated at a long rectangular table. All of the husbands will sit on one side of the table and all of the wives will sit on the other side. Let X be the number of husbands that sit across from their wives. Find var(X).


I've setted $X_i=1$ If husband seats across his wife and $X_i=0$ otherwise (with $i=1,2....n$).

Also, $P(X_i=1)$=$1\over n$,

I then have: $E(X_i)=\sum_{k=1}^{n}x_iP_X(x_i=1)=1$.

From the variance definition, I can have: $Var(X_i)=E(X_i^2)-(E(X_i))^2$

After that, I'm a bit stuck. Can I just continue with my last line

$Var(X_i)=E(X_i^2)-(E(X_i))^2$

and then apply a $\sum_i^n$ on the expectations?

Or can I just write more on the line of:

$Var(X_i)= \frac{n-1}{n^2}$ with $i\in [0,n]$

Any help or tip would be greatly appreciated.

1

There are 1 best solutions below

3
On BEST ANSWER

Comment. Because you can google several proofs online, including the one in my earlier comment for the 'hat check' incarnation, maybe it is worthwhile to illustrate the reasonably good fit to $\mathsf{Pois}(1)$ using simulation in R. With a million iterations one can expect at least two place accuracy.

set.seed(412);  m = 10^6;  n = 12
x = replicate(m, sum(sample(n)==1:n))
mean(x);  sd(x);  table(x)/m
[1] 1.001044       # aprx E(X) = 1
[1] 0.999903       # aprx SD(X) = 1
x
       0        1        2        3        4        5        6        7        8 
0.367157 0.368324 0.184228 0.061268 0.015332 0.003110 0.000495 0.000076 0.000010 

hist(x, prob=T, br=(-1:n)+.5, col="skyblue2")
k = 0:n; pdf = dpois(k, 1);  points(k, pdf, col="red")

The histogram below shows the simulated distribution of $X$ and the centers of red circles show probabilities of $\mathsf{Pois}(1).$

enter image description here

Note: By one of @TheoreticalEconomist's links, $P(X = 0) = \sum_{i=0}^{12} (-1)^i/i! = 0.3679.$

i=0:12;  sum((-1)^i/factorial(i))
[1] 0.3678794