Weeks
Statistics 1Week 8 · Conditional Probability, Independence and Bayes' Rule
Week 8 Notes

Statistics for
Data Science 1

Conditional probability: contingency tables, the multiplication rule, independent events and their properties, the law of total probability and Bayes' rule.

5 chapters~17 min read
Conditional probabilityMultiplication ruleIndependenceTotal probabilityBayes

Chapters

  1. 01Contingency Tables and Conditional ProbabilityLectures 7.1 and 7.2
  2. 02Multiplication RuleLecture 7.3
  3. 03Independent EventsLectures 7.4 to 7.6
  4. 04Law of Total Probability and Bayes' RuleLecture 7.7
  5. 05Week 8 Summary SheetAll lectures

Based on lectures by Usha Mohan, IIT Madras

01
Lectures 7.1 and 7.2

Contingency Tables and Conditional Probability

Joint, marginal and conditional probabilities, and the formula for P(E | F).

1.1Contingency table

In simple words

A contingency table sorts a sample by two categories at once (rows and columns). Dividing every count by the grand total turns it into a table of probabilities.

Example. A survey of 100 people, by gender and smartphone ownership:

Not owningOwningTotal
Female103444
Male144256
Total2476100

1.2Joint, marginal and conditional probability

TypeWhere in the tableExample
Jointa cell (both things at once)P(Female ∩ Not owning) = 10/100 = 0.10; P(Male ∩ Owning) = 0.42
Marginala row or column total (one thing only)P(Female) = 44/100 = 0.44; P(Owning) = 0.76
Conditionalrestrict to one row or columnP(Not owning | Female) = 10/44

1.3Reading conditional probability from the table

In simple words

"Given Female" means: look only at the Female row. That row is the new, smaller sample space (44 people). Count what you want inside it.

Not owningOwningTotalFemale103444Male144256Total2476100Not owningOwningTotalFemale103444Male144256Total2476100given Female: restrict to the rowgiven Not owning: restrict to the columnP(Not owning | Female) = 10/44P(Female | Not owning) = 10/24
Figure 1. Restrict to a row for "among females", to a column for "among non-owners"
QuestionRestrict toAnswer
Among females, chance of not owning?Female row (44)10/44 ≈ 0.227
Among non-owners, chance of being female?Not-owning column (24)10/24 ≈ 0.417
Row or column? A row relative frequency answers "among females, ...". A column relative frequency answers "among non-owners, ...". In P(E∣F)P(E \mid F), the event after the bar is the group you restrict to.

1.4Definition of conditional probability

Definition

For events E and F with P(F)>0P(F) > 0, the probability of E given F is

P(E∣F)=P(E∩F)P(F)P(E \mid F) = \frac{P(E \cap F)}{P(F)}

Check with the table: P(Not owning∣Female)=0.100.44=1044P(\text{Not owning} \mid \text{Female}) = \dfrac{0.10}{0.44} = \dfrac{10}{44}, the same answer as counting in the row.

Example 1: sum is 10, given the first roll is 4

A die is rolled twice (36 equally likely outcomes). Find the probability that the sum is 10 given that the first roll is 4.

  1. F = first roll is 4 = {(4,1), (4,2), ..., (4,6)}, so P(F) = 6/36.
  2. E = sum is 10. Within F only (4,6) works, so P(E∩F)=1/36P(E \cap F) = 1/36.
  3. P(E∣F)=1/366/36=16P(E \mid F) = \dfrac{1/36}{6/36} = \dfrac{1}{6}. Directly: of the 6 outcomes in F, one gives sum 10.
  4. Answer: 1/6.
5678910112233445566second roll (columns)first roll (rows)F = first roll is 4: 6 outcomesonly (4, 6) has sum 10P(E | F) = 1/6
Figure 2. Given F, only the six outcomes in row 4 remain

