Solution (source code)

= Solution

Let $I_c$ be the <indicator random variable> that colour $c$ appears at least once. Then $X=I_R+I_B+I_G$. For a colour of single-roll probability $p_c$, independence of rolls gives $\mathbb P(I_c=0)=(1-p_c)^n$. By <linearity of expectation>,
$$
\boxed{\mathbb E X=\sum_c\bigl(1-(1-p_c)^n\bigr)=3-\left(\frac12\right)^n-\left(\frac23\right)^n-\left(\frac56\right)^n.}
$$
The three indicators are not independent, but <linearity of expectation> does not require them to be. This is the <expected number of observed categories>.