Math ClubMath Club
v1 · padrão canônico

Lesson 109 — Introductory Bayesian statistics

Prior, likelihood, posterior. Bayes's rule. Beta-Bernoulli conjugates. MAP versus MLE. Credible interval. Introduction to inference under the Bayesian paradigm.

Used in: Stochastik LK (Alemanha, Klasse 12) · H2 Math Statistics (Singapura) · AP Statistics (EUA)

P(θD)=P(Dθ)P(θ)P(D)P(\theta \mid D) = \frac{P(D \mid \theta)\,P(\theta)}{P(D)}

Bayes's rule updates our belief about the parameter θ\theta after observing data DD. The posterior P(θD)P(\theta \mid D) is proportional to the product of the likelihood P(Dθ)P(D \mid \theta) and the prior P(θ)P(\theta), normalized by the evidence P(D)P(D).

Choose your door

Rigorous notation, full derivation, hypotheses

Rigorous definition

Bayes's theorem

"Bayes's theorem is a basic result of conditional probability, but its interpretation changes everything: it offers a formal recipe for updating beliefs in light of evidence." — OpenIntro Statistics §3.6

Conjugate priors: the Beta-Bernoulli case

Point estimators

Credible interval

Bayes factor

Prior P(θ)Beta(α, β)LikelihoodP(D | θ)s successes / n×Posterior P(θ|D)Beta(α+s, β+n−s)updated beliefBayesian update cycle — posterior becomes prior for next data

Bayesian flow: prior × likelihood → posterior. The posterior becomes the new prior when more data arrives.

Worked examples

Exercise list

40 exercises · 10 with worked solution (25%)