1.5Going deeper

  1. P(E∣F)P(E \mid F) is not P(F∣E)P(F \mid E). From the same cell: P(Not owning | Female) = 10/44 ≈ 0.227 but P(Female | Not owning) = 10/24 ≈ 0.417. Different groups are restricted to, so the numbers differ.
  2. Conditional probabilities in one row add to 1. 10/44 + 34/44 = 1: once you restrict to F, F is the whole sample space, so all the axioms of Week 7 still hold.
  3. Without the table (extra remark). Compare P(sum 10) = 3/36 = 1/12 with P(sum 10 | first is 4) = 1/6. Knowing the first roll doubled the chance, because 4 is a roll from which 10 is still reachable.
  4. A look ahead (extra remark). P(Owning | Female) = 34/44 ≈ 0.773 and P(Owning | Male) = 42/56 = 0.75 are close but not equal, so in this sample ownership is not exactly independent of gender (Chapter 3).
Exam tips
  • Underline the word after "given" or "among": that is the group you restrict to.
  • Use counts directly when you have a table: cell over row or column total.
Common mistakes
  • Dividing by the grand total instead of the row or column total.
  • Swapping P(E∣F)P(E \mid F) and P(F∣E)P(F \mid E).
Next · Lecture 7.3Multiplication Rule
02
Lecture 7.3

Multiplication Rule

P(E ∩ F) = P(F) P(E | F), the generalized rule, and two lecture examples.

In simple words

Rearranging the conditional probability formula tells us how to find the chance that both things happen: first F, then E given F.

Multiply both sides of P(E∣F)=P(E∩F)/P(F)P(E \mid F) = P(E \cap F)/P(F) by P(F)P(F):

P(E∩F)=P(F)×P(E∣F)P(E \cap F) = P(F) \times P(E \mid F)

The probability that both E and F occur equals the probability that F occurs times the conditional probability of E given F. It is the tool for the probability of an intersection.

2.1Generalized multiplication rule

For n events

Multiply step by step, each event conditioned on all the ones before it:

P(E1∩E2∩⋯∩En)=P(E1) P(E2∣E1) P(E3∣E1∩E2)⋯P(En∣E1∩⋯∩En−1)\begin{aligned} &P(E_1 \cap E_2 \cap \cdots \cap E_n) \\ &= P(E_1)\,P(E_2 \mid E_1)\,P(E_3 \mid E_1 \cap E_2) \\ &\quad \cdots P(E_n \mid E_1 \cap \cdots \cap E_{n-1}) \end{aligned}

Example 2: two students, without replacement

A class of 40 has 23 males and 17 females. Two students are chosen at random, the first not returned. Find the probability that the first is female and the second is male.

  1. P(first is female) = 17/40.
  2. Given the first was female, 39 students remain and 23 are male: P(second male | first female) = 23/39.
  3. P(F1∩M2)=1740×2339=3911560≈0.251P(F_1 \cap M_2) = \dfrac{17}{40} \times \dfrac{23}{39} = \dfrac{391}{1560} \approx 0.251
  4. Answer: ≈ 0.251.
first studentsecond student17/4023/40F1: femaleM1: male16/3923/39femalemale17/40 × 23/39 = 391/1560 ≈ 0.251after F1: 39 left, still 23 males
Figure 3. Multiply along the path: first female, then male

Example 3: each pile gets exactly one ace

A deck of 52 cards is randomly divided into 4 piles of 13. Find the probability that each pile has exactly one ace.

  1. Let E1E_1 = the ace of spades is in some pile; E2E_2 = the spade and heart aces are in different piles; E3E_3 = spade, heart and diamond aces in different piles; E4E_4 = all four aces in different piles. We need P(E1∩E2∩E3∩E4)P(E_1 \cap E_2 \cap E_3 \cap E_4).
  2. P(E1)=1P(E_1) = 1.
  3. P(E2∣E1)=39/51P(E_2 \mid E_1) = 39/51: of the other 51 cards, 39 are in the three piles without the ace of spades.
  4. P(E3∣E1∩E2)=26/50P(E_3 \mid E_1 \cap E_2) = 26/50: of the remaining 50 cards, 26 are in the two piles with no ace yet.
  5. P(E4∣E1∩E2∩E3)=13/49P(E_4 \mid E_1 \cap E_2 \cap E_3) = 13/49: 13 of the last 49 cards are in the one empty pile.
  6. Product: 3951×2650×1349≈0.105\dfrac{39}{51} \times \dfrac{26}{50} \times \dfrac{13}{49} \approx 0.105
  7. Answer: ≈ 0.105.
