Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
36 views22 pages

Random Variable (Slide)

A random variable is defined as a variable whose outcomes are determined by a random experiment, and can be either discrete or continuous. Discrete random variables take finite or countably infinite values, while continuous random variables take any value in a given interval. The document also covers probability mass functions, cumulative distribution functions, probability density functions, and the concepts of mathematical expectation and variance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views22 pages

Random Variable (Slide)

A random variable is defined as a variable whose outcomes are determined by a random experiment, and can be either discrete or continuous. Discrete random variables take finite or countably infinite values, while continuous random variables take any value in a given interval. The document also covers probability mass functions, cumulative distribution functions, probability density functions, and the concepts of mathematical expectation and variance.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Random Variable

Definition
• Random Variable: A variable whose outcomes
are determined by the outcomes of a random
experiment is called random variable.
• A random variable is a function that assigns a
real number to each sample point in a sample
space.
• Notation: 𝑋, 𝑌, 𝑍 etc. are used for random
variables whereas 𝑥, 𝑦, 𝑧 etc. are used to
denote any specific value of a random variable
Types of R.V.

Random Variable

Discrete Random Variable A random


variable X is said to be discrete If it takes either Continuous random variable A random
finite or countably infinite values. Thus, discrete variable X is said to be continuous if it takes any
random variable takes only isolated values. values in a given interval. Thus, a continuous
random variable takes uncountably infinite
Examples: values
(i) Number of children in a family Examples:
(ii)Number of cars sold by different companies in (i) Height of a person in cm
a year
(ii) Temperature of a city in degree Celsius
(iii) Number of stars in the sky
(iii) Life of an electric bulb in hours
Probability Mass function
• Let X be a random variable which can take the
possible values 𝑥1 , 𝑥2 , 𝑥3 , … , 𝑥𝑛 . With each
value of the variable X, we associate a number,
𝑝𝑖 = 𝑃 𝑋 = 𝑋𝑖 ; 𝑖 = 1,2, … , 𝑛
Which is known as the probability of 𝑋𝑖 , and
satisfies the following conditions:
i. 𝑝𝑖 = 𝑃 𝑋 = 𝑋𝑖 ≥ 0, 𝑖 = 1,2, … , 𝑛 i.e.,
𝑝𝑖 ’s are all non-negative.
ii. ∑𝑝𝑖 = 𝑝1 + 𝑝2 + ⋯ + 𝑝𝑛 = 1 i.e., the total
probability is 1.
Discrete Distribution function or
cumulative distribution function
• Let 𝑋 be a discrete random variable which takes the
values 𝑥1 , 𝑥2 , …such that 𝑥1 < 𝑥2 < ⋯ with probabilities
𝑝 𝑥1 , 𝑝 𝑥2 , … such that 𝑝 𝑥𝑖 ≥ 0 for all values 𝑖 and
∑𝑥𝑖=1 𝑝 𝑥𝑖 = 1.
The distribution function 𝐹(𝑥) of the discrete
random variable 𝑋 is defined by
𝑥

𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = ෍ 𝑝 𝑥𝑖
𝑖=1
where, x is any integer. The function 𝐹(𝑥) is also
called the cumulative distribution function. The set of pairs
𝑥𝑖 , 𝐹 𝑥 , 𝑖 = 1,2, … is called the cumulative probability
distribution.
Probability density function
• Let X be a continuous random variable taking values on
the interval [𝑎, 𝑏]. A function 𝑓(𝑥) is said to be the
probability density function of the continuous random
variable X if it satisfies the following properties :
i. 𝑓(𝑥) ≥ 0 for all x in the interval [a, b].
ii. For two distinct numbers c and d in the interval [a, b],
𝑃(𝑐 ≤ 𝑋 ≤ 𝑑) =[Area under the probability curve
between the ordinates (𝑣𝑒𝑟𝑡𝑖𝑐𝑎𝑙 𝑙𝑖𝑛𝑒𝑠) at 𝑥 = 𝑐 and
𝑑
𝑥 = 𝑑] = ‫𝑥𝑑 𝑥 𝑓 𝑐׬‬
iii. Total area under the probability curve is 1, i.e.,

