Skip to content

Probability (Extended)

This document extends the core probability material with rigorous treatments of conditional Probability, independence, Venn diagrams, tree diagrams, and Bayes” theorem.


The conditional probability of event AA given that event BB has occurred is:

P(AB)=P(AB)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)}

Provided P(B)>0P(B) \gt 0.

Interpretation. P(AB)P(A \mid B) is the probability of AA within the “reduced sample space” BB.

For any two events AA and BB:

P(AB)=P(A)P(BA)=P(B)P(AB)P(A \cap B) = P(A) \cdot P(B \mid A) = P(B) \cdot P(A \mid B)

Extension to three events:

P(ABC)=P(A)P(BA)P(CAB)P(A \cap B \cap C) = P(A) \cdot P(B \mid A) \cdot P(C \mid A \cap B)

Problem. A bag contains 5 red and 3 blue balls. Two balls are drawn without replacement. Find The probability that both are red.

Let R1R_1 = “first ball is red”, R2R_2 = “second ball is red”.

P(R1R2)=P(R1)P(R2R1)=58×47=2056=514P(R_1 \cap R_2) = P(R_1) \cdot P(R_2 \mid R_1) = \frac{5}{8} \times \frac{4}{7} = \frac{20}{56} = \frac{5}{14}

If {B1,B2,,Bn}\{B_1, B_2, \ldots, B_n\} is a partition of the sample space (mutually exclusive and exhaustive), Then for any event AA:

P(A)=i=1nP(ABi)P(Bi)\boxed{P(A) = \sum_{i=1}^{n} P(A \mid B_i)\,P(B_i)}

Proof. Since the BiB_i partition Ω\Omega:

A=AΩ=A ⁣(i=1nBi)=i=1n(ABi)A = A \cap \Omega = A \cap \!\left(\bigcup_{i=1}^n B_i\right) = \bigcup_{i=1}^n (A \cap B_i)

The sets ABiA \cap B_i are mutually exclusive, so:

P(A)=i=1nP(ABi)=i=1nP(ABi)P(Bi)P(A) = \sum_{i=1}^n P(A \cap B_i) = \sum_{i=1}^n P(A \mid B_i)\,P(B_i) \quad \blacksquare

1.5 Worked example: law of total probability

Section titled “1.5 Worked example: law of total probability”

Problem. In a factory, Machine AA produces 60% of items and Machine BB produces 40%. Machine AA has a defect rate of 2% and Machine BB has a defect rate of 5%. Find the probability that a Randomly selected item is defective.

Let DD = “item is defective”.

P(D)=P(DA)P(A)+P(DB)P(B)=0.02×0.6+0.05×0.4=0.012+0.020=0.032P(D) = P(D \mid A)\,P(A) + P(D \mid B)\,P(B) = 0.02 \times 0.6 + 0.05 \times 0.4 = 0.012 + 0.020 = 0.032


Bayes’ Theorem. For events AA and BB with P(B)>0P(B) \gt 0:

P(AB)=P(BA)P(A)P(B)\boxed{P(A \mid B) = \frac{P(B \mid A)\,P(A)}{P(B)}}

Using the law of total probability in the denominator, for a partition {A1,,An}\{A_1, \ldots, A_n\}:

P(AiB)=P(BAi)P(Ai)j=1nP(BAj)P(Aj)P(A_i \mid B) = \frac{P(B \mid A_i)\,P(A_i)}{\sum_{j=1}^{n} P(B \mid A_j)\,P(A_j)}

P(AB)=P(AB)P(B)=P(BA)P(A)P(B)P(A \mid B) = \frac{P(A \cap B)}{P(B)} = \frac{P(B \mid A)\,P(A)}{P(B)}

The first step is the definition of conditional probability. The second step applies the Multiplication rule to the numerator. \blacksquare

Problem. A disease affects 1% of a population. A test for the disease has a 95% true positive Rate (P(positivedisease)=0.95P(\mathrm{positive} \mid \mathrm{disease}) = 0.95) and a 10% false positive rate (P(positiveno disease)=0.10P(\mathrm{positive} \mid \mathrm{no\ disease}) = 0.10). If a person tests positive, what is the Probability they actually have the disease?

Let DD = “has disease”, T+T^+ = “tests positive”.