♠1ace of ♠ goes somewhere♠♥39/51♥ ace avoids its pile♠♥♦26/50♦ ace avoids both piles♠♥♦♣13/49♣ ace in the last pile1 × 39/51 × 26/50 × 13/49 ≈ 0.105
Figure 4. Placing the aces one at a time; each new ace (orange) must land in a pile that has no ace yet
Note on the source. The slides give the aces example as a list of fractions; the reasons for 39/51, 26/50 and 13/49 are written out here. The product was also checked by counting all deals with combinations: it is exactly 2197/20825 ≈ 0.1055.
Without replacement

When an item is not returned, the counts and the total change for the next draw. That is exactly why the second factor is a conditional probability.

2.2Going deeper

  1. With replacement (extra remark). If the first student were returned, the second factor would stay 23/40 and the answer would be 17/40 × 23/40 = 391/1600 ≈ 0.244, slightly smaller.
  2. Either order works. P(E∩F)=P(F) P(E∣F)=P(E) P(F∣E)P(E \cap F) = P(F)\,P(E \mid F) = P(E)\,P(F \mid E). Pick the order in which the conditional probabilities are easy to read, usually the time order.
  3. Why not just 1/4 × 1/4 ...? The aces are not placed independently: once a pile has an ace, fewer places are left in it. The conditional factors carry exactly this information.
Exam tips
  • Draw a small tree and multiply along the path you want.
  • After each draw without replacement, update both the count and the total.
Common mistakes
  • Using 23/40 for the second draw when the first student was not returned.
  • Forgetting P(E1)=1P(E_1) = 1 when the first step is always possible.
Next · Lectures 7.4 to 7.6Independent Events
03
Lectures 7.4 to 7.6

Independent Events

Definition and tests with dice and cards, E and Fᶜ, and three or more events.

3.1Idea and definition

In simple words

E is independent of F if knowing that F happened does not change the chance of E: P(E∣F)=P(E)P(E \mid F) = P(E). Since P(E∩F)=P(F) P(E∣F)P(E \cap F) = P(F)\,P(E \mid F), this gives P(E∩F)=P(F) P(E)P(E \cap F) = P(F)\,P(E).

Definition

Two events E and F are independent if

P(E∩F)=P(E)×P(F)P(E \cap F) = P(E) \times P(F)

Events that are not independent are dependent. The rule works both ways: independent ⇒ product rule, and product rule ⇒ independent.

3.2Example: rolling a die twice

Example 4: dice: dependent or independent?

S has 36 outcomes. E1E_1: first outcome is 3. E2E_2: sum is 8. E3E_3: sum is 7. Are E1,E2E_1, E_2 independent? Are E1,E3E_1, E_3?

  1. P(E1)=6/36P(E_1) = 6/36. E2E_2 = {(2,6), (3,5), (4,4), (5,3), (6,2)}, so P(E2)=5/36P(E_2) = 5/36. E3E_3 has six pairs, P(E3)=6/36P(E_3) = 6/36.
  2. E1∩E2E_1 \cap E_2 = {(3,5)}: 1/36, but P(E1)P(E2)=30/1296=5/216P(E_1)P(E_2) = 30/1296 = 5/216. Not equal: dependent.
  3. E1∩E3E_1 \cap E_3 = {(3,4)}: 1/36, and P(E1)P(E3)=36/1296=1/36P(E_1)P(E_3) = 36/1296 = 1/36. Equal: independent.
  4. Answer: E1, E2 dependent; E1, E3 independent.
88888112233445566777777112233445566E1 ∩ E2: sum 8, first 3E1 ∩ E3: sum 7, first 31/366/36 × 5/36= 5/216dependent1/366/36 × 6/36= 1/36independentE1 = first is 3 (row)
Figure 5. Green row = E1, blue = the sum; orange = the overlap

Why? Whatever the first roll is, exactly one second roll makes the sum 7, so the first roll tells you nothing about "sum 7". For sum 8 it does: if the first roll were 1, a sum of 8 would be impossible.

3.3Example: a deck of cards

Example 5: cards: dependent or independent?

