Lecture 4

Conditional Probability and Independence


Grace Tompkins

Last modified — 23 May 2026

Learning Outcomes

By the end of this lecture, students are anticipated to be able to:

  • Define a conditional probability
  • Solve problems using conditional probability rules, including Bayes’ theorem
  • Identify when events are independent

1 Conditional Probability

Last class:

  • The conditional probability of \(A\) given \(B\) is \[\mathbb{P}\left(A \ \vert\ B \right) \, = \, \frac{ \mathbb{P}\left( A \cap B \right) }{ \mathbb{P}\left( B \right) }\]


We will continue our discussion of conditional probability.

Multiplication Property

If \(\mathbb{P}(A_1) > 0\): \[ \mathbb{P}\left( A_{1} \cap A_{2}\right) = \mathbb{P}\left(A_{2}\ \vert\ A_{1}\right) \, \mathbb{P}\left( A_{1}\right). \]

If \(\mathbb{P}(A_1),\ \mathbb{P}(A_1 \cap A_2),\dots,\ P(A_1 \cap A_2 \cap \dots \cap A_{n-1}) > 0\), then \[\begin{aligned} \mathbb{P}\left( A_{1}\cap A_{2}\cap \cdots \cap A_{n}\right) &= \mathbb{P}\left( A_{n}\ \vert\ A_{1}\cap A_{2}\cap \cdots \cap A_{n-1}\right) \\ &\quad \times \mathbb{P}\left( A_{n-1}\ \vert\ A_{1}\cap A_{2}\cap \cdots \cap A_{n-2}\right) \\ & \quad \times \cdots \times\\ & \quad \times \mathbb{P}\left( A_{3}\ \vert\ A_{1}\cap A_{2}\right) \times \mathbb{P}\left( A_{2}\ \vert\ A_{1}\right) \times \mathbb{P}\left( A_{1}\right) \end{aligned}\]

Proof of multiplication property

Urns and Balls

  • An urn has 10 red balls and 40 black balls.

  • Three balls are randomly drawn without replacement.

Calculate the probability that:

  1. The 3rd ball is red given that the 1st is red and the 2nd is black.

  2. The first drawn ball is red, the 2nd is black and the 3rd is red.

Urns and Balls

The “Total Probability” Formula

We say that \(B_{1}, \ldots, B_{n}\) is a partition of \(\Omega\) if

  1. They are disjoint \[ B_{i}\cap B_{j} \, = \, \varnothing \quad \mbox{ for } i \ne j \, , \]

  2. They cover the whole sample space: \(\bigcup_{i=1}^{n} B_{i} \, = \, \Omega\)

A simple partition is any event \(A\) and its complement \(A^c\).

The “Total Probability” Formula

If \(B_{1}, \ldots, B_{n}\) is a partition of \(\Omega\), then, for any \(A \in \Omega\), \[\mathbb{P}\left( A\right) =\sum_{i=1}^{n} \mathbb{P}\left( A\ \vert\ B_{i}\right) \, \mathbb{P}\left( B_{i}\right).\]

Proof of Total Probability

  • \(A = A \cap \Omega = A \cap \left( \bigcup _{i=1}^{n}B_{i}\right) = \bigcup_{i=1}^{n}\left( A \cap B_{i}\right)\)

  • The events \(\left( A \cap B_{i}\right)\) are disjoint.

  • Therefore, by Axiom 3, we have \[\begin{aligned} \mathbb{P}\left( A\right) & = \mathbb{P}\left( \bigcup_{i=1}^{n} A \cap B_{i} \right) \\ &=\sum_{i=1}^{n} \mathbb{P}\left( A\cap B_{i}\right) \\ &=\sum_{i=1}^{n} \mathbb{P}\left( A\ \vert\ B_{i}\right) \, \mathbb{P}\left( B_{i}\right). \end{aligned}\]

Flu Test

  • Suppose that every patient who visits the ER is given a flu test.
  • Suppose that 30% of patients have flu.
  • A patient with flu tests positive 90% of the time.
  • A patient without flu tests negative 80% of the time.

If a new patient walks into the ER, what is the probability that they test positive for the flu?

Flu Test

Bayes’ Theorem

  • Sometimes we have information about \(\mathbb{P}(A\ \vert\ B)\) but require \(\mathbb{P}(B\ \vert\ A)\).

  • Bayes’ Theorem allows us to relate these conditional probabilities.

Bayes’ Theorem

Let \(A\) and \(B\) be arbitrary sets with \(\mathbb{P}(A)>0\). we have \[\mathbb{P}\left( B \ \vert\ A\right) \, = \, \frac{\mathbb{P}\left( A\ \vert\ B \right) \, \mathbb{P}\left( B\right) }{\mathbb{P}(A) }\]

You can also consider \(B_{1}\), \(B_{2}\), …, \(B_{n}\) is a partition of \(\Omega\), then for each \(i=1,\dots,n\), so that:

\[\mathbb{P}\left( B \ \vert\ A\right) \, = \, \frac{\mathbb{P}\left( A\ \vert\ B \right) \, \mathbb{P}\left( B\right) }{\sum_{j=1}^{n} \mathbb{P}\left( A\ \vert\ B_{j}\right) \, \mathbb{P}\left( B_{j}\right)}\]

Proof of Bayes Formula

\[ \begin{aligned} \mathbb{P}\left( B \ \vert\ A\right) &=\frac{\mathbb{P}\left( A\cap B\right)}{\mathbb{P}\left( A\right) } & \text{(Definition of conditional prob)} \\ &=\frac{ \mathbb{P}\left( A\ \vert\ B \right) \, \mathbb{P}\left( B \right)}{\mathbb{P}\left( A\right) } & \text{(Multiplication Rule)} \\ &=\frac{\mathbb{P}\left( A\ \vert\ B \right) \, \mathbb{P}\left( B \right) }{\sum_{j=1}^{n} \mathbb{P}\left( A\ \vert\ B_{j}\right) \, \mathbb{P}\left( B_{j}\right) } & \text{(Rule of Total Prob)} \end{aligned} \]

