QUIZ
Probability
12 questions on Probability, from 17 lessons. Pick an answer in your head, then open it.
On the roadmap for: AI Engineering, ML Engineering, Data Science.
Question 1 of 12
A disease affects 1% of people. A test catches 99% of cases and wrongly flags 1% of healthy people. You test positive. Roughly how likely is it that you have the disease?
- A. About 90%, because most positive results come from real cases
- B. About 50%, because false alarms match true cases
- C. About 99%, because the test is 99% accurate
- D. About 1%, because only 1% have the disease
View answer
✓ B. About 50%, because false alarms match true cases
Per 10,000 people: 99 true positives and 99 false positives (1% of 9,900). So 99 / 198 ≈ 50%. The rare base rate matters.
Lesson: Probability Basics & Bayes' Rule
Question 2 of 12
What does it mean that X and Y are conditionally independent given Z?
- A. X and Y can never happen at the same time once Z is known
- B. X and Y are both unaffected by Z, so Z can be ignored
- C. P(X, Y | Z) = P(X | Z) · P(Y | Z): given Z, Y adds nothing about X
- D. P(X | Y) = P(Y | X), so the order of conditioning doesn't matter
View answer
✓ C. P(X, Y | Z) = P(X | Z) · P(Y | Z): given Z, Y adds nothing about X
Two things can be correlated overall yet independent once a common cause Z is known. Naive Bayes rests on this.
Question 3 of 12
You assume the target is Gaussian noise around the model's prediction. Maximising the likelihood is the same as minimising which loss?
- A. Hinge loss, because it maximises the margin
- B. Absolute error, because it is robust to outliers
- C. Cross-entropy, because the target is treated as a probability
- D. Mean squared error, from the Gaussian log-likelihood
View answer
✓ D. Mean squared error, from the Gaussian log-likelihood
The Gaussian log-likelihood is −(y − ŷ)²/2σ² plus a constant, so maximising it minimises squared error. A Bernoulli target gives log-loss.
Lesson: Common Probability Distributions
Question 4 of 12
You average many models whose errors are positively correlated. What happens to the variance of the average as you add more models?
- A. It stays the same, because the errors move together
- B. It increases, because correlated errors add up across the models
- C. It falls but levels off at a floor set by the correlation
- D. It falls to zero as you add enough models
View answer
✓ C. It falls but levels off at a floor set by the correlation
Var = ρσ² + (1 − ρ)σ²/n. The second term shrinks with n, but ρσ² stays, so correlated models help less.
Question 5 of 12
What does the central limit theorem say?
- A. Any large enough dataset becomes normally distributed
- B. Large samples contain no outliers, so their histogram always looks normal
- C. The sample mean always equals the population mean exactly
- D. The mean of many independent draws is roughly normal, whatever the shape
View answer
✓ D. The mean of many independent draws is roughly normal, whatever the shape
The law of large numbers says the mean converges; the CLT describes the shape of its spread, which is why z-tests and confidence intervals work.
Question 6 of 12
By concentration bounds such as Hoeffding's, the error of a test-set estimate shrinks like 1/√n. To halve the error margin, how many test samples do you need?
- A. 4× as many samples
- B. The same number, if you repeat the test
- C. 8× as many samples
- D. 2× as many samples
View answer
✓ A. 4× as many samples
Margin ∝ 1/√n, so halving it needs √n to double, which means 4× the samples.
Lesson: Concentration Inequalities
Question 7 of 12
L2 regularisation on a model's weights is the same as MAP estimation with which prior?
- A. A Gaussian prior centred at zero
- B. A Beta prior on each weight
- C. A uniform prior over all weights
- D. A Laplace prior centred at zero
View answer
✓ A. A Gaussian prior centred at zero
The log of a zero-mean Gaussian prior is −w²/2τ², which adds an L2 penalty. A Laplace prior gives L1.
Lesson: Maximum Likelihood & MAP
Question 8 of 12
You use a Beta prior for a coin's probability of heads and observe some flips. Why is this convenient?
- A. The posterior is also a Beta: just add the heads and tails counts
- B. You no longer need data, because the prior alone decides the answer
- C. The posterior becomes Gaussian after a few flips
- D. The posterior always gives a probability of exactly 0.5
View answer
✓ A. The posterior is also a Beta: just add the heads and tails counts
Beta is conjugate to the Bernoulli/binomial likelihood: Beta(a, b) becomes Beta(a + heads, b + tails).
Question 9 of 12
What is the stationary distribution π of a Markov chain with transition matrix P?
- A. A distribution that doesn't change after one more step: π = πP
- B. The state the chain visits least often over time
- C. The state the chain starts in, before any steps
- D. The largest entry in each row of the chain's transition matrix
View answer
✓ A. A distribution that doesn't change after one more step: π = πP
If the chain is in π, it stays in π. Many chains converge to it from any start, which MCMC relies on.
Lesson: Markov Chains
Question 10 of 12
How does importance sampling estimate an expectation under a hard distribution p?
- A. It samples from p directly, using a faster random number generator
- B. It evaluates p on a fixed grid and averages the values
- C. It replaces the expectation with the value at the mode of p
- D. It samples from an easier q and weights each sample by p(x)/q(x)
View answer
✓ D. It samples from an easier q and weights each sample by p(x)/q(x)
The weights correct for sampling from the wrong distribution. It works poorly when q misses regions where p is large.
Lesson: Sampling Methods: Inverse Transform, Importance Sampling and MCMC
Question 11 of 12
On average it takes 4 flips to see HT, but 6 flips to see HH. Why the difference?
- A. HH has a lower probability per pair of flips than HT
- B. After H, a T resets HH to zero, but an extra H keeps HT's progress
- C. Real coins land tails slightly more often, which slows HH
- D. Both average 4 flips; the gap of 6 comes only from small samples
View answer
✓ B. After H, a T resets HH to zero, but an extra H keeps HT's progress
Both pairs have probability 1/4 per position, but a failed HH attempt (HT) wastes your progress, while for HT a failure (HH) leaves you one step away.
Lesson: Coin Flip Practice
Question 12 of 12
In the Monty Hall game, you pick a door, the host opens a losing door, and offers a switch. Should you switch?
- A. No: two doors remain, so it's 50/50
- B. It doesn't matter: the host's choice reveals nothing
- C. Only if you first picked the middle door
- D. Yes: switching wins 2/3 of the time
View answer
✓ D. Yes: switching wins 2/3 of the time
Your first pick wins 1/3 of the time. The host's choice concentrates the other 2/3 on the remaining door.
Lesson: Classic Probability Puzzles