Example 22: Four boxes of coloured balls: black ball from box III,
Coloured balls are distributed in four boxes as shown in the following table:
| Box | Colour | |||
|---|---|---|---|---|
| Black | White | Red | Blue | |
| I | 3 | 4 | 5 | 6 |
| II | 2 | 2 | 2 | 2 |
| III | 1 | 2 | 3 | 1 |
| IV | 4 | 3 | 1 | 5 |
Let : box I, II, III, IV is selected, and : a black ball is drawn.
form a partition of the sample space (exactly one box is selected).
The box is selected at random, so , .
The boxes have 18, 8, 7 and 13 balls, so , , and .
By the theorem of total probability,
By Bayes' theorem,
The probability that the black ball is from box III is .
Want the reason behind every step, the basics and the checks?
A box is selected at random and then a ball is randomly drawn from the selected box. The colour of the ball is black, what is the probability that ball drawn is from the box III?
Only the black-ball column matters, divided by each box's size. Each box is equally likely, so each box's weight in the answer is its chance of giving black: , , , . Box III's share of the total of these four is the answer. Box III has only one black ball, but it is also the smallest box.
- Given
- The table of balls in boxes I to IV. A box is chosen at random, a ball is drawn from it at random, and the ball is black.
- To find
- The probability that the ball came from box III: .
- Plan
- (1) Name the events. (2) Count each box's balls to get . (3) Total probability for . (4) Bayes' theorem; give the decimal.
Basics you need
A row is a box; adding a row gives the number of balls in that box. The Black column gives the favourable balls. Basics: the classical definition
The lowest common denominator of 24, 16, 28 and 13 is 4368. Basics: working with fractions
over the partition. Lesson: total probability and Bayes' theorem
Solution
Name the events
Let
- : a black ball is drawn;
- , , , : box I, II, III, IV is selected, respectively.
form a partition of the sample space: exactly one box is selected, and each can be.
The box is the hidden cause, the black colour is the observed effect, and the question asks for the probability of the cause "box III" given the effect.A partition: pairwise disjoint, exhaustive, nonzero probabilities. Lesson: Bayes' theoremThe probabilities from the table
Each box is selected with probability . Adding along each row, the boxes hold
balls, of which 3, 2, 1 and 4 are black. So
"At random" gives the four boxes equal chances. Once a box is chosen, every ball in it is equally likely, so the chance of black is (black balls in the box) ÷ (all balls in the box). The boxes have different sizes, which is why the colour counts alone are not enough.The chance of a black ball: total probability
By the theorem of total probability,
The lowest common denominator is , so
The tree for Example 22. The black paths have products , , (box III, rose) and ; together . The four black paths cannot happen together, so they add. Each product simplifies first: , , , . Then , , and .Multiply along a path, add the paths. Basics: tree diagramsBox III, given black: Bayes' theorem
By Bayes' theorem,
The top is the box III path, ; the bottom is all black draws. The common denominator cancels. 947 is prime, so does not simplify. The book writes the same fraction and gives its value as 0.165; the exact value is , and rounds to 0.165.Bayes' theorem: one path over all the paths. Lesson: Bayes' theoremA shortcut: the cancels
Every box has the same , so it cancels from the top and the bottom of Bayes' formula:
With equal priors, each box's posterior is just its own divided by the sum of all of them. Here .A factor common to every term cancels. Basics: working with fractions
The probability that the black ball was drawn from box III is .
(Textbook answer: .)
Picture 4368 tries, 1092 with each box. Black comes up of the time from box I (182 times), from box II (273), from box III (156) and from box IV (336). That is black balls, 156 of them from box III: .
All four posteriors: box I , II , III , IV ; they add to 1.
- Counting black balls only. Box III has 1 of the black balls, but is wrong: the boxes have different sizes and are chosen with equal probability, so a ball in a small box is more likely to be drawn.
- Using the wrong box total. Add the whole row: box III has balls.
- Stopping at the decimal. The exact answer is ; 0.165 is its value to three decimal places.
- When the causes are equally likely, the posterior of each is proportional to .
- Read a table row by row: the row total is the denominator of .
- The same set-up with marbles: Miscellaneous Exercise, Question 6.
Every fact used, and where it comes from
| Fact | Used in | Source |
|---|---|---|
| Partition of the sample space | Step 1 | Section 13.5.1 (Lesson: Bayes' theorem) |
| Step 2 | Class XI, Probability (Basics: the classical definition) | |
| Theorem of total probability | Step 3 | Section 13.5.2 (Lesson: total probability) |
| Bayes' theorem | Steps 4, 5 | Section 13.5 (Examples 22 to 24) |
| Common denominators; cancelling a common factor | Steps 3, 5 | Arithmetic (Basics: working with fractions) |
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →