Skip to article frontmatterSkip to article content

3.1 Random Variables and Discrete Distributions

Overview

A random variable is a real-valued function defined on a sample space. Random variables are the main tools used for modeling unknown quantities in statistical analyses. For each random variable XX and each set CC of real numbers, we could calculate the probability that XX takes its value in CC. The collection of all of these probabilities is the distribution of XX. There are two major classes of distributions and random variables: discrete (this section) and continuous (3.2 Continuous Distributions). Discrete distributions are those that assign positive probability to at most countably many different values. A discrete distribution can be characterized by its probability mass function (pmf), which specifies the probability that the random variable takes each of the different possible values. A random variable with a discrete distribution will be called a discrete random variable.

3.1.1 Definition of a Random Variable

For example, in Example 3.1.1 the number XX of heads in the 10 tosses is a random variable. Another random variable in that example is Y=10XY = 10 − X, the number of tails.

The event that at least one utility demand is high in .

Figure 3.1:The event that at least one utility demand is high in Example 3.1.3.

The Distribution of a Random Variable

When a probability measure has been specified on the sample space of an experiment, we can determine probabilities associated with the possible values of each random variable XX. Let CC be a subset of the real line such that {XC}\{X \in C\} is an event, and let Pr(XC)\Pr(X \in C) denote the probability that the value of XX will belong to the subset CC. Then Pr(XC)\Pr(X \in C) is equal to the probability that the outcome ss of the experiment will be such that X(s)CX(s) \in C. In symbols,

Pr(XC)=Pr({s:X(s)C}).\Pr(X \in C) = \Pr(\{s: X(s) \in C\}).

It is a straightforward consequence of the definition of the distribution of XX that this distribution is itself a probability measure on the set of real numbers. The set {XC}\{X \in C\} will be an event for every set CC of real numbers that most readers will be able to imagine.

The event that water demand is between 50 and 175 in

Figure 3.2:The event that water demand is between 50 and 175 in Example 3.1.5

The general definition of distribution in Definition 3.1.2 is awkward, and it will be useful to find alternative ways to specify the distributions of random variables. In the remainder of this section, we shall introduce a few such alternatives.

Discrete Distributions

Random variables that can take every value in an interval are said to have continuous distributions and are discussed in 3.2 Continuous Distributions.

Here are some simple facts about probability mass functions.

A typical pmf is sketched in Figure 3.3, in which each vertical segment represents the value of f(x)f(x) corresponding to a possible value xx. The sum of the heights of the vertical segments in Figure 3.3 must be 1.

An example of a pmf

Figure 3.3:An example of a pmf

Theorem 3.1.2 shows that the pmf of a discrete random variable characterizes its distribution, and it allows us to dispense with the general definition of distribution when we are discussing discrete random variables.

Some random variables have distributions that appear so frequently that the distributions are given names. The random variable ZZ in Example 3.1.6 is one such example.

The ZZ in Example 3.1.6 has the Bernoulli distribution with parameter 0.65252. It is easy to see that the name of each Bernoulli distribution is enough to allow us to compute the pmf, which, in turn, allows us to characterize its distribution.

We conclude this section with illustrations of two additional families of discrete distributions that arise often enough to have names.

Uniform Distributions on Integers

The XX in Example 3.1.8 has the uniform distribution on the integers 0,1,,9990, 1, \ldots, 999. A uniform distribution on a set of kk integers has probability 1/k1/k on each integer. If b>ab > a, there are ba+1b − a + 1 integers from aa to bb including aa and bb. The next result follows immediately from what we have just seen, and it illustrates how the name of the distribution characterizes the distribution.

Theorem 3.1.3

If XX has the uniform distribution on the integers a,,ba, \ldots, b, the pmf of XX is

