The probability density function (PDF) of a random variable is a function describing the probabilities of each particular event occurring. For instance, a random variable describing the result of a single dice roll has the p.d.f.
In general, the value of the p.d.f. at any point must be nonnegative (since a negative probability is impossible), and the sum of the probabilities must be equal to 1 (as exactly one outcome must occur).
The expected value of a random variable is a weighted average of each case, defined by:
which weights the values of each outcome by the probability it occurs. For example, the expected value of a single dice roll is
Note that the expected value does not mean the most likely value to occur (the mode); indeed, 3.5 is an impossible value for a die roll to take on. The best interpretation of the expected value is its significance across multiple trials; after dice rolls, the sum of the results is approximated by . This is also an illustration of linearity of expectation, which states that for any two (not necessarily independent random variables and ,
where is the random variable representing the sum of and . In this particular case, this says that if are random variables representing a single dice roll, then is a random variable representing the sum of dice rolls, and that
where is the mean of .
This is often rewritten in the following manner:
Although the mean is always additive, the corresponding property holds for variance under the additional assumption of independence: