Think Bayes🚧 Under construction



Notes





Active study

  1. Recall concept · cap-1 ●○○

    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)

  2. Recall concept · cap-1 ●○○

    How do you compute p(A and B) when A and B are independent, and in the general case?

    Reveal answer

    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)

  3. True or false relationship · cap-1 ●●○

    p(A and B) = p(A)·p(B) holds for any events A and B.

  4. Recall concept · cap-2 ●●○

    How is Bayes's theorem derived from the joint probability?

    Reveal answer

    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

  5. Recall concept · cap-2 ●●○

    What is the diachronic interpretation of Bayes's theorem?

    Reveal answer

    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

  6. Recall concept · cap-2 ●○○

    What are p(H), p(H|D), p(D|H) and p(D) called?

    Reveal answer

    Prior, posterior, likelihood and normalizing constant.

    Source: Notes, ch. 2 — Bayes's Theorem

  7. Multiple choice relationship · cap-2 ●●○

    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?

  8. Recall concept · cap-2 ●○○

    What is the short recipe for a Bayesian update?

    Reveal answer

    Multiply the prior by the likelihood and divide by the normalizing constant (normalize).

    Source: Notes, ch. 2 — Bayes's Theorem

  9. Recall concept · cap-2 ●●○

    What conditions on the set of hypotheses simplify computing p(D)?

    Reveal answer

    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

  10. Recall concept · cap-2 ●●○

    What does the law of total probability say?

    Reveal answer

    p(A) = Σᵢ p(Bᵢ)·p(A | Bᵢ), for mutually exclusive and exhaustive Bᵢ.

    Source: Notes, ch. 2 — Bayes's Theorem

  11. Recall relationship · cap-2 ●●●

    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?

    Reveal answer

    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

  12. Recall relationship · cap-2 ●●●

    What is the intuition that switching doors in Monty Hall doubles the chance of winning?

    Reveal answer

    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

  13. Recall concept · cap-3 ●○○

    What is a PMF?

    Reveal answer

    Probability Mass Function: a set of values with their probabilities; in empiricaldist, a Pmf is basically a Pandas Series.

    Source: Notes, ch. 3 — Distributions

  14. Recall relationship · cap-3 ●●○

    What values does Pmf.from_seq(list('Mississippi')) have, and what does letters('x') return?

    Reveal answer

    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

  15. Recall relationship · cap-3 ●●○

    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?

    Reveal answer

    3/5: (3/4 · 1/2) / (5/8).

    Source: Notes, ch. 3 — Distributions

  16. Recall concept · cap-3 ●●○

    How do you do the Bayesian update with Pmf in code?

    Reveal answer

    posterior = prior * likelihood and then posterior.normalize(), which divides by the sum (the returned value is the normalizing constant).

    Source: Notes, ch. 3 — Distributions

  17. Recall concept · cap-3 ●●○

    In the problem with 101 bowls (0% to 100% vanilla) and a uniform prior, what does the posterior look like after one vanilla cookie?

    Reveal answer

    Proportional to each bowl's vanilla percentage: linear, with bowl 100 the most likely and bowl 0 eliminated.

    Source: Notes, ch. 3 — Distributions

  18. Recall relationship · cap-3 ●●●

    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?

    Reveal answer

    Bowl 67: the MAP matches the proportion observed so far (2 out of 3 ≈ 67%).

    Source: Notes, ch. 3 — Distributions

  19. Recall concept · cap-3 ●●○

    How do you incorporate new data after already having a posterior?

    Reveal answer

    The previous posterior becomes the new prior: multiply by the likelihood of the new data and normalize again.

    Source: Notes, ch. 3 — Distributions

  20. True or false relationship · cap-3 ●●○

    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.

  21. Recall relationship · cap-3 ●●○

    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?

    Reveal answer

    4/9 ≈ 44%: (1/6·1/3) / (1/3·1/6 + 1/3·1/8 + 1/3·1/12).

    Source: Notes, ch. 3 — Distributions

  22. Recall relationship · cap-3 ●●●

    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?

    Reveal answer

    The d6 is eliminated (likelihood 0); d8 ≈ 69% and d12 ≈ 31%.

    Source: Notes, ch. 3 — Distributions

  23. Recall relationship · cap-3 ●●●

    Why do dice with fewer sides gain probability when a low number, such as 1, comes up?

    Reveal answer

    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

  24. Recall relationship · cap-3 ●●●

    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?

    Reveal answer

    3/10: (1/2·1/4) / (5/12).

    Source: Notes, ch. 3 — Distributions

  25. Recall general · cap-4 ●○○

    What is the euro coin problem that opens ch. 4?

    Reveal answer

    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

  26. Recall concept · cap-4 ●○○

    What does the binomial distribution give?

    Reveal answer

    The probability of k successes in n independent trials, each with probability p.

    Source: Notes, ch. 4 — Estimating Proportions

  27. Recall relationship · cap-4 ●●○

    With binom.pmf([0, 1, 2], 2, 0.5), what probabilities come out?

    Reveal answer

    0.25; 0.5; 0.25.

    Source: Notes, ch. 4 — Estimating Proportions

  28. Recall relationship · cap-4 ●●○

    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?

    Reveal answer

    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

  29. Recall concept · cap-4 ●●○

    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?

    Reveal answer

    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

  30. Recall relationship · cap-4 ●●○

    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?

    Reveal answer

    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

  31. Recall relationship · cap-4 ●●●

    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?

    Reveal answer

    Almost nothing: the maximum stayed at 0.56. With enough data, the choice of prior matters little.

    Source: Notes, ch. 4 — Estimating Proportions

  32. Recall concept · cap-4 ●●○

    Why is it said that Bayesian statistics has subjectivity, even though Bayes's theorem is objective?

    Reveal answer

    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

  33. Recall relationship · cap-4 ●●●

    When does the choice of prior matter most?

    Reveal answer

    When there is little data: the likelihood does not dominate yet and the prior strongly influences the posterior.

    Source: Notes, ch. 4 — Estimating Proportions

  34. Recall concept · cap-4 ●●○

    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?

    Reveal answer

    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

  35. Recall concept · cap-4 ●●●

    How does the Bayesian approach treat a physical property, such as a coin's probability of heads?

    Reveal answer

    As an uncertain quantity represented by a probability distribution, updated with the data.

    Source: Notes, ch. 4 — Estimating Proportions

  36. Recall relationship · cap-4 ●●●

    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?

    Reveal answer

    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

  37. True or false relationship · cap-4 ●●●

    The most likely value of the posterior is always equal to the proportion observed in the data.

  38. Recall Off the notes externo · concept · cap-5 ●●○

    What is the classic problem of ch. 5 on estimating counts?

    Source: Downey, Think Bayes (2nd ed.), ch. 5 — Estimating Counts

    Reveal answer

    The train problem (a variant of the German tank problem): seeing a locomotive numbered 60, estimate how many the railroad has.

  39. Recall Off the notes externo · relationship · cap-5 ●●●

    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

    Reveal answer

    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.

  40. Recall Off the notes externo · concept · cap-6 ●●○

    What does Bayes's theorem look like in odds form?

    Source: Downey, Think Bayes (2nd ed.), ch. 6 — Odds and Addends

    Reveal answer

    Posterior odds = prior odds × likelihood ratio (Bayes factor).

  41. Recall Off the notes externo · relationship · cap-6 ●●●

    What does a Bayes factor greater than 1 indicate?

    Source: Downey, Think Bayes (2nd ed.), ch. 6 — Odds and Addends

    Reveal answer

    That the data are more likely under hypothesis A than under B, and therefore favor A.

  42. Recall Off the notes externo · concept · cap-6 ●●○

    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

    Reveal answer

    By convolution: adding up the probabilities of all pairs of values that give each total (Pmf.add_dist).

  43. Recall Off the notes externo · concept · cap-7 ●●●

    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

    Reveal answer

    Through the CDF: CDF_max(x) = CDF(x)^n, since the maximum is ≤ x only if all of them are ≤ x.

  44. Recall Off the notes externo · concept · cap-8 ●●○

    What kind of phenomenon does the Poisson process model?

    Source: Downey, Think Bayes (2nd ed.), ch. 8 — Poisson Processes

    Reveal answer

    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.

  45. Recall Off the notes externo · relationship · cap-8 ●●●

    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

    Reveal answer

    A gamma: it is continuous, positive and combines well with the Poisson likelihood.

  46. Recall Off the notes externo · concept · cap-9 ●●○

    What is the idea of Bayesian decision analysis?

    Source: Downey, Think Bayes (2nd ed.), ch. 9 — Decision Analysis

    Reveal answer

    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.

  47. Recall Off the notes externo · concept · cap-10 ●●●

    How does the book treat hypothesis testing in a Bayesian way?

    Source: Downey, Think Bayes (2nd ed.), ch. 10 — Testing

    Reveal answer

    By comparing hypotheses through Bayes factors and posteriors (e.g. fair vs. biased coin; which slot machine is better), instead of p-values.

  48. Recall Off the notes externo · relationship · cap-10 ●●●

    What is Thompson sampling in the multi-armed bandit problem?

    Source: Downey, Think Bayes (2nd ed.), ch. 10 — Testing

    Reveal answer

    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.

  49. Recall Off the notes externo · concept · cap-11 ●●○

    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

    Reveal answer

    By building the joint distribution of the two posteriors (a grid of hypotheses) and computing the probability that one is greater than the other.

  50. Recall Off the notes externo · concept · cap-12 ●●○

    What is the idea of the naive Bayes classifier of ch. 12?

    Source: Downey, Think Bayes (2nd ed.), ch. 12 — Classification

    Reveal answer

    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).

  51. Recall Off the notes externo · concept · cap-14 ●●●

    What is the survival function?

    Source: Downey, Think Bayes (2nd ed.), ch. 14 — Survival Analysis

    Reveal answer

    S(t) = 1 − CDF(t): the probability that the time until the event is greater than t; censored data enter through the survival likelihood.

  52. Recall Off the notes externo · concept · cap-15 ●●○

    What is the idea of the mark and recapture method?

    Source: Downey, Think Bayes (2nd ed.), ch. 15 — Mark and Recapture

    Reveal answer

    Mark k individuals, recapture a sample and use how many marked ones appear (hypergeometric likelihood) to estimate the population size.

  53. Recall Off the notes externo · concept · cap-16 ●●●

    How does the book treat logistic regression in a Bayesian way?

    Source: Downey, Think Bayes (2nd ed.), ch. 16 — Logistic Regression

    Reveal answer

    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.

  54. Recall Off the notes externo · concept · cap-18 ●●○

    What are conjugate priors?

    Source: Downey, Think Bayes (2nd ed.), ch. 18 — Conjugate Priors

    Reveal answer

    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.

  55. Recall Off the notes externo · relationship · cap-18 ●●●

    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

    Reveal answer

    Beta(α + k, β + n − k).

  56. Recall Off the notes externo · relationship · cap-18 ●●●

    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

    Reveal answer

    Beta(141, 111): Beta(1,1) is the uniform; add 140 heads and 110 tails.

  57. Recall Off the notes externo · concept · cap-19 ●●○

    What is MCMC for?

    Source: Downey, Think Bayes (2nd ed.), ch. 19 — MCMC

    Reveal answer

    For sampling from the posterior when there are too many parameters for a grid; libraries such as PyMC generate samples that approximate the distribution.

  58. Recall Off the notes externo · relationship · cap-19 ●●●

    Why does the grid approach, used in the first chapters, not scale?

    Source: Downey, Think Bayes (2nd ed.), ch. 19 — MCMC

    Reveal answer

    Because the number of points grows exponentially with the number of parameters.

  59. Recall Off the notes externo · concept · cap-20 ●●●

    What is the idea of Approximate Bayesian Computation (ABC)?

    Source: Downey, Think Bayes (2nd ed.), ch. 20 — Approximate Bayesian Computation

    Reveal answer

    When the likelihood is hard to compute, simulate data under each hypothesis and accept the hypotheses whose simulations come close to the observed data.

See all questions (59)

Transparency note AI was used in this post for: generating the study questions · creating the English version