3 people flip $k$ coins + conditional expectations 3 people in a room and $k\le3$ coins. At each stage, at most $k$ people flip a coin and anyone that flips heads leaves the room. This continues until everyone leaves the room. What is the expected number of time periods until all people have left the room if $k=1,2,3$?
I think I've figured it out for $k=1$ (answer below). I'm pretty sure that for $k=2,3$ I'm going to have to condition on a third variable but I'm not sure what to condition on.
*If $k=1$, then if we let $N$=number of flips and $Y$={1 if first flip is head, 0 otherwise}, then
$$E[N] = E[N|Y=1]P(Y=1) + E[N|Y=0]P(Y=0)$$
$$= (1/2)+(1/2)E[N|Y=0]$$
but, $E[N|Y=0] = 1 + E[N]$ so $E[N]=2$, but there are 3 people so $3E[N]=6$ solves that part.
 A: The answer of 6 for $k=1$ is correct. Here is another approach: model the situation as a Markov chain with matrix
\begin{bmatrix}
\frac12&0&0&0\\
\frac12&\frac12&0&0\\
0&\frac12&\frac12&0\\
0&0&\frac12&1\end{bmatrix}
This, when raised to the $n$th power and multiplied by the column vector $[1,0,0,0]^T$, gives the probability that 3, 2, 1 or 0 people remain after $n$ steps (reading top to bottom). To find the expected number of steps, take the first three rows and columns of the above matrix as $Q$ and compute the fundamental matrix $(I-Q)^{-1}$:
\begin{bmatrix}2&0&0\\2&2&0\\2&2&2\end{bmatrix}
Left-multiplying this by a row vector of ones gives the expected number of steps from having 3, 2 or 1 people in the room to having none. Here, we get $[6,4,2]$; this indicates that six steps are expected to empty the room from three people when $k=1$.
A similar approach can be taken for $k=2,3$, with corresponding matrices
$$\begin{bmatrix}
\frac14&0&0&0\\
\frac12&\frac14&0&0\\
\frac14&\frac12&\frac12&0\\
0&\frac14&\frac12&1\end{bmatrix}\begin{bmatrix}
\frac18&0&0&0\\
\frac38&\frac14&0&0\\
\frac38&\frac12&\frac12&0\\
\frac18&\frac14&\frac12&1\end{bmatrix}$$
and these give expected emptying times of $\frac{34}9$ and $\frac{22}7$ steps respectively.