Bayes’ Theorem

In general, \(\mathbb{P}(A\ \vert\ B) \ne \mathbb{P}(B\ \vert\ A)\). The assumption that these two probabilities are equivalent is referred to as the “conditional probability fallacy” or “confusion of the inverse”

  • In some court systems, presenting evidence as a conditional probability has been banned due to the frequent confusion of the inverse
  • For example: \(\mathbb{P}(\text{DNA found at the crime scene} \ \vert\ \text{Guilty}) \ne \mathbb{P}(\text{Guilty} \ \vert\ \text{DNA found at the crime scene})\)

Flu Prevalence

  • Suppose that every patient who visits the ER is given a flu test.
  • Suppose that 30% of tests are positive.
  • A patient with flu tests positive 90% of the time.
  • A patient without flu tests negative 80% of the time.

Suppose you bring a friend to the ER.

  1. What is the probability that your friend has the flu if they test positive?
  2. What is the probability that your friend has the flu if they test negative?

Flu Prevalence

Flu Prevalence

The Monty Hall Problem

  • You are a contestant on a game show. In front of you are three doors.
  • Behind two doors are goat. 🐐
  • Behind one door is a car 🚗

You select a door, the host then opens one of the 2 remaining doors, revealing a goat 🐐. The host asks

Would you like to switch to the remaining closed door?

What would you do? Discuss with your peers.

The Monty Hall Problem

Show that the probability of winning the car if you switch doors is 2/3.

The Monty Hall Problem

2 Independence

Independence

Independence:

We say that events \(A\) and \(B\) are independent if \[\mathbb{P}\left( A\cap B\right) \, = \, \mathbb{P}\left( A \right) \, \mathbb{P}\left( B\right).\]

If \(\mathbb{P}\left( B\right) >0\) and \(A\) and \(B\) are independent events, then:

\[\mathbb{P}\left( A\ \vert\ B\right) = \frac{\mathbb{P}\left( A\cap B\right) }{\mathbb{P}\left( B\right) } = \frac{\mathbb{P}\left( A\right) \mathbb{P}\left( B\right) }{\mathbb{P}\left( B\right) } = \mathbb{P}\left( A\right).\]

  • Knowledge about \(B\) occurring does not change the probability of \(A\) and vice versa.

Independence

We say that an event \(A\) is non-trivial if \(0<P\left( A\right) <1\).

If \(A\) and \(B\) are non-trivial events. Then,

  1. If \(A\cap B=\varnothing\) then \(A\) and \(B\) are not independent
  2. If \(A\subset B\) then \(A\) and \(B\) are not independent.

Independence

  1. \[ \mathbb{P}\left( A\ \vert\ B\right) =\frac{\mathbb{P}\left( A\cap B\right) }{\mathbb{P}\left( B\right) } = \frac{0}{\mathbb{P}\left( B\right)}= 0 \neq \mathbb{P}\left( A\right) \]

  2. \[ \mathbb{P}\left( A \ \vert\ B\right) =\frac{\mathbb{P}\left( A\cap B\right) }{\mathbb{P}\left( B\right) } =\frac{\mathbb{P}\left( A\right)}{\mathbb{P}\left( B\right) } \neq \mathbb{P}\left( A \right) \]

Independence and Complements

Show the following:

  1. If \(A\) and \(B\) are independent then so are \(A^{c}\) and \(B\).
  2. If \(A\) and \(B\) are independent then so are \(A\) and \(B^{c}\).
  3. (Try at home!) If \(A\) and \(B\) are independent then so are \(A^{c}\) and \(B^{c}\)

Independence and Complements

More than 2 Independent Events

We say that the events \(A_{1},A_{2},\dots\) are independent if, for any finite collection \(K = \{(i_1,\dots,i_k)\}\), \[\mathbb{P}\left( \bigcap_{i \in K} A_{i} \right) = \prod_{i \in K} \mathbb{P}(A_i).\]

For example, if \(n=3,\) then, \(A_1\), \(A_2\), and \(A_3\) are independent if and only if all of the following hold:

\[\begin{aligned} \mathbb{P}\left( A_{1}\cap A_{2}\right) &= \mathbb{P}\left( A_{1}\right) \, \mathbb{P}\left( A_{2}\right), \\ \mathbb{P}\left( A_{1}\cap A_{3}\right) &= \mathbb{P}\left( A_{1}\right) \, \mathbb{P}\left( A_{3}\right),\\ \mathbb{P}\left( A_{2}\cap A_{3}\right) &= \mathbb{P}\left( A_{2}\right) \, \mathbb{P}\left( A_{3}\right),\\ \mathbb{P}\left( A_{1}\cap A_{2}\cap A_{3}\right) &= \mathbb{P}\left( A_{1}\right) \, \mathbb{P}\left( A_{2}\right) \, \mathbb{P}\left( A_{3}\right). \end{aligned}\]

Coin Flipping

We flip a fair coin twice. Define the following three events:

  1. \(A = \{\text{first flip is H}\}\).
  2. \(B = \{\text{second flip is H}\}\).
  3. \(C = \{\text{flips show the same result}\}\).

Show that \(A,B,C\) are pairwise independent, but not independent.

Coin Flipping

To do:

  • Prove the last theorem in your own time (good practice!)
  • Read Chapters 1.5.2, 2.1, 2.2 before Wednesday’s class (SERIOUSLY)
  • Submit Assignment 1 by Wednesday May 20th, 11:59pm