Random Variables
Class STA2030S
Random Variables
In a sample space, there are elementary events which are the possible
outcomes of a random experiment. These outcomes can be expressed
quantitatively or qualitatively.
Quantitative descriptions take the form of numerical values, such as
length of time
Qualitative descriptions take on the form of statements, such as the sex
of students
Mathematically, in order to manipulate the data (elementary events) in the
sample space, they need to be assigned numerical values. Once they have been
assigned, using alphabets, they are the again assigned to the numerical value
of the elementary elements.
Let X stand for a numerical value of events. X is a random variable
Random variables are numerical variables whose value is determined by the
outcome of the random experiment.
We can denote the probability of the events as P r[X = x] where x stands for
any real number as defined by the problem being dealt with.
P r[X = 1] is read as “the probability that the random variable X takes the
value of 1.”
You can also have P r[2 ≤ X < 4] which is the same thing as above, instead
uses a range of values. Whatever is denoted in the brackets is therefore an
event.
You can write P r[X = x] as P r(x).
Example 1:
The die above can be rolled to show either of the 6 sides. It is a fair die
and we can assign the scores on the die to a number (this only sounds
logical). Therefore the P r[X = 1] = 16 , in fact P r[X = x] = 16 for 1 ≤ x ≤ 6.
You can be asked to calculate P r[2 < x ≤ 5] which is then equal to:
P r[2 < x ≤ 5] = P r[X = 3] + P r[X = 4] + P r[X = 5]
Random Variables 1
, P r[2 < X ≤ 5] = P r[X = 3] + P r[X = 4] + P r[X = 5]
1 1 1 3 1
P r[2 < X ≤ 5] = + + = =
6 6 6 6 2
Example 2:
It is not always the case that all events need to be assigned specific
numerical values. If you look at the example of a coin toss done 3 times
successively, you might get HTH, which is the same as THH and HHT. These
events can be assigned either 2 values, depending on heads or tails. If we
were concerned with the number of heads, we’d say X be a random variable
which denotes the number of heads, in which case X = 2, on the other hand
if X was a random variable that was used to denote the number of times the
coin has landed showing tails, X = 1. If the sample space is as shown, and
now we let X be the number of times a heads is shown we can represent this
as:
S = {HHH, HHT , HT H, T HH, HTT , TT H, T HT , TTT }
X = {3, 2, 2, 2, 1, 1, 1, 0}
Types of Random Variables
They can be either continuous or discrete. Continuous random variables can
take any value on the number line and can be conceptually measured to a
certain degree of freedom. Meanwhile discrete random variables can only take
certain values, almost always integers.
Probability Mass Functions p.m.f
We use these for calculating probabilities for discrete random variables.
This is a function p(x) which satisfies 3 conditions:
PMF 1: p(x) is defined at all values of x but p(x) =
0 at only definite
values of x
PMF 2: 0 ≤ p(x) ≤ 1
PMF 3: Σp(x) = 1 where all the values of x are taken when p(x) =
0
Example 1:
Consider a fair, 6 sided, die being rolled, and let X be the random
variable which denotes the number of dots appearing on the die. Find the
pmf of the die.
Firstly, assign P [X = x] = p(x). Secondly, we know it is a fair die, hence
p(1) = 16 , and similarly p(2 …… 6) = 16 . But when you input any value for x
Random Variables 2