You are on page 1of 36

Recap

• Conditional probability
P(A  E)
P(A/E)  , P(E)  0
P(E)
• Multiplication rule
𝑃 (𝐴𝐵) = 𝑃 (𝐴). 𝑃 (𝐵/𝐴)
• An event B is said to be independent of an event A then P (B) = P (B/A)
 𝑃 (𝐴𝐵) = 𝑃 (𝐴). 𝑃 (𝐵)
n

• Total Probability theorem P(A) =  P(A/E ).P(E )


i 1
i i

• Bayes’ Theorem
P(E i /A)  n
P(A/Ei ) . P(E i )
 i , 𝑎𝑛𝑑 𝑃(𝐸𝑖 ) > 0
 P(A/E ) . P(E )
i 1
i i
Chapter 02:
Random Variables and Probability Distributions

contents:
2.1 Random variables
2.2 Discrete random variables
2.3 Continuous random variables
Learning Objectives:
• Develop the notion of a random variable
• Numerical data and discrete random variables
• Discrete random variables and their probabilities
2.1 Random Variables
• Definition 1: A random variable is a variable that assumes
numerical values associated with the random outcomes of an
experiment, where one (and only one) numerical value is assigned
to each sample point.

• A random variable is a variable .

• A numeric outcome that results from an experiment.

• For each element of an experiment’s sample space, the random


variable can take on exactly one value.
• Definition 2:
A random variable 𝑋 on a sample space 𝑆(𝑜𝑟 Ω) is a function from 𝑆 into the
set ℝ of real numbers such that the pre-image of any interval of ℝ is an event
in 𝑆.

Consider the Example 1: Tossing a coin twice. 𝑋 - number of heads.


𝑋: 𝑆(𝑜𝑟 Ω) ⟶ ℝ.
Consider the Example 2 :Tossing a fair die.
Let 𝑋 denote the number appearing on the face and let 𝑌 denote one or three
according as an odd or even number appears.
Experiment tossing a die
𝑋(1) = 1, 𝑋(2) = 2, 𝑋(3) = 3, 𝑋(4) = 4, 𝑋(5) = 5, 𝑋(6) = 6
Range of 𝑋 = {1, 2, 3, 4, 5, 6}
𝑋 (Ω) = {1, 2, 3, 4, 5, 6}
𝑌(1) = 𝑌(3) = 𝑌(5) = 1
𝑌(2) = 𝑌(4) = 𝑌(6) = 3
Range of 𝑌 = {1, 3, 1, 3, 1, 3}
𝑌 (Ω) = {1, 3}
Probability space of 𝑋 (Ω) = {1/6, 1/6, 1/6, 1/6, 1/6, 1/6}
Probability space of 𝑌 (Ω) = {1/2, 1/2}
Examples of Random Variables
1. Let the number of computers sold per day by a local merchant be a
random variable. Integer values ranging from zero to about 50 are possible
values.
2. Let the number of pages in a mystery novel at a bookstore be a random
variable. The smallest number of pages is 125 while the largest number of
pages is 547.
3. Let the time it take an employee to get to wok be a random variable.
Possible values are 15 minutes to over 2 hours.
4. Let the volume of water used by a household during a month be a random
variable. Amount range up to several thousand gallons.
Two Types of Random Variables
• Discrete Random Variable
• Continuous Random Variable
2.2 Discrete Random Variable
• A discrete random variable can assume a countable number of
values.
2.3 Continuous Random Variable
• Random variables that can assume values corresponding to any of
the points contained in one or more intervals (i.e., values that are
uncountable) are called continuous.
Discrete Random Variable & Continuous Random Variable
Discrete Random Variables Continuous Random Variables

Number of sales Length

Number of calls Depth

Shares of stock Volume

People in line Time

Mistakes per page Weight


More Examples of Discrete and continuous
Discrete Continuous
Number of children in a family Weight of babies at birth
Number of accidents in Jaffna in one Height of students in a class
day
Number of defective items in a box Life time of eclectic equipment

• Random variables which count objects or events are clear examples


of discrete random variables.
• Random variables denoting measurements of physical quantities as
weight , time , temperature , and voltage are described as continuous
random variables.
Example 3:
Two balls are drawn (with out replacement) from an urn containing
4 red balls and 3 black balls construct the sample space and let the
values of the random variables,
𝑋 – The number of red balls
𝑌 – The number of black balls
Ω = {𝑅𝑅, 𝑅𝐵, 𝐵𝑅, 𝐵𝐵}