f(x)={1ba+1for x=a,,b,0otherwise.f(x) = \begin{cases} \frac{1}{b-a+1} &\text{for }x = a, \ldots, b, \\ 0 &\text{otherwise.} \end{cases}

The uniform distribution on the integers a,,ba, \ldots, b represents the outcome of an experiment that is often described by saying that one of the integers a,,ba, \ldots, b is chosen at random. In this context, the phrase “at random” means that each of the ba+1b − a + 1 integers is equally likely to be chosen. In this same sense, it is not possible to choose an integer at random from the set of all positive integers, because it is not possible to assign the same probability to every one of the positive integers and still make the sum of these probabilities equal to 1. In other words, a uniform distribution cannot be assigned to an infinite sequence of possible values, but such a distribution can be assigned to any finite sequence.

Note: Random Variables Can Have the Same Distribution without Being the Same Random Variable. Consider two consecutive daily number draws as in Example 3.1.8. The sample space consists of all 6-tuples (i1,,i6)(i_1, \ldots, i_6), where the first three coordinates are the numbers drawn on the first day and the last three are the numbers drawn on the second day (all in the order drawn). If s=(i1,,i6)s = (i_1, \ldots, i_6), let X1(s)=100i1+10i2+i3X_1(s) = 100i_1 + 10i_2 + i_3 and let X2(s)=100i4+10i5+i6X_2(s) = 100i_4 + 10i_5 + i_6. It is easy to see that X1X_1 and X2X_2 are different functions of ss and are not the same random variable. Indeed, there is only a small probability that they will take the same value. But they have the same distribution because they assume the same values with the same probabilities. If a businessman has 1000 customers numbered 0,,9990, \ldots, 999, and he selects one at random and records the number YY, the distribution of YY will be the same as the distribution of X1X_1 and of X2X_2, but YY is not like X1X_1 or X2X_2 in any other way.

Binomial Distributions

Example 3.1.9: Defective Parts (p. 98)

Consider again exm-2-2-5. In that example, a machine produces a defective item with probability pp (0<p<10 < p < 1) and produces a nondefective item with probability 1p1 − p. We assumed that the events that the different items were defective were mutually independent. Suppose that the experiment consists of examining nn of these items. Each outcome of this experiment will consist of a list of which items are defective and which are not, in the order examined. For example, we can let 0 stand for a nondefective item and 1 stand for a defective item. Then each outcome is a string of nn digits, each of which is 0 or 1. To be specific, if, say, n=6n = 6, then some of the possible outcomes are

010010,100100,000011,110000,100001,000000,etc.\texttt{010010}, \texttt{100100}, \texttt{000011}, \texttt{110000}, \texttt{100001}, \texttt{000000}, \text{etc.}

{#eq-3-1-3}

We will let XX denote the number of these items that are defective. Then the random variable XX will have a discrete distribution, and the possible values of XX will be 0,1,2,,n0, 1, 2, \ldots, n. For example, the first four outcomes listed in eq-3-1-3 all have X(s)=2X(s) = 2. The last outcome listed has X(s)=0X(s) = 0.

Div is a generalization of exm-2-2-5 with nn items inspected rather than just six, and rewritten in the notation of random variables. For x=0,1,,nx = 0, 1, \ldots, n, the probability of obtaining each particular ordered sequence of nn items containing exactly xx defectives and nxn − x nondefectives is px(1p)nxp^x(1 − p)^{n−x}, just as it was in exm-2-2-5. Since there are (nx)\binom{n}{x} different ordered sequences of this type, it follows that

Pr(X=x)=(nx)px(1p)nx.\Pr(X = x) = \binom{n}{x}p^x(1-p)^{n-x}.

Therefore, the pmf of XX will be as follows:

f(x)={(nx)px(1p)nx for x=0,1,,n,0otherwise.f(x) = \begin{cases} \binom{n}{x}p^x(1-p)^{n-x} &\text{ for }x = 0, 1, \ldots, n, \\ 0 &\text{otherwise.} \end{cases}

{#eq-3-1-4}

Definition 3.1.7: Binomial Distribution/Random Variable

The discrete distribution represented by the pmf in eq-3-1-4 is called the binomial distribution with parameters nn and pp. A random variable with this distribution is said to be a binomial random variable with parameters nn and pp.

The reader should be able to verify that the random variable XX in Example 3.1.4, the number of heads in a sequence of 10 independent tosses of a fair coin, has the binomial distribution with parameters 10 and 1/21/2.

Since the name of each binomial distribution is sufficient to construct its pmf, it follows that the name is enough to identify the distribution. The name of each distribution includes the two parameters. The binomial distributions are very important in probability and statistics and will be discussed further in later chapters of this book.

A short table of values of certain binomial distributions is given at the end of this book. It can be found from this table, for example, that if XX has the binomial distribution with parameters n=10n = 10 and p=0.2p = 0.2, then Pr(X=5)=0.0264\Pr(X = 5) = 0.0264 and Pr(X5)=0.0328\Pr(X \geq 5) = 0.0328.

As another example, suppose that a clinical trial is being run. Suppose that the probability that a patient recovers from her symptoms during the trial is pp and that the probability is 1p1 − p that the patient does not recover. Let YY denote the number of patients who recover out of nn independent patients in the trial. Then the distribution of YY is also binomial with parameters nn and pp. Indeed, consider a general experiment that consists of observing nn independent repititions (trials) with only two possible results for each trial. For convenience, call the two possible results “success” and “failure.” Then the distribution of the number of trials that result in success will be binomial with parameters nn and pp, where pp is the probability of success on each trial.

Note: Names of Distributions. In this section, we gave names to several families of distributions. The name of each distribution includes any numerical parameters that are part of the definition. For example, the random variable XX in Example 3.1.4 has the binomial distribution with parameters 10 and 1/21/2. It is a correct statement to say that XX has a binomial distribution or that XX has a discrete distribution, but such statements are only partial descriptions of the distribution of XX. Such statements are not sufficient to name the distribution of XX, and hence they are not sufficient as answers to the question “What is the distribution of XX?” The same considerations apply to all of the named distributions that we introduce elsewhere in the book. When attempting to specify the distribution of a random variable by giving its name, one must give the full name, including the values of any parameters. Only the full name is sufficient for determining the distribution.

Summary

A random variable is a real-valued function defined on a sample space. The distribution of a random variable XX is the collection of all probabilities Pr(XC)\Pr(X \in C) for all subsets CC of the real numbers such that {XC}\{X \in C\} is an event. A random variable XX is discrete if there are at most countably many possible values for XX. In this case, the distribution of XX can be characterized by the probability mass function pmf of XX, namely, f(x)=Pr(X=x)f(x) = \Pr(X = x) for xx in the set of possible values. Some distributions are so famous that they have names. One collection of such named distributions is the collection of uniform distributions on finite sets of integers. A more famous collection is the collection of binomial distributions whose parameters are nn and pp, where nn is a positive integer and 0<p<10 < p < 1, having pmf eq-3-1-4. The binomial distribution with parameters n=1n = 1 and pp is also called the Bernoulli distribution with parameter pp. The names of these distributions also characterize the distributions.

Exercises

Exercise 3.1.1

Suppose that a random variable XX has the uniform distribution on the integers 10,,2010, \ldots, 20. Find the probability that XX is even.

Exercise 3.1.2

Suppose that a random variable XX has a discrete distribution with the following pmf:

f(x)={cxfor x=1,,5,0otherwise.f(x) = \begin{cases} cx &\text{for }x = 1, \ldots, 5, \\ 0 &\text{otherwise.} \end{cases}

Determine the value of the constant cc.

Exercise 3.1.3

Suppose that two balanced dice are rolled, and let XX denote the absolute value of the difference between the two numbers that appear. Determine and sketch the pmf of XX.

Exercise 3.1.4

Suppose that a fair coin is tossed 10 times independently. Determine the pmf of the number of heads that will be obtained.

Exercise 3.1.5

Suppose that a box contains seven red balls and three blue balls. If five balls are selected at random, without replacement, determine the pmf of the number of red balls that will be obtained.

Exercise 3.1.6

Suppose that a random variable XX has the binomial distribution with parameters n=15n = 15 and p=0.5p = 0.5. Find Pr(X<6)\Pr(X < 6).

Exercise 3.1.7

Suppose that a random variable XX has the binomial distribution with parameters n=8n = 8 and p=0.7p = 0.7. Find Pr(X5)\Pr(X \geq 5) by using the table given at the end of this book. Hint: Use the fact that Pr(X5)=Pr(Y3)\Pr(X \geq 5) = \Pr(Y \leq 3), where YY has the binomial distribution with parameters n=8n = 8 and p=0.3p = 0.3.

Exercise 3.1.8

If 10 percent of the balls in a certain box are red, and if 20 balls are selected from the box at random, with replacement, what is the probability that more than three red balls will be obtained?

Exercise 3.1.9

Suppose that a random variable XX has a discrete distribution with the following pmf:

f(x)={c2xfor x=0,1,2,,0otherwise.f(x) = \begin{cases} \frac{c}{2^x} &\text{for }x = 0, 1, 2, \ldots, \\ 0 &\text{otherwise.} \end{cases}

Find the value of the constant cc.

Exercise 3.1.10

A civil engineer is studying a left-turn lane that is long enough to hold seven cars. Let XX be the number of cars in the lane at the end of a randomly chosen red light. The engineer believes that the probability that X=vX = v is proportional to (v+1)(8v)(v + 1)(8 − v) for v=0,,7v = 0, \ldots, 7 (the possible values of XX).

a. Find the pmf of XX. b. Find the probability that XX will be at least 5.

Exercise 3.1.11

Show that there does not exist any number cc such that the following function would be a pmf:

f(v)={cvfor v=1,2,,0otherwise.f(v) = \begin{cases} \frac{c}{v} &\text{for }v = 1, 2, \ldots, \\ 0 &\text{otherwise.} \end{cases}