Discrete and Continuous Random Variables - Theory

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Discrete and continuous random variables

Let's look at the definition of random variable, as well as discrete and continuous random
variables with examples and exercises.

A random variable is a function that assigns a numerical value to the outcome of a random
experiment. A random variable can be discrete or continuous. Discrete random variables are
those that have a countable number of values; for example, the number of people living in a
house (it can be 3, 5 or 9). Continuous random variables are those that have an uncountable
number of values; for example, the weight of cows on a farm (one cow may weigh 632.12 kg,
another may weigh 583.12312 kg, another 253.12012 kg, another 198.0876 kg, and we would
never finish listing all the possible values) . As these definitions are very difficult to understand
at a glance, we are going to explain them in detail.

Random variable

A random variable is a function that assigns a numerical value to the outcome of a random
experiment. Recall that the outcome of a random experiment depends on chance. Let's see the
examples.

Random Variable Example 1

We have a coin that has a cat on one side and a dog on the other.

We are going to perform a random experiment that consists of tossing 2 coins. We will plot the
results in the following graph:

We define our random variable X:


• X = number of dogs.
Note that the random variable is always in uppercase letters (in this case X), while the values in
its range are always in lowercase letters (in this case x1 , x2 , x3).

The range values of this random variable are:

• x1 = 0

• x2 = 1

• x3 = 2

In the domain of the function we have the sample space, that is, all possible outcomes of our
random experiment. Whereas the range we have a set of real numbers.

Random variable example 2

There are 3 ATMs in a bank. We are going to perform a random experiment where we go to
the bank at a random time of day and see which tellers are busy and which tellers are empty.

We place the results in the following graph, the empty ATMs (E) will be red and the busy ones
(B) will be green.
We define our random variable Y:

• Y = number of occupied ATMs.

Note that the random variable is always in uppercase letters (in this case Y), while the values in
its range are always in lowercase letters (in this case y1 , y2 , y3, y4).

The range values of this random variable are:

• y1 = 0

• y2 = 1

• y3 = 2

• y4 = 3

Random variables are classified as discrete or continuous based on the numerical values they
assume. Let's see this in detail.

discrete random variable

A discrete random variable is one that can assume a countable number of values.

For example, if we perform the experiment of going outside and selecting 10 people at random
for a pop quiz in math, we can define the random variable A:

• A = number of people who passed the exam.

The values assumed by A (in its range), range from 0 to 10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10). We
would express the range as follows:

• AR = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
The random variable A assumes a countable number of values, so it is a discrete random
variable.

Another example, let's do the experiment of registering cars at a toll booth. We can define the
random variable V:

• V = number of vehicles arriving during the period of one day.

The values that V assumes (in its range), are 0, 1, 2, 3, 4, 5, …; even if many vehicles arrive, we
can always count the number of values assumed by V. Therefore, the variable V is a discrete
random variable.

continuous random variable

A continuous random variable is one that can assume an uncountable number of values.

For example, if we perform the experiment of going to my farm and studying the
characteristics of the vaquitas, we can define the random variable C:

• B = weight of a cow on Jorge's farm (in kilograms).

Some small cow can weigh 425.1872 kg; another can weigh 612.5874541 kg; another can
weigh 545.897512121 kg. If we take more cows, we could have more values and we would
never finish.

It is known that the smallest calf weighs 30 kg, and the largest cow weighs 1000 kg.

And so, we would have an uncountable number of values for the range of this variable. The
range of this variable can be any value within the range from 30 kg to 1000 kg.

Therefore, it is a continuous random variable.

Another example, if we go to a bank branch and record customer service data, we can define
the random variable D:

• D = bank customer service time (in seconds).

A customer can be served in 24,123 s; another client at 72.32142 s; another at 51.123123 s. If


we continue taking more clients, we would have more values. It is also known that the
minimum window service time is 1 s and the maximum time is 240 s.
And so, we would have an uncountable number of values for the range of this variable. The
range of this variable can be any value within the interval from 1 s to 240 s. Therefore, it is a
continuous random variable.

In general, discrete random variables represent data that comes from counting the number of
elements, while continuous random variables represent data that comes from measurements,
for example, time, weight, length, etc.

You might also like