One card from 52. E1E_1: a face card (J, Q, K, so 12 cards). E2E_2: a king (4 cards). E3E_3: a heart (13 cards).

  1. E1,E2E_1, E_2: face and king = king, probability 4/52. Product 1252×452=3169\dfrac{12}{52} \times \dfrac{4}{52} = \dfrac{3}{169}. Not equal: dependent (a king is always a face card).
  2. E2,E3E_2, E_3: king of hearts, 1/52. Product 452×1352=152\dfrac{4}{52} \times \dfrac{13}{52} = \dfrac{1}{52}. Equal: independent.
  3. Answer: (face, king) dependent; (king, heart) independent.
Note on the source. In the king-and-heart check the slide writes P(E1∩E2)P(E_1 \cap E_2); it means P(E2∩E3)=1/52P(E_2 \cap E_3) = 1/52.
Quick test

Compute P(E∩F)P(E \cap F), compute P(E) P(F)P(E)\,P(F), compare. Equal means independent. Also check the intuition: does knowing F change the chance of E?

3.4Independence of E and Fc

Proposition

If E and F are independent, then E and FcF^c are also independent.

SEFE ∩ FE ∩ FᶜP(E) = P(E ∩ F) + P(E ∩ Fᶜ)two pieces, no overlap
Figure 6. E splits into the part inside F and the part outside F

Proof. Write E=(E∩F)∪(E∩Fc)E = (E \cap F) \cup (E \cap F^c). The two parts are mutually exclusive, so P(E)=P(E∩F)+P(E∩Fc)P(E) = P(E \cap F) + P(E \cap F^c). By independence P(E∩F)=P(E) P(F)P(E \cap F) = P(E)\,P(F), so P(E∩Fc)=P(E)−P(E) P(F)=P(E) (1−P(F))=P(E) P(Fc)P(E \cap F^c) = P(E) - P(E)\,P(F) = P(E)\,(1 - P(F)) = P(E)\,P(F^c). ∎

So if E is independent of F, the chance of E is unchanged by knowing whether or not F occurred. Check with cards (extra remark): king and "not a heart" gives 3/52, and 452×3952=352\frac{4}{52} \times \frac{39}{52} = \frac{3}{52}.

3.5More than two events

Warning. If E is independent of F and also of G, it does not follow that E is independent of F∩GF \cap G. Two dice: E = sum is 7, F = first die is 4, G = second die is 3. E is independent of F alone and of G alone. But F∩GF \cap G means the roll is (4, 3), so P(E∣F∩G)=1≠P(E)=1/6P(E \mid F \cap G) = 1 \ne P(E) = 1/6.
Independence of three events

E, F, G are independent if all four hold:

  1. P(E∩F∩G)=P(E) P(F) P(G)P(E \cap F \cap G) = P(E)\,P(F)\,P(G)
  2. P(E∩F)=P(E) P(F)P(E \cap F) = P(E)\,P(F)
  3. P(E∩G)=P(E) P(G)P(E \cap G) = P(E)\,P(G)
  4. P(F∩G)=P(F) P(G)P(F \cap G) = P(F)\,P(G)

For independent events, the probability that all of them occur is the product of their individual probabilities.

Example 6: three children

A couple plans three children. Each child is equally likely to be a boy or a girl, and the sexes are independent. Find the probability that all three are girls.

  1. EiE_i = the i-th child is a girl; P(Ei)=1/2P(E_i) = 1/2.
  2. Independence: P(E1∩E2∩E3)=12×12×12=18P(E_1 \cap E_2 \cap E_3) = \frac{1}{2} \times \frac{1}{2} \times \frac{1}{2} = \frac{1}{8}.
  3. Answer: 1/8.

3.6Going deeper

  1. Pairwise is not enough (extra remark). In the warning example all three pairs are independent: each pair intersection has probability 1/36 = 1/6 × 1/6. But P(E∩F∩G)=1/36P(E \cap F \cap G) = 1/36, not 1/216. That is why the definition needs condition 1 as well.
  2. Independent is not mutually exclusive (extra remark). Mutually exclusive events cannot happen together, so knowing one happened tells you the other did not: that is strong dependence. King and heart are independent but not mutually exclusive.
  3. Where independence comes from. In the dice and children examples it is an assumption about the experiment (separate rolls, separate births); in the cards example it is checked by counting.
