Math Lab
Home/Class XII/Ch 13/Law of total probability

Law of total probability

Often we cannot compute P(A)P(A) directly, but we know P(ABi)P(A \mid B_i) for various BiB_i's and the P(Bi)P(B_i)'s. The law of total probability combines these into P(A)P(A).

Statement

Let E1,E2,,EnE_1, E_2, \ldots, E_n be mutually exclusive and exhaustive events , i.e. they partition the sample space, with P(Ei)>0P(E_i) > 0 for each ii. Then for any event AA: P(A)=i=1nP(AEi)P(Ei).P(A) = \sum_{i=1}^n P(A \mid E_i)\,P(E_i).

Why it works

Since the EiE_i's partition the sample space, AA can be decomposed: A=(AE1)(AE2)(AEn)A = (A \cap E_1) \cup (A \cap E_2) \cup \cdots \cup (A \cap E_n), with the pieces disjoint. So P(A)=iP(AEi)=iP(AEi)P(Ei)P(A) = \sum_i P(A \cap E_i) = \sum_i P(A \mid E_i) P(E_i), using the multiplication rule.

When to use it

The law applies whenever you can identify a natural partition of "how AA might come about." Each EiE_i is one "way." Typical settings:

  • Several urns/boxes: pick a box, then draw from it.
  • Different defective rates: items from machine ii with defect rate pip_i, fraction wiw_i from each.
  • Medical tests: disease present or not (the partition), test positive or not (the event AA).
  • Communication: signal sent (partition: which message), signal received (event AA).

Worked examples

Example 1. Box 1 has 3 red, 7 blue. Box 2 has 5 red, 5 blue. A box is chosen at random, then a ball is drawn from it. Find P(red)P(\text{red}).

Partition: E1=E_1 = box 1, E2=E_2 = box 2. P(E1)=P(E2)=1/2P(E_1) = P(E_2) = 1/2.

P(redE1)=3/10P(\text{red} \mid E_1) = 3/10. P(redE2)=5/10=1/2P(\text{red} \mid E_2) = 5/10 = 1/2.

P(red)=(3/10)(1/2)+(1/2)(1/2)=3/20+5/20=8/20=2/5P(\text{red}) = (3/10)(1/2) + (1/2)(1/2) = 3/20 + 5/20 = 8/20 = 2/5.

Example 2. A factory has three machines M1,M2,M3M_1, M_2, M_3 producing 30%,50%,20%30\%, 50\%, 20\% of total output, with defect rates 1%,2%,3%1\%, 2\%, 3\%. A random item is picked. Find P(defective)P(\text{defective}).

P=0.30.01+0.50.02+0.20.03=0.003+0.010+0.006=0.019P = 0.3 \cdot 0.01 + 0.5 \cdot 0.02 + 0.2 \cdot 0.03 = 0.003 + 0.010 + 0.006 = 0.019.

So 1.9%1.9\% of items are defective.

Example 3. A disease affects 1%1\% of a population. A test detects it correctly 95%95\% of the time when present and falsely positives 2%2\% of the time when absent. Find P(test positive)P(\text{test positive}).

Partition: D=D = has disease, Dc=D^c = doesn't. P(D)=0.01P(D) = 0.01, P(Dc)=0.99P(D^c) = 0.99.

P(posD)=0.95P(\text{pos} \mid D) = 0.95. P(posDc)=0.02P(\text{pos} \mid D^c) = 0.02.

P(pos)=0.950.01+0.020.99=0.0095+0.0198=0.0293P(\text{pos}) = 0.95 \cdot 0.01 + 0.02 \cdot 0.99 = 0.0095 + 0.0198 = 0.0293.

Example 4. A coin is selected at random from a jar of 5 coins: 2 are fair, 3 are biased with P(H)=0.8P(H) = 0.8. The selected coin is flipped. Find P(H)P(H).

P(fair)=2/5P(\text{fair}) = 2/5, P(biased)=3/5P(\text{biased}) = 3/5. P(Hfair)=1/2P(H \mid \text{fair}) = 1/2, P(Hbiased)=0.8=4/5P(H \mid \text{biased}) = 0.8 = 4/5.

P(H)=(2/5)(1/2)+(3/5)(4/5)=1/5+12/25=5/25+12/25=17/25P(H) = (2/5)(1/2) + (3/5)(4/5) = 1/5 + 12/25 = 5/25 + 12/25 = 17/25.

Example 5. A bag has 4 red, 6 blue balls. Two balls are drawn one after another without replacement. Find the probability that the second ball is red.

Partition by colour of first ball: E1=E_1 = 1st red, E2=E_2 = 1st blue. P(E1)=4/10=2/5P(E_1) = 4/10 = 2/5. P(E2)=6/10=3/5P(E_2) = 6/10 = 3/5.

