Recursive formula to compute the probability the starting player wins

  • Context: Engineering 
  • Thread starter Thread starter Kakashi
  • Start date Start date
Kakashi
Messages
19
Reaction score
0
Homework Statement
Two players take turns removing a ball from a jar that initially contains m white and n black balls. The first player to remove a white ball wins. Develop a recursive formula that allows the convenient computation of the probability that starting player wins.
Relevant Equations
N/A
Let X be the random variable denoting the number of turns to win the game. X can take the numerical values from 1 to n. The probabilities assigned to the numerical value of the random variable are

$$ P(X=1)= \frac{m}{m+n} $$.
$$ P(X=2)=\frac{m}{m+n-1} $$
$$ P(X=3)=\frac{m}{m+n-2} $$
..
$$ P(X=n)=\frac{m}{m+n-n}=\frac{m}{m}=1 $$

The odd numerical values of X correspond to the events the starting player wins. The recursive formula taking the difference in probabilities of some odd numerical value to realize the pattern

$$ P(X=2k+1)=P(X=k)+\frac{2m}{(m+n-(k-1))(m+n-(k+1))} $$
Where k is odd
 
Physics news on Phys.org
Kakashi said:
Homework Statement: Two players take turns removing a ball from a jar that initially contains m white and n black balls. The first player to remove a white ball wins. Develop a recursive formula that allows the convenient computation of the probability that starting player wins.
Relevant Equations: N/A

Let X be the random variable denoting the number of turns to win the game. X can take the numerical values from 1 to n. The probabilities assigned to the numerical value of the random variable are

$$ P(X=1)= \frac{m}{m+n} $$.
$$ P(X=2)=\frac{m}{m+n-1} $$
For ##X = 2## you also need that the game was not won on the first turn.
 
  • Like
Likes   Reactions: Kakashi
PeroK said:
For ##X = 2## you also need that the game was not won on the first turn.
Conditioning on this event the probability of winning on turn 2 given that the game was not won on the first turn is $$ P(X=2)= \frac{n}{m+n} \frac{m}{m+n-1} $$
$$ P(X=3)=\frac{n}{m+n}\frac{n-1}{m+n-1}\frac{m}{m+n-2} $$
If we generalize this argument $$ P(X=k)=P(X=k-1)\frac{n-k+2}{m+n-k+1} $$
 
I think they want the probability that the first player wins. So, you still have some work to do. That said, it's not clear whether they want some sort of recursion on ##m## and ##n##.
 
The recursive probability derived gives the probabilty the game ends on turn k and its valid when k>=2. The first player wins if the game ends when X is odd.

$$P(\text{First player wins}) =\sum_{i=0}^{\frac{n}{2}} P(X=2i+1) $$
Since the game ends after all black balls are exhausted.
$$ 2i+1 \leq n+1 $$
$$ i \leq n/2 $$
 
Kakashi said:
The recursive probability derived gives the probabilty the game ends on turn k and its valid when k>=2. The first player wins if the game ends when X is odd.

$$P(\text{First player wins}) =\sum_{i=0}^{\frac{n}{2}} P(X=2i+1) $$
Since the game ends after all black balls are exhausted.
$$ 2i+1 \leq n+1 $$
$$ i \leq n/2 $$
That's not an answer. I think what they are looking for is a recursion based on ##m, n##.

Let ##p(m, n)## be the probability the first player wins a game with ##m## white and ##n## black balls. Then:
$$p(m, n) = p(W) + p(B)(1- p(m, n-1))$$Where ##p(W), p(B)## is the probablity the first player draws a white or black ball. And, ##p(m, n-1)## is the probably the second player wins, given that the first player drew a black ball.

That gives you a recursion starting from ##p(m, 1)## and calculating ##p(m, 2)## etc.
 
  • Like
Likes   Reactions: Kakashi
Does $$ (1-p(m,n-1)) $$ correspond to the sum of the probabilities that the first player wins odd numbered future turns conditioned on the fact that the first draw was black?
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K