## 8.1: Random Variables and Distributions

Based on Section 8.1 in Finite Mathematics and Finite Mathematics and Applied Calculus

Note: To follow this tutorial, you need to know what we mean by an experiment, the outcomes of an experiment, and probability. For a brief refresher, consult the summary of Chapter 7 .

Q What is a random variable?
A In many experiments the outcomes of the experiment can be assigned numerical values. For instance, if you roll a die, each outcome has a value from 1 through 6. If you ascertain the midterm test score of a student in your class, the outcome is again a number. A random variable is just a rule that assigns a number to each outcome of an experiment. These numbers are called the values of the random variable. We often use letters like X, Y and Z to denote a random variable. Here are some examples

Examples
1. Experiment: Select a mutual fund; X = the number of companies in the fund portfolio.
The values of X are 2, 3, 4, ...

2. Experiment: Select a soccer player; Y = the number of goals the player has scored during the season.
The values of Y are 0, 1, 2, 3, ...

3. Experiment: Survey a group of 10 soccer players; Z = the average number of goals scored by the players during the season.
The values of Z are 0, 0.1, 0.2, 0.3, ...., 1.0, 1.1, ...

Some for you:

4. Experiment: Flip a coin three times; X = the total number of heads.
The values of X are .

5. Experiment: Throw two dice; X = the sum of the numbers facing up.
The values of X are .

6. Experiment: Throw one die over and over until you get a six; X = the number of throws.
The values of X are .

Discrete and Continuous Random Variables

A discrete random variable can take on only specific, isolated numerical values, like the outcome of a roll of a die, or the number of dollars in a randomly chosen bank account. Discrete random variables that can take on only finitely many values (like the outcome of a roll of a die) are called finite random variables. Discrete random variables that can take on an unlimited number of values (like the number of stars estimated to be in the universe) are infinite discrete random variables.

A continuous random variable, on the other hand, can take on any values within a continuous range or an interval, like the temperature in Central Park, or the height of an athlete in centimeters.

Examples

 Random Variable Values Type Flip a coin three times; X = the total number of heads. {0, 1, 2, 3} Finite There are only four possible values for X. Select a mutual fund; X = the number of companies in the fund portfolio. {2, 3, 4, ...} Discrete Infinite There is no stated upper limit to the size of the portfolio. Measure the length of an object; X = its length in centimeters. Any positive real number Continuous The set of possible measurements can take on any positive value.

Here are some for you:

Random VariableType
Throw two dice over and over until you roll a double six;
X = the number of throws.
 Finite Discrete Infinite Continuous
Take a true-false test with 100 questions;
X = the number of questions you answered corectly.
 Finite Discrete Infinite Continuous
Invest \$10,000 in stocks;
X = the value, to the nearest \$1, of your investment after a year.
 Finite Discrete Infinite Continuous
Select a group of 50 people at random;
X = the exact average height (in m) of the group.
 Finite Discrete Infinite Continuous

### Probability Distributions of Random Variables

Given a random variable X, it is natural to look at certain events --- for instance, the event that X = 2. By this, we mean the event consisting of all outcomes that have an assigned X-value of 2. To illustrate this let's look at an exmple: Throw a pair of fair dice, and take X to be the sum of the numbers facing up. Then

The event that X = 2 is {(1, 1)}     The event that you throw a 2
The event that X = 3 is {(2, 1), (1, 2)} nbsp;   The event that you throw a 3
The event that X = 4 is {(3, 1), (2, 2), (1, 3)} nbsp;   The event that you throw a 4
and so on.
Each of these events has a certain probability. For instance, the probability that X = 4 is 3/36 = 1/12 because the event in question consists of three of the thirty-six possible (equally likely) outcomes. We write
 P(X = 4) = 112 The probability that X = 4 is 1/12

Here are some for you. Enter each answer as a whole number, fraction, or decimal accurate to 3 places.

 P(X = 1) = P(X = 2) = P(X = 3) = P(X = 4) = P(X = 5) =

