Bayes Probability calculator

You have (a belief about) a hypothesis. See some evidence about it. How should this information update your prior belief.

Instead of using the meaningless A and B, we use here H for hypothesis and E for evidence.

P(H) the probability of the hypothesis being true before any evidence. The current belief about the hypothesis; the "prior".
P(E|H) the probability of seeing evidence if the hypothesis is true. The "likelihood".
P(E) the probability of seeing evidence.
P(H|E) the probability the hypothesis is true given some evidence, i.e. when E is true. The new, updated belief about the hypothesis; the "posterior".

Bayes' formula:
P(H|E) = P(H)·P(E|H) / P(E)              P(E)=P(H)·P(E|H)+P(H̄)·P(E|H̄)

How often the hypothesis is true among the cases where the evidence is true , i.e. what proportion.

Enter these 3 probabilities. OR    Enter these 4 data counts.
P(H):     P(H̄)= H
P(E|H): P(H)P(E|H)= EH E
P(E|H̄): OR P(E): P(H̄)P(E|H̄)=

P(H|E)=       = /(+)

Area=1 i.e. all possibilities.

P(E)=P(H)P(E|H)+P(H̄)P(E|H̄) = total probability of seeing the evidence.
P(H|E) = P(H)P(E|H) / (P(H)P(E|H)+P(H̄)P(E|H̄)) = the proportion of the possibilities fitting the evidence that supports the hypothesis.


Box 1 has 2 red, 1 blue ball
Box 2 has 1 red, 3 blue balls
select a box, draw a ball. Sequence of dependent events: box, then ball

P(B1)=P(B2)=1/2
P(red)=1/2*2/3+1/2*1/4 = 11/24=0.458333          the probability of seeing red
P(blue)=1/2*1/3+1/2*3/4 = 13/24=541666 =P(~red)
P(red|B1) = P(red∩B1)/P(B1) = 1/2*2/3 / 1/2 = 2/3
P(red|B2) = P(red∩B2)/P(B2) = 1/2*1/4 / 1/2 = 1/4
P(blue|B1) = P(blue∩B1)/P(B1) = 1/2*1/3 / 1/2 = 1/3
P(blue|B2) = P(blue∩B2)/P(B2) = 1/2*3/4 / 1/2 = 3/4

P(B1|red) =
the color, the second step in the sequence, is the Evidence; box is the Hypothesis
P(H)=P(B1)=0.5  your "prior" belief about boxes, 50-50
P(E|H)=P(red|B1)=.6666  the likelihood of seeing red if it's box 1
P(E|~H)=P(red|B2)=.25     or P(E)=P(B1)·P(red|B1)+P(B2)·P(red|B2)=1/2*2/3+1/2*1/4=0.458333
=0.7272=8/11   your "posterior" belief that it was box 1 whence the red

P(B2|red) =
P(B1|blue) =
P(B2|blue) =