PRACTICAL MATHEMATICS

Random Variables

Contents

  1. Discrete Random Variables
  2. Continuous Random Variables
  3. The Normal Random Variable
  4. Chebyshev's Inequality

Discrete Random Variables

A random variable x has a set of possible values, called a sample space. If the sample space is a discrete set {x1, ... , xn}, then we may assign theoretical probabilities p(x1), ... , p(xn) to each xi such that 0 < p(xi) < 1, and p(x1) + ... +p(xn) = 1.

The sample space may consist of categories.

EXAMPLES

  1. Sample space: {male, female}.
    Probabilities: p(male) = 0.5, p(female) = 0.5.
  2. Sample space: {blue eyes, brown eyes}.
    Probabilities: p(blue eyes) = 0.25, p(brown eyes) = 0.75.

When the sample space consists of numbers we may calculate statistics summarizing the properties of the random variable x.

Let f(x) be any function of x. The expected value E[f(x)] of f(x) is defined to be

E[f(x)] = p(x1).f(x1) + ... + p(xn).f(xn).
The mean is the expected value of x:
mu = E[x] = p(x1).x1 + ... + p(xn).xn.
The variance Var(x) is the expected value of (x - mu)2:
sigma2 = Var(x) = E[(x - mu)2] = p(x1).(x1 - mu)2 + ... + p(xn).(xn - mu)2.

EXAMPLE

Let k represent the number of wet days in a period of n days. Then the sample space is the set of numbers: k = 0, 1, 2, ..., n. Suppose the average number of wet days in a period of n days is a constant mu. Then the probability p(k) of getting exactly k wet days in any particular period of n days may be given by the binomial distribution:
p(k) = C(n,k).pk.(1 - p)n-k,
where C(n,k) = n!/k!(n - k)!, and p = mu/n.

The expected value of k is: E[k] = mu = n.p.

The variance is: sigma2 = Var(k) = n.p.(1 - p).

The standard deviation is therefore: sigma = sqrt[n.p.(1 - p)].

For example, if n = 7 and mu = 4, then we have the probabilities in Table 1, and sigma = 1.309. These values are shown in Fig. 1.

Table 1. The Binomial Distribution with n = 7 and mu = 4
k: 0 1 2 3 4 5 6 7
p(k): .003 .025 .099 .220 .294 .235 .104 .020

Fig. 1.

Fig. 1. The Binomial distribution with mu = 4.
The mean and standard deviation are shown above the diagram.

EXERCISE

Find the values of p(k) with k = 0, 1, 2, 3, 4, 5 for the binomial distribution with n = 5 and mu = 1.5; show the probabilities on a diagram.

EXAMPLE

Let n represent the number of sales per day of an item in a shop. Then the sample space is the set of numbers: n = 0, 1, 2, 3, ... Suppose the average number of sales per day is a constant mu. Then the probability of selling exactly n items on any particular day may be given by the Poisson distribution:
p(n) = (mun/n!).exp(-mu).
The expected value of n is: E[n] = mu.

The variance is: sigma2 = Var(n) = mu.

The standard deviation is therefore: sigma = sqrt(mu).

For example, if mu = 1.5, then we have the probabilities in Table 2, and sigma = 1.225. These values are shown in Fig. 2.

Table 2. The Poisson Distribution with mu = 1.5
n: 0 1 2 3 4 5 6 7 . . . . .
p(n): .223 .335 .251 .126 .047 .014 .004 .001 . . . . .

Fig. 2.

Fig. 2. The Poisson distribution with mu = 1.5.
The mean and standard deviation are shown above the diagram.

EXERCISE

Find the values of p(n) with n = 0 to 6 for the Poisson distribution with mu = 3.5, and show the probabilities on a diagram.

Continuous Random Variables

The sample space may be a continuous interval of real numbers x. Theoretical probabilities are then represented by a probability density function phi(x) such that the probability for x to be in the interval a < x < b is:
p(a < x < b) = Integral(a, b): phi(x).dx,
and
Integral(-infinity, +infinity): phi(x).dx = 1.
The expected value of a function f(x) is given by:
E[f(x)] = Integral(-infinity, +infinity): f(x).phi(x).dx.
The mean of the random variable is:
mu = E[x] = Integral(-infinity, +infinity): x.phi(x).dx,
and the variance is:
sigma2 = Var(x) = E[(x - mu)2] = Integral(-infinity, +infinity): (x - mu)2.phi(x).dx
= Integral(-infinity, +infinity): x2.phi(x).dx - mu2.

The Normal Random Variable

An important continuous random variable is the normal random variable with mean mu and variance sigma2. It has the probability density function:
phimu,sigma(x) = [sigma.sqrt(2.pi)]-1.exp[-(x - mu)2/(2.sigma2)].
By putting z = (x - mu)/sigma we get the standard normal random variable, which has the probability density function:
phi0,1(z) = [sqrt(2.pi)]-1.exp[-(½).z2],
where mu = 0 and sigma = 1.

The graph of phi(z) and the probabilities for the values of z in the intervals of width sigma about the mean mu are shown in Fig. 3. The normal random variable arises when observations of a quantity are disturbed by a large number of random fluctuations which are independent of each other.

Fig. 3.

Fig. 3. The standard normal probability density function; mu = 0, and sigma = 1. Numbers above the intervals are the probabilities for z to be in the intervals.

Chebyshev's Inequality

Chebyshev showed that for any probability density function the random variable is concentrated about the mean value in accordance with the inequality:
p(mu -n.sigma < x < mu + n.sigma) > 1 - 1/n2,
where n > 1.

A comparison between these probabilities and the corresponding probabilities for the standard normal random variable is given in Table 3. Of all possible random variables with the same variance, the normal random variable is the most concentrated about the mean value.

Table 3. Values of the Probability that x is in the interval -n.sigma to +n.sigma.
   n    Any random variable Normal random variable
1 > 0 0.68
2 >0.75 0.95
3 >0.89 0.997
4 >0.94 0.99994

Home Page


By R. H. B. Exell, 1998. King Mongkut's University of Technology Thonburi.