P(DT+)=P(T+D)P(D)P(T+D)P(D)+P(T+D)P(D)P(D \mid T^+) = \frac{P(T^+ \mid D)\,P(D)}{P(T^+ \mid D)\,P(D) + P(T^+ \mid D')\,P(D')}

=0.95×0.010.95×0.01+0.10×0.99=0.00950.0095+0.099=0.00950.10850.0876= \frac{0.95 \times 0.01}{0.95 \times 0.01 + 0.10 \times 0.99} = \frac{0.0095}{0.0095 + 0.099} = \frac{0.0095}{0.1085} \approx 0.0876

So even with a positive test, there is only about an 8.8% chance of having the disease.

### 2.4 Worked example: factory with three machines

Problem. A factory has three machines producing bolts. Machine 1 produces 50%, Machine 2 produces 30%, and Machine 3 produces 20%. Defect rates are 1%, 2%, and 3% respectively. A bolt is found to Be defective. What is the probability it came from Machine 3?

P(M3D)=P(DM3)P(M3)P(DM1)P(M1)+P(DM2)P(M2)+P(DM3)P(M3)P(M_3 \mid D) = \frac{P(D \mid M_3)\,P(M_3)}{P(D \mid M_1)\,P(M_1) + P(D \mid M_2)\,P(M_2) + P(D \mid M_3)\,P(M_3)}

=0.03×0.200.01×0.50+0.02×0.30+0.03×0.20= \frac{0.03 \times 0.20}{0.01 \times 0.50 + 0.02 \times 0.30 + 0.03 \times 0.20}

=0.0060.005+0.006+0.006=0.0060.0170.353= \frac{0.006}{0.005 + 0.006 + 0.006} = \frac{0.006}{0.017} \approx 0.353


For two events AA and BBThe Venn diagram has four regions:

RegionDescriptionProbability
ABA \cap BIn both AA and BBP(AB)P(A \cap B)
ABA \cap B'In AA but not in BBP(A)P(AB)P(A) - P(A \cap B)
ABA' \cap BIn BB but not in AAP(B)P(AB)P(B) - P(A \cap B)
ABA' \cap B'In neither AA nor BB1P(AB)1 - P(A \cup B)

Problem. In a group of 100 students, 45 study Maths, 30 study Physics, and 15 study both. A Student is chosen at random. Find: (a) the probability they study at least one subject; (b) the Probability they study Maths given they study Physics.

P(M)=0.45,P(P)=0.30,P(MP)=0.15P(M) = 0.45, \quad P(P) = 0.30, \quad P(M \cap P) = 0.15

(a) P(MP)=0.45+0.300.15=0.60P(M \cup P) = 0.45 + 0.30 - 0.15 = 0.60

(b) P(MP)=P(MP)P(P)=0.150.30=0.50P(M \mid P) = \dfrac{P(M \cap P)}{P(P)} = \dfrac{0.15}{0.30} = 0.50

For three events AA, BB, CCThe inclusion-exclusion formula gives:

P(ABC)=P(A)+P(B)+P(C)P(AB)P(AC)P(BC)+P(ABC)P(A \cup B \cup C) = P(A) + P(B) + P(C) - P(A \cap B) - P(A \cap C) - P(B \cap C) + P(A \cap B \cap C)

Problem. In a survey, 60% of people like tea, 50% like coffee, 40% like chocolate, 30% like Tea and coffee, 25% like tea and chocolate, 20% like coffee and chocolate, and 10% like all three. What proportion likes none of these?

P(TCH)=0.6+0.5+0.40.30.250.2+0.1=0.85P(T \cup C \cup H) = 0.6 + 0.5 + 0.4 - 0.3 - 0.25 - 0.2 + 0.1 = 0.85

P(none)=10.85=0.15P(\mathrm{none}) = 1 - 0.85 = 0.15


A tree diagram represents a sequence of events. Each branch represents a possible outcome with its Probability. The probability of any path through the tree is the product of the probabilities along That path.

  1. The probabilities on branches from any single node must sum to 1.
  2. The probability of an outcome is the product of probabilities along the path to that outcome.
  3. To find the probability of a compound event, add the probabilities of all paths leading to that event.

Problem. A box contains 7 red and 5 green counters. Two counters are drawn at random without Replacement. Find the probability that: (a) both are the same colour; (b) exactly one is red.

