In the basket lies m black balls and n reds. Vasya takes out a random ball from the basket and, if it is black, then replaces it with red, and if it is red, then puts it back. Find the mathematical expectation and variance of the number of red balls in the basket after k iterations of this procedure. Both answers must be compact expressions (i.e. do not contain summation signs, ellipses, etc.).
I tried to solve this problem in this way. Let X - number of red balls after k iterations. Easy to see that n <= X <= n + m
We should find
$\sum_{i=n}^{n+m} P(X=i) * i$
$P(X = i) = (\frac{n}{n+m}) ^ {i}$ But couldn't find other probabilities. Because the probability of taking black/red ball changes after we take a black ball. How I can solve this ?
I feel sure this question has been asked and answered on this site before, but I can't find it. Anyway, this is one of those problems that's easy enough once you find the right way of looking at it. Suppose that instead of changing the colors of the balls, we just choose with replacement $k$ times, and keep track of which balls have been chosen. Then the number we seek is the number of red balls, plus the number of black balls that have been chosen at least once.
If we let $X_i$, be a random variable which is $0$ if black ball number $i$ has not been chosen, and $1$ if it has been chosen, where $i=1,2,\dots,m$ then $E(X)=n+\sum_{i=1}^mE(X_i)$ by linearity.
Can you take it from here?
EDIT
Here's some more description of the new model. Imagine that the black balls are numbered $1$ to $m$. Instead of changing the colors of the balls, we keep track of which black balls have been chosen. After $k$ iterations we find that black ball $1$ has been chosen once, black ball $3$ has bene chosen once, and black ball $4$ has been chosen $3$ times. No other balls have been chosen.
If we were changing the colors of the balls, black balls $1,3$, and $4$ would have been replaced by red balls, or colored red. But black ball $4$ would only have been replaced by a red ball the first time it was chosen. After that, it would have been colored red, and nothing would have changed when it was picked. So the number of red balls in this scenario would be $n+3$.
In general, we just need to count how many of the black balls have been chosen at least once.