diff --git a/source/statistics/bayes_theorem.rst b/source/statistics/bayes_theorem.rst index ea2ac41..c8522a1 100644 --- a/source/statistics/bayes_theorem.rst +++ b/source/statistics/bayes_theorem.rst @@ -1,15 +1,31 @@ Bayes' Theorem --------------- -This page is inpired from `MathIsFun `__. +This page is inpired from: + +* `MathIsFun `__ +* `Wikipedia `__ Theorem ========= +The Bayes's theorem describes the probability of an event, based on prior knowledge of conditions +that might be related to the event. +To compute :math:`P(A|B)`, in other words, the probability of the event :math:`A` to happen, knowing that :math:`B` +already happen, the following drawing can be used: + .. figure:: figures/bayes_theorem.svg :align: center :width: 400px + :math:`\,` + +The red area represents :math:`P(B)=a3+a4`. Thus, to compute :math:`P(A|B)` we do: + +.. math:: + P(A|B)=\frac{a3}{a3+a4}=\frac{P(A)P(B|A)}{P(A)P(B|A)+P(\neg A)P(B|\neg A)}=\frac{P(A)P(B|A)}{P(B)} + +This final formula is the Baye's Theorem. See the `3Blue1Brown video `__ for a better understanding. Example