This document defines and provides examples of random variables. It discusses:
1. The concept of randomness and sample spaces using coin toss examples.
2. The definition of a random variable as a function that maps sample space elements to real numbers. Examples of random variables like number of heads in coin tosses are given.
3. The two types of random variables - discrete random variables that take integer values and continuous random variables that can take decimal values over an interval. Height and temperature are used as examples of continuous random variables.
4. A short example calculating the probability of getting two heads in three coin tosses is presented to demonstrate using a random variable.
2. 2Info@stepupanalytics.com www.stepupanalytics.com
• What does “random” mean ?
We know all possible outcomes that can happen but we don’t know the
outcome that will happen.
• Example: When we toss a fair coin, the possible outcomes are “head” and
“tail” resp. i.e.
S = {H, T}
Again if we toss a coin two times then the possible outcomes are
S = {HH, HT, TH, TT}
And this continues…
• Now, we might decide to toss a coin 50 times and note that sample space
contains 2^50 elements, each containing a order strings of “H” and “T” of
length 50.
• Sample space increases and it becomes very difficult to calculate the
desired probability.
Concept of Random Variable
3. 3Info@stepupanalytics.com www.stepupanalytics.com
• Definition: Random variable is a single real valued function from a
sample space S into the real numbers.
• Generally, It is denoted by capital letters like A,B,C,…,X,Y,Z.
• Now, from the above example:
Suppose, We need to calculate “the probability of getting heads”
X = No of Heads in 50 tosses and then we calculate the desired probability.
• Sample space of X is {0, 1,…, 49, 50}
• we can also define random variable like
1. No of tails in 50 tosses and so on.
4. 4Info@stepupanalytics.com www.stepupanalytics.com
• Suppose, we toss a coin 3 times.
• Sample space = S = {HHH, HHT, HTT, TTT, THH, TTH, HTH, THT}
• Objective is to calculate the probability of 2 heads.
• Let us define a random variable “X” as Number of heads in 3 tosses of a
coin.
• Sample space of X = {0, 1, 2, 3}
• P( X=2 ) = (1/8)+(1/8)+(1/8) = (3/8)
Quick solved exercise of what you
have learnt.
HHH HHT HTT TTT THH TTH HTH THT
3 2 1 0 2 1 2 1
5. 5Info@stepupanalytics.com www.stepupanalytics.com
• Random variable is of two types:
1. Discrete Random variable: A random variable which takes only integer
values.
example: 1. Number of deaths
2. Number of accidents
2. Continuous Random variable: A Random variable which
takes values in interval and decimals too.
example: 1. Heights of an individuals
2. Temperature of a city.
Types of Random variable