Try it yourself · Class 12 Maths · Probability

Conditional probability and Bayes' theorem: see P(B) and P(A given B) as areas

Bayes’ theorem turns a chance of given into a chance of given . The simulation draws a box of area 1 and the matching tree: the total chance of is the sum of two areas, and is one of them as a share of that total.

The box has area 1. Its width splits as and , and in each part the bottom share is . is the -and- area divided by all of the area.

The simulation needs JavaScript; everything it shows is explained below.

What to change

  • P(A): from 0 to 1 in steps of 0.01 (starts at 0.30).
  • P(B given A): from 0 to 1 in steps of 0.01 (starts at 0.90).
  • P(B given not A): from 0 to 1 in steps of 0.01 (starts at 0.20).

What to watch

  • At 0.30, 0.90, 0.20: = 0.270, = 0.410, so = 0.659 and = 0.341.
  • At 0.01, 0.99, 0.05: = 0.059, yet is only 0.167, because is rare.
  • At 0.50, 0.80, 0.80: is equally likely given or not, so = 0.800 and = 0.500, the same as .
  • At 0.50, 0.80, 0.20: = 0.500 and = 0.800.

The formula

All values are chances between 0 and 1; means not . The bottom of the fraction is , the total probability of .

Try these questions

Work each one out with the simulation, tap to see the answer, then try the chapter quiz.

  1. CBSE

    Bag I contains red and black balls and Bag II contains red and black balls. One ball is transferred from Bag I to Bag II and then a ball is drawn from Bag II. The ball so drawn is found to be red in colour. Find the probability that the transferred ball is black.
    Show the answer
  2. CBSE 2026

    Out of two bags, bag I contains 3 red and 4 white balls and bag II contains 8 red and 6 white balls. A die is thrown. If it shows a number less than 3 then a ball is drawn at random from bag I, otherwise a ball is drawn at random from bag II. Find the probability that the ball drawn from one of the bags is a red ball.
    Show the answer
    11/21
  3. Our question

    Bag holds red and blue balls, and bag holds red and blue balls. A bag is chosen at random and a ball is drawn from it. The probability that the ball is red is
    Show the answer
    (D)

More to try in Probability

Every simulation in the Lab