Application 29Understanding 3Modeling 5Challenge 1Proof 2
  1. Ex. 109.1Application

    Disease prevalence: 1%. Test sensitivity: 95%. False-positive rate: 10%. A patient tests positive. Calculate the probability of having the disease.

    Select the correct option
    Select an option first
    Show solution
    Using Bayes: P(disease+)=0.95×0.010.95×0.01+0.10×0.99=0.00950.10858.76%P(\text{disease} \mid +) = \frac{0.95 \times 0.01}{0.95 \times 0.01 + 0.10 \times 0.99} = \frac{0.0095}{0.1085} \approx 8.76\%. The low prior (1%) generates many false positives even with a reasonable test.
  2. Ex. 109.2Application

    A coin is flipped 10 times and gets 4 heads. Prior: Beta(1,1) (uniform). Calculate the posterior, posterior mean, and compare with MLE.

    Select the correct option
    Select an option first
    Show solution
    Posterior: Beta(1+4,1+6)=Beta(5,7)\text{Beta}(1+4, 1+6) = \text{Beta}(5, 7). Posterior mean: 5/120.4175/12 \approx 0.417. MLE: 4/10=0.404/10 = 0.40. The uniform prior pulls slightly the estimate.
    Show step-by-step (with the why)
    1. Uniform prior = Beta(1,1). We know nothing before.
    2. Data: 4 successes in 10 trials, so s=4,n=10s=4, n=10.
    3. Posterior: Beta(1+4,1+104)=Beta(5,7)\text{Beta}(1+4, 1+10-4) = \text{Beta}(5,7).
    4. Posterior mean: α/(α+β)=5/120.417\alpha/(\alpha+\beta) = 5/12 \approx 0.417.
    5. MLE: sample proportion s/n=0.40s/n = 0.40. The uniform prior pulls very little because data dominates.
    Tip: With prior Beta(1,1), the posterior mean is always (s+1)/(n+2) — called the Laplace estimate.
  3. Ex. 109.3Application

    Prior: Beta(4, 6). Sample: 7 successes in 10. Calculate the posterior, posterior mean, and MAP.

    Select the correct option
    Select an option first
    Show solution
    Posterior: Beta(4+7,6+3)=Beta(11,9)\text{Beta}(4+7, 6+3) = \text{Beta}(11, 9). Mean: 11/20=0.5511/20 = 0.55. MAP: (111)/(11+92)=10/180.556(11-1)/(11+9-2) = 10/18 \approx 0.556.
  4. Ex. 109.4Application

    Prior: Beta(2, 2). Batch 1: 5 successes in 10. Batch 2: 8 successes in 10. Perform sequential update and calculate final posterior mean.

    Select the correct option
    Select an option first
    Show solution
    After batch 1 (5 of 10): Beta(2+5,2+5)=Beta(7,7)\text{Beta}(2+5, 2+5) = \text{Beta}(7,7). After batch 2 (8 of 10): Beta(7+8,7+2)=Beta(15,9)\text{Beta}(7+8, 7+2) = \text{Beta}(15,9). Mean: 15/24=0.62515/24 = 0.625.
  5. Ex. 109.5Application

    Prevalence: 0.5%. Sensitivity: 99%. False-positive rate: 2%. Patient tests positive. What is the probability of having the disease?

    Select the correct option
    Select an option first
    Show solution
    Evidence: P(+)=0.99×0.005+0.02×0.995=0.00495+0.01990=0.02485P(+) = 0.99 \times 0.005 + 0.02 \times 0.995 = 0.00495 + 0.01990 = 0.02485. Posterior: 0.00495/0.0248519.9%0.00495/0.02485 \approx 19.9\%. Less than 20% even with a very good test.
  6. Ex. 109.6ApplicationAnswer key

    3 successes in 10 trials. Compare the posterior mean with priors Beta(1,1) and Beta(5,5). Which prior has greater influence on the posterior?

    Select the correct option
    Select an option first
    Show solution
    MLE: s/n=3/10=0.30s/n = 3/10 = 0.30. With Beta(1,1): posterior mean = 4/12 = 0.333. With Beta(5,5): posterior mean = 8/20 = 0.40. Stronger prior pulls more toward 0.5.
  7. Ex. 109.7ApplicationAnswer key

    Three factories produce bolts: E1 (60% of production, 30% defective), E2 (30%, 50% defective), E3 (10%, 10% defective). A defective bolt is withdrawn. What is the probability it came from E1?

    Select the correct option
    Select an option first
    Show solution
    Bayes table: P(E1B)=0.6×0.3/(0.6×0.3+0.3×0.5+0.1×0.1)=0.18/0.3452.9%P(E_1 \mid B) = 0.6 \times 0.3 / (0.6 \times 0.3 + 0.3 \times 0.5 + 0.1 \times 0.1) = 0.18/0.34 \approx 52.9\%.
  8. Ex. 109.8Application

    Prior: Beta(3, 3) (slight belief in fair coin, mean 0.5). Flip 5 times and get 0 heads. Calculate the posterior and new mean.

    Select the correct option
    Select an option first
    Show solution
    Posterior after 0 successes in 5: Beta(3+0,3+5)=Beta(3,8)\text{Beta}(3+0, 3+5) = \text{Beta}(3,8). Mean: 3/110.2733/11 \approx 0.273. Before: 0.50. The absence of successes reduces belief in a fair coin.
  9. Ex. 109.9Application

    Prior: Beta(1,1). Data: 15 successes in 20. Calculate MAP and MLE. Are they equal? Why?

    Select the correct option
    Select an option first
    Show solution
    MAP of Beta(a,b) with a,b greater than 1 is (a1)/(a+b2)(a-1)/(a+b-2). Posterior: Beta(1+15, 1+5) = Beta(16,6). MAP: 15/20=0.7515/20 = 0.75. MLE: 15/20=0.7515/20 = 0.75. With uniform prior, MAP = MLE.
  10. Ex. 109.10Application

    Bag with two coins: one always gives heads (H), the other is fair (J). One is chosen at random. Flipped twice, both heads. What is the probability it is the H coin?

    Select the correct option
    Select an option first
    Show solution
    P(H2H)=P(2HH)P(H)P(2HH)P(H)+P(2HJ)P(J)=(1)2×0.5(1)2×0.5+(0.5)2×0.5=0.50.625=0.8P(H \mid 2H) = \frac{P(2H \mid H)P(H)}{P(2H \mid H)P(H) + P(2H \mid J)P(J)} = \frac{(1)^2 \times 0.5}{(1)^2 \times 0.5 + (0.5)^2 \times 0.5} = \frac{0.5}{0.625} = 0.8. There is 80% chance it's the always-heads coin.
  11. Ex. 109.11Understanding

    What does a 95% Bayesian credible interval mean?

    Select the correct option
    Select an option first
    Show solution
    The Bayesian credible interval has direct interpretation: given the prior and the data, the probability that θ\theta lies in the interval is exactly 1α1-\alpha. This is possible because, in the Bayesian paradigm, θ\theta is a random variable with distribution. Option B describes the frequentist CI.
  12. Ex. 109.12Understanding

    Which statement about MAP and MLE is INCORRECT?

    Select the correct option
    Select an option first
    Show solution
    The correct statement is A: MAP = MLE when the prior is uniform, because maximizing P(Dθ)×cP(D|\theta) \times c (constant) is equivalent to maximizing P(Dθ)P(D|\theta). Option B is wrong — with non-uniform prior, MAP and MLE differ. Option D describes asymptotic convergence, not equality.
  13. Ex. 109.13Understanding

    How does sample size n affect the relationship between prior and posterior?

    Select the correct option
    Select an option first
    Show solution
    With large nn, the likelihood dominates — the posterior converges to the MLE regardless of prior (Bernstein–von Mises result). Statement D is correct. Statement A has correct logic for small to moderate n, but when n is large even a strong prior dilutes.
  14. Ex. 109.14ApplicationAnswer key

    A student passes the exam (AA). Known: P(AB1)=0.8P(A \mid B_1) = 0.8 (studied hard, probability 60%), P(AB2)=0.2P(A \mid B_2) = 0.2 (didn't study, probability 40%). Given that they passed, what is the probability they studied hard?

    Select the correct option
    Select an option first
    Show solution
    P(AB1)=0.8,P(B1)=0.6,P(AB2)=0.2,P(B2)=0.4P(A \mid B_1) = 0.8, P(B_1) = 0.6, P(A \mid B_2) = 0.2, P(B_2) = 0.4. P(B1A)=(0.8×0.6)/(0.8×0.6+0.2×0.4)=0.48/0.5685.7%P(B_1 \mid A) = (0.8 \times 0.6)/(0.8 \times 0.6 + 0.2 \times 0.4) = 0.48/0.56 \approx 85.7\%.
  15. Ex. 109.15ApplicationAnswer key

    A machine has unknown success rate. Prior: Beta(4, 2) (history of 4 successes and 2 failures). New test: 6 consecutive successes. Calculate the posterior, mean, and MAP.

    Select the correct option
    Select an option first
    Show solution
    Beta(10, 2). Mean: 10/12 ≈ 0.833. MAP: 9/10 = 0.9. The informative prior (Beta(4,2)) weighs less than the data (6 of 6): the posterior reflects the perfect sequence but with memory of earlier failures.
  16. Ex. 109.16ApplicationAnswer key

    Calculate the Bayes Factor for H1:θ=0.7H_1: \theta = 0.7 versus H0:θ=0.5H_0: \theta = 0.5 after 8 heads in 10 flips.

    Select the correct option
    Select an option first
    Show solution
    BF10=P(8H,2Tθ=0.7)/P(8H,2Tθ=0.5)BF_{10} = P(8H, 2T \mid \theta=0.7)/P(8H, 2T \mid \theta=0.5). Numerator: (108)(0.7)8(0.3)20.2335\binom{10}{8}(0.7)^8(0.3)^2 \approx 0.2335. Denominator: (108)(0.5)100.0439\binom{10}{8}(0.5)^{10} \approx 0.0439. BF ≈ 5.32. Moderate evidence for biased coin.
  17. Ex. 109.17Application

    Three batches of 10 trials each: 7 successes, 6 successes, 7 successes. Prior: Beta(1,1). Perform sequential update and calculate final posterior mean.

    Select the correct option
    Select an option first
    Show solution
    Cumulative posterior after 30 trials (20 successes): Beta(1+20, 1+10) = Beta(21, 11). Mean: 21/32 ≈ 0.656. With n=30, prior Beta(1,1) has minimal weight; posterior mean ≈ MLE = 20/30 = 0.667.
  18. Ex. 109.18Application

    Prevalence: 30%. Sensitivity: 95%. False-positive rate: 20%. Patient tests positive. Calculate the probability of having the disease and compare with Exercise 109.1.

    Select the correct option
    Select an option first
    Show solution
    Evidence: P(+) = 0.95 × 0.30 + 0.20 × 0.70 = 0.285 + 0.14 = 0.425. P(disease | +) = 0.285/0.425 ≈ 67.1%. High prevalence dramatically changes the positive predictive value.
  19. Ex. 109.19Application

    Show that the posterior mean of the Beta-Bernoulli model is a weighted average of the prior and sample proportion. Identify the weights.

    Select the correct option
    Select an option first
    Show solution
    The mean of Beta(a,b) is a/(a+b). After n trials with s successes and prior Beta(α,β): posterior mean = (α+s)/(α+β+n). It is a weighted average of the prior (α/(α+β)) and sample proportion (s/n), with weights (α+β) and n.
  20. Ex. 109.20Application

    Prior: Beta(2, 2). Data: 0 successes in 3. Calculate the posterior, MAP, and posterior mean.

    Select the correct option
    Select an option first
    Show solution
    Beta(2+0, 2+3) = Beta(2,5). Mean: 2/7 ≈ 0.286. MAP: (2-1)/(2+5-2) = 1/5 = 0.20. With 0 of 3, the posterior concentrates at low values of θ.
  21. Ex. 109.21ApplicationAnswer key

    Probability of rain in Fortaleza on a given day: 40%. If it rains, there is 85% chance of dark clouds. If it doesn't rain, 30%. There are dark clouds. What is the probability of rain?

    Select the correct option
    Select an option first
    Show solution
    P(rain | clouds) = P(clouds | rain) × P(rain) / P(clouds). P(clouds) = 0.85 × 0.4 + 0.3 × 0.6 = 0.34 + 0.18 = 0.52. Posterior = 0.34/0.52 ≈ 65.4%.
  22. Ex. 109.22Application

    Production history: 10% defect rate (equivalent to 10 defects in 100 items = Beta(10,90)). New inspection: 3 defects in 20. Calculate the posterior and posterior mean.

    Select the correct option
    Select an option first
    Show solution
    With prior Beta(10, 90) (expected 10%), after 3 defective in 20: Beta(13, 107). Mean: 13/120 ≈ 10.8%. The strong prior (100 earlier observations) absorbs the small new sample.
  23. Ex. 109.23Application

    Bag with 3 coins: 1 always gives heads (H), 2 are fair (J). One is withdrawn at random and flipped: heads comes up. What is the probability it is the H coin?

    Select the correct option
    Select an option first
    Show solution
    P(H) = 1/3, P(J) = 2/3. P(H | heads) = 1, P(J | heads) = 0.5. P(H | heads) = (1 × 1/3) / (1 × 1/3 + 0.5 × 2/3) = (1/3) / (2/3) = 0.5. After 1 head: 50%.
    Show step-by-step (with the why)
    1. Set up the table: hypothesis, prior, likelihood, product.
    2. H (always heads): prior 1/3, likelihood 1, product 1/3.
    3. J (fair): prior 2/3, likelihood 0.5, product 1/3.
    4. Sum of products = 2/3. Normalize: P(H|heads) = (1/3)/(2/3) = 0.5.
    5. Surprising: 1 heads doesn't distinguish between the two coins — J's higher prior balances H's greater likelihood.
    Note: If 5 heads in a row come up, P(H|HHHHH) = (1)^5×(1/3) / [(1)^5×(1/3) + (0.5)^5×(2/3)] ≈ 0.94.
  24. Ex. 109.24Application

    Prior Beta(1,1). Data: 10 successes in 20. Describe the posterior and the central 95% credible interval (use the fact that the 2.5th percentile of Beta(11,11) ≈ 0.31).

    Select the correct option
    Select an option first
    Show solution
    Posterior after 10 successes in 20 with Beta(1,1): Beta(11,11). Central 95% interval: 2.5th and 97.5th percentiles of Beta(11,11). By symmetry (a=b), centered at 0.5. Approx. (0.31; 0.69).
  25. Ex. 109.25ModelingAnswer key

    A tutoring center has historically approved 70% of students in ENEM. New class, 20 students: 15 passed. Propose a suitable Beta prior, calculate the posterior, and posterior mean approval rate.

    Select the correct option
    Select an option first
    Show solution
    Natural prior: Beta(α, β) with α/(α+β) = historical approval rate (e.g., 70%). If history suggests 70%: Beta(7,3). After 15 approved in 20 students from new class: Beta(22,8). Posterior mean: 22/30 ≈ 73.3%. Credible interval (use software or table).
  26. Ex. 109.26Modeling

    Pancreatic cancer prevalence: 0.2%. Biopsy: sensitivity 92%, specificity 97%. Exam positive. Calculate P(cancer | positive) and discuss the medical decision.

    Select the correct option
    Select an option first
    Show solution
    Doctor's inverse Bayes: P(cancer) = 0.002 (rare). Biopsy positive: sensitivity 92%, false-positive 3%. P(cancer | biopsy+) = (0.92 × 0.002)/(0.92 × 0.002 + 0.03 × 0.998) = 0.00184/0.03178 ≈ 5.8%. Nevertheless, biopsy is recommended because the cost of not treating is huge.
  27. Ex. 109.27ModelingAnswer key

    A transport company reports 20 delayed deliveries in 50 monitored deliveries. Using prior Beta(1,1), estimate the delay rate with a 90% credible interval.

    Select the correct option
    Select an option first
    Show solution
    With prior Beta(1,1) and 20 delays in 50 deliveries: Beta(21, 31). Mean: 21/52 ≈ 40.4%. 90% credible interval approx. (0.29; 0.53). The operation maintains rate close to 40%. Bayesian allows saying "there is 90% chance the rate is between 29% and 53%".
  28. Ex. 109.28Modeling

    A fintech knows 1% of transactions are fraudulent. An algorithm detects that the current transaction has value outside the client's pattern. P(abnormal value | fraud) = 85%, P(abnormal value | legitimate) = 2%. Calculate the probability of fraud.

    Select the correct option
    Select an option first
    Show solution
    Before: P(fraud) = 0.01. Transaction of 15,000 reais outside pattern. P(large transaction | fraud) = 0.85, P(large transaction | legitimate) = 0.02. Posterior: (0.85 × 0.01)/(0.85 × 0.01 + 0.02 × 0.99) = 0.0085/0.0283 ≈ 30.0%. One suspicious signal raises from 1% to 30%.
    Show step-by-step (with the why)
    1. Identify prior: P(fraud) = 0.01.
    2. Likelihood: P(high value | fraud) = 0.85; P(high value | legitimate) = 0.02.
    3. Calculate evidence: P(high value) = 0.85 × 0.01 + 0.02 × 0.99 = 0.0085 + 0.0198 = 0.0283.
    4. Apply Bayes: posterior = 0.0085/0.0283 ≈ 30%.
    5. Decision: with 30% chance of fraud, worth investigating (block temporarily).
    Curiosity: Real anti-fraud systems chain multiple Bayes updates: each signal (location, time, amount) updates risk score sequentially.
  29. Ex. 109.29ProofAnswer key

    Show that, for the Bernoulli model with Beta prior, the posterior is also Beta. Identify the parameters.

    Select the correct option
    Select an option first
    Show solution
    Likelihood for s successes in n Bernoulli(θ): L(θ)=(ns)θs(1θ)nsL(\theta) = \binom{n}{s}\theta^s(1-\theta)^{n-s}. Prior Beta(α,β): proportional to θα1(1θ)β1\theta^{\alpha-1}(1-\theta)^{\beta-1}. Posterior: proportional to θs+α1(1θ)ns+β1\theta^{s+\alpha-1}(1-\theta)^{n-s+\beta-1}, which is exactly the kernel of Beta(α+s, β+n-s). The normalization constant is B(α+s, β+n-s).
  30. Ex. 109.30Proof

    Demonstrate that, with prior Beta(1,1) (uniform), the MAP estimator coincides with the MLE for the Bernoulli model.

    Select the correct option
    Select an option first
    Show solution
    Uniform prior: Beta(1,1), constant density 1 on [0,1]. Posterior with s successes in n: Beta(1+s, 1+n-s), proportional to θs(1θ)ns\theta^s(1-\theta)^{n-s}. This is exactly the likelihood (Bernoulli). So maximizing posterior = maximizing likelihood = MAP = MLE = s/n.
  31. Ex. 109.31Application

    Spam filter: 20% of emails are spam. In spam emails, each suspicious keyword appears with probability 60%; in legitimate emails, 5%. An email has 3 keywords. What is the probability it is spam?

    Select the correct option
    Select an option first
    Show solution
    P(email spam | 3 keywords) applying Naive Bayes: P(spam) = 0.2, P(keywords | spam) = 0.6^3 = 0.216, P(keywords | legitimate) = 0.05^3 = 0.000125. Posterior: (0.216 × 0.2)/(0.216 × 0.2 + 0.000125 × 0.8) = 0.0432/0.04321 ≈ 99.97%.
  32. Ex. 109.32Application

    Two groups of rats: lineage 1 (10 animals, 8 developed tumor after exposure) and lineage 2 (10 animals, 3 developed). Prior Beta(1,1) for both rates. Calculate the posterior and posterior mean for each lineage.

    Select the correct option
    Select an option first
    Show solution
    Posteriors: H1: Beta(1+8, 1+2) = Beta(9,3); H2: Beta(1+3, 1+7) = Beta(4,8). Means: H1 = 9/12 = 0.75; H2 = 4/12 = 0.33. Lineage 1 has much higher estimated transmission probability. 95% credible interval for H1 approx. (0.46; 0.94).
  33. Ex. 109.33Application

    An urn has unknown proportion of orange balls. After 100 draws with replacement, 50 are orange. Prior Beta(1,1). Calculate the posterior, mean, and 95% credible interval.

    Select the correct option
    Select an option first
    Show solution
    After 50 draws of orange ball in 100: Beta(1+50, 1+50) = Beta(51,51). Mean: 0.5. MAP: 50/100 = 0.5. 95% credible interval approx. (0.40; 0.60). With n=100, the credible interval narrows much compared to n=10 case.
  34. Ex. 109.34Challenge

    The Jeffreys prior for Bernoulli is Beta(0.5; 0.5). After 6 successes in 10, calculate the posterior. Research what it means for this prior to be "invariant under reparametrization" and compare the posterior mean with prior Beta(1,1).

    Select the correct option
    Select an option first
    Show solution
    The Beta(0.5; 0.5) prior is the Jeffreys prior for the Bernoulli model. It is invariant under transformations — if θ → φ = g(θ), the resulting prior is also Jeffreys for the new parametrization. It is "objectively non-informative" in the sense of not privileging any parametrization. After 6 successes in 10: Beta(6.5; 4.5). Mean ≈ 0.591, different from 0.60 of MAP with uniform prior.
  35. Ex. 109.35ApplicationAnswer key

    A genetic test detects predisposition for thrombosis. It is known that 3% of the population truly has the predisposition. The test is 99% accurate when a person has the predisposition and 98% accurate when they do not. What is the probability that a person with a positive test truly has the predisposition?

    Select the correct option
    Select an option first
    Show solution
    Prevalence: P(T)=0.03P(T) = 0.03. Sensitivity: P(+T)=0.99P(+|T) = 0.99. Specificity: P(¬T)=0.98P(-|\neg T) = 0.98, so false-positive: P(+¬T)=0.02P(+|\neg T) = 0.02. Evidence: P(+)=0.99×0.03+0.02×0.97=0.0297+0.0194=0.0491P(+) = 0.99 \times 0.03 + 0.02 \times 0.97 = 0.0297 + 0.0194 = 0.0491. Posterior: P(T+)=0.0297/0.04910.605P(T|+) = 0.0297/0.0491 \approx 0.605, or about 60.5%.
    Show step-by-step (with the why)
    1. Define events: TT = have predisposition; ++ = test positive. Prior: P(T)=0.03P(T) = 0.03.
    2. Write likelihoods: P(+T)=0.99P(+|T) = 0.99 and P(+¬T)=10.98=0.02P(+|\neg T) = 1 - 0.98 = 0.02.
    3. Calculate evidence: P(+)=0.99×0.03+0.02×0.97=0.0491P(+) = 0.99 \times 0.03 + 0.02 \times 0.97 = 0.0491.
    4. Apply Bayes: P(T+)=0.0297/0.049160.5%P(T|+) = 0.0297 / 0.0491 \approx 60.5\%.
    Contrast: with only 3% prevalence, even a 99% sensitive test leaves 40% false positives. Bayes's rule formalizes this counterintuitive effect.
  36. Ex. 109.36Application

    Lupus affects 2% of the population. The test is 98% accurate when a person has the disease and 74% accurate when they do not. A patient tests positive. What is the probability of having lupus? Does the TV show phrase "It's always lupus" make Bayesian sense?

    Select the correct option
    Select an option first
    Show solution
    Prevalence: P(L)=0.02P(L) = 0.02. Sensitivity: P(+L)=0.98P(+|L) = 0.98. False-positive rate: P(+¬L)=10.74=0.26P(+|\neg L) = 1 - 0.74 = 0.26. Evidence: P(+)=0.98×0.02+0.26×0.98=0.0196+0.2548=0.2744P(+) = 0.98 \times 0.02 + 0.26 \times 0.98 = 0.0196 + 0.2548 = 0.2744. Posterior: P(L+)=0.0196/0.27447.1%P(L|+) = 0.0196/0.2744 \approx 7.1\%. With 74% specificity, many false positives. Dr. House's phrase has Bayesian grounding.
  37. Ex. 109.37Application

    An exit poll showed that 53% of voters voted for Scott Walker. Among those who voted for Walker, 37% had a college degree; among those who voted against, 44% had a degree. A voter with a college degree was selected at random. What is the probability they voted for Walker?

    Select the correct option
    Select an option first
    Show solution
    Let WW = voted for Walker and CC = has college degree. Prior: P(W)=0.53P(W) = 0.53. Likelihoods: P(CW)=0.37P(C|W) = 0.37 and P(C¬W)=0.44P(C|\neg W) = 0.44. Evidence: P(C)=0.37×0.53+0.44×0.47=0.1961+0.2068=0.4029P(C) = 0.37 \times 0.53 + 0.44 \times 0.47 = 0.1961 + 0.2068 = 0.4029. Posterior: P(WC)=0.1961/0.402948.7%P(W|C) = 0.1961/0.4029 \approx 48.7\%.
    Show step-by-step (with the why)
    1. Prior: P(W)=0.53P(W) = 0.53, so P(¬W)=0.47P(\neg W) = 0.47.
    2. Likelihoods: P(CW)=0.37P(C|W) = 0.37 and P(C¬W)=0.44P(C|\neg W) = 0.44.
    3. Evidence: P(C)=0.37×0.53+0.44×0.470.403P(C) = 0.37 \times 0.53 + 0.44 \times 0.47 \approx 0.403.
    4. Posterior: P(WC)=(0.37×0.53)/0.40348.7%P(W|C) = (0.37 \times 0.53)/0.403 \approx 48.7\%.
    Note: Walker's prior was 53%, but among college graduates the posterior drops to about 49% — a college degree is slightly negatively correlated with a Walker vote in this election.
  38. Ex. 109.38Application

    Let P(C)=0.4P(C) = 0.4, P(D)=0.5P(D) = 0.5, P(CD)=0.6P(C|D) = 0.6. Calculate P(CD)P(C \cap D) and determine if CC and DD are independent.

    Select the correct option
    Select an option first
    Show solution
    P(CD)=0.6P(C|D) = 0.6, so P(CD)=P(CD)×P(D)=0.6×0.5=0.30P(C \cap D) = P(C|D) \times P(D) = 0.6 \times 0.5 = 0.30. For independence we'd need P(CD)=P(C)=0.4P(C|D) = P(C) = 0.4, but P(CD)=0.60.4P(C|D) = 0.6 \neq 0.4 — so C and D are not independent. Also: P(CD)=0.4+0.50.3=0.6P(C \cup D) = 0.4 + 0.5 - 0.3 = 0.6. And P(DC)=P(CD)/P(C)=0.3/0.4=0.75P(D|C) = P(C \cap D)/P(C) = 0.3/0.4 = 0.75.
  39. Ex. 109.39Application

    According to United Blood Services: 43% of people have type O blood, 15% have Rh^- factor, and 52% have type O or Rh^- factor. Calculate the probability that a person has both type O blood AND Rh^- factor, and the probability of having neither.

    Select the correct option
    Select an option first
    Show solution
    By addition: P(ORh)=P(O)+P(Rh)P(ORh)P(O \cup Rh^-) = P(O) + P(Rh^-) - P(O \cap Rh^-). Substituting: 0.52=0.43+0.15P(ORh)0.52 = 0.43 + 0.15 - P(O \cap Rh^-), so P(ORh)=0.06P(O \cap Rh^-) = 0.06. Probability of NOT having both: 10.06=0.941 - 0.06 = 0.94.
  40. Ex. 109.40Modeling

    After an introductory statistics course, 80% of students can correctly construct box plots. Of those, 65% pass the final exam. Of those who cannot construct box plots correctly, only 15% pass. A student passed the exam. What is the probability that they knew how to correctly construct box plots?

    Select the correct option
    Select an option first
    Show solution
    After an introductory statistics class: 80% of students construct box plots correctly. Of those, 65% pass the exam. Of those who don't construct correctly (20%), only 15% pass. Apply Bayes to find: P(correctpassed)=(0.65×0.80)/(0.65×0.80+0.15×0.20)=0.52/0.5594.5%P(\text{correct}|\text{passed}) = (0.65 \times 0.80)/(0.65 \times 0.80 + 0.15 \times 0.20) = 0.52/0.55 \approx 94.5\%. Those who passed almost certainly knew how to construct box plots.
    Show step-by-step (with the why)
    1. Define: BB = constructed box plot correctly, EE = passed exam.
    2. Prior: P(B)=0.80P(B) = 0.80, P(¬B)=0.20P(\neg B) = 0.20.
    3. Likelihoods: P(EB)=0.65P(E|B) = 0.65 and P(E¬B)=0.15P(E|\neg B) = 0.15.
    4. Evidence: P(E)=0.65×0.80+0.15×0.20=0.52+0.03=0.55P(E) = 0.65 \times 0.80 + 0.15 \times 0.20 = 0.52 + 0.03 = 0.55.
    5. Posterior: P(BE)=0.52/0.5594.5%P(B|E) = 0.52/0.55 \approx 94.5\%.
    Interpretation: passing the exam is strong evidence that the student mastered the content — Bayes quantifies this inverse inference.

Sources

Updated on 2026-05-06 · Author(s): Clube da Matemática

Found an error? Open an issue on GitHub or submit a PR — open source forever.