Lec 2 Random Variables and PDF
Lec 2 Random Variables and PDF
Random Variables
and Stochastic
Processes
Lecture 2: Random Variables
Multi-dimensional RV
When an outcome of a random experiment can be specified by n random variable 𝑋1 , 𝑋2 , … , 𝑋𝑛 , it is very
convenient to use the notion of an n-dimensional vector associated with these outcomes.
Example
1. Consider an experiment of throwing a die and tossing a coin together. A two-dimensional RV can be defined as
the appearance of head and an even number
RV and Probability Distribution Function
• Each value of x of the random variable X is associated with a probability
𝑃(𝑥)
• Consider a real RV X. The function of 𝑥 whose value is the probability
P(X ≤ 𝑥) is called the probability distribution function (PDF) of the
random variable X. In other words, it is the probability that the random
variable X is less than or equal to 𝑥.
• 𝑋 is characterized by the PDF, 𝐹𝑋 (𝑥) of the random variable 𝑋. PDF is also
known as cumulative density function (c.d.f)
PDF curve
• It defines the random variable’s probability coming within a distinct
range of values [𝑎, 𝑎 + 𝑑𝑥 = 𝑏], as opposed to taking on any one value.
• 𝐹𝑋 𝑥 𝑑𝑥 is the probability that random variable 𝑋 lies in the interval
[𝑎, 𝑏]. 𝐹𝑋 𝑥 ≥ 0, ∀𝑥 ∈ 𝑅
• The probability that 𝑋 lies within the interval [𝑎, 𝑏] is the area under the
PDF curve, denoted as
𝑏
P X ∈ 𝑎, 𝑏 = න 𝐹𝑋 𝑥 𝑑𝑥
𝑎
∞
• Naturally, −∞ 𝐹𝑋 𝑥 𝑑𝑥 = 1 since the sample space 𝑆 = (−∞, ∞)
Random Variables
Example 5
The number of telephone calls received in the Telecom department during lunch hour has the
probability function given below
# of calls 0 1 2 3 4 5 6
𝑃(𝑥) 0.05 0.20 0.25 0.20 0.15 0.10 0.05
i. Find the probability that there will be three or more calls. Ans: 0.50
ii. Find the probability that there will be an odd number of calls. Ans: 0.50
Example 6
A random experiment consists of three independent tosses of a fair coin and 𝑋 denotes the random
variable which assigns to each element of the sample space the number of tails and Y denotes the
number of consecutive tails in the sample space. Find
i. The probability distribution of 𝑋.
ii. The PDF of 𝑋 and Y
Random Variables
Example 7
A discrete random variable 𝑋 has the probability function given below:
Values 0 1 2 3 4 5 6 7
𝑃(𝑥) 0 𝑎 2𝑎 2𝑎 3𝑎 𝑎2 2𝑎2 7𝑎2 + 𝑎
i. Find the value of 𝑎
ii. Find P X < 6 , P(X ≥ 6), and P(0 < X < 4)
iii. Find the distribution function of X
Probability Density Function (p.d.f)
• In the case of discrete random variable, the values assumed by it can be easily defined, hence, it is easy to assign
a probability for each of the value.
• But a continuous random variable takes values which are continuum over a range in real axis.
• As an example, if the continuous random variable takes values in the rang -5 to 5, it is difficult to say exactly
where the particular value 4.999 exists. So, it is not possible to find the probability of it by observing in the range
-5 to 5.
• Generally, probability of observing a single value in a continuous range of values is zero. It is only meaningful to
define the probability of a single value to exist over a small range.
• Obviously, 4.999 will exist in the range 4.5 to 5 with a high probability than in the range 4 to 4.5.
The probability density function fx (x) of a continuous random variable X is defined such that
𝑑𝑥 𝑑𝑥
𝑃 𝑥− ≤𝑋≤𝑥+ = 𝑓𝑋 𝑥 𝑑𝑥
2 2
and satisfying the following conditions:
i. fX (x) is integrable over the range (−∞, ∞)
ii. 𝑓𝑋 𝑥 ≥ 0, ∀𝑥, −∞ < 𝑥 < ∞
∞
iii. −∞ 𝑓𝑋 𝑥 𝑑𝑥 = 1
Properties of p.d.f and its relationship with PDF
• The p.d.f of a continuous RV 𝑋 satisfies the following properties:
i. 0 ≤ fX (x) for all x. A random variable 𝑋 may assume negative values from −∞ to 0. But fX (x) cannot take
negative values as it defines probability measure
∞
ii. −∞ 𝑓𝑋 𝑥 𝑑𝑥 = 1
𝑥
iii. 𝑃 𝑥1 < 𝑋 ≤ 𝑥2 = 𝑥2 𝑓𝑋 𝑥 𝑑𝑥
1
𝑑
The p.d.f is defined as the derivative of the PDF FX (𝑥) as fX 𝑥 = 𝐹 (𝑥), if the derivative exists.
𝑑𝑥 𝑋
Example 8
A continuous RV 𝑋 has a p.d.f. f 𝑥 = 3𝑥 2 , 0 ≤ 𝑥 ≤ 1. Find 𝐾 and 𝛼 such that
i. P X ≤ 𝐾 = 𝑃(𝑋 > 𝐾) and (ii) P X > 𝛼 = 0.1
1 1
1 3 9 3
Ans: K = ; 𝛼=
2 10
Properties of p.d.f and its relationship with PDF
Example 9
The life in hours of a certain radio tube has the p.d.f given by
100
, 𝑓𝑜𝑟 𝑥 ≥ 100
f x = ቐ 𝑥2
0, 𝑓𝑜𝑟 𝑥 < 100
i. Find the probability that none of three such tubes in a given radio tube will have to be replaced during the
first 150 hours. 𝐴𝑛𝑠: 1/27
ii. Find the probability that all three original tubes would have been replaced during the first 150 hours.
𝐴𝑛𝑠: 8/27
Mean, Variance of Random Variables
• Consider a discrete random variable 𝑋 which assumes n values x1 , x2 , … , xn . Assume that we repeat the
experiment N times and let m1 , 𝑚2 , … , mn be the number of times that x1 , x2 , … , xn occur. So, the mean or average
value of 𝑋 can be given as
𝑚1 𝑥1 + 𝑚2 𝑥2 + ⋯ + 𝑚𝑛 𝑥𝑛 𝑚1 𝑚2 𝑚𝑛
𝑋ത = = 𝑥1 + 𝑥2 + ⋯ + 𝑥
𝑁 𝑁 𝑁 𝑁 𝑛
𝑚𝑖
• As 𝑁 → ∞, tends to the probability of 𝑥𝑖 , namely 𝑝𝑖 . So, the mean or average of a random variable is
𝑁 𝑛
𝑋ത = 𝑝1 𝑥1 + 𝑝2 𝑥2 + ⋯ + 𝑝𝑛 𝑥𝑛 = 𝑝𝑖 𝑥𝑖
𝑖=1
• The mean value is also called expectation or stochastic average of 𝑋. That is, 𝐸 𝑋 = 𝑋ത = 𝜇
Mean for discrete RV
𝑛
𝑋ത = 𝜇 = 𝐸 𝑋 = 𝑝𝑖 𝑥𝑖
𝑖=1
Mean for a continuous RV
∞
𝑋ത = 𝜇 = 𝐸 𝑋 = න 𝑥𝑓𝑥 𝑥 𝑑𝑥
−∞
Mean, Variance of Random Variables
Mean of a Function of a RV
If Y = 𝑔 𝑋 then,
𝑌ത = 𝑔 𝑋ത = σ𝑛𝑖=1 𝑔 𝑥𝑖 𝑝𝑖 if 𝑥, 𝑦 are discrete
∞
𝑌ത = 𝑔 𝑋ത = 𝑥𝑑 𝑥 𝑋𝑓 𝑥 𝑔 if 𝑥, 𝑦 are continuous
−∞
Properties of Expectation
If 𝑋 and 𝑌 are random variables and 𝑎, 𝑏 are constants, then
1. 𝐸 𝑎 =𝑎 10. 𝐸 𝑋 ≤ 𝐸 |𝑋|
2
2. 𝐸 𝑎𝑋 = 𝑎𝐸(𝑋) 11. 𝐸 𝑋𝑌 ≤ 𝐸 𝑋 2 𝐸(𝑌 2 ) → Schwartz inequality
3. 𝐸 𝑎𝑋 + 𝑏 = 𝑎𝐸 𝑋 + 𝑏
4. 𝐸 𝑋 + 𝑌 = 𝐸 𝑋 + 𝐸(𝑌)
5. 𝐸 𝑋𝑌 = 𝐸 𝑋 𝐸(𝑌) if 𝑋, 𝑌 are independent RVs
6. 𝐸 𝑋 − 𝑋ത = 0
7. 𝐸[𝑎𝑔 𝑥 ] = 𝑎𝐸[𝑔 𝑥 ]
8. 𝐸 𝑔 𝑥 +𝑎 =𝐸 𝑔 𝑥 +𝑎
9. 𝐸 𝑋 ≥ 0 if X ≥ 0
Mean, Variance of Random Variables
• Though mean or expectation is a significant number representing the behavior of an RV, it is not
adequate to describe the behavior of an RV completely.
• This is because two different RVs can have the same average but their sample deviations may be
different. To completely define an RV, we need to find some more numbers other than the mean of
the RV. These numbers are simply moment.
• The 𝑛𝑡ℎ moment about origin of a random variable 𝑋 is defined as the expected value of the 𝑛𝑡ℎ
power of 𝑋
• For a discrete RV, the 𝑛𝑡ℎ moment is defined as 𝐸 𝑋 𝑛 = σ𝑖 𝑥𝑖𝑛 𝑝𝑖 and for a continuous RV, 𝐸 𝑋 𝑛 =
∞
−∞ 𝑥 𝑛 𝑓𝑋 𝑥 𝑑𝑥
• The variance of 𝑋 is the average square deviation about the mean, 𝜇. That is, the average degree to
which each number is different from the mean. It is the second moment about the mean.
∞
𝜎𝑋2 = 𝐸 𝑋 − 𝜇 2
= න 𝑥 − 𝜇 2 𝐹𝑋 𝑥 𝑑𝑥 = 𝐸 𝑋 2 − 𝐸 𝑋 2
−∞
• Standard Deviation is the square root of the variance
Mean, Variance of Random Variables
Example 10
When a die is thrown, X denotes the number that turns up. Find 𝐸 𝑋 , E(X 2 ) and 𝑉𝑎𝑟(𝑋)
Solution
𝐸 𝑋 = 3.5, 𝐸 𝑋 2 = 15.17, Var 𝑋 = 1.71
Example 11
By throwing a fair die, a game is played. A player wins 20 GHc if 2 turns up, 40 GHc if 4 turns up and
loses 30 GHc if 6 turns up. And he never loses or gains if any other number turns up. Find the
expected value of money won.
Ans: 5 GHc
Example 12
Let X be an RV with the following probability distribution. Find 𝐸(𝑋), 𝐸(𝑋 2 ) and 𝐸[ 1 + 2𝑋 2 ]
𝑥 3 6 9 Ans: 𝐸(𝑋) = 6.5; 𝐸(𝑋) = 46.5; 𝐸[ 1 + 2𝑋 2 ] = 213
𝑃(𝑋 = 𝑥) 1/6 1/12 1/3
Application of Mean, Variance in Wireless Comm.
• In a multipath environment, the multiple signal copies arrive with
different delays and hence, the different signal components will have
different power levels.
• This is known as the power delay profile (PDP). It gives the intensity of a
signal received through a multipath channel as a function of time delay.
• The objective is to find the average delay and variance of the delay given
a PDP.
• A typical wireless PDP is exponential in nature
• Given a multipath power profile, 𝐹 𝜏 = 𝛼𝑒 −𝛼𝜏 , find the average delay
and variance
1 1
Ans: Average delay, 𝜏ҧ = ; variance, 𝜎𝜏2 =
𝛼 𝛼2
1
The standard deviation, 𝜎𝜏 = . This is known as the RMS delay spread of
𝛼
the wireless channel, the channel’s average delay spread