A random variable, usually denoted by x, describes the outcome of a random process (or "experiment") numerically. For example, suppose you toss a coin. Then the possible outcomes from this experiment are heads and tails. We could define a random variable x to take the value 1 if the coin lands heads and 0 if it lands tails. Since x assigns a number which depends on the outcome of the random process, it is a random variable. There are two types of random variables: discrete and continuous. A discrete random variable takes a finite number of values or a countably infinite number of values such as 0, 1, 2, .... A continuous random variable can take any value inside of some interval or set of intervals.
Outcome |
Random Variable (x) |
Tails |
0 |
Heads |
1 |
A probability distribution describes how probabilities are distributed over values of a random variable. The probability distribution for a discrete random variable is known as a discrete distribution while the probabiliy distribution for a continuous random variable is called a continuous distribution. There are several ways of representing the probability distribution of a random variable. For a discrete random variable, we can simply list the values of the random variable and the corresponding values in a table. However, a table doesn't work for a continuous random variable. Other ways of representing a probability distribution are a formula and a graph, which works for both discrete and continuous random variables.
Random Variable (x) |
Probability |
0 |
.5 |
1 |
.5 |
Probabilities for a discrete random variable are provided by the probability function, written f(x) or sometimes p(x). For example, in the experiment of tossing a coin with a random variable x = 1 for heads and x = 0 for tails, we have f(0) = f(1) = 1/2. This is simply because the probability of heads and tails are both 50% or 1/2. There are two requirements for the probability function. The first is that the value of each f(x) is at least zero. The second requirement is that the values of f(x) sum to one. Note that for a continuous random variable we don't use a probability function. We use something called a probability density function, which is actually writen the same way as the probability function - f(x).
Probability Function |
$ f(x) \geq {\color{Black}0} $ |
$ \sum f(x) = 1 $ |
As mentioned before, a discrete distribution can be represented in a couple of different ways: table, graph or formula. A simple example of a table is the random variable for a coin toss. The simplest example of graph method is known as the discrete uniform distribution. Here, the probability for each value of the random variable is equal to 1 divided by the number of possible values, denoted n. Actually, the coin toss is an example of a discrete uniform distribution. This is because the random variable can take two possible values (0 or 1) and the probability of each value is 1/2. Another example of a discrete uniform distribution is rolling a die, where the probability of 1 through 6 is 1/6.
Discrete Uniform Distribution |
$ f(x) = \dfrac{1}{n} $ |
The probability distribution of a random variable can be summarized in a couple of different ways. One way is to use the expected value, which is also known as the mean, and written E(x) or u. The expected value of a random variable, just like the mean of a variable, measures the central location of the random variable. It can be thought of as the long-run average of the random variable if we repeated the experiment many times. For a discrete random variable, the expected value is calculated by summing the products of the random variables and the corresponding probabilities. So, for our coin toss example, we have the expected value equals 1*(1/2) + 0*(1/2) = 1/2 which is what we would expect on average in the long-run.
Expected Value |
$ E(x) = \sum x f(x) $ |
The variance of a random variables, denoted by Var(x) or sigma^2, measures the variability in the values of the random variable. Note that sigma^2 is the same notation used for the population variance, just as mu^2 is used for both the expected value and population mean. When the discrete probability distribution is presented as a table, it is straight-forward to calculate the expected value and variance by expanding the table. Computing the variance involves use of the expected value. It is the sum of the product of the squared deviations of the random variable from the expected value and the corresponding probabilities.
Variance |
$ \text{Var}(x) = \sum (x - \mu)^2 f(x) $ |
The standard deviation can be found by taking the square root of the variance. Like the variance, the standard deviation is a measure of variability for a discrete random variable. However, unlike the variance, it is in the same units as the random variable. The reason the variance is not in the same units as the random variable is because its formula involves squaring the difference between x and the mean. So, the units of the variance are in the units of the random variable squared. Taking the square root brings the value back to the same units as the random variable.
Standard Deviation |
$ \sigma = \sqrt{\text{Var}(x)} $ |
The most important discrete distribution is the binomial distribution. It is the probability distribution corresponding to a certain type of experiment, known as a binomial experiment. A binomial experiment consists of a sequence of n trials with two outcomes possible in each trial. The two outcomes are labeled "success" and "failure" with probabilities of p and 1-p, respectively. The probabilities of success and failure do not change from trial to trial and the trials are independent. The probability of x successes in n trials is given by the binomial probability function. The expected value and variance are given by E(x) = np and Var(x) = np(1-p).
Binomial Distribution |
$ f(x) = {n \choose x} p^x (1-p)^{(n-x)} $ |
The Poisson probability distribution is useful when the random variable measures the number of occurrences over an interval of time or space. It is associated with a Poisson experiment. A Poisson experiment is one in which the probability of an occurrence is the same for any two intervals of the same length and occurrences are independent of each other. Probabilities for a Poisson probability distribution can be calculated using the Poisson probability function.
Poisson Distribution |
$ f(x) = \dfrac{\mu^x e^{-\mu}}{x!} $ |
The hypergeometric probabiity distribution is very similar to the binomial probability distributionn. The differences are that in a hypergeometric distribution, the trials are not independent and the probability of success changes from trial to trial. Another difference between the two is that for the binomial probability function, we use the probability of success, p. For the hypergeometric probability distribution, we use the number of successes, r, in the population, N. The expected value and variance are given by E(x) = n$\left(\frac{r}{N}\right)$ and Var(x) = n$\left(\frac{r}{N}\right) \left(1 - \frac{r}{N}\right) \left(\frac{N-n}{N-1}\right)$.
Hypergeometric Distribution |
$ f(x) = \dfrac{{r \choose x}{N-r \choose n-\cancel{x}}}{{N \choose n}} $ |