Probability and Statistics — Lecture 2

Conditional Probability and Bayes' Rule a

Summary

This lecture focuses on:

  1. Conditional probability
  2. Multiplication rule
  3. Law of total probability
  4. Bayes' rule
  5. Independence of events

It also briefly reviews permutations and combinations. :contentReference[oaicite:0]


1. Permutations and Combinations

Permutations

For a permutation, the order matters.

If we arrange all n distinct objects:

n!=n(n−1)(n−2)⋯2⋅1

Example

25 students are placed in a queue:

25!

If 3 of the 25 students sit on three different chairs:

25⋅24⋅23

because there are:


Combinations

For a combination, the order does not matter.

The number of ways to choose k objects from n is:

(nk)=n!k!(n−k)!

Example

3 out of 25 students are allowed to enter the museum shop:

(253)
Tip

Permutation: who goes where → order matters
Combination: who is selected → order does not matter


2. Probability of an Intersection

For two events A and B:

P(A∩B)=P(A)+P(B)−P(A∪B)

This follows from the sum rule:

P(A∪B)=P(A)+P(B)−P(A∩B)

However,

P(A∩B)=P(A)P(B)

is not always true.

It is only true when A and B are independent.


3. Conditional Probability

Definition

The probability of A, given that C has occurred, is:

P(A∣C)=P(A∩C)P(C)

provided that:

P(C)>0

Interpretation

Knowing that C occurred means we restrict the original sample space Ω to C.

The conditional probability is then the probability of A in this reduced sample space.

Important

P(A∣C) means:

"the probability of A, given C."


Example: Throwing a Die

A die is thrown twice.

Without any extra information:

P(first throw=5)=16

Now suppose we are told that:

X1+X2=9

The possible outcomes are:

(3,6),(4,5),(5,4),(6,3)

Only one of these has first throw equal to 5.

Therefore:

P(X1=5∣X1+X2=9)=14

The extra information changes the relevant sample space.


4. The Difference Between P(A∣B) and P(B∣A)

In general:

P(A∣B)≠P(B∣A)

The lecture illustrates this using teachers and park rangers.

Even if:

P(likes nature∣park ranger)>P(likes nature∣teacher)

this does not imply:

P(park ranger∣likes nature)>P(teacher∣likes nature)

because there may be many more teachers than park rangers.

Warning

Never confuse:

P(A∣B)

with

P(B∣A)

5. Multiplication Rule

Starting from the definition:

P(A∣C)=P(A∩C)P(C)

we obtain:

P(A∩C)=P(A∣C)P(C)

Equivalently:

P(A∩C)=P(C∣A)P(A)

Example: Pebbles

A box contains:

Two pebbles are selected without replacement.

Let:

Then:

P(C)=310

After one granite pebble has been selected:

so:

P(A∣C)=29

Using the multiplication rule:

P(A∩C)=P(A∣C)P(C)=29⋅310=115

6. Summary of Probability Rules

Sample Space

P(Ω)=1

Sum Rule

P(A∪B)=P(A)+P(B)−P(A∩B)

Complement Rule

P(Ac)=1−P(A)

Multiplication Rule

P(A∩B)=P(A∣B)P(B)

De Morgan's Laws

(A∩B)c=Ac∪Bc(A∪B)c=Ac∩Bc

Therefore:

P((A∩B)c)=P(Ac∪Bc)

and:

P((A∪B)c)=P(Ac∩Bc)

7. Law of Total Probability

Suppose the sample space is split into:

CandCc

Then event A can occur through either part:

A=(A∩C)∪(A∩Cc)

Therefore:

P(A)=P(A∩C)+P(A∩Cc)

Using the multiplication rule:

P(A)=P(A∣C)P(C)+P(A∣Cc)P(Cc)

General Form

Suppose:

C1,C2,…,Cm

are disjoint and fill the whole sample space:

Ci∩Cj=∅i≠j

and:

C1∪C2∪⋯∪Cm=Ω

Then:

P(A)=∑i=1mP(A∣Ci)P(Ci)

Example: Production Machines

Three machines produce resistors:

Machine Accuracy Production share
C1 80% 30%
C2 90% 50%
C3 60% 20%

Let:

A={resistor is accurate}

Then:

P(A)=P(A∣C1)P(C1)+P(A∣C2)P(C2)+P(A∣C3)P(C3)=0.8(0.3)+0.9(0.5)+0.6(0.2)=0.24+0.45+0.12P(A)=0.81

So a randomly selected resistor has an 81% probability of being accurate.


8. Bayes' Rule

Bayes' rule is used when we want to reverse the direction of a conditional probability.

For example, we may know:

P(A∣C)

but want:

P(C∣A)

From:

P(C∣A)=P(A∩C)P(A)