Exam tips
  • Always test with numbers: P(E∩F)P(E \cap F) against P(E) P(F)P(E)\,P(F).
  • For three events check all four conditions.
Common mistakes
  • Calling disjoint events independent.
  • Multiplying probabilities of events that are not independent.
Next · Lecture 7.7Law of Total Probability and Bayes' Rule
04
Lecture 7.7

Law of Total Probability and Bayes' Rule

Splitting into cases, the probability tree, and reasoning backwards from an event.

4.1Law of total probability

In simple words

To find the chance of E, split the world into cases (F happens, F does not), find the chance of E in each case, and take a weighted average, weighting each case by how likely it is.

E can be written as (E∩F)∪(E∩Fc)(E \cap F) \cup (E \cap F^c): an outcome in E is either in F as well, or not. These parts are mutually exclusive (Figure 6), so

P(E)=P(E∩F)+P(E∩Fc)=P(F) P(E∣F)+P(Fc) P(E∣Fc)\begin{aligned} P(E) &= P(E \cap F) + P(E \cap F^c) \\ &= P(F)\,P(E \mid F) + P(F^c)\,P(E \mid F^c) \end{aligned}
General form

If F1,F2,…,FkF_1, F_2, \ldots, F_k are mutually exclusive and exhaustive (exactly one of them occurs), then for any event E

P(E)=∑i=1kP(E∣Fi) P(Fi)P(E) = \sum_{i=1}^{k} P(E \mid F_i)\,P(F_i)

4.2Example: insurance policy

People are either accident-prone or not. An accident-prone person has an accident in a year with probability 0.1; others with probability 0.05. A new policyholder is accident-prone with probability 0.2. Let E = has an accident in the first year, F = is accident-prone. Given: P(F) = 0.2, P(E | F) = 0.1, P(E∣Fc)=0.05P(E \mid F^c) = 0.05.

0.2F: accident-prone0.1accident0.2 × 0.1 = 0.020.9no accident0.2 × 0.9 = 0.180.8Fᶜ: not prone0.05accident0.8 × 0.05 = 0.040.95no accident0.8 × 0.95 = 0.76P(E) = 0.02 + 0.04 = 0.06
Figure 7. Probability tree for the insurance example

Each branch carries a probability; multiply along a path to get the joint probability at its end. The four end values 0.02, 0.18, 0.04, 0.76 add up to 1. The two paths ending in an accident add to P(E).

Example 7: chance of an accident in year one

Find P(E).

  1. P(Fc)=1−0.2=0.8P(F^c) = 1 - 0.2 = 0.8.
  2. P(E)=0.2×0.1+0.8×0.05=0.02+0.04=0.06P(E) = 0.2 \times 0.1 + 0.8 \times 0.05 = 0.02 + 0.04 = 0.06.
  3. Answer: 0.06, that is 6 percent.

4.3Bayes' rule

In simple words

Total probability goes from causes to effect: P(E). Bayes' rule goes backwards: given that E happened, how likely is each cause?

Start from P(F∣E)=P(F∩E)/P(E)P(F \mid E) = P(F \cap E)/P(E); use the multiplication rule on the top and total probability on the bottom:

P(F∣E)=P(E∣F) P(F)P(F) P(E∣F)+P(Fc) P(E∣Fc)P(F \mid E) = \frac{P(E \mid F)\,P(F)}{P(F)\,P(E \mid F) + P(F^c)\,P(E \mid F^c)}
General form

For mutually exclusive and exhaustive F1,…,FkF_1, \ldots, F_k and any event E,

P(Fi∣E)=P(E∣Fi) P(Fi)∑jP(E∣Fj) P(Fj)P(F_i \mid E) = \frac{P(E \mid F_i)\,P(F_i)}{\sum_{j} P(E \mid F_j)\,P(F_j)}

Example 8: is the policyholder accident-prone?

