I am working on the following problem:
An urn contains red, green, and blue balls. Balls are chosen randomly with replacement (each time, the color is noted and then the ball is put back.) Let $r$, $g$, $b$ be the probabilities of drawing a red, green, blue ball respectively $(r + g + b = 1)$.
Find the expected number of different colors of balls obtained before getting the first red ball.
I have written my attempt below. My answer doesn't agree with the solution so would appreciate if anyone could point out my mistake.
Let $N$ be the number of colors that are seen before the first red ball, and $X$ be the number of balls taken out before the first red one (not counting the red one). Then $N$ can be $0$, $1$ or $2$, and $$P(N=1 | X)=b^X+g^X$$ because for $N$ to be 1 we need all $X$ balls to be blue or all $X$ balls to be red.
Similarly, $$P(N=2|X)=\sum_{k=1}^{X-1}{X\choose k}b^kg^{X-k}=(b+g)^X-b^X-g^X.$$
Then we can calculate $E(N)$ using the law of iterated expectations \begin{align} E(N)=E(E(N|X))&=E(0\cdot P(N=0|X)+1\cdot P(N=1|X)+2\cdot P(N=2|X))\\ &=E(b^X+g^X+2((b+g)^X-b^X-g^X)=E(2(b+g)^X-b^X-g^X) \end{align}
$X$ is distributed $\sim$ Geo(r), so using LOTUS we can find $$E(b^X)=\sum_{k=0}^\infty b^k (1-r)^kr=\frac{r}{1-b(1-r)}$$ and similarly we can find $E(g^X)$ and $E((g+b)^X)$ to get a final answer $$E(N)=\frac{2r}{1-(b+g)(1-r)}-\frac{r}{1-b(1-r)}-\frac{r}{1-g(1-r)}.$$
This doesn't agree with the solution given or this post Expected number of different colors of balls obtained before getting the first red ball. I understand the answer given in that post but I can't find the mistake in this alternative method.