TITLE: Picking Multiples of 4
QUESTION [10 upvotes]: I recently came up with and tried to solve the following problem: If you are randomly picking integers in the range $[1,30]$ out of a hat without replacement, on average, how many integers will you have to pick until you have picked all of the multiples of $4$?
There are $7$ multiples of $4$ that can be chosen. I know that the expected value of picks until you pick a multiple of 4 is the smallest value of $n$ such that $1-\displaystyle\prod_{i=0}^{n-1}\dfrac{23-i}{30-i}>0.5$, which is $3$. However, I don't know how to figure out how many picks are needed until all multiples of $4$ have been chosen. Can I please have some assistance?

REPLY [4 votes]: Colour the $23$ numbers not divisible by $4$ blue, and call them $b_1$ to $b_{23}$. Colour the $7$ multiples of $4$ red. For $i=1$ to $23$, let indicator random variable $X_i$ be defined by $X_i=1$ if there is a  red number which is chosen later than $b_i$, and by $X_i=0$ otherwise. 
Then the total number $W$ of trials until we get all the red numbers is given by $W=7+\sum_1^{23}X_i$. 
By the linearity of expectation, 
$$E(W)=7+\sum_1^{23}E(X_i).$$
The probability that $X_i=1$ is $\frac{7}{8}$, for the blue integer $b_i$ is equally likely to be first, second, and so on up to eighth among the $8$ numbers consisting of the red numbers and $b_i$. It follows that
$$E(W)=7+23\cdot\frac{7}{8}.$$
This simplifies to $\frac{217}{8}$.
Remark: The indicator random variable technique bypasses finding the distribution of $W$. That distribution is in this case not difficult to find, but the technique can be valuable when the distribution is  less accessible.