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

Exercise 13.3 · Q2: Two bags: the red ball came from the first bag, P=23P = \frac23

Exercise 13.3Bayes' theorem · Section 13.5
The question

A bag contains 4 red and 4 black balls, another bag contains 2 red and 6 black balls. One of the two bags is selected at random and a ball is drawn from the bag which is found to be red. Find the probability that the ball is drawn from the first bag.

Exam answer

Let E1E_1⁠: the first bag is selected, E2E_2⁠: the second bag is selected, and AA⁠: the ball drawn is red.

E1E_1 and E2E_2 form a partition of the sample space (exactly one bag is selected).

P(E1)=P(E2)=12P(E_1) = P(E_2) = \frac12

P(A∣E1)=48=12P(A|E_1) = \frac{4}{8} = \frac12 and P(A∣E2)=28=14P(A|E_2) = \frac{2}{8} = \frac14

By the theorem of total probability,

P(A)=P(E1)P(A∣E1)+P(E2)P(A∣E2)=12⋅12+12⋅14=14+18=38\begin{aligned} P(A) &= P(E_1)P(A|E_1) \\ &\quad + P(E_2)P(A|E_2) \\ &= \frac12\cdot\frac12 + \frac12\cdot\frac14 \\ &= \frac14 + \frac18 = \frac38 \end{aligned}

By Bayes' theorem,

P(E1∣A)=P(E1)P(A∣E1)P(A)=14÷38=14×83\begin{aligned} P(E_1|A) &= \frac{P(E_1)P(A|E_1)}{P(A)} \\ &= \frac14 \div \frac38 \\ &= \frac14 \times \frac83 \end{aligned}

∴\therefore The probability that the ball is drawn from the first bag is 23\dfrac23⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

We know the result (a red ball) and ask for the cause (which bag). Bayes' theorem turns the question round: of all the ways a red ball can appear, find the share that goes through the first bag. That share is the first bag's path on the tree divided by the total of the red paths, which the theorem of total probability gives.

Given, to find, and the plan
Given
Bag I: 4 red, 4 black. Bag II: 2 red, 6 black. A bag is chosen at random, then a ball is drawn from it; the ball is red.
To find
The probability that the ball came from the first bag, given that it is red: P(E1∣A)P(E_1|A)⁠.
Plan
(1) Name the events; check the partition. (2) Write P(E1)P(E_1)⁠, P(E2)P(E_2)⁠. (3) Count each bag for P(A∣E1)P(A|E_1)⁠, P(A∣E2)P(A|E_2)⁠. (4) Total probability for P(A)P(A)⁠. (5) Bayes' theorem for P(E1∣A)P(E_1|A)⁠.

Basics you need

1Conditional probability (Section 13.2)

P(A∣E)P(A|E) is the chance of AA once EE is known to have happened. For a ball from a known bag, it is the share of that bag's balls with the colour. Lesson: conditional probability

2Theorem of total probability (Section 13.5.2)

For a partition E1,E2E_1, E_2⁠: P(A)=P(E1)P(A∣E1)+P(E2)P(A∣E2)P(A) = P(E_1)P(A|E_1) + P(E_2)P(A|E_2)⁠. Basics: tree diagrams

3Bayes' theorem (Section 13.5)

For a partition E1,E2E_1, E_2 and an event AA with P(A)≠0P(A) \ne 0⁠, P(E1∣A)P(E_1|A) is the E1E_1 path divided by the total: P(E1)P(A∣E1)P(A)\frac{P(E_1)P(A|E_1)}{P(A)}⁠. Lesson: Bayes' theorem

4Dividing fractions

ab÷cd=ab×dc\frac{a}{b} \div \frac{c}{d} = \frac{a}{b} \times \frac{d}{c}⁠. Basics: dividing by a fraction

