# Theorem of Total Probabilities and Bayes’ Rule

### From MM*Stat International

English |

Português |

Français |

Español |

Italiano |

Nederlands |

Recall the disjoint decomoposition we have introduced earlier in this chapter as a set of events satisfying

## Theorem of Total Probabilities

be a disjoint decomposition. Then, for any event with : We have applied the multiplication rule of probability .

## Bayes’ Rule

Let be a disjoint decomposition. Then, for any event with and given conditional probabilites :
The *Bayesian approach* to statistics interprets the as *posterior probabilities* and as *prior probabilities*. This conceptual approach to statistics accounts for prior information in the form of subjective belief rather than defining probabilities as limits of relative frequencies.
The Monty Hall problem (named after Monty Hall, television host of the show ”Let’s make a deal”) is based on the following situation:
Monty Hall shows his guest three doors A,B and C. The main prize is hidden behind one of them, other doors conceal smaller prizes. For now, let us assume that the main prize is behind the door B.
Monty Hall asks the player to choose one door. After the player chooses (let us say door A), one of the doors which does not contain the main prize is opened (let us say door C). The player can now decide whether to continue with his original choice (door A) or if he wants to choose the other closed door (door B). What is the probability that the main prize is behind the originally selected door (A) or behind the other (unopened and not selected) door (B)?
This interactive example allows you to play the game with “virtual Monty” and to study the relative frequency of winning the game depending on your strategy.
The statistical definition of probability ensures that your question will be answered after a sufficient number of games. Try it!!!

**Solution:**
Let us define the events
Initially, the probability is that you have selected the winning door.,
These probabilities are valid **before** Monty opens a door; we can denote them as the a priori probabilities. Let us say, that you choose door A. Monty now opens one of the other doors which does not contain the main price. We distinguish two situations:

Situation 1

If the prize is behind your door (A) then Monty can open either of the remaing two doors (door B or C). Let us assume that his decision is random—this means that both door have probability 1/2.

Situation 2

If the prices

**is not**behind your door, then it has to be behind door B or C and Monty has to open (i.e. he will open with probability 1) the other one.

Let us assume that Monty opens door B. Mathematically, this means
As a player, you do not know which situation has occurred.
When Monty opens the door, you can stick to your original decision or you can change it and open door C. Which decision is better, i.e. which of the doors A or C are more likely to conceal the main prize, if we know that Monty has opened door B?
We would like to calculate the probabilities and . The a priori probabilities were . When Monty opens door , we can calculate the a posteriori probabilities by applying the Bayes rule and the Total Probabilities Theorem:
Changing your decision pays off!
Description of the interactive example:
In this example you can choose the number of rounds , the number of six and the probability of the event, that you obtain six when you throw “adjusted” dice. From these entries, you obtain a probability that the dice used in the game, was adjusted.
Read the following story carefully before you start the interactive example !
**The story:**
Three siblings are playing dice. The youngest one (a boy) gave one die to each of his sisters. They roll the die times and the one who obtains six the most frequently, wins.
The sisters remember that one of the dice is ”loaded’. The probability of obtaining six with this die is , the probability of other numbers is uniform at .
The first sister rolled the die times and she has sixes. The other sister wants to caculate the probability that her die is loaded. This can be done easily.
Let us look at the actual number of sixes which can be . For simplicity, suppose For a fair die we will write , for a loaded die, . . All throws are mutually independent and therefore we obtain:
.
For the same experiment with the loaded die () we obtain:
Let us say, that the first sister obtains two sixes from her three throws (). What is the probability that she played with the loaded die?
We want to calculate the probability . According to the Bayes rule we have Using leads in the numerator to and in the denominator so that the probability .
**The interactive example:**
Choose (the number of sixes), (the number of throws) and (the probability of a six when the die is loaded) and let the computer calculate the probability .
Recommendation: always change the value of only one parameter at a time and observe the influence of the change on the result.
Assume per cent of the population is infected with a particular virus that leads to acute disease only after a long period of time.
A clinical study shows that per cent of the individuals suffering from the symptoms that confirm an infection with the virus test positive. On the other hand, per cent of people not developing the symptoms test positive as well.
What is the probability that a person testing positive has the infection?
Let us first formalise the problem. Instead of using the set theoretic notation we will now define indicator variables for the two binary variables corresponding to the infection () and the test ():
Using the above we know the following probabilities.

We we would like to calculate . The definition of conditional probability contains probabilities which not readily available: To replace the numerator by a known quantity we rearrange to yield The denominator can be calculated using the theorem of total probabilities: We thus get Performing the calculation we obtain a somewhat surprising result: Thus a ramdomly selected person who tests positive has an per cent chance of not being infected. But don’t forget about one crucial assumption we have made: the proportion of infected people has to be the same in the population and the sample of tested persons. This may be true for large scale clinical tests. But in practice, there is usually a reason for testing a person, e.g. him/her having been exposed to an infected person. In this example we will apply both the theorem of total probabilities and Bayes’ rule. Wolfram has a wine cellar. Having invited guests for a dinner party, he considers showing off in the most economical fashion. He knows that his guests usually buy their wine at the local supermarket. So he decides to provide above average food and not to spend too much time choosing the accompanying wine. His stock currently consists of Qualitätswein, Kabinett and Spätlese in the proportions . The proportion of white wine in these classes is , and , respectively. Being a technocrat not only in pedantically monitorig his stock, he wants to compute the probability for producing a bottle of white wine when randomly picking one. He estimates probabilities by their relative proportions in the stock population:

This classification establishes a disjoint decomposition of Wolfram’s wine stock: , , . Let represent the event of picking a bottle of white wine. Then we know:

Being short of time, Wolfram decides to have the food delivered from a gourmet deli. Now he has spare time to draw a Venn diagram:

As , and establish a disjoint decomposition, , and must be disjoint as well. Thus, for As he doesn’t know the probabilities for the union sets on the right hand side, Wolfram applies the multiplication rule, substituting for : Thus randomly selecting a bottle will result in a white wine with a 25 per cent probility. Given that Wolfram has selected a bottle of white wine, what is the probability that it is Qualitätswein, that is, what is ? Wolfram wants to apply the definition for conditional probability, He has already calculated using the theorem of total probability. But what about the numerator on the right hand side? Wolfram chooses to rearrange the definition for the conditional probability of , given to yield a multiplication rule he can substitute into the numerator: This yields