P(2nd redE1)=3/9=1/3P(\text{2nd red} \mid E_1) = 3/9 = 1/3. P(2nd redE2)=4/9P(\text{2nd red} \mid E_2) = 4/9.

P(2nd red)=(2/5)(1/3)+(3/5)(4/9)=2/15+12/45=6/45+12/45=18/45=2/5P(\text{2nd red}) = (2/5)(1/3) + (3/5)(4/9) = 2/15 + 12/45 = 6/45 + 12/45 = 18/45 = 2/5.

(Same as P(1st red)P(\text{1st red}) , a deep symmetry of sampling without replacement.)

Example 6. A student answers an MCQ. With probability 0.70.7 she knows the answer; otherwise she guesses uniformly among 4 options. Find P(correct)P(\text{correct}).

P(know)=0.7P(\text{know}) = 0.7. P(correctknow)=1P(\text{correct} \mid \text{know}) = 1. P(correctguess)=1/4P(\text{correct} \mid \text{guess}) = 1/4.

P(correct)=0.71+0.30.25=0.7+0.075=0.775P(\text{correct}) = 0.7 \cdot 1 + 0.3 \cdot 0.25 = 0.7 + 0.075 = 0.775.

Try it yourself

  1. Two urns: U1 has 3R/2B, U2 has 4R/4B. Choose urn uniformly, then a ball. Find P(R)P(R).
  2. Three urns: U1 has 1R/4B, U2 has 3R/2B, U3 has 2R/3B. Pick urn uniformly, then a ball. P(R)P(R).
  3. Coin probability of heads is 1/2,1/31/2, 1/3, or 1/41/4 with equal probabilities. Flip the chosen coin. Find P(H)P(H).
  4. A factory makes light bulbs at three machines (30%, 45%, 25%) with defect rates (3%, 1%, 2%). P(defective)P(\text{defective}).
  5. A car insurance company classifies drivers as low, medium, high risk: 60%,30%,10%60\%, 30\%, 10\%. Probability of accident in a year: 0.01,0.05,0.200.01, 0.05, 0.20. Probability a random driver has an accident.
  6. A box has 5 white, 6 black balls. Two drawn without replacement. Find P(2nd is white)P(\text{2nd is white}).
  7. Two coins: one fair, one with P(H)=0.6P(H) = 0.6. Choose at random and flip twice. Probability both flips are heads.
  8. Toss a die. If even, draw from urn A (3 red/2 blue); if odd, urn B (1 red/4 blue). P(red)P(\text{red}).
  9. A student answers a question. Probability she knows: 0.60.6. Probability of correct if guesses: 1/31/3. Find P(correct)P(\text{correct}).
  10. 5 cards, 3 face cards 2 number cards. Choose without replacement two cards. P(2nd is face)P(\text{2nd is face}).
  11. A bag contains 5 W and 4 B. A ball is drawn and not replaced; then a 2nd is drawn. P(2nd is white)P(\text{2nd is white}).
  12. A test for a rare condition affecting 0.5%0.5\% of population: sensitivity 98%98\%, specificity 95%95\%. P(test positive)P(\text{test positive}).
  13. Three boxes: contains coins with respective probabilities of being authentic 0.9,0.85,0.70.9, 0.85, 0.7. Choose box uniformly; draw a coin. Find P(authentic)P(\text{authentic}).
  14. Two coins: a fair one and a coin with P(H)=pP(H) = p. Pick at random and flip. Probability of heads is observed to be 0.60.6. Find pp.

Pitfalls and tricks

  • Verify the partition. The EiE_i's must be mutually exclusive AND exhaustive.
  • Don't forget any EiE_i. Missing a partition piece gives the wrong total.
  • Each conditional P(AEi)P(A \mid E_i) must be computed in the world where EiE_i has occurred.
  • The formula reads: prior × likelihood, summed. P(Ei)P(E_i) is the "prior", P(AEi)P(A \mid E_i) is the "likelihood."
  • Tree diagrams are excellent for two-level partitions.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Total probability
6 questions · pick the best answer
Q1

Total probability formula partition is

Q2

If E1,E2E_1, E_2 partition with P(E1)=0.3,P(E2)=0.7P(E_1) = 0.3, P(E_2) = 0.7, and P(AE1)=0.5,P(AE2)=0.2P(A|E_1) = 0.5, P(A|E_2) = 0.2, then P(A)=P(A) =

Q3

Box A 3R/7B, Box B 5R/5B. Random box, draw red. P(R)=P(R) =

Q4

A medical test: P(+D)=0.99,P(+Dˉ)=0.05,P(D)=0.01P(+|D) = 0.99, P(+|\bar D) = 0.05, P(D) = 0.01. P(+)=P(+) =

Q5

In sampling without replacement, P(2nd red)=P(\text{2nd red}) =

Q6

Total probability requires