Conditional Probability and Bayes' Theorem
This session extends the introductory probability framework to dependent events and conditional reasoning.
We analyse how the occurrence of one event affects another, use contingency tables for joint distributions, and apply Bayes' theorem to update beliefs with new evidence.
Session Preparation¶
Brooks: Chapter 5
Resources Danish Class:¶
Some Python Solutions¶
Exercises¶
Exercise 1: Basic Probabilities¶
Let \(A\) and \(B\) be two events such that:
Find the probabilities below. State your answers as correct to one decimal place.
-
\(P(A^c)\) (1)
- \(0.7\)
-
\(P(A\cup B)\) (1)
- \(0.4\)
-
\(P(A^c \cap B)\) (1)
- \(0.1\)
-
\(P(A \cap B^c)\) (1)
- \(0.2\)
-
\(P((A\cup B)^c)\) (1)
- \(0.6\)
-
\(P(A^c \cup B)\) (1)
- \(0.8\)
Exercise 2: Rolling a Fair Die Twice¶
I roll a fair die twice and obtain two numbers: \(X_1=\) result of the first roll, \(X_2=\) result of the second roll.
-
Find the probability that \(X_2=4\). (1)
- \(\dfrac{1}{6}\)
-
Find the probability that \(X_1+X_2=7\). (1)
- \(\dfrac{1}{6}\)
-
Find the probability that \(X_1 \neq 2\) and \(X_2 \geq 4\). (1)
- \(\dfrac{5}{12}\)
Exercise 3: Venn and Probability¶
Let \(A, B\), and \(C\) be three events with probabilities given:

Find the probabilities below. State you answers as irreducible fractions.
-
\(P(A\mid B)\) (1)
- \(\dfrac{4}{7}\)
-
\(P(C\mid B)\) (1)
- \(\dfrac{3}{7}\)
-
\(P(B\mid A\cup C)\) (1)
- \(\dfrac{5}{14}\)
-
\(P(B\mid (A,C))\) (1)
- \(\dfrac{1}{2}\)
Exercise 4: Flight Punctuality¶
The probability that a regularly scheduled flight departs on time is \(0.83\); the probability that it arrives on time is \(0.82\); and the probability that it departs and arrives on time is \(0.78\). Find the probability that a plane. State your answers as correct to four decimal places.
-
Arrives on time, given that it departed on time (1)
- \(0.9398\)
-
Departed on time, given that it has arrived on time (1)
- \(0.9512\)
-
Arrives on time, given that it did not depart on time (1)
- \(0.2353\)
Exercise 5: Independence & Contingency Tables¶
A survey was conducted to determine the employment rate of recently graduated engineering students. The survey was conducted one year after graduation and was made for ICT Engineers, Civil Engineers, Mechanical Engineers, and Global Business Engineers. The graduates were classified in one of two employment categories: (1) employed/studying and (2) unemployed. 40% of the respondents had studied ICT Engineering and of these 85% were employed/studying. Of all the respondents, 20% were unemployed. Of the 100 former civil engineering students who took part in the survey, 20% were unemployed. The proportion of unemployed Mechanical and Civil engineering students was the same and the survey included exactly 9 unemployed mechanical engineering students. 300 students took part in the survey.
-
Construct the \(2\times 4\) contingency table for the survey results. (1)
-
What is the probability that an unemployed respondent is a former ICT student? State your answer as an irreducible fraction. (1)
- \(\dfrac{3}{10}\)
-
If a respondent is unemployed, what is the probability that the respondent was a GBE student? State your answer as an irreducible fraction. (1)
- \(\dfrac{13}{60}\)
-
Is being unemployed independent from being a former ICT student? (1)
- No, since \(P(\text{ICT}\mid\text{Unemployed})=\dfrac{3}{10} \neq \dfrac{2}{5}=P(\text{ICT})\).
Exercise 6: Bayes' Theorem¶
Disease \(A\) occurs with probability 0.1, and disease \(B\) occurs with probability 0.2. It is not possible to have both diseases. You have a single test. This test reports positive with probability 0.8 for a patient with disease \(A\), with probability 0.5 for a patient with disease \(B\), and with probability 0.01 for a patient with no disease - call the latter event \(W\). Stating your answer as correct to four decimal places, if the test comes back positive, what is the probability you have either:
-
Disease \(A\) (1)
- \(0.4278\)
-
Disease \(B\) (1)
- \(0.5348\)
-
No disease (1)
- \(0.0374\)
Challenge Exercises¶
Challenge Exercise 1: Random Quadratic¶
This problem is taken from the exam in Stochastic Modelling and Processes (IT-SMP1) on the 6th/7th semester.
You choose a point \((A, B)\) uniformly at random in the unit square \(\{(x, y): 0 \leq x, y \leq 1\}\).

Find the probability that the quadratic $$ A X^2 + X + B = 0 $$ has real roots.
Challenge Exercise 2: Binomial Theorem¶
Binomial expansion formula:
where \(\binom{n}{k}=\frac{n!}{k!(n-k)!}\) is the binomial coefficient The general term in the binomial expansion:
Important property: The number of terms in the binomial expansion of \((a+b)^n\) is \(n+1\).
-
Write the binomial expansion of \((a+2 b)^4\). Hint: You can use Pascal's triangle to easily write down the binomial coefficients.
- \(a^4+8 a^3 b+24 a^2 b^2+32 a b^3+16 b^4\)
-
Find the 5th term of the expansion of \((\sqrt{x}+x)^{10}\)
- \(210 x^7\)
-
Determine the term that contains \(x^6\) in the expansion of \(\left(x+\frac{1}{2} y\right)^9\).
- \(\frac{21}{2} x^{6} y^{3}\)
Challenge Exercise 3: The Monty Hall Problem¶
The Monty Hall problem is a famous probability puzzle based on a game show scenario. Here’s how it works:
- You are presented with three doors: behind one door is a car (the prize you want), and behind the other two doors are goats (which you don’t want).
- You pick one door (say, Door 1).
- The host, who knows what’s behind each door, opens another door (say, Door 3), which has a goat behind it.
- You are then given the choice to stick with your original pick (Door 1) or switch to the remaining unopened door (Door 2).
The question is: Should you stick with your original choice, switch to the other door, or does it not matter? To solve this problem, we can analyze the probabilities of winning the car based on your strategy (sticking or switching).
-
What is the probability of winning the car if you stick with your original choice? (1)
- \(\dfrac{1}{3}\)
-
What is the probability of winning the car if you switch to the other door? (1)
- \(\dfrac{2}{3}\)
-
What would be the probability of winning if there were 100 doors, with 1 car and 99 goats, and after you pick a door, the host opens 98 doors with goats behind them? (1)
- \(\dfrac{99}{100}\)
Fun Fact: This problem led to a lot of debate about probability and decision-making. The problem was popularized by Marilyn vos Savant in her "Ask Marilyn" column in Parade magazine in 1990, leading to widespread discussion and analysis.
(YT 3 min) Monty Hall Problem - AsapSCIENCE