and:

P(A∩C)=P(A∣C)P(C)

we get:

P(C∣A)=P(A∣C)P(C)P(A)

Using the law of total probability:

P(C∣A)=P(A∣C)P(C)P(A∣C)P(C)+P(A∣Cc)P(Cc)

9. Bayes' Rule for Multiple Causes

If:

C1,…,Cm

form a partition of the sample space, then:

P(Ci∣A)=P(A∣Ci)P(Ci)∑j=1mP(A∣Cj)P(Cj)

The numerator is:

P(A∣Ci)P(Ci)

which represents the probability that:

The denominator is the total probability:

P(A)

10. Example: Medical Test

Let:

I={infected}

and:

T={test positive}

The test satisfies:

P(T∣I)=0.90

95% of non-infected people test negative:

P(Tc∣Ic)=0.95

therefore:

P(T∣Ic)=0.05

Also:

P(I)=0.02

and:

P(Ic)=0.98

We want:

P(I∣T)

Using Bayes' rule:

P(I∣T)=P(T∣I)P(I)P(T∣I)P(I)+P(T∣Ic)P(Ic)

Substituting:

=0.9(0.02)0.9(0.02)+0.05(0.98)=0.0180.067≈0.269

Therefore:

P(I∣T)≈26.9%
Important

Even though 90% of infected people test positive, a positive test does not mean there is a 90% probability of being infected.

The base probability of infection, P(I), also matters.


11. Independence

Definition

An event A is independent of event B if:

P(A∣B)=P(A)

In other words, knowing that B occurred does not change the probability of A.


Equivalent Condition

From the multiplication rule:

P(A∩B)=P(A∣B)P(B)

If A and B are independent:

P(A∣B)=P(A)

so:

P(A∩B)=P(A)P(B)

This is often the easiest condition to use when checking independence.


Symmetry

If A is independent of B, then B is also independent of A.

A⊥B⟺B⊥A

12. Independence of More Than Two Events

For events:

A1,A2,…,Am

independence must hold for every subset.

For three events, for example, we need:

P(A1∩A2)=P(A1)P(A2)P(A1∩A3)=P(A1)P(A3)P(A2∩A3)=P(A2)P(A3)

and also:

P(A1∩A2∩A3)=P(A1)P(A2)P(A3)
Warning

Pairwise independence does not automatically imply full independence.

Three events may be independent in every pair while not being jointly independent.

This is explicitly highlighted as an exam-style pitfall in the lecture. :contentReference[oaicite:1]


13. Independent vs Disjoint

These concepts are very different.

Disjoint Events

Events are disjoint when:

A∩B=∅

Therefore:

P(A∩B)=0

They cannot happen at the same time.


Independent Events

Events are independent when:

P(A∩B)=P(A)P(B)

If A and B both have positive probability and are disjoint:

P(A∩B)=0

while:

P(A)P(B)>0

so they cannot be independent.

Danger

For events with positive probability:

disjoint ⇒ dependent

If A happens, then you know that B cannot happen.


14. Which Rule Should I Use?

Situation Rule
Probability of A given B Conditional probability
Probability of both A and B Multiplication rule
Several possible causes can produce A Law of total probability
Observation is known and cause is unknown Bayes' rule
Check whether events affect each other Independence
Probability of A or B Sum rule
Probability of not A Complement rule

15. Formula Overview

Conditional probability

P(A∣B)=P(A∩B)P(B)

Multiplication rule

P(A∩B)=P(A∣B)P(B)

Law of total probability

P(A)=∑iP(A∣Ci)P(Ci)

Bayes' rule

P(Ci∣A)=P(A∣Ci)P(Ci)∑jP(A∣Cj)P(Cj)

Independence

P(A∣B)=P(A)

or equivalently:

P(A∩B)=P(A)P(B)

16. Common Pitfalls

Warning

1. Reversing conditional probabilities

P(A∣B)≠P(B∣A)

Warning

2. Ignoring the base probability

A highly accurate medical test can still give a relatively low

P(infected∣positive)

when the infection is rare.

Warning

3. Using P(A∩B)=P(A)P(B) automatically

This is only valid when the events are independent.

Warning

4. Confusing pairwise and full independence

For three or more events, the larger intersections must also be checked.

Warning

5. Confusing disjoint with independent

Disjoint events with positive probability are actually dependent.


17. What You Should Be Able to Do

According to the lecture wrap-up, you should be able to:


Core Idea

The most important starting point of the lecture is:

P(A∣B)=P(A∩B)P(B)

From this follows the multiplication rule:

P(A∩B)=P(A∣B)P(B)

and together with the law of total probability, we obtain Bayes' rule:

P(B∣A)=P(A∣B)P(B)P(A)