Probability & Statistics,
Discrete Random Variables,
RL 2.1.1
BITS Pilani Dr. Mayank Goel
Department of Mathematics
K K Birla Goa Campus
BITS Pilani, K K Birla Goa Campus
Recorded Lecture – 2.1.1.
Random Variables:
• Random variables-motivation, definition and examples.
• Types of random variables.
• Probability density function - discrete case.
• Cumulative distribution function.
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Random Variable - Motivation
• Outcomes of a random experiment can be either numbers or
it can be a non numeric sample points also.
• Often we are only interested in a number summarizing the
outcome.
• Let’s consider an example of tossing a coin three times, then
sample space, S is defined as
S {HHH , HHT , HTH , THH , TTH , THT , HTT , TTT }
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Motivation Cont’d
• Suppose we are only interested in number of heads obtained
in each outcome.
• In short, we may want to assign a number to each outcome.
• In the above example if X represents the total number of
heads obtained, then
X {HHH } 3, X {HHT } 2, X {THH } 2,
X {HTH } 2, X {HTT } 1, X {THT } 1,
X {TTH } 1, X {TTT } 0.
4
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Definition
A random variable X on a sample space S is a function
X : S RX R that assign a real number X ( s) to each
sample point s S .
• Random variable depends upon random outcomes, so it
is called as “random variable” and not just a variable.
• Random variable is often denoted by a upper case and
the lower case is used to represent its observations, e.g.
in previous example:
5
X : total number of heads, and x= 0,1,2,3
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Example
Lets consider a game; a dice is rolled, if the score is 1 or 2,
player A gives player B $1, if the score is 5 or 6, player B
gives player A $1.
Suppose, we are interested in the gain of player A, then we
define
X: gain of player A
x = -1,0,1, with
X (1) X (2) 1, X (3) X ( 4) 0, X (5) X (6) 1
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Example
We can see that X is a function from sample space
S {1, 2,3, 4,5,6} to RX {1,0,1} R.
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Types of Random Variables
Random variables can be either discrete or continuous
type.
Discrete random variables can only take finite or countable
infinite values.
Continuous random variables takes infinite values.
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Example-Discrete Random
Variables
Experiment Random Variable Possible Values
Make 100 sales calls Total number of sales 0,1,2,…,100
Inspect 80 radios Total number of 0,1,2,…,80
defective radios
Answer 35 questions Total number of 0,1,2,…,35
correct answers
Count phone calls at Total number of 0,1,2,…
call center between phone calls between
8:00 AM to 8:00 PM 8:00 AM to 8:00 PM
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Example-Continuous Random
Variables
In all the following random variables we have infinitely
many possible observations.
Experiment Random Variable
Measure height of Height.
100 people
Measure electrical Life in hours.
component life
Measure time Inter arrival time.
between arrivals
Measure size of Size of apple.
apples in fruit market
10
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Discrete Random Variables
11
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Probability Density Function
(pdf)
Probability density function of a discrete random variable is
a table or formula that specifies the probability
associated with each possible value the random variable
can assume.
Mathematically, if X is a random variable with pdf f , then
f ( x) P( X x)
Probability density function is also known as probability
mass function (pmf) but same is not true in continuous
case. 12
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Necessary and Sufficient
Condition for pdf
Necessary and sufficient condition for f to be a pdf of X is
• f ( x) 0 for all x RX .
• x X
f ( x) 1.
13
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Example
Drawing two balls with replacement from a basket
containing 12 red, 4 blue and 4 green balls.
Suppose, X is defined as; X: total number of red balls
obtained, then
14
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Example Cont’d
x f (x)
0 0.16
1 0.48
2 0.36
15
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Plotting pdf
f(x)
.48
.36
.16
.00 x
0 1 2
16
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Cumulative Distribution
Function (cdf)
If X is a discrete random variable, the function given by
F ( x) P( X x) f (i ) for x
i x
Where f (i ) is the value of the pmf of X at i, is called the
cumulative distribution function (cdf) of X.
cdf is commonly denoted by an upper case while pdf is
denoted by the lower case.
17
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Example
Distribution function of total number of heads obtained in
three tosses of a balanced coin:
18
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
Graph of the Distribution function
F(x)
1 .
7/8 .
4/8 .
1/8 . x
0 1 2 3
Mayank Goel
BITS Pilani, K K Birla Goa Campus
Cdf Cont’d
• The cdf is defined not only for the values taken by the
given random variable, but for all real numbers. So,
4
F (1.8) and F (6) 1.
8
• F () 0, F () 1.
• If a b , then F (a) F (b) for any real numbers a and
b , hence F is non decreasing function.
20
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus
21
Probability & Statistics (MATH F113) BITS Pilani, K K Birla Goa Campus