I have a problem that involves a box containg N balls, one of which is red and the rest of which (N-1) are white. The question involves finding the expected value and variance for the number of trials to obtain the red ball in the case that (a) the balls are replaced and the case (b) the balls are not replaced.
For (a) I said that $$P(X=1) = \frac{1}{n}$$ $$P(X=2) = \frac{n-1}{n}\cdot\frac{1}{n}=\frac{n-1}{n^2}$$ $$P(X=3) = \frac{n-1}{n}\cdot\frac{n-1}{n}\cdot\frac{1}{n}=\frac{(n-1)^2}{n^3}$$ etc.
So that: $$E(X) = \sum xP(X=x) = \sum_{k=1}^{n} k\frac{(n-1)^{k-1}}{n^{k}}$$
For (b) I said that: $$P(X=1) = \frac{1}{n}$$ $$P(X=2) = \frac{n-1}{n}\cdot\frac{1}{n-1} = \frac{1}{n}$$ $$P(X=3) = \frac{n-1}{n}\cdot\frac{n-2}{n-1}\cdot\frac{1}{n-2} = \frac{1}{n}$$ etc.
So that: $$E(X) = \sum xP(X=x) = \sum_{k=1}^n k\frac{1}{n}$$
So originally when I was writing this question I had obtained the same result for both but then found an error in my ways. Instead I'll ask is this working correct? Any assistance is appreciated, thank you.
Your answer to (i) is slightly wrong as with replacement you can require more than $n$ selections so it should be $\displaystyle \sum_{k=1}^\infty k\frac{(n-1)^{k-1}}{n^{k}}$ but this can be simplified to $n$. An easier approach is to solve $E[X]=1 + \dfrac{n-1}{n}E[X]$, since this is a geometric distribution.
Your answer to (ii) is correct but this can be simplified to $\dfrac{n+1}{2}$, since you are just looking at the average of the possible values from $1$ to $n$.