If we tabulate the probabilities of all the possible values of X together, we get the probability distribution of X.

You toss a coin 4 times. Three are 16 possible outcomes:

HHHH, HHHT, HHTH, HHTT, HTHH, HTHT, HTTH, HTTT, THHH, THHT, THTH, THTT, TTHH, TTHT, TTTH, TTTT
(H = heads, T = tails) Now take X = number of heads.
 The possible values of X are: Use commas to separate the values.

Here are some of the probabilities:

 P(X = 0) = 116 Only one of the 16 possible outcomes has X = 0; namely TTTT. P(X = 1) = 416 Four of the 16 possible outcomes have X = 1; namely HTTT, THTT, TTHT, and TTTH.

Now fill in the rest (use fractions or decimals accurate to 4 places):

x 0 1 2 3 4
P(X = x)
 116
 416

Q What is the distinction between X (upper case) and x (lower case) in the table?
A The distinction is important; X stands for the random variable in question, whereas x stands for a specific value (0, 1, 2, 3, or 4) of X (so that x is always a number). Thus, if, say x = 2, then P(X = x) means P(X = 2), the probability that X is 2. Similarly, if Y is a random variable, then P(Y = y) is the probability that Y has the specific value y.

### Using Frequencies to Obtain the Probability Distribution

Sometimes, we must calculate estimated probabilities for each value of X using frequencies. Recall that we obtain the estimated probability of an event by dividing its frequency by the total number of times the experiment is performed. (Would you like to know more?) Here is an example:

#### Example: Probability Distribution from Frequency Distribution

A survey of all the shopping malls (and there are many!) in Mars County yields the following data on the number of movie screens they contain:
 Movie Screens 0 1 2 3 4 5 Number of Malls 6 4 4 3 2 1

We can take X to be the number of movie screens in a selected mall (so the values of X are given in the top row of the chart). The frequencies are then the numbers in the second row. For instance, we observed X = 0 (no movie screens) a total of 35 times, since 25 of the malls had no movie screens. So, we rewrite the table as follows:

 x 0 1 2 3 4 5 Frequency 6 4 4 3 2 1

An experiment that gives the above data is:

The experiment was performed a total of times.

To obtain the probability distribution, divide each frequency by the total number of times the experiment was performed:

x 0 1 2 3 4 5
P(X = x)
 620 = .30
 420 = .20

Sometimes, values of X are not handed to us on a platter, but instead we are given ranges of values, such as income brackets. Such ranges of values are called measurement classes, as shown in this example:

#### Example: Measurement Classes

The number of on-line Monday stock trades at OHaganStockTrades.com (a subsidiary of oHaganBooks.com) was measured for 50 Mondays in a row, with the following results:

 Stock Trades 0-99 100-199 200-299 300-399 400-499 Frequency(Number of Mondays) 3 12 20 10 5

Thus, for example, there there between 300 and 399 trades on 10 of the 50 Mondays. The measurement classes are the ranges 0-99, 100-299, etc.

We would like X to measure the number of stock trades on a randomly selected Monday,, and then calculate its probability disstribution. Since we are only given data for ranges of data, we replace each measurement class by its (rounded) midpoint. Let us take them one-by-one:

 The midpoint of the 0-99 range is its average value: 0 + 992 = 49.5, which we round to 50. The midpoint of the 100-199 range is its average value: 100 + 1992 = 149.5, which we round to 150.

Now continue in the same way to obtain the remaining values of X:

 x 50 150 250 350 450 Frequency 3 12 20 10 5

Use the above frequency table to complete the (estimated) probabiliity distribution of X.

 x 50 150 250 350 450 P(X = x)

Now try some of the exercises in Section 8.1 of Finite Mathematics and Finite Mathematics and Applied Calculus

Top of Page

Last Updated: October, 2003