Ω 𝑋=𝑥 𝑌=𝑦
RR 2 0
RB 1 1
BR 1 1
BB 0 2
Here 𝑋 and 𝑌 are random variables and they take distinct countable values.
Therefore they are discrete random variable.
• If we throw a coin until we observe a head, the sample space will
be
Ω = {𝐻, 𝑇𝐻, 𝑇𝑇𝐻, 𝑇𝑇𝑇𝐻 … … … }
Here Ω is countably infinite
• If we define a random variable 𝑋 on Ω as 𝑋- total number of tosses
until a head appears then, 𝑋(Ω) = {1,2,3, … … }
• Here also 𝑋 is a discrete random variable
Example 4:
• Consider an electric bulb if we define 𝑋 as the life length of the
bulb then 𝑋 is a continuous random variable
𝑋<𝑥
0 ℝ+
Some results
• If X1and 𝑋2 are random variables and 𝐶1 and 𝐶2 are constants.
Then,
• 𝐶1𝑋1 𝑖s a random variable.
• 𝐶1𝑋1 + 𝐶2𝑋2 is a random variable.
• 𝑋1/𝑋2 is a random variable.
• 𝑋1. 𝑋2 is a random variable.
Note:-
• 𝐶1 = 1 = 𝐶2
𝑋1 + 𝑋2 is a random variable.
• When 𝐶1 = 1 and 𝐶2 = −1
𝑋1 − 𝑋2 is a random variable.
2.4 Probability Distributions of Random
Variables
2.4.1 Probability Distributions of Discrete Random
Variables
The probability distribution of a discrete random variable is
a graph, table, or formula that specifies the probability associated
with each possible (outcome) value the random variable can
assume.
Requirements for the Probability Distribution of a
Discrete Random Variable X
1. p(𝑥) ≥ 0 for all values of 𝑥
2. 𝑝(𝑥) = 1

where the summation of 𝑝(𝑥) is over all possible


values of 𝑥.
Visualizing Discrete Probability Distributions

Listing Table
{ (0, 0.25), (1, 0.50), (2, 0.25) } # Tails
f(x)
Count p(x)
0 1 0.25
1 2 0.50
Graph 2 1 0.25
p(x)
0.50
0.25 Formula
0.00 x n!
p (x ) = px(1 – p)n – x
0 1 2 x!(n – x)!
Example 5:
Consider tossing a coin three times.

Sample space 𝑆 = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇𝐻, 𝑇𝐻𝐻, 𝐻𝑇𝑇, 𝑇𝐻𝑇, 𝑇𝑇𝐻, 𝑇𝑇𝑇}

• Define the random variable X-Represents the No of heads.

The 𝑋 take values 0, 1, 2, 3

1 3
𝑃 𝑋 = 0 = 𝑃 𝑇𝑇𝑇 = 𝑃 𝑋 = 1 = 𝑃 𝐻𝑇𝑇, 𝑇𝐻𝑇, 𝑇𝑇𝐻 =
8 8
3 1
𝑃 𝑋 = 2 = 𝑃 𝑇𝐻𝐻, 𝐻𝑇𝐻, 𝐻𝐻𝑇 = 𝑃 𝑋 = 3 = 𝑃 𝐻𝐻𝐻 =
8 8

It is convenient to represent all the probabilities of a random variable X by a formula,


such a formula would necessarily be a function. We shall denote the function by 𝒇𝑿(𝒙)
Hence we write for 𝑓𝑋(𝑥) = 𝑃(𝑋 = 𝑥) and is usually given either in the
form of a table or as a mathematical function.
Table:
𝑥1 𝑥2 … … … … … … 𝑥𝑛
𝑓𝑋(𝑥1) 𝑓𝑋(𝑥2) … … … … … … 𝑓𝑋(𝑥𝑛)
.
The discrete distribution function ‘𝒇’ satisfy

1. 𝑓𝑋(𝑥𝑖 ) ≥ 0 ; ∀ 𝑖

2. 𝑖 𝑓𝑋(𝑥𝑖 ) =1
Example 6:
• Find a formula for the probability distribution of the number of
heads when an unbiased coin is tossed 4 times.
Solution:-

• 𝑋 be the number of heads

