Class 12 Maths, Worked in Full Past papersGet updates
Chapter 13 · Probability

Example 22: Four boxes of coloured balls: black ball from box III, P=156947P = \frac{156}{947}

ExamplesBayes' theorem · Miscellaneous Examples
The question

Coloured balls are distributed in four boxes as shown in the following table:

BoxColour
BlackWhiteRedBlue
I3456
II2222
III1231
IV4315
Exam answer

Let E1,E2,E3,E4E_1, E_2, E_3, E_4⁠: box I, II, III, IV is selected, and AA⁠: a black ball is drawn.

E1,E2,E3,E4E_1, E_2, E_3, E_4 form a partition of the sample space (exactly one box is selected).

The box is selected at random, so P(Ei)=14P(E_i) = \frac14⁠, i=1,2,3,4i = 1, 2, 3, 4⁠.

The boxes have 18, 8, 7 and 13 balls, so P(A∣E1)=318P(A|E_1) = \frac{3}{18}⁠, P(A∣E2)=28P(A|E_2) = \frac28⁠, P(A∣E3)=17P(A|E_3) = \frac17 and P(A∣E4)=413P(A|E_4) = \frac{4}{13}⁠.

By the theorem of total probability,

P(A)=P(E1)P(A∣E1)+P(E2)P(A∣E2)+P(E3)P(A∣E3)+P(E4)P(A∣E4)=14⋅318+14⋅28+14⋅17+14⋅413=124+116+128+113=1824368+2734368+1564368+3364368=9474368\begin{aligned} P(A) &= P(E_1)P(A|E_1) \\ &\quad + P(E_2)P(A|E_2) \\ &\quad + P(E_3)P(A|E_3) \\ &\quad + P(E_4)P(A|E_4) \\ &= \frac14\cdot\frac{3}{18} + \frac14\cdot\frac28 \\ &\quad + \frac14\cdot\frac17 + \frac14\cdot\frac{4}{13} \\ &= \frac{1}{24} + \frac{1}{16} \\ &\quad + \frac{1}{28} + \frac{1}{13} \\ &= \frac{182}{4368} + \frac{273}{4368} \\ &\quad + \frac{156}{4368} + \frac{336}{4368} \\ &= \frac{947}{4368} \end{aligned}

By Bayes' theorem,

P(E3∣A)=P(E3)P(A∣E3)P(A)=128÷9474368=1564368÷9474368\begin{aligned} P(E_3|A) &= \frac{P(E_3)P(A|E_3)}{P(A)} \\ &= \frac{1}{28} \div \frac{947}{4368} \\ &= \frac{156}{4368} \div \frac{947}{4368} \end{aligned}

∴\therefore The probability that the black ball is from box III is 156947≈0.165\dfrac{156}{947} \approx 0.165⁠.

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?

The one idea this problem is built on

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: 318\frac{3}{18}⁠, 28\frac28⁠, 17\frac17⁠, 413\frac{4}{13}⁠. 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, to find, and the plan
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: P(E3∣A)P(E_3|A)⁠.
Plan
(1) Name the events. (2) Count each box's balls to get P(A∣Ei)P(A|E_i)⁠. (3) Total probability for P(A)P(A)⁠. (4) Bayes' theorem; give the decimal.

Basics you need

1Reading the table

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

2Adding fractions

The lowest common denominator of 24, 16, 28 and 13 is 4368. Basics: working with fractions

3Theorem of total probability (Section 13.5.2)

P(A)=∑P(Ei)P(A∣Ei)P(A) = \sum P(E_i)P(A|E_i) over the partition. Lesson: total probability and Bayes' theorem

4Bayes' theorem (Section 13.5)

P(E3∣A)=P(E3)P(A∣E3)P(A)P(E_3|A) = \frac{P(E_3)P(A|E_3)}{P(A)}⁠. Lesson: Bayes' theorem