A new policyholder has an accident in the first year. What is the probability that he or she is accident-prone?

  1. From Example 7, P(E) = 0.06.
  2. P(F∣E)=0.2×0.10.06=0.020.06=13P(F \mid E) = \dfrac{0.2 \times 0.1}{0.06} = \dfrac{0.02}{0.06} = \dfrac{1}{3}
  3. Answer: 1/3.
all accidents: 0.06from prone people 0.02from the others 0.04P(F | E) = 0.02 / 0.06 = 1/3prior P(F) = 0.2 → posterior 1/3
Figure 8. Of all accidents, one third come from accident-prone people
Why only 1/3?

Accident-prone people are only 20% of policyholders, so even though they have more accidents, most accidents (0.04 of the 0.06) still come from the other 80%. The prior 0.2 rises to 1/3 after seeing an accident.

4.4Going deeper

  1. Bayes is just a share of the tree. P(F | E) = (the E-path through F) ÷ (all E-paths) = 0.02 / (0.02 + 0.04). Draw the tree and Bayes needs no extra formula.
  2. Again, P(E | F) ≠ P(F | E). P(accident | prone) = 0.1 but P(prone | accident) = 1/3. Confusing the two is the most common Bayes mistake.
  3. Total probability is an average (extra remark). 0.06 lies between 0.05 and 0.1, closer to 0.05 because that case has weight 0.8. P(E) must always lie between the smallest and largest P(E∣Fi)P(E \mid F_i).
  4. The cases must cover everything once. F and FcF^c always do; with more cases check that the P(Fi)P(F_i) add to 1.
Exam tips
  • Write the given numbers as P(F), P(E | F), P(E | Fᶜ) before calculating.
  • Check: the tree's end values add to 1.
Common mistakes
  • Forgetting the FcF^c branch in the denominator.
  • Reporting P(E | F) when the question asks P(F | E).
Next · All lecturesWeek 8 Summary Sheet
05
All lectures

Week 8 Summary Sheet

Everything in Week 8 on one sheet.

Lectures 7.1 to 7.7 on one sheet, for a last-minute revision.

All formulas in one table

IdeaFormula
Conditional probabilityP(E∣F)=P(E∩F)/P(F)P(E \mid F) = P(E \cap F)/P(F), P(F)>0P(F) > 0
Multiplication ruleP(E∩F)=P(F) P(E∣F)P(E \cap F) = P(F)\,P(E \mid F)
GeneralizedP(E1) P(E2∣E1) P(E3∣E1∩E2)⋯P(E_1)\,P(E_2 \mid E_1)\,P(E_3 \mid E_1 \cap E_2) \cdots
Independent eventsP(E∩F)=P(E) P(F)P(E \cap F) = P(E)\,P(F), equivalently P(E∣F)=P(E)P(E \mid F) = P(E)
ComplementE, F independent ⇒ E, FcF^c independent
Three eventstriple product and all three pair products
Total probabilityP(E)=P(F) P(E∣F)+P(Fc) P(E∣Fc)P(E) = P(F)\,P(E \mid F) + P(F^c)\,P(E \mid F^c)
Bayes' ruleP(F∣E)=P(E∣F) P(F)/P(E)P(F \mid E) = P(E \mid F)\,P(F)/P(E)

Formula sheet at a glance

Conditional
DefinitionP(E∣F)=P(E∩F)P(F)P(E \mid F) = \frac{P(E \cap F)}{P(F)}
MultiplicationP(E∩F)=P(F) P(E∣F)P(E \cap F) = P(F)\,P(E \mid F)
Independence
TestP(E∩F)=P(E) P(F)P(E \cap F) = P(E)\,P(F)
Same asP(E∣F)=P(E)P(E \mid F) = P(E)
Total probability
Two casesP(E)=P(F)P(E∣F)+P(Fc)P(E∣Fc)P(E) = P(F)P(E \mid F) + P(F^c)P(E \mid F^c)
k casesP(E)=∑iP(E∣Fi)P(Fi)P(E) = \sum_i P(E \mid F_i)P(F_i)
Bayes
ReverseP(F∣E)=P(E∣F) P(F)P(E)P(F \mid E) = \frac{P(E \mid F)\,P(F)}{P(E)}

Formulas

