Professional Documents
Culture Documents
Discrete and Continuous Random Variables - Theory
Discrete and Continuous Random Variables - Theory
Discrete and Continuous Random Variables - Theory
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.
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:
• 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.
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:
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).
• 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.
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:
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:
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.
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:
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.
Another example, if we go to a bank branch and record customer service data, we can define
the random variable D:
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.