Recursive formula to compute the probability the starting player wins

  • Context: Engineering 
  • Thread starter Thread starter Kakashi
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around developing a recursive formula to compute the probability that the starting player wins a game involving two players taking turns to remove balls from a jar containing white and black balls. The conversation explores various approaches to defining the probabilities associated with the number of turns until a win occurs, as well as the conditions under which these probabilities are calculated.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • Some participants define a random variable X representing the number of turns to win, with probabilities assigned to various outcomes based on the number of white (m) and black (n) balls.
  • One participant proposes a recursive formula for the probability of winning on odd-numbered turns, suggesting that the first player wins if the game ends on an odd turn.
  • Another participant emphasizes the need to condition probabilities on the game not being won on the first turn, leading to a generalized formula for P(X=k).
  • There is a suggestion that the problem may require recursion based on the values of m and n, leading to a proposed formula for p(m, n) that incorporates the probabilities of drawing white or black balls.
  • Some participants question whether the expression (1-p(m,n-1)) corresponds to the sum of probabilities that the first player wins in future turns, given the first draw was black.
  • A later reply illustrates a similar recursive argument using a coin-tossing game as an analogy, suggesting that recursive reasoning can be applied to different types of games.

Areas of Agreement / Disagreement

Participants express differing views on the exact formulation of the recursive probabilities and the conditions under which they apply. While some agree on the need for a recursive approach, there is no consensus on the specific details or the final form of the formula.

Contextual Notes

Some limitations are noted regarding the assumptions made in the probability calculations, particularly concerning the conditions under which the game is won and the dependence on the initial counts of white and black balls.

Kakashi
Messages
28
Reaction score
1
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?
 
Kakashi said:
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?
Yes, if you play a game with ##m## white balls and ##n-1## black balls, then ##p(m, n-1)## is the probability that the first player wins the game.

The recursive formula in post #6 relates the probability in the ##m, n## game to the probability in the ##m, n-1## game.

This is a useful idea in this type of problem. Here's another example:

Suppose two players take turns tossing a coin and the first to throw a Head wins. You can calculate the probability that the first player wins the game using the sum of an infinite series. But, you can also calculate it from a recursive argument. Let ##p## be the probability that the first player wins, then:
$$p = \frac 1 2 + \frac 1 2(1-p)$$You should try to understand the logic here and check that it gives the right answer.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
254
  • · 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
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 29 ·
Replies
29
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K