There is a basket which contains the following soft drink bottles:
2 Pepsi bottles
4 Fanta bottles
9 Coke bottles
11 Thums up bottles
A boy Nick comes and randomly selects 2 bottles from the basket, and goes away. Then Rick comes and takes away 7 soft drink bottles randomly. At last Sam comes who takes 2 bottles randomly and returns 1 of the two.
What is the probability that the bottle returned is of Thums up brand?
First categorize the bottles into two categories:
cat1: thumbs up bottles, 11 of them; t=11.
cat2: not cat1 -> the rest 15 of them; o=15. (o as in other)
So the basket can be represented with a pair of values (o,t) where t is the number of Thums up bottles, and o is the number of bottles of other brands of soft drinks. The number of bottles in the basket is obviously o+t.
Initially the basket contains 26 bottles, 11 Thums up, and 15 bottles of other brands of soft drinks. So the basket is represented by a pair of numbers (15,11).
Nick comes and takes away 2 bottles. That leaves you with three possible scenarios. In every one of them the basket will contain 26-2=24 bottles, just not of the same composition:
- Nick took 2 Thums up bottles: (15,9)
- Nick took 1 Thums up bottle, and 1 other brand: (14,10)
- Nick took 0 Thums up bottles, and 2 bottles of other brand: (13,11)
For each of those three scenarios you have to consider Rick showing up and taking away 7 bottles. Brands that Rick took with him can also be represented with a pair of numbers (o,t) in: (0,7), (1,6),(2,5),(3,4),(4,3),(5,2),(6,1),(7,0). For example a pair (2,5) means Rick walked away with 5 Thums up bottles and 2 other bottles.
Combine that with every scenario Nick could create.
Consider the case Nick took 2 Thums up bottles. The basket is now a pair (15,9). What is left inside the basket after Rick walks away are the pairs of numbers you get after subtracting each pair of numbers that tell you with what Rick could have walked away from the current basket content (15,9). Thus you have
(15,9)-{(0,7), (1,6),(2,5),(3,4),(4,3),(5,2),(6,1),(7,0)}
giving you the possible basket content described with one of the pairs
(15,2), (14,3), (13,4),(12,5),(11,6),(10,7),(9,8),(8,9).
Similarly, if after Nick walked away leaving the basket described with a pair (14,10), after Rick picks its drinks out of the basket, the content of the basket could be described with one of the pairs:
(14,10)-{(0,7), (1,6),(2,5),(3,4),(4,3),(5,2),(6,1),(7,0)},
namely
(14,3), (13,4), (12,5),(11,6),(10,7),(9,8),(8,9),(7,10).
Considering the third scenario after Nick made its pick, (13,11), and combining that with possible Ricks choices of drinks, the content of the basket could be described with one of the following pairs of numbers:
(13,4), (12,5),(11,6),(10,7),(9,8),(8,9),(7,10),(6,11).
All in all, after Nick and Rick made their picks the basket would contain 17 bottles in total, but content could be either one of the following:
(15,2)
(14,3)
(13,4)
(12,5)
(11,6)
(10,7)
(9,8)
(8,9)
(7,10)
(6,11)
Certain basket content can turn up in more than one way. To be precise
(15,2) 1 way
(14,3) 2 ways
(13,4) 3 ways
(12,5) 3 ways
(11,6) 3 ways
(10,7) 3 ways
(9,8) 3 ways
(8,9) 3 ways
(7,10) 2 ways
(6,11) 1 way
Case (15,2) can occur in only one way: Nick taking 2 Thums up bottles form basket (15,11) AND Rick taking 7 Thums up bottles out of the basket (15,9). Now calculate the probability:
The case (14,3) can occur in two ways: Nick taking 2 Thums up bottles form basket (15,11) AND Rick taking 'only' 6 Thums up bottles out of the basket (15,9) OR Nick taking 1 Thums up bottle out of (15,11) basket AND Rick taking 7 Thums up bottles out of (14,10) basket.
(13,4) can turn up in three scenarios: Nick taking 2 Thums up out of basket (15,11) AND Rick taking 5 of them out of basket (15,9) OR Nick taking 1 Thums up out of basket (15,11) AND Rick taking 6 of them out of basket (14,10) OR Nick taking 0 Thums up bottles from basket (15,11) AND Rick taking 7 of them out of basket (13,11).
And so on.
Those are the hypothesis and their probabilities just before Sam comes along. Now Sam can take two bottles, describing his pick with one of the pairs of numbers (0,2),(1,1), (2,0). Now if his pick were to be (2,0), meaning he didn't take a Thums up bottle there's no way he could return Thums up bottle back into the basket. So probability is 0. If his pick was (1,1) the probability of him returning the Thums up bottle is 0.5. And of course in case (0,2) he would return Thums up bottle with probability 1.
The thing is that probability of each pick Sam could make depends on the content of the basket.
For example, if Sam shows up and the basket is (15,2) then the probabilities for his picks are
So in this case the probability of Sam returning Thums up bottle would be
Now you'd have to apply the probability of actually having the basket (15,2) meaning you'd have to multiply the result just above with the probability
Do that for every basket content case and sum up the numbers and you get the result.