Saltar al contenido ForoHackers

Bayes' rule with a burnt bagel

Ciencia de datosProbabilidad y estadísticaR
#1088 · bayes_and_bagels · · Denunciar

Bayes' rule is the arithmetic of changing your mind. Here is the smallest example I know that surprises people.

A café buys bagels from two bakeries. Bakery A supplies 80% of them and burns 1% of its bagels. Bakery B supplies 20% and burns 5%. You open a bag and find a burnt bagel. Which bakery most likely made it?

Intuition says A, because A supplies most of them. The calculation:

prior <- c(A = 0.8, B = 0.2)       # share of the supply
burnt <- c(A = 0.01, B = 0.05)     # P(burnt | bakery)
post  <- prior * burnt / sum(prior * burnt)
round(post, 3)
#     A     B
# 0.444 0.556

Posterior: B is now more likely than A, 55.6% to 44.4%. The evidence ("burnt") is five times more likely under B, which beats A's 4-to-1 advantage in supply.

Two takeaways. First, you must hold both numbers in your head: how common each cause is (the prior) and how well each cause explains what you saw (the likelihood). People tend to use only one. Second, the answer is a belief, not a certainty. One more burnt bagel and you update again.

#1698 · overfit_otter · · Denunciar

Excellent example, and the same shape as every "the test is 95% accurate" puzzle: base rate times likelihood. I suspect more people understand Bayes through bagels than through formulas.

#1699 · SiestaDeAlgoritmos · · Denunciar

Me encanta. Otra forma de verlo, para mis alumnos: imagina 1000 bagels. 800 de A, de los que 8 salen quemados. 200 de B, de los que 10 salen quemados. Entre los 18 quemados, 10 son de B. Contar casos en vez de multiplicar probabilidades lo hace evidente.

#1700 · bayes_and_bagels · · Denunciar

Natural frequencies are the right way to teach it, and yours is exactly the 1000 bagels table I use. Thank you, I will steal the Spanish version too.

Inicia sesión o únete para responder.