න 𝑓 𝑥 𝑑𝑥 = 1
−∞
Cumulative density function
• If X is a continuous random variable having
the probability density function f (x) then
the function
𝑥
𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = න 𝑓 𝑥 𝑑𝑥 , −∞ < 𝑥
−∞
<∞
is called the distribution function or
cumulative distribution function of the
random variable X.
Example
Example
Exercise
• A random variable X has the following probability function:
𝒙𝒊 : -2 -1 0 1 2 3
𝑓𝑖 : 0.1 k 0.2 2k 0.3 3k
– Find K.
– Evaluate 𝑃 𝑋 < 2 , 𝑃 𝑋 ≤ 2 , 𝑃(−2 < 𝑋 < 2).
– Determine the distribution function 𝐹(𝑥).
– Find the mean of X.
• If the probability density function of a random variable X is given by
𝑥−2 2

𝑓 𝑥 =𝑐𝑒 2 ; −∞ <𝑥<∞
find the value of c, the expectation and variance of the distribution.
• A continuous variate X has the pdf
𝑥
;0 ≤ 𝑥 ≤ 1
2
1
𝑓 𝑥 = ;1 < 𝑥 ≤ 2
2
3−𝑥
;2 < 𝑥 ≤ 3
2
Find the mean and variance of the distribution.
Mathematical Expectation
• Let X be a discrete random variable Which can take values 𝑥1 , 𝑥2 , … , 𝑥𝑛
with associate probabilities 𝑝 𝑥1 , 𝑝 𝑥2 , … , 𝑝 𝑥𝑛 , then mathematical
expectation or mean of X, denoted by 𝐸(𝑋) is defined by
𝐸 𝑋 = 𝑥1 𝑝 𝑥1 + 𝑥2 𝑝 𝑥2 + ⋯ + 𝑝 𝑥𝑛 = ∑𝑥𝑝 𝑥
• Remark: Mathematical expectation of a random variable is the mean of
the population.
• In case of continuous random variable,

𝑀𝑒𝑎𝑛, 𝜇 = 𝐸 𝑋 = න 𝑥 𝑓(𝑥) 𝑑𝑥
−∞
For any function 𝜙(𝑥),

𝐸 𝑋 = න 𝜙 𝑥 𝑓(𝑥) 𝑑𝑥
−∞
Variance,
∞ ∞
𝜎2 = න 𝑥 − 𝜇 2 𝑓 𝑥 = න 𝑥 2 𝑓 𝑥 𝑑𝑥 − 𝜇2
−∞ −∞
Variance of a random variable
• Let X be a discrete random variable Which
can take values 𝑥1 , 𝑥2 , … , 𝑥𝑛 with associate
probabilities 𝑝 𝑥1 , 𝑝 𝑥2 , … , 𝑝 𝑥𝑛 , then
mathematical expectation or mean of X,
denoted by 𝜎 2 is defined by
2 2 2 2
𝜎 =𝐸 𝑋−𝐸 𝑋 =𝐸 𝑋 − 𝐸 𝑋
Here,
𝐸 𝑋 2 = 𝑥12 𝑝 𝑥1 + 𝑥22 𝑝 𝑥2 + ⋯ + 𝑥𝑛2 𝑝 𝑥𝑛
Example
• A company introduces a new product in the market and expects to
make profit of Tk. 2.5 lakh during the first year if the demand is good;
Tk. 1.5 if the demand is moderate; and a loss of Tk. 1 lakh if the
demand is poor. Market research studies indicate that the probabilities
for the demand to be good, moderate and poor are 0.2, 0.5 and 0.3
respectively. Find the company’s expected profit and the standard
deviation.
Expectation and Variance
(continuous random variable)
• Suppose X is a continuous random variable
with probability density function 𝑓(𝑥), then
the expected value or mean of X is defined
as

