Formula of total probability
First of all, it's important to remember the definition of mutually exclusive (disjoint) events. Two events are mutually exclusive if they can't both occur at the same time. For example, event "randomly chosen number is greater than " and event "randomly chosen number is less than " are disjoint.
Next, we need one more definition. When a sample space is distributed down into some mutually exclusive events (finite or infinite set) such that their union forms the sample space itself , then events are called exhaustive events. Also events are called hypotheses.
And the last in this paragraph is the law of total probability. Let's suppose, that are exhaustive events and we need to calculate the probability of some event the following way ( can be ):
Why is this formula correct? Event can be represented as a union of non-intersecting events . These events are mutually non-intersecting, because the events are mutually exclusive. Therefore:
Next, we use the definition of the conditional probability:
Finally, we have the already written formula:
Let's see a simple example of usage of the total probability formula. Three factories are producing the same pills. The first one is producing of all pills, the second one and the third one . And the first factory has defective pills, the second , the third . What is the probability of buying defective pills?
Let event mean that pills are produced by a factory number , event is buying defective pills.
We have , and .
Using the formula of total probability we get the answer:
Bayes' theorem: simple form
In this paragraph we introduce the simple form of Bayes' formula.
Suppose, there are events , and .
First, let's look at the definition of conditional probability:
But, on the other hand:
Notice that both fractions have the same numerators and we can equate them:
Also it can be divided by and the result is a simple form of Bayes' theorem:
With this formula we could calculate conditional probability without knowing the probability of .
Extended Bayes' theorem
So, we have the formula . It's easy to remember and use that, but in real problems, the probability of event is very often unknown. We can try to use the formula of total probability for event :
where are hypotheses
Okay, now let's try Bayes' theorem where is some hypothesis and understand the trustability of this hypothesis.
Suppose we have a hypothesis and some event .
Using the previous formula we know that
We can use the formula of total probability for event , as we have done before:
The last formula is called Bayes' theorem or Bayes' formula.
Actually, if some event happened and we know all probabilities and we can calculate the probability that some hypothesis really happened.
For example, let's look at the problem about the factories from the previous paragraph. Now we need to find the probability of having bought a pill produced by the first factory, if this pill is defective.
means that pills are produced by factory number , as it meant before, event is buying defective pills. Formally, we need to find . We calculated that .
Let's use the Bayes' theorem:
By this way we recalculated the probability that we have bought a pill from the first factory. If it was unknown that this pill is defective, the probability that we have bought a pill from the first factory would be .
Example
Let's consider an example: two shooters toss a coin and decide which of them will shoot. If it comes up heads, the first one will shoot, if it comes up tails the second one. The probability that the first shooter hits the target is , the second one . Suppose that we know the result of this experiment: the target was hit. For each shooter what is the probability that he was shooting in this case?
We have hypotheses: is that the first shooter will shoot, is for the second. Also let the event mean that the target was hit. We know that and . So, we need to calculate and .
Notice, that if we didn't know that the target was hit, it would be clear that .
Now we are ready to use Bayes' formula.
So, if it's unknown that target was shot, then the probabilities of heads and tails are equal, but if the target was shot, then the probability of heads is times more than the probability of tails.
Conclusion
Now we have learned very important formulas – the formula of the total probability and Bayes' formula. The formula of the total probability helps us to calculate probability using exhaustive events. And Bayes' formula can recalculate the probability of some event if something is known about the result of this event. Both formulas are widely used in next topics.