Site Loader

This lesson defines the term random variables in the context of probability.

You’ll learn about certain properties of random variables and the different types of random variables.

Best services for writing your paper according to Trustpilot

Premium Partner
From $18.00 per page
4,8 / 5
Writers Experience
Recommended Service
From $13.90 per page
4,6 / 5
Writers Experience
From $20.00 per page
4,5 / 5
Writers Experience
* All Partners were chosen among 50+ writing services by our Customer Satisfaction Team

What Is a Random Variable?

If you have ever taken an algebra class, you probably learned about different variables like x, y and maybe even z. Some examples of variables include x = number of heads or y = number of cell phones or z = running time of movies. Thus, in basic math, a variable is an alphabetical character that represents an unknown number.Well, in probability, we also have variables, but we refer to them as random variables. A random variable is a variable that is subject to randomness, which means it can take on different values.

As in basic math, variables represent something, and we can denote them with an x or a y or any other letter for that matter. But in statistics, it is normal to use an X to denote a random variable. The random variable takes on different values depending on the situation. Each value of the random variable has a probability or percentage associated with it.

Discrete Random Variables

Let’s see an example. We’ll start with tossing coins. I want to know how many heads I might get if I toss two coins.

Since I only toss two coins, the number of heads I could get is zero, one, or two heads. So, I define X (my random variable) to be the number of heads that I could get.In this case, each specific value of the random variable – X = 0, X = 1 and X = 2 – has a probability associated with it. When the variable represents isolated points on the number line, such as the one below with 0, 1 or 2, we call it a discrete random variable. A discrete random variable is a variable that represents numbers found by counting. For example: number of marbles in a jar, number of students present or number of heads when tossing two coins.

Discrete random variables represent isolated points on the number line.
number line with random variables

X is discrete because the numbers that X represents are isolated points on the number line.The number of heads that can come up when tossing two coins is a discrete random variable because heads can only come up a certain number of times: 0, 1 or 2.

Also, we want to know the probability associated with each value of the random.

# of Heads Probability
0 0.25
1 0.


2 0.25

In the table, you will notice the probabilities. We will see how to calculate the probabilities associated with each value of the variable. However, what we see above is called a probability distribution for the number of heads (our random variable) when you toss two coins. A probability distribution has all the possible values of the random variable and the associated probabilities.

Continuous Random Variables

Let’s see another example.Suppose I am interested in looking at statistics test scores from a certain college from a sample of 100 students.

Well, the random variable would be the test scores, which could range from 0% (didn’t study at all) to 100% (excellent student). However, since test scores vary quite a bit and they may even have decimal places in their scores, I can’t possibly denote all the test scores using discrete numbers. So in this case, I use intervals of scores to denote the various values of my random variable.When we have to use intervals for our random variable or all values in an interval are possible, we call it a continuous random variable. Thus, continuous random variables are random variables that are found from measuring – like the height of a group of people or distance traveled while grocery shopping or student test scores. In this case, X is continuous because X represents an infinite number of values on the number line.

Let’s look at a hypothetical table of the random variable X and the number of people who scored in those different intervals:

Test Scores Frequency(% of students)
0 to ;20% 5
20% to ;40% 20
40% to ;60% 30
60% to ;80% 35
80% to 100% 10

Since I know there are one hundred students in all, I could also have a column with relative frequency or percentage of students that scored in the different intervals. We calculate this by dividing each frequency by the total (in this case, 100). We then either leave the answer as a decimal or convert it to a percentage. Thus, like the coin example, the random variable (in this case, the intervals) would have certain probabilities or percentages associated with it.

And this would be a probability distribution for the test scores.

Test Scores Relative Frequency
0 to ;20% 5%
20% to ;40% 20%
40% to ;60% 30%
60% to ;80% 35%
80% to 100% 10%

Probabilities Range Between 0 and 1

In the study of probability, we are interested in finding the probabilities associated with each value of these random variables. You may notice that, as a decimal, no probability is ever greater than one, nor are they negative.

This is always true. For any designation of the random variable, the probability is always between zero and one, never negative and never greater than one. In math books, you will see this written as:


Which says that P(X) is always between 0 and 1.The notation of P and then parentheses around XP(X) – means the probability of X. Remember, X is the random variable.

One note here: it does not matter if you use capital or common letters for the random variable or for P, as long as you are consistent!

Sum of Probabilities for a Distribution

Perhaps you noticed above that in each table the sum of all probabilities added up to 1 or 100%. However, for continuous random variables, we can construct a histogram of the table with relative frequencies, and the area under the histogram is also equal to 1.

Test Scores Histogram

This graph is often called a density curve for the continuous random variable. Thus, a density curve is a plot of the relative frequencies of a continuous random variable. In math books, the property that the sum of the probabilities is given in short hand notation as:

The Greek symbol is called Sigma, capital sigma, and means sum. And so the statement says that the sum of the probabilities in a probability distribution equal 1.

Some More Examples

Let’s just look at a few examples of classifying random variables.Suppose I’m looking at the number of defective tires on the car.

Let X = the number of defective tires on the car. Is X discrete or continuous? Well, since there are usually four tires on the car, X can range from 0-4. However, it can only be 0, 1, 2, 3 or 4. So X is a discrete random variable.Okay let’s look at another example. Suppose I am measuring the running time of movies that are currently playing in theaters in my city.

Let X = the running time of movies. Is X discrete or continuous?Since movie times vary quite a lot and the length of the movie can be measured to the nearest minute or fraction of a minute or even seconds, depending on how accurate you want to be, X is a continuous random variable. When collecting my data, it would make sense to compile the data into intervals of running times as opposed to creating a category for each individual running time.One more example: You play a game where you toss a coin and record the number of tosses it takes to get two heads in a row. So let the random variable X = the number of times the coin is tossed to get two heads in a row.

Using H for heads and T for tails, we could have sequences like these:HH two tossesTHH three tossesTTHH four tossesHTHH four tossesTHTHH five tossesTTTHH five tossesand so on …Is X discrete or continuous?Well for the above sequences X = 2, X = 3, X = 4, X = 5 and so on.

….But we can’t have 1.

5 tosses or 1.25 tosses. Thus, X is a discrete random variable.However, note that X can go on infinitely, since theoretically, we could toss forever and never get two heads in a row – although the probability of this happening is extremely small. But nonetheless, X is discrete since it represents isolated points on the number line (albeit these points go on forever).

Lesson Summary

So let’s recap:A random variable is really just a variable that has certain values associated with it.

In addition, each value of the random variable or each range of values of the random variable has probabilities associated with it.If the random variable represents isolated numbers on the number line, we call it discrete.If the random variable represents an infinite range of numbers or measurements, we call it continuous.Generally, discrete random variables are most often integers, and continuous random variables have a few to a lot of decimal places.We also saw that probabilities are always between zero and one, and the sum of the probabilities in a probability distribution equals one for a discrete random variable or the area under the density curve is one for a continuous random variable.So why the fuss over random variables? Well, by defining X, the random variable, to be something, it eliminates us having to write long sentences about what we are talking about, and we can now go on to calculating probabilities and generating probability distributions for our random variable X.

Learning Outcomes

Following this video lesson, you should be able to:

  • Define random variable
  • Differentiate between discrete and continuous random variables
  • Identify what the sum of the probabilities in a probability distribution equals

Post Author: admin


I'm Eric!

Would you like to get a custom essay? How about receiving a customized one?

Check it out