What is conditional probability, p(A | B)?
Reveal answer
The probability of A given a context: knowing that B is true.
Source: Notes, ch. 2 — Bayes's Theorem (includes the essentials of ch. 1 — Probability)
July 20, 2025, 1:39 p.m.
Progress saved only in this browser · log in to save it to your account
Uncheck to exclude.
No questions match these filters.
What is conditional probability, p(A | B)?
The probability of A given a context: knowing that B is true.
Source: Notes, ch. 2 — Bayes's Theorem (includes the essentials of ch. 1 — Probability)
How do you compute p(A and B) when A and B are independent, and in the general case?
Independent: p(A)·p(B). In general: p(A)·p(B | A).
Source: Notes, ch. 2 — Bayes's Theorem (includes the essentials of ch. 1 — Probability)
p(A and B) = p(A)·p(B) holds for any events A and B.
False: only when they are independent; in the general case it is p(A)·p(B | A).
Source: Notes, ch. 2 — Bayes's Theorem (includes the essentials of ch. 1 — Probability)
How is Bayes's theorem derived from the joint probability?
Since p(A and B) = p(B and A), we have p(A)·p(B|A) = p(B)·p(A|B); isolating, p(A|B) = p(B|A)·p(A)/p(B).
Source: Notes, ch. 2 — Bayes's Theorem
What is the diachronic interpretation of Bayes's theorem?
Using it to update the probability of a hypothesis H in light of data D: p(H|D) = p(D|H)·p(H)/p(D).
Source: Notes, ch. 2 — Bayes's Theorem
What are p(H), p(H|D), p(D|H) and p(D) called?
Prior, posterior, likelihood and normalizing constant.
Source: Notes, ch. 2 — Bayes's Theorem
In a medical test, "the chance that the test comes out positive if the person is sick" is which term of Bayes, taking the disease as the hypothesis?
It is p(D | H): the probability of the data given the hypothesis.
Source: Notes, ch. 2 — Bayes's Theorem
What is the short recipe for a Bayesian update?
Multiply the prior by the likelihood and divide by the normalizing constant (normalize).
Source: Notes, ch. 2 — Bayes's Theorem
What conditions on the set of hypotheses simplify computing p(D)?
Being mutually exclusive (only one is true) and collectively exhaustive (at least one is); then p(D) is the sum of p(Hᵢ)·p(D|Hᵢ).
Source: Notes, ch. 2 — Bayes's Theorem
What does the law of total probability say?
p(A) = Σᵢ p(Bᵢ)·p(A | Bᵢ), for mutually exclusive and exhaustive Bᵢ.
Source: Notes, ch. 2 — Bayes's Theorem
In Monty Hall, you choose door A and the host opens B. What is the likelihood of opening B under each hypothesis, and the posteriors?
Car behind A: likelihood 1/2 → posterior 1/3. Behind B: 0 → 0. Behind C: 1 (he is forced to open B) → posterior 2/3. It pays to switch.
Source: Notes, ch. 2 — Bayes's Theorem
What is the intuition that switching doors in Monty Hall doubles the chance of winning?
The host knows where the car is and never reveals it; if the car is behind C, he is forced to open B, which makes this data twice as likely under "car behind C" as under "car behind A".
Source: Notes, ch. 2 — Bayes's Theorem
What is a PMF?
Probability Mass Function: a set of values with their probabilities; in empiricaldist, a Pmf is basically a Pandas Series.
Source: Notes, ch. 3 — Distributions
What values does Pmf.from_seq(list('Mississippi')) have, and what does letters('x') return?
M ≈ 0.09; i ≈ 0.36; s ≈ 0.36; p ≈ 0.18. For a missing value, such as 'x', it returns 0.
Source: Notes, ch. 3 — Distributions
Cookie problem: bowl 1 is 3/4 vanilla, bowl 2 is 1/2. I drew a vanilla cookie. What is the chance it came from bowl 1?
3/5: (3/4 · 1/2) / (5/8).
Source: Notes, ch. 3 — Distributions
How do you do the Bayesian update with Pmf in code?
posterior = prior * likelihood and then posterior.normalize(), which divides by the sum (the returned value is the normalizing constant).
Source: Notes, ch. 3 — Distributions
In the problem with 101 bowls (0% to 100% vanilla) and a uniform prior, what does the posterior look like after one vanilla cookie?
Proportional to each bowl's vanilla percentage: linear, with bowl 100 the most likely and bowl 0 eliminated.
Source: Notes, ch. 3 — Distributions
In the 101-bowls problem (bowl i has i% vanilla cookies; uniform prior), I draw with replacement vanilla, vanilla and chocolate. Which bowl becomes most likely, and why?
Bowl 67: the MAP matches the proportion observed so far (2 out of 3 ≈ 67%).
Source: Notes, ch. 3 — Distributions
How do you incorporate new data after already having a posterior?
The previous posterior becomes the new prior: multiply by the likelihood of the new data and normalize again.
Source: Notes, ch. 3 — Distributions
In the 101-bowls problem (bowl i has i% vanilla cookies; uniform prior), drawing a chocolate cookie makes bowl 100 (vanilla only) drop to probability zero.
True: its likelihood for chocolate is 0.
Source: Notes, ch. 3 — Distributions
I have a d6, a d8 and a d12; I pick one at random and roll a 1. What is the chance it is the d6?
4/9 ≈ 44%: (1/6·1/3) / (1/3·1/6 + 1/3·1/8 + 1/3·1/12).
Source: Notes, ch. 3 — Distributions
I pick one of a d6, a d8 and a d12 at random; the first roll is a 1 and, with the same die, the second roll is a 7. What are the probabilities of each die now?
The d6 is eliminated (likelihood 0); d8 ≈ 69% and d12 ≈ 31%.
Source: Notes, ch. 3 — Distributions
Why do dice with fewer sides gain probability when a low number, such as 1, comes up?
Because the likelihood of each possible value is 1/n: the fewer the sides, the more likely any specific result within range.
Source: Notes, ch. 3 — Distributions
One drawer has black and white socks in equal numbers, the other red, green and blue ones. I choose a drawer and draw a matching pair. What is the chance they are white?
3/10: (1/2·1/4) / (5/12).
Source: Notes, ch. 3 — Distributions
What is the euro coin problem that opens ch. 4?
Spun 250 times, a Belgian coin came up heads 140 times; a statistician said that, if it were fair, a result this extreme would have a chance of less than 7%. Is the coin biased?
Source: Notes, ch. 4 — Estimating Proportions
What does the binomial distribution give?
The probability of k successes in n independent trials, each with probability p.
Source: Notes, ch. 4 — Estimating Proportions
With binom.pmf([0, 1, 2], 2, 0.5), what probabilities come out?
0.25; 0.5; 0.25.
Source: Notes, ch. 4 — Estimating Proportions
In the euro coin problem (a Belgian coin spun 250 times came up heads 140 times), a statistician said that, if the coin were fair, a result this extreme would have a chance of "less than 7%". Where does that number come from?
From the sum of the tails of the binomial(250, 0.5): P(k ≥ 140) + P(k ≤ 110) ≈ 0.066.
Source: Notes, ch. 4 — Estimating Proportions
In the euro coin problem (a Belgian coin spun 250 times came up heads 140 times), how do the notes set up the Bayesian analysis of the probability of heads?
Hypotheses for the probability of heads from 0 to 1 (101 values), a uniform prior, likelihood p for heads and 1−p for tails, updating with 140 heads and 110 tails.
Source: Notes, ch. 4 — Estimating Proportions
In the euro coin problem (a Belgian coin spun 250 times came up heads 140 times), with a uniform prior, what is the most likely value of the posterior for the probability of heads, and what does it mean?
0.56 (= 140/250): the observed proportion; the Bayesian analysis gives a whole distribution for the probability of heads, not a yes/no on whether the coin is fair.
Source: Notes, ch. 4 — Estimating Proportions
In the euro coin problem (a Belgian coin spun 250 times came up heads 140 times), did swapping the uniform prior for a triangular one peaking at 0.5 change the posterior much? Why?
Almost nothing: the maximum stayed at 0.56. With enough data, the choice of prior matters little.
Source: Notes, ch. 4 — Estimating Proportions
Why is it said that Bayesian statistics has subjectivity, even though Bayes's theorem is objective?
The theorem is a mathematical tautology, but the prior represents beliefs and is chosen to some degree subjectively; therefore so is the posterior.
Source: Notes, ch. 4 — Estimating Proportions
When does the choice of prior matter most?
When there is little data: the likelihood does not dominate yet and the prior strongly influences the posterior.
Source: Notes, ch. 4 — Estimating Proportions
In the euro coin problem (a Belgian coin spun 250 times came up heads 140 times), how can you avoid doing 250 updates, one per spin?
Using the binomial likelihood all at once: binom.pmf(k=140, n=250, p=hypos); the result is identical to that of the sequential update.
Source: Notes, ch. 4 — Estimating Proportions
How does the Bayesian approach treat a physical property, such as a coin's probability of heads?
As an uncertain quantity represented by a probability distribution, updated with the data.
Source: Notes, ch. 4 — Estimating Proportions
A rookie player gets 3 hits in 3 at-bats; with a uniform prior between 0.20 and 0.33, what is the most likely value of his average?
0.33, the upper bound of the prior: the data push upward, but the prior rules out values outside the plausible range.
Source: Notes, ch. 4 — Estimating Proportions
The most likely value of the posterior is always equal to the proportion observed in the data.
False: with a uniform prior and lots of data it usually matches, but the prior can pull it (as in the baseball case, capped at 0.33).
Source: Notes, ch. 4 — Estimating Proportions
What is the classic problem of ch. 5 on estimating counts?
Source: Downey, Think Bayes (2nd ed.), ch. 5 — Estimating Counts
The train problem (a variant of the German tank problem): seeing a locomotive numbered 60, estimate how many the railroad has.
In the train problem (you see a locomotive numbered 60 and want to estimate how many the railroad has), why does the prior weigh so much on the result?
Source: Downey, Think Bayes (2nd ed.), ch. 5 — Estimating Counts
Because there is a single data point; the estimate changes considerably with the upper bound of the uniform prior, and a power-law prior makes it more stable.
What does Bayes's theorem look like in odds form?
Source: Downey, Think Bayes (2nd ed.), ch. 6 — Odds and Addends
Posterior odds = prior odds × likelihood ratio (Bayes factor).
What does a Bayes factor greater than 1 indicate?
Source: Downey, Think Bayes (2nd ed.), ch. 6 — Odds and Addends
That the data are more likely under hypothesis A than under B, and therefore favor A.
How do you get the distribution of the sum of two independent random variables, such as two dice?
Source: Downey, Think Bayes (2nd ed.), ch. 6 — Odds and Addends
By convolution: adding up the probabilities of all pairs of values that give each total (Pmf.add_dist).
How do you compute the distribution of the maximum of n independent variables?
Source: Downey, Think Bayes (2nd ed.), ch. 7 — Minimum, Maximum, and Mixture
Through the CDF: CDF_max(x) = CDF(x)^n, since the maximum is ≤ x only if all of them are ≤ x.
What kind of phenomenon does the Poisson process model?
Source: Downey, Think Bayes (2nd ed.), ch. 8 — Poisson Processes
Events that occur at a constant rate and independently, such as goals in a match; the number of events in an interval follows a Poisson and the time between them an exponential.
What distribution does the book use as a prior for a team's goal-scoring rate, and why?
Source: Downey, Think Bayes (2nd ed.), ch. 8 — Poisson Processes
A gamma: it is continuous, positive and combines well with the Poisson likelihood.
What is the idea of Bayesian decision analysis?
Source: Downey, Think Bayes (2nd ed.), ch. 9 — Decision Analysis
Using the posterior distribution to choose the action that maximizes the expected gain (or minimizes the expected loss), as in a bid on The Price is Right.
How does the book treat hypothesis testing in a Bayesian way?
Source: Downey, Think Bayes (2nd ed.), ch. 10 — Testing
By comparing hypotheses through Bayes factors and posteriors (e.g. fair vs. biased coin; which slot machine is better), instead of p-values.
What is Thompson sampling in the multi-armed bandit problem?
Source: Downey, Think Bayes (2nd ed.), ch. 10 — Testing
Choosing the machine each time by drawing a value from each one's posterior and playing the one with the highest drawn value, balancing exploration and exploitation.
How do you compare two uncertain quantities (e.g. the heights of two groups) in a Bayesian way?
Source: Downey, Think Bayes (2nd ed.), ch. 11 — Comparison
By building the joint distribution of the two posteriors (a grid of hypotheses) and computing the probability that one is greater than the other.
What is the idea of the naive Bayes classifier of ch. 12?
Source: Downey, Think Bayes (2nd ed.), ch. 12 — Classification
Computing the posterior of each class by multiplying the prior by the likelihoods of each feature, assuming they are independent given the class (e.g. penguin species).
What is the survival function?
Source: Downey, Think Bayes (2nd ed.), ch. 14 — Survival Analysis
S(t) = 1 − CDF(t): the probability that the time until the event is greater than t; censored data enter through the survival likelihood.
What is the idea of the mark and recapture method?
Source: Downey, Think Bayes (2nd ed.), ch. 15 — Mark and Recapture
Mark k individuals, recapture a sample and use how many marked ones appear (hypergeometric likelihood) to estimate the population size.
How does the book treat logistic regression in a Bayesian way?
Source: Downey, Think Bayes (2nd ed.), ch. 16 — Logistic Regression
By putting priors on the intercept and slope, computing the likelihood of each pair over a grid and obtaining the joint posterior of the parameters.
What are conjugate priors?
Source: Downey, Think Bayes (2nd ed.), ch. 18 — Conjugate Priors
Priors that, combined with a certain likelihood, produce a posterior of the same family, allowing only the parameters to be updated: beta with binomial, gamma with Poisson.
With a Beta(α, β) prior and k successes in n binomial trials, what is the posterior?
Source: Downey, Think Bayes (2nd ed.), ch. 18 — Conjugate Priors
Beta(α + k, β + n − k).
In the euro coin problem (a Belgian coin spun 250 times came up heads 140 times), what is the posterior for the probability of heads with a Beta(1, 1) prior?
Source: Downey, Think Bayes (2nd ed.), ch. 18 — Conjugate Priors
Beta(141, 111): Beta(1,1) is the uniform; add 140 heads and 110 tails.
What is MCMC for?
Source: Downey, Think Bayes (2nd ed.), ch. 19 — MCMC
For sampling from the posterior when there are too many parameters for a grid; libraries such as PyMC generate samples that approximate the distribution.
Why does the grid approach, used in the first chapters, not scale?
Source: Downey, Think Bayes (2nd ed.), ch. 19 — MCMC
Because the number of points grows exponentially with the number of parameters.
What is the idea of Approximate Bayesian Computation (ABC)?
Source: Downey, Think Bayes (2nd ed.), ch. 20 — Approximate Bayesian Computation
When the likelihood is hard to compute, simulate data under each hypothesis and accept the hypotheses whose simulations come close to the observed data.
Shortcuts: Enter reveals the answer or the options, then goes to the next one · 1–4 answers · Z undoes · E writes · Esc leaves the text box
Transparency note AI was used in this post for: generating the study questions · creating the English version