Maths4UBETA

Maths4U · Learning together

Trees, total probability and reverse conditioning

← Two-way tables, conditioning and independenceWithout replacement, transfers and changing contents →

Notes

Objective

Weight every route through a mixture and distinguish independence within a group from independence after mixing.

Before you start

Use exact fractions and identify what is selected at random. Counting-selections questions refer to the next chapter; the combination notation used there is introduced briefly in the final lesson.

Key ideas

Choose the population, then the outcome

If the first-stage groups G and G′ exhaust the possibilities,

P(S)=P(G)P(S∣G)+P(G′)P(S∣G′).\begin{aligned}\mathrm P(S)&=\mathrm P(G)\mathrm P(S\mid G)\\&\quad+\mathrm P(G^{\prime})\mathrm P(S\mid G^{\prime}).\end{aligned}

Group labels do not make groups equally likely. At every reached node, outgoing probabilities sum to 1; terminal path probabilities also sum to 1.

A weighted tree with group probabilities one third and two thirds and different success chances

Reverse the condition through the joint event

P(G∣S)=P(G)P(S∣G)P(S).\mathrm P(G\mid S)=\frac{\mathrm P(G)\mathrm P(S\mid G)}{\mathrm P(S)}.

The denominator must include success through every possible group. Use the observed outcome to update the group probability; do not just report a forward branch.

Conditional independence can disappear after mixing

Two tests may be independent within each production line while both share that unobserved line. Calculate the unconditional joint and compare it with the product of the unconditional marginals. Choosing one line once is different from choosing a fresh line before each test.

Recover an unknown branch or group weight

Use the total-probability equation, then check the recovered value lies between 0 and 1 and reproduces the observed total. A zero denominator makes a conditional undefined, not zero.

Method

  1. Define outcomes, events and any condition before calculating.
  2. Decide which outcomes are equally likely and which branch probabilities change.
  3. Multiply along a path and add only disjoint qualifying paths.
  4. For a conditional probability, restrict both numerator and denominator to the stated condition.
  5. Check probability bounds, all branches and original model restrictions.

Common mistakes

  • Weight groups by their actual selection probabilities.
  • A posterior is not its forward branch.
  • The denominator includes all routes to the observed outcome.
  • Independence within groups does not imply independence after mixing.

Worked examples

A weighted choice changes the observed mixture

Container A is chosen with probability 13\frac{1}{3}, B otherwise. Their red proportions are 34\frac{3}{4} and 25\frac{2}{5}. One counter is selected uniformly from the chosen container. Find the red probability and the chance of A given red.

Follow the solutionP(R)=(13)(34)+(23)(25)=3160,P(A∣R)=(14)/(3160)=1531.\begin{aligned}\mathrm P(R)&=(\frac{1}{3})(\frac{3}{4})+(\frac{2}{3})(\frac{2}{5})\\&=\frac{31}{60},\\\mathrm P(A\mid R)&=(\frac{1}{4})/(\frac{31}{60})=\frac{15}{31}.\end{aligned}

Recover an unknown success branch

A route A is chosen with probability 25\frac{2}{5}. It succeeds with probability 34\frac{3}{4}. The other route succeeds with probability q. Overall success has probability 35\frac{3}{5}. Find q.

Follow the solution(25)(34)+(35)q=35.(\frac{2}{5})(\frac{3}{4})+(\frac{3}{5})q=\frac{3}{5}.

Thus q=12\frac{1}{2}. It lies in [0,1] and reproduces the given success probability.

Independent inside each line, dependent overall

A component comes from A with probability 14\frac{1}{4}, B otherwise. Conditional on the line, two tests are independent, each with pass chance 45\frac{4}{5} on A and 25\frac{2}{5} on B. Find the marginal and joint pass probabilities, then update the line probability after two passes.

Follow the solutionP(P1)=15+310=12.\mathrm P(P_1)=\frac{1}{5}+\frac{3}{10}=\frac{1}{2}.P(P1∩P2)=425+325=725.\mathrm P(P_1\cap P_2)=\frac{4}{25}+\frac{3}{25}=\frac{7}{25}.P(A∣P1∩P2)=425725=47.\begin{aligned}\mathrm P(A\mid P_1\cap P_2)&=\frac{\frac{4}{25}}{\frac{7}{25}}\\&=\frac{4}{7}.\end{aligned}

The two pass events are dependent overall because 725\frac{7}{25} differs from 14\frac{1}{4}. Each term in the joint first weights the appropriate line, then multiplies its two conditional pass chances.

A rare observation updates a source proportion

Source A has defect probability 110\frac{1}{10}; B has defect probability 150\frac{1}{50}. Overall defect probability is 125\frac{1}{25}. Find the proportion from A and the chance that a defective item came from A.

Follow the solutionw/10+(1−w)/50=125.w/10+(1-w)/50=\frac{1}{25}.

Hence w=14\frac{1}{4}.

P(A∣D)=(140)/(125)=58.\mathrm P(A\mid D)=(\frac{1}{40})/(\frac{1}{25})=\frac{5}{8}.

The posterior 58\frac{5}{8} is different from the prior 14\frac{1}{4} and from the forward defect probability 110\frac{1}{10}.

Practise this topic