If I draw from the bag $n$ times, what's the probability that all stones are white? I've got a bag with $k$ stones in it, each either black or white with probability $\frac12$.  I draw a stone from the bag $n$ times; each time seeing that the stone is white, then tossing it back in the bag.
What is the probability that all $k$ stones are white, given $n$ draws of a white stone?

I think I understand specific cases, but I'm having trouble generalizing this.  For $k=3$ and $n=1$, you only see one stone, so the other two could be any ordered set of white and black, leaving a 1/4 chance of all three stones being white.
Using similar logic, I think that when $n=2$, you have a 1/3 chance of seeing only one stone and a 2/3 chance of seeing two different stones.  If you've seen one, odds are 1/4 that the other two are white, and if you've seen two, odds are 1/2 that the other one is white.  Together, the chance of all three being white is 5/12.
How can I generalize this for any $n$ and $k$?
 A: The assumption that each stone in the bag is black or white with probability $\frac12$ means that the event $E_j$ for "there are $j$ white stones in the bag" has probability $\binom{k}{j}/2^k.$ Then using Bayes' rule, and cancelling out the common factor of $1/2^k$ everywhere, we find that the likelihood that the bag originally contained all white stones, given we drew with replacement $n$ times and always got white, is the reciprocal of the number
$$\sum_{j=0}^k (\frac jk)^n \binom{k}{j}.\tag{1}$$
Here the $k^n$ can be brought out of the sum, and the remaining sum can, for a specific $n ,$ be obtained by starting with the expansion of $(1+x)^k$ and repeatedly doing the steps "differentiate, then multiply by $x$" and putting in $x=1$.
Added explanation: Let $A$ be the event of drawing all whites in the $n$ draws with replacement from the bag of $k$ stones. The event where all stones in the bag are white, in the above notation, is $E_k$ with probability $\binom{k}{k}/2^k=1/2^k.$ Then the question is to find the conditional probability $P(E_k|A)$. This suggests using Bayes' theorem since the probabilities of the reversed conditionals $P(A|E_j)$ are easy to find, and are $(j/k)^n$ since we are drawing $n$ times with replacement from a bag containing a proportion of $j/k$ white stones. In Bayes' theorem the numerator will then be $P(A|E_k)\cdot P(E_k)=1\cdot (1/2^k)$, while the denominator will be, after cancelling the common factor $1/2^k$ from everything, the expression (1) above.
If we denote the conditional p[robability sought by $P(k,n)$ we can work things out for some small $n$ as $P(1,n)=1$, which seems clear, next
$$P(2,n)=\frac{2^n}{2^n+2},\\ P(3,n)=\frac{3^n}{3^n+3\cdot 2^n+3},
\\P(4,n)=\frac{4^n}{4^n+4\cdot 3^n+6\cdot 2^n+4}.$$
The pattern of binomial coefficients appearing here seems to continue as one finds $P(5,n),P(6,n),$ and so on.
