Rules

Sum rule:

Product rule:

Derivation

Let us have random variables and .

  • can take any of the values where
  • can take any of the values where

We also define:

  • is the number of trials
  • is the number of trials in which and for trials in which we sample both of the variables and .
  • is the number of trials in which takes the value , irrespective of the value that takes.
  • is the number of trials in which takes the value , irrespective of the value that takes.

The joint probability of and is written as

The probability that takes the value irrespective of the value of is written as and is given by the fraction of the total number of points that fall in column , so that:

Because the number of instances in column , denoted by , is just the sum of the cells in the column, we have . This gives us the sum rule of probability:

Sum Rule of Probability

where is the number of values can take on, such that for .

Note that is sometimes called the marginal probability and is obtained by marginalizing, or summing out, the other variables (in this case ).

What if we want to consider cases where given that ? This is conditional probability, which we can obtain by finding the fraction of points in column that fall in cell :

Using our equations from before, we can then write out the joint probability:

This gives us the product rule of probability:

Product Rule of Probability