Conditional probability
Given FP(E∣F)=P(E∩F)P(F)P(E \mid F) = \frac{P(E \cap F)}{P(F)}

Use whenThe question says "given", "among" or "if we know".

  1. Identify the group after the bar.
  2. Restrict to it (row, column, or outcomes in F).
  3. Count or divide inside it.
ExampleSum 10 given first roll 4.
1/366/36=16\frac{1/36}{6/36} = \frac{1}{6}
Multiplication rule
Both, in orderP(E∩F)=P(F) P(E∣F)P(E \cap F) = P(F)\,P(E \mid F)

Use whenBoth events happen, often one after another, without replacement.

  1. Write the events in time order.
  2. Multiply the first probability by each conditional one.
  3. Update counts after each draw.
ExampleFemale then male.
1740×2339≈0.251\frac{17}{40} \times \frac{23}{39} \approx 0.251
Independence test
Product ruleP(E∩F)=P(E) P(F)P(E \cap F) = P(E)\,P(F)

Use whenYou must decide whether two events affect each other.

  1. Find P(E), P(F) and P(E ∩ F).
  2. Multiply P(E) P(F).
  3. Equal: independent. Otherwise dependent.
ExampleKing and heart.
452×1352=152\frac{4}{52} \times \frac{13}{52} = \frac{1}{52}
Total probability and Bayes
ForwardP(E)=∑iP(E∣Fi)P(Fi)P(E) = \sum_i P(E \mid F_i)P(F_i)
BackwardP(F∣E)=P(E∣F)P(F)P(E)P(F \mid E) = \frac{P(E \mid F)P(F)}{P(E)}

Use whenSeveral cases lead to one event; or you see the event and ask about the case.

  1. Draw the tree with P(F) and P(E | F) branches.
  2. Add the paths ending in E: P(E).
  3. For Bayes, divide the path you want by P(E).
ExampleInsurance.
P(E)=0.06,P(F∣E)=0.020.06=13P(E) = 0.06, \quad P(F \mid E) = \frac{0.02}{0.06} = \frac{1}{3}

Values worked in the lectures

QuestionAnswer
Survey: P(Not owning | Female), P(Female | Not owning)10/44, 10/24
Two dice: P(sum 10 | first is 4)1/6
Class of 40: P(female then male)≈ 0.251
Piles: each has exactly one ace≈ 0.105
Dice: (E1, E2) / (E1, E3) independent?no / yes
Cards: (face, king) / (king, heart) independent?no / yes
Three girls1/8
Insurance: P(accident), P(prone | accident)0.06, 1/3

How to decide

  1. "Given ..." → conditional: restrict to the given group.
  2. "Both" or "then" → multiplication rule; update counts if there is no replacement.
  3. Independence test: compare P(E∩F)P(E \cap F) with P(E) P(F)P(E)\,P(F).
  4. Several cases leading to one event → total probability; going backwards from the event → Bayes.
Source notes
  • The lectures are numbered 7.1 to 7.7; these are the Week 8 notes.
  • Lecture 7.7 is titled "Bayes' Rule" on its first slide but its file name says "Law of total probability"; both topics are in it.
  • In the cards independence check the slide writes P(E1∩E2)P(E_1 \cap E_2) where it means P(E2∩E3)=1/52P(E_2 \cap E_3) = 1/52.
  • Several slides are images (Venn diagrams, set listings); values here come from the slide text and the definitions, each checked by computation.
  • The source's extra practice questions are not reproduced, as the Statistics 1 notes carry worked examples only.
Revision overview
ConditionalP(E | F) = P(E ∩ F)/P(F)
Restrict to row or column
Dice: 1/6
MultiplicationP(F) P(E | F)
Update counts
Students 0.251, aces 0.105
IndependenceP(E ∩ F) = P(E) P(F)
King, heart: yes
E, Fc also independent
Conditional probabilityStatistics for Data Science 1
Three eventsTriple and pair products
Pairwise is not enough
Three girls: 1/8
Total probabilityWeighted average of cases
Tree: add E paths
Insurance: 0.06
BayesBackwards from E
Path ÷ all E paths
Prone | accident: 1/3
Revision: the whole of Week 8 on one map
Back to top