girgit.org

Probability

Adding up every route: partitions and total probability

The big ideaIf an event A can happen by several separate routes that between them cover everything, its chance is the sum over the routes of (chance of the route) × (chance of A on that route): \( \text{P}(A) = \sum_j \text{P}(E_j)\,\text{P}(A \mid E_j) \).

In simple words

Your train can be late on a rainy day or on a dry day. Every day is one or the other, never both. So the chance the train is late is the chance of "rainy and late" plus the chance of "dry and late". Work out each road to "late", then add the roads together.

A reverse question, and a tool for it

Here is the kind of question the rest of this chapter is about. Bag I has 3 red and 2 blue balls; Bag II has 1 red and 4 blue. You toss a coin to choose a bag, then draw a ball. It is easy to find P(red | Bag I). But suppose the ball comes out red: what is the chance it came from Bag I? That is a reverse probability, from the result back to the cause. To answer it (with Bayes' theorem, next page) you first need P(red) itself, and for that you need two ideas: a partition and the theorem of total probability.

Partition of a sample space

Events \( E_1, E_2, \dots, E_n \) form a partition of the sample space S if

  1. they are pairwise disjoint: \( E_i \cap E_j = \phi \) whenever \( i \ne j \) (no two overlap);
  2. they are exhaustive: \( E_1 \cup E_2 \cup \dots \cup E_n = S \) (together they cover everything);
  3. each has a non-zero chance: \( \text{P}(E_i) > 0 \) for every i.

So exactly one of them happens every time. Examples:

  • Any event E with \( 0 < \text{P}(E) < 1 \) and its complement E′. (Rainy day, dry day.)
  • For any two events E and F, the four pieces \( E \cap F,\ E \cap F',\ E' \cap F,\ E' \cap F' \) of the Venn diagram (leaving out any piece with zero chance).
  • "Made on line 1", "made on line 2", "made on line 3" for every phone from a factory with three lines.

A sample space can be partitioned in many ways; a partition is not unique. Pick the one that matches the story, usually "which cause or route was it?".

Try it before the step-by-step working: guess, then change how often it rains and watch the answer slide between the two late rates.

The tree, step by step

It rains on 30% of July days in Mumbai. On a rainy day the local train is late with probability 0.6; on a dry day, with probability 0.2. What is the chance the train is late on a July day picked at random?

  1. Draw the first split: the partition. From a starting point draw two branches, "Rain" with 0.3 and "Dry" with 0.7. These add up to 1, as the branches of a partition must.
  2. From each branch, draw the second split. From "Rain" draw "Late" (0.6) and "On time" (0.4). From "Dry" draw "Late" (0.2) and "On time" (0.8). These are conditional probabilities: P(Late | Rain), P(Late | Dry) and so on. Each pair again adds to 1.
  3. Multiply along each path. Rain then Late: \( 0.3 \times 0.6 = 0.18 \). Dry then Late: \( 0.7 \times 0.2 = 0.14 \). (This is the multiplication rule: P(Rain ∩ Late) = P(Rain) P(Late | Rain).)
  4. Add the paths that end where you want. Two paths end in "Late": \( \text{P}(\text{Late}) = 0.18 + 0.14 = 0.32 \).

Note the trap: the answer is not the plain average of 0.6 and 0.2, which is 0.4. Dry days are much more common, so their 0.2 counts for more. Total probability is a weighted average.

The theorem of total probability

Let \( \{E_1, E_2, \dots, E_n\} \) be a partition of S with each \( \text{P}(E_j) \ne 0 \), and let A be any event. Then

\[ \text{P}(A) = \text{P}(E_1)\,\text{P}(A \mid E_1) + \text{P}(E_2)\,\text{P}(A \mid E_2) + \dots + \text{P}(E_n)\,\text{P}(A \mid E_n) = \sum_{j=1}^{n} \text{P}(E_j)\,\text{P}(A \mid E_j) \]

Why it is true. Since the \( E_j \) cover S, \( A = A \cap S = (A \cap E_1) \cup (A \cap E_2) \cup \dots \cup (A \cap E_n) \). Each \( A \cap E_j \) lies inside \( E_j \), and the \( E_j \) don't overlap, so these pieces don't overlap either. Add their probabilities, then write each one with the multiplication rule as \( \text{P}(A \cap E_j) = \text{P}(E_j)\,\text{P}(A \mid E_j) \). That is the theorem.

Worked examples

  1. The two bags. P(red) \( = \frac12 \times \frac35 + \frac12 \times \frac15 = \frac{3}{10} + \frac{1}{10} = \frac25 \).
  2. Three factory lines. A phone factory makes 50% of its phones on line 1, 30% on line 2 and 20% on line 3. Their defect rates are 1%, 2% and 3%. P(a phone is defective) \( = 0.5 \times 0.01 + 0.3 \times 0.02 + 0.2 \times 0.03 = 0.005 + 0.006 + 0.006 = 0.017 \).
  3. Moving a ball (JEE favourite). Bag I has 2 red and 3 black balls; Bag II has 3 red and 3 black. One ball is moved, unseen, from Bag I to Bag II, then a ball is drawn from Bag II. Partition by what was moved. If red was moved (chance \( \frac25 \)), Bag II has 4 red of 7. If black (chance \( \frac35 \)), it has 3 red of 7. P(red) \( = \frac25 \times \frac47 + \frac35 \times \frac37 = \frac{8}{35} + \frac{9}{35} = \frac{17}{35} \).

Don't mix these up

  • The \( E_j \) must be a true partition: no overlaps, no gaps. Check that the \( \text{P}(E_j) \) add up to 1.
  • The \( \text{P}(A \mid E_j) \) do not need to add up to 1. In the factory, 0.01 + 0.02 + 0.03 = 0.06, and that is fine.

Try it. 40% of a coaching centre's students are in the morning batch and 60% in the evening batch. 70% of the morning batch and 50% of the evening batch clear a test. What fraction of all students clear it?

Answer
\( 0.4 \times 0.7 + 0.6 \times 0.5 = 0.28 + 0.30 = 0.58 \), so 58%.

Words to know

Partition
Events that never overlap, cover all of S, and each have a non-zero chance.
Pairwise disjoint
No two of the events share an outcome.
Exhaustive
Together they cover the whole sample space.
Theorem of total probability
P(A) = Σ P(Eⱼ) P(A|Eⱼ) over a partition.
Reverse probability
The chance of a cause, worked out from the result it produced.

60% of a town's buses are electric. An electric bus is on time 90% of the time; any other bus, 70%. What is P(a random bus is on time)?

  1. 0.80
  2. 0.82
  3. 0.54

Which of these is a partition of the sample space of one die roll?

  1. {1, 2, 3}, {3, 4, 5, 6}
  2. {1}, {2, 3}, {4, 5, 6}
  3. {1, 2}, {3, 4}, {5}

In the theorem of total probability, which numbers must add up to 1?

  1. P(E₁), P(E₂), …, P(Eₙ)
  2. P(A|E₁), P(A|E₂), …, P(A|Eₙ)
  3. P(A ∩ E₁), …, P(A ∩ Eₙ)