Picking Multiples of 4

Solution 1:

Another approach would be to think of a permutation of $\{1, 2, ..., 30\}$. We can think of the seven multiples of $4$ as separating runs (some possibly empty) of the $23$ nonmultiples of $4$. Since there are seven separators, there are $8$ runs, with the average run length being $\frac{23}{8}$. Thus the average number of nonmultiples of $4$ after the last (seventh) multiple of $4$ is $\frac{23}{8}=2.875$. Thus the average position of the last multiple of $4$ is position $30-2.875=27.125$.

Solution 2:

To begin, you correctly note that there are seven multiples of four to be chosen.

Let us choose a convenient sample space to work with. In this case, I find it convenient to let the sample space be all permutations of $[30]$. We know the samplespace size is $30!$. This is done because we could choose to simply pick more numbers out of the hat until the hat is empty and the probabilities of success in $k$ rounds will remain the same. In addition, each outcome in the sample space is equally likely to occur.

Let us count how many permutations satisfy the following properties for each value of $k$:

  • The $k^{th}$ number is a multiple of four
  • The remaining six multiples of four all appear before the $k^{th}$ number

To do so,

  • Pick the spaces occupied by the multiples of $4$: $\binom{k-1}{6}$ choices.
  • Pick the order in which the multiples of four appear: $7!$ choices
  • Pick the order in which the rest of the numbers appear: $23!$ choices

Letting $X=\text{number of rounds until all multiples of four are drawn}$, we have $Pr(X=k)=\dfrac{\binom{k-1}{6}7!23!}{30!}$. Note that this formula makes sense even in the situation that $k<7$ since it is impossible to have drawn all multiples of four in that time and the formula gives the probability of occurrence as zero.

Now, we can apply the definition of Expected Value.

$\mathbb{E}[X] = \sum\limits_{k\in \Delta} kPr(X=k)$

which in this case yields

$$\mathbb{E}[X]=\sum\limits_{k=7}^{30} \dfrac{k\binom{k-1}{6}7!23!}{30!}=27.125$$

wolfram calculation


Through similar methods, one could also calculate the estimated time before the first occurrence of a multiple of four to be $3.875$ as in @lulu's comment above.

That answer yields the same result as ours above by recognizing that via interpreting this as selecting occurrences of numbers in our permutation in reverse order and an appropriate shifting of indices, that the first occurrence of a multiple of four being $3.875$ from the end corresponds exactly with the last occurrence of $27.125$ from the start.

Solution 3:

The probability of getting all multiples of $4$ precisely on draw $k$ is $$ \frac{\binom{k-1}{6}}{\binom{30}{7}} $$ Thus, the expected number of draws would be $$ \begin{align} \frac1{\binom{30}{7}}\sum_{k=7}^{30}k\binom{k-1}{6} &=\frac7{\binom{30}{7}}\sum_{k=7}^{30}\binom{k}{7}\\ &=\frac7{\binom{30}{7}}\binom{31}{8}\\ &=\frac{217}{8}\\[9pt] &=27.125 \end{align} $$