Two players take turns removing a ball from a jar that initially contains $m$ white and $n$ black balls. The first player to remove white ball wins. Develop a recursive formula that allows the convenient computation of the probability that the starting player wins.
Solution
Let $p(m,k)$ indicates the winning probability when there is $m$ white balls and $k$ black balls.
Let event $A = $ the starting player wins at the first move and $B=$ the starting player lost the first move but its opponent is doomed to lose. Let $C$ = the starting player will win when there is $m$ white balls and $k$ black balls.
Then, $P(C) = P(A) + P(B)$. Let $p(m,k)$ indicate the winning probability when there are $m$ white balls and $k$ black balls. We have
$P(A) = \frac{m}{m+k}$, $P(B) = \frac{k}{m+k} \times (1-p(m,k-1))$, $p(m,k) = \frac{m}{m+k} + \frac{k}{m+k} \times (1 - p(m,k-1))$.
The initial statement is $p(m,0) = 1$.
没有评论:
发表评论