Bayes Theorem interview question

Probability & MathBayes TheoremBayesian Statisticsmedium

A labelling vendor's error rate is either 2% (prior 0.7) or 10% (prior 0.3). You audit two batches of 10 independent labels: the first has 1 error, the second has 2. What is the posterior probability of the 10% hypothesis after both batches, and does updating batch by batch change it?

  1. AAbout 0.93 when all 20 labels are pooled, but about 0.84 batch by batch, because the 0.3 prior enters once per update and so is counted twice in the sequential result.
  2. BAbout 0.67: update each batch separately from the 0.3 prior (giving about 0.50 and 0.84) and average the two posteriors, since the batches are independent evidence.
  3. CAbout 0.97 either way: with 20 labels the data dominate, so the posterior is the normalised likelihood ratio, 29.4 / (29.4 + 1), and the 0.3 prior no longer matters.
  4. DAbout 0.93 either way: the first batch moves P(10%) from 0.30 to about 0.50, the second from 0.50 to about 0.93, and one update on all 20 labels gives the same 0.93.
Show the answer and explanation

Correct answer: D, About 0.93 either way: the first batch moves P(10%) from 0.30 to about 0.50, the second from 0.50 to about 0.93, and one update on all 20 labels gives the same 0.93.

Explanation Bayes Theorem

With a few discrete hypotheses, Bayes' rule is a table: multiply each prior by the likelihood of the data, then normalise. The binomial coefficient is the same under both hypotheses and cancels.

StepLikelihood if 2%Likelihood if 10%P(10%) after
Prior0.30
Batch 1: 1 error in 100.02 · 0.98⁹ ≈ 0.01670.1 · 0.9⁹ ≈ 0.0387≈ 0.50
Batch 2: 2 errors in 100.02² · 0.98⁸ ≈ 0.000340.1² · 0.9⁸ ≈ 0.0043≈ 0.93

In one step: the likelihood ratio for 3 errors in 20 is (0.1³ · 0.9¹⁷) / (0.02³ · 0.98¹⁷) ≈ 29.4, the posterior odds are (0.3/0.7) × 29.4 ≈ 12.6, so P(10%) ≈ 12.6 / 13.6 ≈ 0.93.

Sequential and batch updates agree because, for data that are independent given the hypothesis, likelihoods multiply: P(batch 1, batch 2 | h) = P(batch 1 | h) · P(batch 2 | h). Each posterior becomes the next prior, and the original prior is used exactly once.

Why the distractors fail: the prior is not reapplied at each step, so nothing is counted twice (0.84 is what you get by updating batch 2 alone from the 0.3 prior, which throws batch 1 away). Averaging posteriors from separate updates also discards evidence. And 20 labels do not make the prior irrelevant: dropping it gives 0.97 instead of 0.93.

Interview tip: this is why Bayesian monitoring can run as a stream: keep the current posterior and update it with each new batch. The same logic underlies sequential testing and Thompson-sampling bandits.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More Probability & Math questions

  1. A bank fine-tunes a multilingual support assistant on a corpus that is 90% English and 10% Turkish by tokens. Following common multilingual practice, it…
  2. A churn network maps four features x ∈ ℝ⁴ through a = W₁x + b₁ (W₁ is 3 × 4), h = ReLU(a) and z = W₂h + b₂ (W₂ is 2 × 3). Writing the Jacobian with entry (i,…
  3. Each week a loyalty-app user is either Engaged or Idle. An Engaged user becomes Idle the next week with probability 0.10, and an Idle user becomes Engaged…
  4. In RLHF you need the gradient of J(θ) = E[R(y)], where y is a token sequence sampled from the policy LLM π_θ and R is a reward model's score treated as a…
  5. What is the difference between independent events and mutually exclusive events?