drawing balls from a bin but the balls are changing over time I am doing this problem:
An urn initially has w white balls and k black balls. The balls are randomly drawn and replaced in the bin. Whenever a white ball is selected, it is painted black before it is replaced. What is the probability that the ball selected on the (n+1)st draw is white?
What I am thinking is to conditional on there are j times that a white ball is selected in the first n draws. So
$$P(the\ (n+1)st\ draw\ is\ white) = \sum_{j=0}^{n}P(the\ (n+1)st\ draw\ is\ white\ |\ j\ whites\ in\ the\ first\ n\ draws)P(j\ whites\ in\ the\ first\ n\ draws) $$
And I know
$$P(the\ (n+1)st\ draw\ is\ white\ |\ j\ whites\ in\ the\ first\ n\ draws) = \frac{w-j}{k+w}$$
But I am wondering how to calculate the probability that there are j whites in the first n draws. I think it should be $\frac{w(w-1)...(w-j+1)}{(w+k)^j}$, but I am not sure if it is correct.
Can anyone give me a hint? Thank you.
 A: As mentioned in the comments:
In order for draw number $(n+1)$  to be white it must first have been white originally, probability $\frac w{b+w}$ and, secondly, it must never have been drawn before, probability  $\left(\frac {b+w-1}{b+w}\right)^n$.  These two events are independent (being drawn, or not, in the past has nothing to do with being drawn on the current round).  Thus the answer is the product $$\boxed {\frac w{b+w}\times \left(\frac {b+w-1}{b+w}\right)^n}$$
Note:  I have used $w$ for the initial number of white balls and $b$ for the initial number of black balls.
A: let $q:=\frac{1}{w+k}$
$$\#\text{whites at n-th draw}= x, \\
p(\text{white at n-th draw}) = xq, 
\\ \#\text{whites at n-th+1 draw}= x - 1 * p(\text{white at n-th draw}) = x(1-q), \\
p(\text{white at n-th+1 draw}) = \#\text{whites at n-th+1 draw}* q = (x - p(\text{white at n-th draw}))*q = xq(1-q) = p(\text{white at n-th draw})(1-q)$$
so from now we have:
$$p(\text{white at 1 draw}) = wq, \\
p(\text{white at n+1 draw}) = wq(1-q)^n, $$
A: Label the $w$ white balls with the numbers $1,2,...,w$.
Define $$_rA_q = \{\text{the $q$-th white ball is drawn at the $r$-th draw}\}$$
$$_rB_q = \{\text{the $q$-th white ball is drawn at a previous draw than the $r$-th}\}$$
So that
$$P(\text{$r$-th draw is white}) = $$
$$P(\ _{r}A_1\cup  \  _{r}A_2 \cup \dots \cup \ \ _{r}A_w) = $$
$$P(_rA_1)+P(_rA_2)+\dots +P(_rA_w) = w P(_rA_1)$$
but
$$P(_rA_1) = P(_rA_1|_rB_1) P(_rB_1) +P(_rA_1|_rB_1^c)P(_rB_1^c) = $$
$$ 0 \cdot P(_rB_1)+ \frac{1}{w+k}\cdot (\frac{w+k-1}{w+k})^{r-1} $$
then, when $r = n+1$ you have
$$P(\text{$n+1$-th draw is white}) = \frac{w(w+k-1)^n}{(w+k)^{n+1}}$$
A: $\boldsymbol{n^\text{th}}$ Pick is a White Ball
The probability that the $n^\text{th}$ pick will be a white ball equals the probability of choosing a white ball, then choosing $n-1$ other balls. That is,
$$
\bbox[5px,border:2px solid #C0A000]{\frac{w}{k+w}\left(\frac{k+w-1}{k+w}\right)^{n-1}}\tag1
$$

Drawing the $\boldsymbol{j^\text{th}}$ White Ball
Here is a typical sequence for drawing $j$ white balls:
$$
\overbrace{\left(\frac{k}{k+w}\right)^{n_0}}^{\substack{\text{draw $n_0$}\\\text{black balls}}}\overbrace{\ \frac{w\vphantom{k^n}}{k+w}\ }^{\substack{\text{first}\\\text{white ball}}}\cdot\overbrace{\left(\frac{k+1}{k+w}\right)^{n_1}}^{\substack{\text{draw $n_1$}\\\text{black balls}}}\overbrace{\ \frac{w-1\vphantom{k^n}}{k+w}\ }^{\substack{\text{second}\\\text{white ball}}}\cdots\overbrace{\left(\frac{k+j-1}{k+w}\right)^{n_{j-1}}}^{\substack{\text{draw $n_{j-1}$}\\\text{black balls}}}\overbrace{\ \frac{w-j+1\vphantom{k^n}}{k+w}\ }^{\substack{j^\text{th}\\\text{white ball}}}\tag2
$$
we need to consider sums where $n_0+n_1+\dots+n_{j-1}=n-j$. One way to keep track of things is with generating functions.
$$
\left[x^n\right]\frac1{1-\frac{kx}{k+w}}\frac{wx}{k+w}\cdot\frac1{1-\frac{(k+1)x}{k+w}}\frac{(w-1)x}{k+w}\cdots\frac1{1-\frac{(k+j-1)x}{k+w}}\frac{(w-j+1)x}{k+w}\tag3
$$
Thus, the generating function for the probability of drawing the $j^\text{th}$ white ball on a given pick is
$$
\bbox[5px,border:2px solid #C0A000]{\prod_{i=0}^{j-1}\frac{(w-i)x}{k+w-(k+i)x}}\tag4
$$

Verifying $\boldsymbol{(1)}$ Using $\boldsymbol{(4)}$
If we sum $(4)$ over all the possible white balls, we should get the generating function for $(1)$.
$$
\begin{align}
\sum_{j=1}^w\prod_{i=0}^{j-1}\frac{(w-i)x}{k+w-(k+i)x}
&=\sum_{j=1}^w\prod_{i=0}^{j-1}\frac{w-i}{\frac{k+w}x-(k+i)}\tag5\\
&=\sum_{j=1}^w\frac{\binom{w}{j}}{\left(\frac{k(1-x)+w}x\atop{j}\right)}\tag6\\
&=\frac1{\binom{v}{w}}\sum_{j=1}^w\binom{v-j}{v-w}\tag7\\[3pt]
&=\frac1{\binom{v}{w}}\binom{v}{w-1}\tag8\\[6pt]
&=\frac{w}{v-w+1}\tag9\\[9pt]
&=\frac{wx}{k+w}\frac1{1-\frac{k+w-1}{k+w}x}\tag{10}\\
&=\sum_{n=1}^\infty\color{#C00}{\frac{w}{k+w}\left(\frac{k+w-1}{k+w}\right)^{n-1}}x^n\tag{11}
\end{align}
$$
Explanation:
$\phantom{1}\text{(5)}$: divide numerator and denominator by $x$
$\phantom{1}\text{(6)}$: write products as binomial coefficients
$\phantom{1}\text{(7)}$: set $v=\frac{k(1-x)+w}x$
$\phantom{1}\text{(8)}$: Hockey-stick identity
$\phantom{1}\text{(9)}$: simplify
$(10)$: undo $(7)$
$(11)$: write as a series
Indeed, $(11)$ is the generating function for $(1)$.

How Long Will the White Balls Last?
Suppose we start with $10$ white and $10$ black balls. After a possibly large number of picks, we will have drawn all the white balls and be left with a bin of black balls.  We can use $(4)$ to compute the probability of the various durations until the white balls disappear.
The average duration after the $j-1^\text{st}$ white ball is drawn until the $j^\text{th}$ white ball is drawn is $\frac{k+w}{w-j+1}$. Thus, the average duration until all the white balls have been drawn is
$$
(k+w)H_w\tag{12}
$$
where $H_w$ is the $w^\text{th}$ Harmonic Number.
Plotting the coefficients of the generating function
$$
g(x)=\prod_{i=0}^9\frac{(10-i)x}{20-(10+i)x}\tag{13}
$$
we get

where the maximum occurs at $n=46$. The average can be computed by evaluating
$$
g'(1)=\frac{7381}{126}\tag{14}
$$
which matches $20H_{10}$ from $(12)$.
