Calculating expectation of the number of balls that were not taken out of a box Given a box with 10 balls numbered 1 to 10, each time we take out one ball randomly and return it back to the box. The process stops the first time we take out a ball with the number 1.
We need to calculate the expected value of the number of balls that were not taken out of the box.
I tried the following:
$X$ -  The number of balls that were not taken out of the box.
$X_i$ - the ball numbered $i$ was not taken out of the box.
$N\sim Geo(\frac{1}{10})$ - The number of trials until a ball numbered 1 was taken out.
$P(X_i = 1) = (\frac{8}{10})^N$
$X=\sum_2^{10}X_i$
Then use law of total expectation and transformation:
$E(X)=E(E(X|N))=E(E(\sum_2^{10}X_i|N))=9E((\frac{8}{10})^N)$
$=9\sum_{n=1}^\infty(\frac{8}{10})^n\cdot(\frac{9}{10})^{n-1}\cdot(\frac{1}{10})^1$
But the answer is not right, I'd appreciate if you could help me understand what's wrong here
 A: Let $X_i$ be an indicator r.v. that is equal to $1$ if a number (other than $1$) was not taken out before $1$, and zero otherwise.
Then by symmetry, $P(X_i) = \frac12$
Now the expectation of an indicator variable is just the probability of the event it indicates, thus
$\Bbb E[X_i] = \frac12$
and by linearity of expectation,
which operates even if the variables are not independent,
$\Bbb E[X] = \Bbb E[X_2] + \Bbb E[X3] + ... \Bbb E[X_9] = 9\times \frac12 = 4.5$

Addendum
If ball is replaced each time after drawing, I'll compute expected number of balls drawn out until 1 drawn out, and the answer will then be $10 - \Bbb E[Y]$
$\displaylines{\Bbb E[Y =1] = 1*0.9^0*0.1,\\  
\Bbb E[Y=2] = 2*0.9^1*0.1,\\ 
 \Bbb E[Y=3] = 3*0.9^2*0.1\;\; and \;so\; on}$
Thus $$\Bbb E[Y] = \sum_{k=1}^{10} k*0.9^{k-1}/10 \approx 3.0264$$
thus $\Bbb E[X] \approx 6.9736  $
A: Remember $N$ is not a fixed number.
$$P(X_i=1)=\sum_{m=1}^\infty P(N=m)P(X_i=1|N=m)$$
On the other hand, consider just those times that balls $1$ and $i$ are chosen.  It is equally likely the first from that set is $1$, or $i$.  So $P(X_i=1)=1/2$