Solution

  1. Name the events

    Let

    • AA⁠: a black ball is drawn;
    • E1E_1⁠, E2E_2⁠, E3E_3⁠, E4E_4⁠: box I, II, III, IV is selected, respectively.

    E1,…,E4E_1, \ldots, E_4 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' theorem
  2. The probabilities from the table

    Each box is selected with probability P(Ei)=14P(E_i) = \frac14⁠. Adding along each row, the boxes hold

    I: 3+4+5+6=18,II: 2+2+2+2=8,III: 1+2+3+1=7,IV: 4+3+1+5=13\begin{aligned} \text{I: } & 3 + 4 + 5 + 6 = 18, \\ \text{II: } & 2 + 2 + 2 + 2 = 8, \\ \text{III: } & 1 + 2 + 3 + 1 = 7, \\ \text{IV: } & 4 + 3 + 1 + 5 = 13 \end{aligned}

    balls, of which 3, 2, 1 and 4 are black. So

    P(A∣E1)=318,P(A∣E2)=28,P(A∣E3)=17,P(A∣E4)=413.\begin{aligned} P(A|E_1) &= \frac{3}{18}, \quad P(A|E_2) = \frac28, \\ P(A|E_3) &= \frac17, \quad P(A|E_4) = \frac{4}{13}. \end{aligned}
    "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.
    P=favourabletotalP = \frac{\text{favourable}}{\text{total}}⁠. Basics: the classical definition
  3. The chance of a black ball: total probability

    By the theorem of total probability,

    P(A)=P(E1)P(A∣E1)+P(E2)P(A∣E2)+P(E3)P(A∣E3)+P(E4)P(A∣E4)=14⋅318+14⋅28+14⋅17+14⋅413=124+116+128+113.\begin{aligned} P(A) &= P(E_1)P(A|E_1) \\ &\quad + P(E_2)P(A|E_2) \\ &\quad + P(E_3)P(A|E_3) \\ &\quad + P(E_4)P(A|E_4) \\ &= \frac14\cdot\frac{3}{18} + \frac14\cdot\frac28 \\ &\quad + \frac14\cdot\frac17 + \frac14\cdot\frac{4}{13} \\ &= \frac{1}{24} + \frac{1}{16} + \frac{1}{28} + \frac{1}{13}. \end{aligned}

    The lowest common denominator is 4368=24×3×7×134368 = 2^4 \times 3 \times 7 \times 13⁠, so

    P(A)=1824368+2734368+1564368+3364368=9474368.\begin{aligned} P(A) &= \frac{182}{4368} + \frac{273}{4368} \\ &\quad + \frac{156}{4368} + \frac{336}{4368} \\ &= \frac{947}{4368}. \end{aligned}
    start box ball multiply along the path box E₁: box I A: black 1/4 × 3/18 = 1/24 A′: other 1/4 × 15/18 E₂: box II A: black 1/4 × 2/8 = 1/16 A′: other 1/4 × 6/8 E₃: box III A: black 1/4 × 1/7 = 1/28 A′: other 1/4 × 6/7 E₄: box IV A: black 1/4 × 4/13 = 1/13 A′: other 1/4 × 9/13 1/4 3/18 15/18 1/4 2/8 6/8 1/4 1/7 6/7 1/4 4/13 9/13
    The tree for Example 22. The black paths have products 124\frac{1}{24}⁠, 116\frac{1}{16}⁠, 128\frac{1}{28} (box III, rose) and 113\frac{1}{13}⁠; together 9474368\frac{947}{4368}⁠.
    The four black paths cannot happen together, so they add. Each product simplifies first: 14⋅318=372=124\frac14\cdot\frac{3}{18} = \frac{3}{72} = \frac{1}{24}⁠, 14⋅28=232=116\frac14\cdot\frac28 = \frac{2}{32} = \frac{1}{16}⁠, 14⋅17=128\frac14\cdot\frac17 = \frac{1}{28}⁠, 14⋅413=113\frac14\cdot\frac{4}{13} = \frac{1}{13}⁠. Then 4368÷24=1824368 \div 24 = 182⁠, 4368÷16=2734368 \div 16 = 273⁠, 4368÷28=1564368 \div 28 = 156 and 4368÷13=3364368 \div 13 = 336⁠.
    Multiply along a path, add the paths. Basics: tree diagrams
  4. Box III, given black: Bayes' theorem

    By Bayes' theorem,

    P(E3∣A)=P(E3)P(A∣E3)P(A)=1564368÷9474368=156947≈0.165.\begin{aligned} P(E_3|A) &= \frac{P(E_3)P(A|E_3)}{P(A)} \\ &= \frac{156}{4368} \div \frac{947}{4368} \\ &= \frac{156}{947} \approx 0.165. \end{aligned}
    The top is the box III path, 128=1564368\frac{1}{28} = \frac{156}{4368}⁠; the bottom is all black draws. The common denominator cancels. 947 is prime, so 156947\frac{156}{947} does not simplify. The book writes the same fraction and gives its value as 0.165; the exact value is 156947\frac{156}{947}⁠, and 0.16473…0.16473\ldots rounds to 0.165.
    Bayes' theorem: one path over all the paths. Lesson: Bayes' theorem
  5. A shortcut: the 14\frac14 cancels

    Every box has the same P(Ei)=14P(E_i) = \frac14⁠, so it cancels from the top and the bottom of Bayes' formula:

    P(E3∣A)=P(A∣E3)∑i=14P(A∣Ei)=17÷(318+28+17+413)=1561092÷9471092=156947.\begin{aligned} P(E_3|A) &= \frac{P(A|E_3)}{\sum_{i=1}^{4} P(A|E_i)} \\ &= \frac17 \div \Big(\frac{3}{18} + \frac28 + \frac17 + \frac{4}{13}\Big) \\ &= \frac{156}{1092} \div \frac{947}{1092} = \frac{156}{947}. \end{aligned}
    With equal priors, each box's posterior is just its own P(A∣Ei)P(A|E_i) divided by the sum of all of them. Here 318+28+17+413=182+273+156+3361092=9471092\frac{3}{18} + \frac28 + \frac17 + \frac{4}{13} = \frac{182 + 273 + 156 + 336}{1092} = \frac{947}{1092}⁠.
    A factor common to every term cancels. Basics: working with fractions