• Sample space
Ω = {𝐻𝐻𝐻𝐻, 𝐻𝐻𝐻𝑇, 𝐻𝐻𝑇𝐻, 𝐻𝑇𝐻𝐻, 𝑇𝐻𝐻𝐻, 𝐻𝐻𝑇𝑇, 𝑇𝐻𝐻𝑇, 𝑇𝑇𝐻𝐻,

THTH, HTHT, HTTH, TTTH, HTTT, THTT, TTHT, TTTT}

X (Ω) = {4, 3, 2, 1, 0}
𝑋=𝑥 0 1 2 3 4

𝑃(𝑋 = 𝑥) 1/16 4/16 6/16 4/16 1/16

𝑃(𝑋 = 𝑥) = 𝑛𝐶𝑥 /2𝑛

Note:
In the above example, we have to find the probability distribution of 𝑋. Thus,
we need to evaluate 𝑃[𝑋 = 𝑥]. Since the coin is unbiased these
(24 = 16) are equally likely outcomes. Each outcome have 𝑥 heads and
(4 − 𝑥) tails. In general 𝑥 heads and (4 − 𝑥) tails can occur in 4𝐶𝑥 ways.
𝑃[𝑋 = 𝑥] = 4𝐶𝑥 /16
4𝐶𝑥
Hence𝑓𝑋(𝑥) = 𝑃 𝑋 = 𝑥 = ; 𝑥 = 0,1,2 … 4
16

 Cx
4

𝑓𝑋(𝑥) =  16
if x  0,1,2...4
0 other wise

Note:
The probability distribution function 𝑃[𝑋 = 𝑥] defined for discrete
random variable is sometimes called the probability mass function
(pmf).
Example 7
Example 8
Example 8
Example 9
Example 10
Exercise 1
The pair of fair dice is tossed.

(1,1) (1,2)........(1,6)
(2,1) (2,2)...... (2,6) 
 
............................ 
Ω =  
. 
. 
 
. 
(6,1) (6,2)........ (6,6) 
 
• Let 𝑋 assign to each point (𝑎, 𝑏) in Ω, the maximum of its numbers
then 𝑋 is random variable which assign values in {1, 2, 3, 4, 5, 6}.
𝑓𝑋(1) = 𝑃(𝑋 = 1) = 𝑃[(1,1)] = 1/36
𝑓𝑋(2) = 𝑃(𝑋 = 2) = 𝑃[(1,2), (2,1), (2,2)] = 3/36
𝑓𝑋(3) = 𝑃(𝑋 = 3) = 𝑃[(1,3), (2,3), (3,3), (3,2), (3,1)] = 5/36
𝑓𝑋(4) = 𝑃(𝑋 = 4)
= 𝑃[(1,4), (4,1), (2,4), (4,2), (3,4), (4,4), (4,3)] = 7/36
𝑓𝑋 5 = 𝑃 𝑋 = 5
9
= 𝑃 1,5 , 2,5 , 3,5 , 4,5 , 5,5 , 5,3 , 5,2 , 5,1 , 5,4 =
36
𝑓𝑋(6) = 𝑃(𝑋 = 6) = 11/36
𝑋=𝑥 1 2 3 4 5 6

𝑃(𝑋 = 𝑥) 1/36 3/36 5/36 7/36 9/36 11/36

 2x - 1
 if x  1,2,3,4,5,6
𝑓𝑋(𝑥) = 𝑃(𝑋 = 𝑥) =  36

0 otherwise
Exercise 2
Let 𝑋 be a random variable and let
x
 4 if x  0,1,2

𝑓𝑋(𝑥) = 𝑃[𝑋 = 𝑥 ] = k if x  3,4
0 otherwise


Solution:-
4

f
x 0
X (x)  1
0 + 1/4 + 1/2 + 2𝑘 = 1
𝑘 = 1/8
Summary
• Random Variables
Random variables

Continuous
Discrete R.V
R.V
count objects or events measurements of physical
are clear examples of quantities as weight , time ,
discrete random temperature , and voltage
variables. are described as continuous
random variables
• The discrete distribution function ‘𝒇’ satisfy
1. 𝑓𝑋 𝑥𝑖  0 ;  𝑖
2. 𝑖 𝑓𝑋 𝑥𝑖 = 1

• The probability distribution function 𝑃[𝑋 = 𝑥] defined for discrete


random variable is called the Probability mass function (pmf).

You might also like