𝜇 = 𝐸 𝑋 = න 𝑥𝑓(𝑥) 𝑑𝑥; −∞ < 𝑥 < ∞
−∞
2
𝑉𝑎𝑟𝑖𝑎𝑛𝑐𝑒 = 𝐸 𝑋 − 𝜇 = 𝐸 𝑋 2 − 𝜇2

𝑊ℎ𝑒𝑟𝑒, 𝐸 𝑋 2 = න 𝑥 2 𝑓(𝑥) 𝑑𝑥
−∞
Example
• Suppose that in a certain region of a country
the daily rainfall (in inches) is a continuous
random variable X with probability density
3
function 𝑓(𝑥) given by 𝑓 𝑥 = (2𝑥 −
4
𝑥 2 ), 0 < 𝑥 < 2. Find the expected daily
rainfall (in inches) in that region. Also find
variance and standard deviation.
Moment generating function
• Moments are used to describe the characteristics of a distribution.
• According to Karl Pearson, “First four moments are sufficient to
describe a distribution”
• There are two kinds of moments.
– Raw moments and
– Central or Corrected moments
• We calculate these moments in three different ways
– Raw moments about origin
– Raw moments about any arbitrary value
– Moments about mean (Central moment)
• N.B.: We can use raw moments to find central or corrected moments.
• Suppose 𝑥1 , 𝑥2 , … , 𝑥𝑘 are k values of a variable or k mid-points of k
classes with frequencies 𝑓1 , 𝑓2 , … , 𝑓𝑘 respectively, then the 𝑟𝑡ℎ raw
moments about origin is defined by
∑𝑓𝑥 𝑟
𝑣𝑟 = ; 𝑟 = 1,2,3,4
𝑛
Where, 𝑛 = ∑𝑓.
Moment Generating function
• The rth raw moment about any arbitrary value A is defined
𝜇𝑟′ = ∑𝐸 𝑋 − 𝐴 𝑟 ; 𝑟 = 1,2,3,4
= ∑ 𝑋 − 𝐴 𝑟 𝑓 𝑥 (𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒)

=න 𝑋 − 𝐴 𝑟 𝑓 𝑥 𝑑𝑥 (𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠)
−∞
• The first, second, third and fourth raw moments about A are

∑𝑓 𝑥 − 𝐴 ′
∑𝑓 𝑥 − 𝐴 2 ′ ∑𝑓 𝑥 − 𝐴 3 ′ ∑𝑓 𝑥 − 𝐴 4
𝜇1 = ; 𝜇2 = ; 𝜇3 = ; 𝜇4 =
𝑛 𝑛 𝑛 𝑛
• We can use these moments to calculate the first four central moments using
the following relations
𝜇1 = 0,
𝜇2 = 𝜇2′ − 𝜇1′ 2 = 𝑣2 − 𝑣12
𝜇3 = 𝜇3′ − 3𝜇2′ 𝜇1′ + 2 𝜇1′ 2 = 𝑣3 − 3𝑣2 𝑣1 + 2𝑣13
𝜇4 = 𝜇4′ − 4𝜇3′ 𝜇1′ + 6𝜇2′ 𝜇1′ 2 − 3 𝜇1′ 4 = 𝑣4 − 4𝑣3 𝑣1 + 6𝑣2 𝑣12 − 3𝑣44
𝜇32
• Skewness, 𝛽1 =
𝜇23
𝜇
• Kurtosis, 𝛽2 = 𝜇42
2
Moment generating function
• Moment about Mean: The rth moment about the mean
𝜇 of the random variable X setting 𝑎 = 𝜇 we get,
𝜇𝑟 = ∑𝐸 𝑋 − 𝜇 𝑟 ; 𝑟 = 1,2,3,4
= ∑ 𝑋 − 𝜇 𝑟 𝑓 𝑥 (𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒)

