Expectation and variance of seats in a movie theater A movie theater has a row of 10 seats. Each seat is occupied with probability $1/2$ independently of the other seats. A visitor is "comfortable" if he or she is not at the edge of the row and both adjacent seats are unoccupied. If $N$ is the number of comfortable visitors, compute the expectation and variance of $N$.
I know I can count all the different combinations of seating, but is there an easier way to do this?
 A: Let's say there are $m+2$ seats in the row, and the seats are labeled $0,1,\ldots,m,m+1$. Note seats $0$ and $m+1$ are never occupied comfortably. For $i=1,\ldots m$, let $X_i$ be the indicator variable of whether seat $i$ is occupied comfortably. In other words,
$$
X_i = \begin{cases} 1 & \text{Seat $i$ is occupied, Seats $i-1,i+1$ unoccupied}\\
0 & \text{otherwise}
\end{cases}
$$
Since each seat is occupied independently with probablity $1/2$, $\mathbb{E}(X_i)=1/8$.
Note the total number of occupied seats is:
$$
N = \sum_{i=1}^m X_i
$$
By linearity of expectation, we have $\mathbb{E}(N) = \sum_{i=1}^m \mathbb{E}(X_i)=m/8$. 
Calculating the variance is a little trickier because the $X_i$ are not independent. However, it is sufficient to look at pairwise interactions, which we can break down into cases. Adjacent seats are never comfortably occupied. A pair of seats exactly two apart from each other are occupied comfortably with probability $1/32$. A pair of seats further than two spaces apart from each other are occupied comfortably independent of each other. In summary:
$$
\mathbb{E}(X_i X_j) = \begin{cases} 
1/8 & i=j\\
0 & |i-j|=1\\
1/32 & |i-j|=2\\
1/64 & |i-j|>2
\end{cases}
$$
So we can use this to calculate the variance (assuming $m>1$):
$$
\begin{aligned}
\mathbb{E}\left(\sum_{i=1}^m X_i\right)^2 &= \sum_{i=1}^m \mathbb{E}(X_i^2)+ 2\sum_{i=1}^{m-1} \mathbb{E}(X_i X_{i+1}) + 2\sum_{i=1}^{m-2} \mathbb{E}(X_i X_{i+2}) + \sum_{|i-j|>2}\mathbb{E}(X_i X_{j})\\
&=m(1/8) + (2m-2)(0) + (2m-4)(1/32) + (m^2-5m+6)(1/64) \\
&=(m^2+7m-2)/64\\
\operatorname{Var}(N)&=\mathbb{E}\left(\sum_{i=1}^m X_i\right)^2-\left(\sum_{i=1}^m \mathbb{E}X_i\right)^2=(7m-2)/64.
\end{aligned}
$$
This is pretty close to $7m/64$, which is what the variance would be if the $X_i$ were pairwise independent. Basically, the negative correlation between adjacent seats nearly cancels out the positive correlation between seats two apart.
In summary, since $m=8$, the expectation of $N$ is $1$ and its variance is $27/32$.
