Definition: A random variable is defined as a real- or complex-valued function of some random event, and is fully characterized by its probability distribution.
Example: A random variable can be defined based on a coin toss by defining numerical values for heads and tails. For example, we may assign 0 to tails and 1 to heads. The probability distribution for this random variable is then
Example: A die can be used to generate integer-valued random variables between 1 and 6. Rolling the die provides an underlying random event. The probability distribution of a fair die is the discrete uniform distribution between 1 and 6. I.e.,
Example: A pair of dice can be used to generate integer-valued random variables between 2 and 12. Rolling the dice provides an underlying random event. The probability distribution of two fair dice is given by
This may be called a discrete triangular distribution. It can be shown to be given by the convolution of the discrete uniform distribution for one die with itself. This is a general fact for sums of random variables (the distribution of the sum equals the convolution of the component distributions).
Example: Consider a random experiment in which a sewing needle is dropped onto the ground from a high altitude. For each such event, the angle of the needle with respect to north is measured. A reasonable model for the distribution of angles (neglecting the earth's magnetic field) is the continuous uniform distribution on , i.e., for any real numbers and in the interval , with , the probability of the needle angle falling within that interval is
Note, however, that the probability of any single angle is zero. This is our first example of a continuous probability distribution. Therefore, we cannot simply define the probability of outcome for each . Instead, we must define the probability density function (PDF):
To calculate a probability, the PDF must be integrated over one or more intervals. As follows from Lebesgue integration theory (``measure theory''), the probability of any countably infinite set of discrete points is zero when the PDF is finite. This is because such a set of points is a ``set of measure zero'' under integration. Note that we write for discrete probability distributions and for PDFs. A discrete probability distribution such as that in (C.4) can be written as
where denotes an impulse.C.1