=න 𝑋 − 𝜇 𝑟 𝑓 𝑥 𝑑𝑥 (𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠)
−∞
• Moment about origin:
𝜇𝑟′ = ∑𝐸(𝑥 𝑟 ); 𝑟 = 1,2,3,4
= ∑𝑥 𝑟 𝑓 𝑥 (𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒)

= න 𝑥 𝑟 𝑓 𝑥 𝑑𝑥 (𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠)
−∞
Moment generating function
• Let X be a random variable with probability density function
𝑓(𝑥). Then the function 𝑀𝑋 (𝑡), called the moment generating
function (MGF) of the random variable X is defined by
𝑀𝑋 𝑡 = 𝐸 𝑒 𝑡𝑋
= ∑𝑒 𝑡𝑥 𝑓 𝑥 (𝑑𝑖𝑠𝑐𝑟𝑒𝑡𝑒)

= න 𝑒 𝑡𝑥 𝑓 𝑥 𝑑𝑥 (𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠)
−∞
• One way of getting the moments by using the 𝑚. 𝑔. 𝑓. is

𝑡𝑟 ′
𝑀𝑋 𝑡 = ෍ 𝜇𝑟
𝑟!
𝑟=0
Coefficient of,
𝑡 𝑡 2 𝑡 3 𝑡 4
= 𝜇1′ , = 𝜇2′ , = 𝜇3′ , = 𝜇4′
1! 2! 3! 4!
M.G.F.
• Theorem: Let X be a random variable with moment generating function
𝑀𝑋 𝑡 . Then
𝑟
𝑑
𝜇𝑟′ = 𝑀 𝑡
𝑑𝑡 𝑟 𝑋
𝑡=0
• Differentiating 𝑀𝑋 (𝑡) once we get
𝑑 ′ ′
𝑡2 ′ 𝑡 𝑟−1
𝑀𝑋 𝑡 = 𝜇1 + 𝑡𝜇2 + 𝜇3 + ⋯ + 𝜇𝑟′ + ⋯
𝑑𝑡 2! 𝑟−1 !
Setting 𝑡 = 0,
𝑑
𝑀𝑋 0 = 𝐸 𝑋 = 𝜇1′
𝑑𝑡
• Differentiating again,
𝑑2 ′ ′
𝑡2 ′
𝑀 𝑡 = 𝜇2 + 𝑡𝜇3 + 𝜇4 + ⋯
𝑑𝑡 2 𝑋 2!
setting 𝑡 = 0,
𝑑2
2
𝑀𝑋 0 = 𝜇2′
𝑑𝑡
𝑑𝑟 ′
In general,
𝑑𝑡𝑟 𝑀𝑋 0 = 𝜇𝑟
Example
• Suppose X is a random variable for which
the pdf is as follows:
𝑒 −𝑥 , 𝑓𝑜𝑟 𝑥 > 0
𝑓 𝑥 =ቊ
0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
Determine the 𝑚𝑔𝑓 and hence the
variance of X.
Exercise
• Find the moment generating function of random variable X density function
1 −𝑥
𝑓 𝑥 = ቐ2𝑒 , 𝑥>0
2

0, 𝑒𝑙𝑠𝑒𝑤ℎ𝑒𝑟𝑒
• Find the moment generating function of the random variable X whose probability density
function is
1
𝑓 𝑥 = ቐ2 , 0<𝑥<2
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
find the first four central moments.
• Find the moment generating function of the distribution whose pdf is
1 2 −𝑥
𝑓 𝑥 = ቐ2 𝑥 𝑒 , 0<𝑥<∞
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
and hence obtain the mean and the variance.
1
• The random variable X takes the values n with probability 𝑛 , (𝑛 = 1,2,3, … ). Find the moment
2
generating function, the mean and the variance of the distribution.

You might also like