Expected Value: Balls and bins

You approach is right if $n = \infty$.

In that case, you can write

$$ T= T_1 + T_2 + T_3 + T_4$$ where $T$ is the needed number of tosses, and $T_i$ is the number of tosses to fill the $i-$th bin, just after the $i-1$ bin was filled. Applyting linearity of expectation and seeing that each $T_i$ follows a geometric distribution you get the result.

If you don't stop at $4$ but proceed until you get all the bins fill, you get the coupon collector problem, which is solved in the same way.

The result can be written as

$$ \begin{align} P&=10 ( \frac{1}{10}+\frac{1}{9}+\frac{1}{8}+\frac{1}{7}) \\ &= 10 ( H_{10} - H_{6}) \\ \end{align} $$

where $H_n$ is the harmonic number.


If $n$ is finite, then the problem is ill defined, because the event of interest might not happen. One could reformulate: compute the expected number of tosses to fill $4$ bins given that after $n$ tosses at least $4$ bins were occupied. That would be rather messy.


As @leonbloy remarked this problem is ill posed. We can slightly modify this probability experiment so that the expectation you seek is well$-$defined.

Consider the probability experiment of tossing balls into bins until exactly four bins contain at least one ball OR until you run out of balls. Take $K\in \{4,...,n\}$ as the number of times you toss the ball. If $p_K$ is the pmf of $K$ then for $4 \leq k \leq n-1$ we have $$p_{K}(k)=\sum_{a,b,c\in \mathbb{N}:a+b+c=k-1}\Big[(0.1)^{a-1}\cdot(0.9)\cdot(0.2)^{b-1}\cdot (0.8)\cdot(0.3)^{c-1}\cdot(0.7)\Big]$$ The above expression reduces to $$p_K(k)=\frac{126}{5}\cdot (0.3)^{k-2}\Big[3^{2-k}+1-4.5\cdot (2/3)^k\Big]$$ Meanwhile, $$p_{K}(n)=1-\sum_{k=4}^{n-1}p_{K}(k)=\frac{25}{10^n}\Big[16\cdot 3^n-63\cdot 2^n+112\Big]$$ Hence $$\mathbb{E}(K)=\sum_{k=4}^nkp_{K}(k)=\frac{1}{252\cdot 10^n}\left(1260n\left(2^{n}\cdot63-8\cdot3^{n+1}-56\right)+99225\cdot2^{n}+1207\cdot10^{n}-1600\cdot3^{\left(n+3\right)}-78400\right)+\frac{25n}{10^{n}}\left(16\cdot3^{n}-63\cdot2^{n}+112\right)$$ Notice $\mathbb{E}(K)\approx 4.79$ when $n$ is large.