Solution

  1. Name the events

    Let

    • E1E_1⁠: the first bag is selected;
    • E2E_2⁠: the second bag is selected;
    • AA⁠: the ball drawn is red.

    E1E_1 and E2E_2 form a partition of the sample space: exactly one bag is selected, and each has a nonzero chance.

    The bags are the possible causes, and the colour is the observed result. Bayes' theorem needs the causes to be a partition, so that every red ball came from exactly one of them.
    Partition: pairwise disjoint, exhaustive, nonzero probabilities (Section 13.5.1). Lesson: Bayes' theorem
  2. The chance of each bag, before looking at the ball

    P(E1)=P(E2)=12.P(E_1) = P(E_2) = \frac12.
    "Selected at random" from two bags means each bag is equally likely. These are the probabilities before the colour is known.
    Two equally likely choices: 12\frac12 each. Basics: classical probability
  3. The chance of red from each bag

    The first bag has 4 red balls out of 4+4=84 + 4 = 8⁠; the second has 2 red out of 2+6=82 + 6 = 8⁠. So

    P(A∣E1)=48=12,P(A∣E2)=28=14.\begin{aligned} P(A|E_1) &= \frac{4}{8} = \frac12, \\ P(A|E_2) &= \frac{2}{8} = \frac14. \end{aligned}
    Once the bag is known, the ball is drawn at random from that bag, so the chance of red is the share of red balls in it.
    P(A∣E)P(A|E)⁠: the chance of AA in the situation EE leaves behind. Lesson: conditional probability
  4. The overall chance of a red ball

    Since E1E_1 and E2E_2 form a partition, by the theorem of total probability

    P(A)=P(E1)P(A∣E1)+P(E2)P(A∣E2)=12⋅12+12⋅14=14+18=38.\begin{aligned} P(A) &= P(E_1)P(A|E_1) \\ &\quad + P(E_2)P(A|E_2) \\ &= \frac12\cdot\frac12 + \frac12\cdot\frac14 \\ &= \frac14 + \frac18 = \frac38. \end{aligned}
    start bag chosen ball drawn multiply along the path start E₁: bag I A: red 1/2 × 1/2 = 1/4 A′: black 1/2 × 1/2 = 1/4 E₂: bag II A: red 1/2 × 1/4 = 1/8 A′: black 1/2 × 3/4 = 3/8 1/2 1/2 1/2 1/2 1/4 3/4
    The tree for Question 2. The rose path (first bag, then red) has product 14\frac14⁠; the green path (second bag, then red) has 18\frac18⁠. Together the red paths give P(A)=38P(A) = \frac38⁠.
    A red ball can come about in two ways, through either bag. Each way is a path on the tree: multiply along it, then add the two paths.
    Multiply along a path, add the paths. Basics: tree diagrams
  5. Turn it round with Bayes' theorem

    By Bayes' theorem,

    P(E1∣A)=P(E1)P(A∣E1)P(A)=14÷38=14×83=23.\begin{aligned} P(E_1|A) &= \frac{P(E_1)P(A|E_1)}{P(A)} \\ &= \frac14 \div \frac38 \\ &= \frac14 \times \frac83 = \frac23. \end{aligned}
    The top, P(E1)P(A∣E1)=14P(E_1)P(A|E_1) = \frac14⁠, is the probability of the rose path, "first bag and red". Dividing by P(A)=38P(A) = \frac38 keeps only the outcomes where the ball is red and asks what share of them came from the first bag: this is the definition P(E1∣A)=P(E1∩A)P(A)P(E_1|A) = \frac{P(E_1 \cap A)}{P(A)}⁠.
    Dividing by a fraction is multiplying by its flip. Basics: dividing by a fraction
  6. Does the answer make sense?

    The second bag gets the rest: P(E2∣A)=18÷38=13P(E_2|A) = \frac18 \div \frac38 = \frac13⁠, and 23+13=1\frac23 + \frac13 = 1⁠.

    Before the draw each bag had chance 12\frac12⁠. Seeing red raises the first bag to 23\frac23⁠, because the first bag is twice as rich in red (12\frac12 against 14\frac14⁠).

    Given AA⁠, exactly one of the causes happened, so the updated probabilities of the causes must add to 1. It is a quick check on any Bayes answer.
    P(E1∣A)+P(E2∣A)=1P(E_1|A) + P(E_2|A) = 1 for a partition E1,E2E_1, E_2⁠. Lesson: Bayes' theorem
Result

The probability that the red ball was drawn from the first bag is 23\frac23⁠. (Textbook answer: 23\frac23⁠.)

Check it with numbers

Each bag holds 8 balls and is chosen with chance 12\frac12⁠, so each of the 16 balls is drawn with the same chance, 12×18=116\frac12 \times \frac18 = \frac{1}{16}⁠. There are 4+2=64 + 2 = 6 red balls, and 4 of them are in the first bag. Given red, the ball is one of these 6, so the chance it is from the first bag is 46≈0.6667\frac46 \approx 0.6667⁠, and 23≈0.6667\frac23 \approx 0.6667⁠.

Common mistakes
  1. Answering 12\frac12⁠, the chance of red from the first bag. That is P(A∣E1)P(A|E_1)⁠. The question asks the reverse, P(E1∣A)P(E_1|A)⁠.
  2. Stopping at P(A)=38P(A) = \frac38⁠. P(A)P(A) is only the bottom of Bayes' formula.
  3. Using 12\frac12 for the top. The top is the whole path, P(E1)P(A∣E1)=12⋅12=14P(E_1)P(A|E_1) = \frac12 \cdot \frac12 = \frac14⁠, not P(A∣E1)P(A|E_1) alone.
  4. Thinking the colour cannot change the bag's chance. It can: a red ball is more likely to come from the bag with more red balls.
What to take away
  1. Bayes' theorem in words: the path for your cause, divided by the sum of all the paths that give the result.
  2. When every ball is equally likely overall (here, equal bags of 8), Bayes' theorem agrees with simple counting of the red balls.
  3. The same steps, with percentages, answer Question 3; the result there is an A grade and the causes are where the student lives.

Every fact used, and where it comes from

FactUsed inSource
Partition of a sample spaceStep 1Section 13.5.1 (Lesson: Bayes' theorem)
Equally likely choicesSteps 2, 3Classical probability, Class XI (Basics: classical probability)
Conditional probability P(A∣E)P(A|E)Steps 3, 5Section 13.2 (Lesson: conditional probability)
Theorem of total probabilityStep 4Section 13.5.2 (Lesson: Bayes' theorem)
Bayes' theoremSteps 5, 6Section 13.5; used in Example 16, also with two bags (Examples 15 to 21)
Dividing by a fractionStep 5Arithmetic (Basics: dividing by a fraction)
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 →