Definition 6 Conditional Probability: Let be a sample space and let be a probability over . Let and be events such that . The conditional probability of given is given by:
We can think of conditional probability as a restriction of the set of possible outcomes from the sample space to .
Example 2 If we roll two fair dice and observe that the first die is a four, what is the probability that the sum of the two dice equals a six given that the first die is a four?
Given that the first roll is a 4, the restricted sample space is . The conditional probability of this event is 1/6. Another way to calculate it is to use the formula 1/36/6/36 = 1/6.
A useful way to organize the probability space of two events A and B is to divide the sample space into four mutually exclusive events (note: the logical motivation here is similar to the concept of a proof by cases: we attack each independent case separately, and put them all together at the end of present a single solution).

The probability in the margins are called marginals and are calculated by summing across the rows and the columns. The probability of two events is called joint distribution. Sometimes we denote is as or .
From the marginals and the definition of conditional probability, we have:
Definition 7 Total Probability Rule:
It is called Total because and orm the totality of the sample space.
Using conditional probability we can write:
We can derive a useful rule, called Bayes Rule (after the English philosopher Thomas Bayes) by using the definition of conditional probabilities:
is called posterior (posterior distribution on A given B.)
is called prior.
is called evidence.
is called likelihood.
This formula known as Bayes rule.
Using the table above, we can write as follows:
A common use of Bayes rule is when we want to know the probability of an unobserved event given an observed event.