Result

The probability that the black ball was drawn from box III is 156947≈0.165\frac{156}{947} \approx 0.165⁠.

(Textbook answer: 0.1650.165⁠.)

Check it with numbers

Picture 4368 tries, 1092 with each box. Black comes up 318\frac{3}{18} of the time from box I (182 times), 28\frac28 from box II (273), 17\frac17 from box III (156) and 413\frac{4}{13} from box IV (336). That is 182+273+156+336=947182 + 273 + 156 + 336 = 947 black balls, 156 of them from box III: 156947≈0.1647\frac{156}{947} \approx 0.1647⁠.

All four posteriors: box I 182947\frac{182}{947}⁠, II 273947\frac{273}{947}⁠, III 156947\frac{156}{947}⁠, IV 336947\frac{336}{947}⁠; they add to 1.

Common mistakes
  1. Counting black balls only. Box III has 1 of the 3+2+1+4=103 + 2 + 1 + 4 = 10 black balls, but 110\frac{1}{10} 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.
  2. Using the wrong box total. Add the whole row: box III has 1+2+3+1=71 + 2 + 3 + 1 = 7 balls.
  3. Stopping at the decimal. The exact answer is 156947\frac{156}{947}⁠; 0.165 is its value to three decimal places.
What to take away
  1. When the causes are equally likely, the posterior of each is proportional to P(A∣Ei)P(A|E_i)⁠.
  2. Read a table row by row: the row total is the denominator of P(A∣Ei)P(A|E_i)⁠.
  3. The same set-up with marbles: Miscellaneous Exercise, Question 6.

Every fact used, and where it comes from

FactUsed inSource
Partition of the sample spaceStep 1Section 13.5.1 (Lesson: Bayes' theorem)
P=favourabletotalP = \frac{\text{favourable}}{\text{total}}Step 2Class XI, Probability (Basics: the classical definition)
Theorem of total probabilityStep 3Section 13.5.2 (Lesson: total probability)
Bayes' theoremSteps 4, 5Section 13.5 (Examples 22 to 24)
Common denominators; cancelling a common factorSteps 3, 5Arithmetic (Basics: working with fractions)
Found an error, or want more?

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 →