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

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 VariableValuesType
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

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

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

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

Click here to see the probability distribution for the above example.

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

(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:

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

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

16
4

16
     
       

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:

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)
6

20
= .30
4

20
= .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-99100-199200-299300-399400-499
Frequency
(Number of Mondays)
31220105

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:

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

x 50150250350450
Frequency31220105

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
Copyright © 1999, 2003 Stefan Waner and Steven R. Costenoble