St · Statistics & Probability

How to Find Probabilities After Moving a Random Ball Between Boxes

Published By the 9to5Science editorial team

At a glance

  1. 1. List the possible transfers

    Group balls by type and find the probability that each type is selected from the source box.

  2. 2. Update the box counts

    For each possible transfer, add one ball of that type to the receiving box.

  3. 3. Calculate each case

    Find the probability of the event under each updated arrangement.

  4. 4. Combine the cases

    Weight each case by its transfer probability and add the results.

When a ball is moved at random, the box contents after the move are uncertain. To find the probability of a later event, consider each possible type of ball that could have been moved. Calculate the event probability for each resulting arrangement, then weight it by the chance of that transfer.

This method is the law of total probability. The examples below assume one ball is chosen uniformly at random from a source box and moved to a receiving box. If the selection rule or event is different, the same conditioning method applies, but the case probabilities must match that setup.

Set up the cases

Suppose the source box has nin_i balls of type ii, and the receiving box has mim_i balls of type ii. The source box contains N=∑iniN=\sum_i n_i balls. If the ball is selected uniformly from the source, the probability of transferring type ii is

P(transfer type i)=niN.P(\text{transfer type }i)=\frac{n_i}{N}.

After that transfer, the receiving box has mi+1m_i+1 balls of type ii and M+1M+1 balls total, where M=∑imiM=\sum_i m_i. If you then draw one ball uniformly from the receiving box, the probability it is type ii is (mi+1)/(M+1)(m_i+1)/(M+1) when type ii was transferred. If a different type was transferred, the probability of drawing type ii is mi/(M+1)m_i/(M+1).

For a general event EE, write EiE_i for the event’s probability in the arrangement produced by transferring type ii. Then

P(E)=∑iP(transfer type i)P(E∣transfer type i).P(E)=\sum_i P(\text{transfer type }i)P(E\mid\text{transfer type }i).

The cases must cover all possible transfers and cannot overlap: exactly one ball is transferred, and it has exactly one type.

Worked example: drawing a red ball

Box A contains 3 red and 2 blue balls. Box B contains 1 red and 4 blue balls. Choose one ball uniformly from A, move it to B, and then choose one ball uniformly from B. What is the probability that the final draw is red?

There are two possible transfer types:

Ball moved from ATransfer probabilityRed fraction in B afterward
Red3/53/52/62/6
Blue2/52/51/61/6

If a red ball is moved, B has 2 red balls out of 6. If a blue ball is moved, B still has 1 red ball, now out of 6. Therefore,

P(red on final draw)=35⋅26+25⋅16=630+230=415.\begin{aligned} P(\text{red on final draw}) &=\frac{3}{5}\cdot\frac{2}{6}+\frac{2}{5}\cdot\frac{1}{6}\\ &=\frac{6}{30}+\frac{2}{30}\\ &=\frac{4}{15}. \end{aligned}

So the probability is 4/154/15, or about 0.2670.267. The transfer probability and the later draw probability are multiplied within each case; the case results are then added.

Other events use the same method

For example, suppose you want the probability that the receiving box contains at least one red ball after the transfer. If it already contains a red ball, that event is certain. If it contains no red balls, the event occurs exactly when a red ball is transferred. Thus, if the receiving box starts with rr red balls and the source has RR red balls among NN total balls,

P(at least one red after transfer)={1,r≥1,R/N,r=0.P(\text{at least one red after transfer})= \begin{cases} 1, & r\ge 1,\\ R/N, & r=0. \end{cases}

For more complicated events—such as drawing two balls, getting at least one of a certain color, or ending with equal numbers of two colors—find the event probability separately for every possible transfer type and combine the cases in the same way.

Common mistakes

  • Treating transfer types as equally likely. A type’s chance of being moved depends on how many balls of that type are in the source. With 3 red and 2 blue balls, for instance, the chances are 3/53/5 and 2/52/5, not 1/21/2 each.
  • Forgetting to update the receiving box. Its total increases by one, and its count of the transferred type increases by one.
  • Using the wrong box for the random selection. If the later draw is from the source box, the source counts change instead. If the moved ball is itself counted as the outcome, there is no subsequent draw to model.
  • Adding probabilities without weighting them. The event probabilities for the different arrangements must be multiplied by the probabilities of producing those arrangements before they are added.
  • Assuming the moved ball is returned. The formulas here describe a transfer without replacement: the ball leaves the source and joins the receiving box. A different rule changes the counts and may change the answer.

References

  1. A First Course in Probability, Sheldon Ross

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.