Bayes' theorem states the following:
P(A|B)=[P(B|A) * P(A)]/P(B)
Proof:
We can prove this theorem using elementary set theory on the probability spaces of the events A and B. That is, here, a probability event will be defined as the set of the possible outcomes in the probability space:
Figure 2.1: Probability space for the two events
From figure 2.1 above, we can state the following relationships:
P(A|B)=P(A∩B)/P(B)
P(B|A)=P(A∩B)/P(A)
Rearranging these relationships, we get the following:
P(A∩B)=P(A|B)*P(B)
P(A∩B)=P(B|A)*P(A)
P(A|B)*P(B)=P(B|A)*P(A)
This is, in fact, Bayes' theorem:
P(A|B)=P(B|A)*P(A)/P(B)
This concludes the proof.