Back to Lecture 10

Basic Probability Exercises

Work through these exercises to master probability and Bayesian reasoning

Progress
Completed 0/10
Topics:
  • Basic Probability
  • Conditional Probability
  • Bayes' Theorem
  • Joint Probability
  • Independence
1

Coin Flip Probability

Easy

Question:

You flip a fair coin twice. What is the probability of getting at least one head?

Hint: Consider all possible outcomes: HH, HT, TH, TT. Count favorable outcomes.
Your Answer:
Solution:

Sample Space: {HH, HT, TH, TT} — 4 equally likely outcomes

Favorable outcomes: At least one head = {HH, HT, TH} — 3 outcomes

P(at least one head) = 3/4 = 0.75

Alternative approach: P(at least one head) = 1 - P(no heads) = 1 - 0.25 = 0.75

2

Conditional Probability: Card Draw

Easy

Question:

From a standard deck of 52 cards, you draw one card and it's red. What is the probability that it's a heart?

Hint: Use conditional probability: P(Heart|Red). There are 26 red cards (13 hearts + 13 diamonds).
Your Answer:
Solution:

Given information:

  • Total red cards: 26 (13 hearts + 13 diamonds)
  • Hearts that are red: 13
P(Heart|Red) = P(Heart ∩ Red) / P(Red) = (13/52) / (26/52) = 13/26 = 0.50

Intuition: Once we know the card is red, we're choosing from 26 cards, half of which are hearts.

3

Medical Test (Bayes' Theorem)

Medium

Question:

A disease affects 2% of the population. A test for the disease:

  • Has 90% sensitivity (detects disease when present)
  • Has 95% specificity (correctly identifies no disease)

If a person tests positive, what is the probability they actually have the disease?

Hint: Use Bayes' theorem: P(Disease|+) = [P(+|Disease) × P(Disease)] / P(+)
Your Answer (round to 2 decimal places):
Solution:

Step 1: Calculate P(+) using law of total probability

P(+) = P(+|D) × P(D) + P(+|¬D) × P(¬D)
P(+) = 0.90 × 0.02 + 0.05 × 0.98 = 0.018 + 0.049 = 0.067

Step 2: Apply Bayes' theorem

P(D|+) = [P(+|D) × P(D)] / P(+) = (0.90 × 0.02) / 0.067 = 0.018 / 0.067 ≈ 0.27

Interpretation: Only 27% chance of having the disease despite testing positive! This is the base rate fallacy — rare diseases lead to many false positives.

4

Rolling Two Dice

Easy

Question:

You roll two fair six-sided dice. What is the probability that both dice show the same number?

Hint: Count pairs: (1,1), (2,2), (3,3), (4,4), (5,5), (6,6). Total outcomes = 36.
Your Answer:
Solution:

Sample space: 6 × 6 = 36 total outcomes

Favorable outcomes: Both same = {(1,1), (2,2), (3,3), (4,4), (5,5), (6,6)} = 6 outcomes

P(both same) = 6/36 = 1/6 ≈ 0.167
5

Testing Independence

Medium

Question:

Events A and B have the following probabilities:

  • P(A) = 0.4
  • P(B) = 0.5
  • P(A ∩ B) = 0.2

Are events A and B independent?

Hint: Events are independent if P(A ∩ B) = P(A) × P(B).
Your Answer:
Solution:

Test for independence:

P(A) × P(B) = 0.4 × 0.5 = 0.20
P(A ∩ B) = 0.20

Since P(A ∩ B) = P(A) × P(B), events A and B are INDEPENDENT.

This means knowing that A occurred doesn't change the probability of B occurring.

6

Spam Email Filter

Medium

Question:

An email contains the word "FREE". Given:

  • P(Spam) = 0.30
  • P("FREE"|Spam) = 0.80
  • P("FREE"|Ham) = 0.10

What is P(Spam|"FREE")?

Hint: Calculate P("FREE") first, then apply Bayes' theorem.
Your Answer:
Solution:

Step 1: Calculate P("FREE")

P("FREE") = P("FREE"|Spam) × P(Spam) + P("FREE"|Ham) × P(Ham)
P("FREE") = 0.80 × 0.30 + 0.10 × 0.70 = 0.24 + 0.07 = 0.31

Step 2: Apply Bayes' theorem

P(Spam|"FREE") = [P("FREE"|Spam) × P(Spam)] / P("FREE")
P(Spam|"FREE") = (0.80 × 0.30) / 0.31 = 0.24 / 0.31 ≈ 0.77

Answer: C) 0.77 — The word "FREE" strongly indicates spam!

7

At Least One Success

Easy

Question:

A robot sensor has a 10% failure rate on each reading. If the robot takes 3 independent sensor readings, what is the probability that at least one reading succeeds?

Hint: Use complementary probability: P(at least one success) = 1 - P(all fail).
Your Answer:
Solution:

Step 1: Probability of all failures

P(all fail) = 0.10 × 0.10 × 0.10 = 0.001

Step 2: Complementary probability

P(at least one success) = 1 - P(all fail) = 1 - 0.001 = 0.999

Interpretation: Multiple redundant sensors dramatically increase reliability!

8

Drawing Without Replacement

Medium

Question:

A box contains 5 red balls and 3 blue balls. You draw 2 balls without replacement. What is the probability that both balls are red?

Hint: P(both red) = P(1st red) × P(2nd red | 1st red). Note: probabilities change after first draw!
Your Answer:
Solution:

Step 1: Probability of first ball being red

P(1st red) = 5/8 = 0.625

Step 2: Conditional probability of second ball being red

P(2nd red | 1st red) = 4/7 ≈ 0.571

After drawing one red ball, 4 red and 3 blue balls remain (7 total).

Step 3: Apply chain rule

P(both red) = P(1st red) × P(2nd red | 1st red) = (5/8) × (4/7) = 20/56 ≈ 0.357
9

Law of Total Probability

Hard

Question:

A factory has 3 machines:

  • Machine A produces 50% of items, with 2% defect rate
  • Machine B produces 30% of items, with 3% defect rate
  • Machine C produces 20% of items, with 5% defect rate

What is the overall probability that a randomly selected item is defective?

Hint: P(Defect) = Σ P(Defect|Machinei) × P(Machinei)
Your Answer (as percentage):
Solution:

Apply law of total probability:

P(Defect) = P(D|A)×P(A) + P(D|B)×P(B) + P(D|C)×P(C)
P(Defect) = 0.02×0.50 + 0.03×0.30 + 0.05×0.20
P(Defect) = 0.010 + 0.009 + 0.010 = 0.029 = 2.9%

Interpretation: The overall defect rate is a weighted average of each machine's defect rate.

10

Which Machine? (Reverse Inference)

Hard

Question:

Using the same factory from Exercise 9, if an item is found to be defective, what is the probability it came from Machine C?

Hint: Use Bayes' theorem: P(C|Defect) = [P(Defect|C) × P(C)] / P(Defect). Use answer from Exercise 9!
Your Answer:
Solution:

From Exercise 9: P(Defect) = 0.029

Apply Bayes' theorem:

P(C|Defect) = [P(Defect|C) × P(C)] / P(Defect)
P(C|Defect) = (0.05 × 0.20) / 0.029 = 0.010 / 0.029 ≈ 0.345

Interpretation: Machine C produces only 20% of items but accounts for 34.5% of defects because it has the highest defect rate!