(a) P(both red)=712×611=42132=722P(\mathrm{both\ red}) = \dfrac{7}{12} \times \dfrac{6}{11} = \dfrac{42}{132} = \dfrac{7}{22}

P(both green)=512×411=20132=533P(\mathrm{both\ green}) = \dfrac{5}{12} \times \dfrac{4}{11} = \dfrac{20}{132} = \dfrac{5}{33}

P(same colour)=722+533=21+1066=3166P(\mathrm{same\ colour}) = \dfrac{7}{22} + \dfrac{5}{33} = \dfrac{21 + 10}{66} = \dfrac{31}{66}

(b) P(one red)=712×511+512×711=35132+35132=70132=3566P(\mathrm{one\ red}) = \dfrac{7}{12} \times \dfrac{5}{11} + \dfrac{5}{12} \times \dfrac{7}{11} = \dfrac{35}{132} + \dfrac{35}{132} = \dfrac{70}{132} = \dfrac{35}{66}

Problem. Two dice are rolled. Find the probability that the sum is at least 9, given that the First die shows at least 4.

Let AA = “sum 9\geq 9” and BB = “first die 4\geq 4”.

P(B)=36=12P(B) = \frac{3}{6} = \frac{1}{2}

P(AB):First die=4:need second5    2 outcomesP(A \cap B): \mathrm{First\ die} = 4: \mathrm{need\ second} \geq 5 \implies 2\ \mathrm{outcomes}

First die=5:need second4    3 outcomes\mathrm{First\ die} = 5: \mathrm{need\ second} \geq 4 \implies 3\ \mathrm{outcomes}

First die=6:need second3    4 outcomes\mathrm{First\ die} = 6: \mathrm{need\ second} \geq 3 \implies 4\ \mathrm{outcomes}

P(AB)=2+3+436=936=14P(A \cap B) = \frac{2 + 3 + 4}{36} = \frac{9}{36} = \frac{1}{4}

P(AB)=P(AB)P(B)=1/41/2=12P(A \mid B) = \frac{P(A \cap B)}{P(B)} = \frac{1/4}{1/2} = \frac{1}{2}


Events AA and BB are independent if and only if:

P(AB)=P(A)P(B)P(A \cap B) = P(A) \cdot P(B)

Equivalently: P(AB)=P(A)P(A \mid B) = P(A)Or P(BA)=P(B)P(B \mid A) = P(B).

Interpretation. Knowing that BB occurred provides no information about whether AA occurred.

For three events AA, BB, CC:

  • Pairwise independence means each pair is independent.
  • Mutual independence means pairwise independence and P(ABC)=P(A)P(B)P(C)P(A \cap B \cap C) = P(A)\,P(B)\,P(C).

Mutual independence is a stronger condition. Pairwise independence does not imply mutual Independence.

Problem. Events AA and BB are independent with P(A)=0.4P(A) = 0.4 and P(B)=0.7P(B) = 0.7. Find: (a) P(AB)P(A \cap B); (b) P(AB)P(A \cup B); (c) P(AB)P(A \mid B); (d) P(AB)P(A' \cap B').

(a) P(AB)=0.4×0.7=0.28P(A \cap B) = 0.4 \times 0.7 = 0.28

(b) P(AB)=0.4+0.70.28=0.82P(A \cup B) = 0.4 + 0.7 - 0.28 = 0.82

(c) P(AB)=P(A)=0.4P(A \mid B) = P(A) = 0.4 (by independence)

(d) P(AB)=P((AB))=10.82=0.18P(A' \cap B') = P((A \cup B)') = 1 - 0.82 = 0.18

Note: P(AB)=P(A)P(B)=0.6×0.3=0.18P(A' \cap B') = P(A') \cdot P(B') = 0.6 \times 0.3 = 0.18 confirms the complements are Also independent.

5.4 Theorem: complements of independent events are independent

Section titled “5.4 Theorem: complements of independent events are independent”

Theorem. If AA and BB are independent, then AA' and BB' are also independent.

Proof.

P(AB)=P((AB))=1P(AB)=1P(A)P(B)+P(A)P(B)P(A' \cap B') = P((A \cup B)') = 1 - P(A \cup B) = 1 - P(A) - P(B) + P(A)P(B)

=(1P(A))(1P(B))=P(A)P(B)= (1 - P(A))(1 - P(B)) = P(A') \cdot P(B') \quad \blacksquare