Random Variables and Mathematical Expectations - Lecture 13 Notes
Random Variables and Mathematical Expectations - Lecture 13 Notes
STA201 Lecture-13
Introduction to Random Variables and Mathematical Expectation
X=x 0 1 2
Discrete Random Variables: A discrete random variable is a random variable whose possible values
either constitutes a finite set of values or an infinite sequence of numbers that is a countably infinite
set of numbers. Example:
• X = The number of cars crossing an intersection every hour
• X = The number of phone calls received per day at a call centre
Continuous Random Variable: A random variable is said to be continuous whose possible values
consists of either all values of a small interval on real number line or all numbers in a disjoint union of
such intervals (e.g. [0, 5] U [10, 15]). Continuous random variables can represent any value within a
specified range or interval and can take on an infinite number of possible values. Example:
• X = The time taken to serve a customer at a call centre
• X = The daily temperature at noon
1
STA201 – Elements of Statistics and Probability Lecture 13 Notes
Example 1:
Consider the experiment of flipping two fair coins.
Let X = The number of heads
So, X = {0, 1, 2}
𝑃(𝑋 = 𝑥𝑖 ); 𝑥𝑖 = 0, 1, 2
𝑓(𝑥𝑖 ) = {
0; 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝒙𝒊 0 1 2
1 1 1
𝒇(𝒙𝒊 ) 4 2 4
Example 2:
Let X be a random variable with probability function defined as follows:
𝒙𝒊 2 4 6 8
1
1. 𝑃(𝑥 = 4) =
10
4 3 7
2. 𝑃(𝑥 > 4) = 𝑃(𝑋 = 6) + 𝑃(𝑋 = 8) = 10 + 10 = 10
2 1 4 7
3. 𝑃(𝑥 ≤ 6) = 𝑃(𝑋 = 2) + 𝑃(𝑋 = 4) + 𝑃(𝑋 = 6) = 10 + 10 + 10 = 10
1 4 3 8
4. 𝑃(2 < 𝑥 ≤ 8) = 𝑃(𝑋 = 4) + 𝑃(𝑋 = 6) + 𝑃(𝑋 = 8) = 10 + 10 + 10 = 10
5. 𝑃(𝑥 = 3) = 0
2
STA201 – Elements of Statistics and Probability Lecture 13 Notes
𝑃[𝑎 ≤ 𝑥 ≤ 𝑏] = ∫ 𝑓(𝑥) ⅆ𝑥
𝑎
That is, the probability that X takes on a value in the interval [a, b] is equivalent to the area below the
graph of 𝑓(𝑋) between the interval [a, b]. The graph of 𝑓(𝑋) is often referred to as the density curve.
Example:
The probability density function of a random variable 𝑋 is defined as
𝑥; 0≤𝑥<1
𝑓(𝑥) = {2 − 𝑥; 1≤𝑥<2
0; 𝑥≥2
Find 𝑃[0.5 ≤ 𝑥 ≤ 1.5]
1.5
Sol: 𝑃(0.5 ≤ 𝑥 ≤ 1.5) = ∫0.5 𝑓(𝑥) ⅆ𝑥
1 1.5
= ∫0.5 𝑥 ⅆ𝑥 + ∫1 (2 − 𝑥) ⅆ𝑥
1 1.5
𝑥2 𝑥2
=[2] + [2𝑥 − ]
0.5 2 1
3
= 4
3
STA201 – Elements of Statistics and Probability Lecture 13 Notes
𝐸[𝑔(𝑥)] is also known as the expected value of 𝑔(𝑥), or the mean of the distribution of 𝑔(𝑥).
Example 1:
Let X e a random variable with probability function defined as follows:
𝒙 2 4 6 8
4
STA201 – Elements of Statistics and Probability Lecture 13 Notes
Example 3:
If the random variable X is the top face of a tossed, fair, six-sided die, what is the expected value of X?
Solution:
X = {1, 2, 3, 4, 5, 6}
f(x)= 1/6; for x = 1, 2, 3, 4, 5, 6
𝒙 1 2 3 4 5 6
𝐸(𝑥) = ∑ 𝑥𝑖 ∙ 𝑓(𝑥𝑖 )
= (1× 1/6) + (2× 1/6) + (3× 1/6) + (4× 1/6) + (5× 1/6) + (6× 1/6)
= 3.5
5
STA201 – Elements of Statistics and Probability Lecture 13 Notes
𝜇 = 𝐸[𝑋] = ∫ 𝑥 ∙ 𝑓(𝑥) ⅆ𝑥
−∞
Example 1:
Suppose 𝑋 is a continuous random variable with probability density function
2𝑥, 0 ≤ 𝑥 ≤ 1
𝑓(𝑥) = {
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
What is the expected value of 𝑋?
Solution:
1
𝐸(𝑥) = ∫0 𝑥. 𝑓(𝑥) ⅆ𝑥
1
= ∫0 𝑥. 2𝑥 ⅆ𝑥
1
= ∫0 2𝑥 2 ⅆ𝑥
1
2𝑥 3
=[ ]
3 0
= 2/3
Example 2:
The probability density function of a random variable 𝑋 is defined as
𝑥; 0≤𝑥<1
𝑓(𝑥) = {2 − 𝑥; 1≤𝑥<2
0; 𝑥≥2
What is the expected value of 𝑋?
Solution:
∞
𝐸(𝑥) = ∫−∞ 𝑥. 𝑓(𝑥) ⅆ𝑥
2
= ∫0 𝑥. 𝑓 (𝑥) ⅆ𝑥
1 2
= ∫0 𝑥. 𝑓(𝑥) ⅆ𝑥 + ∫1 𝑥. 𝑓(𝑥) ⅆ𝑥
1 2
= ∫0 𝑥 2 ⅆ𝑥 + ∫1 𝑥. (2 − 𝑥) ⅆ𝑥
1 2
= ∫0 𝑥 2 ⅆ𝑥 + ∫1 2𝑥 − 𝑥 2 ⅆ𝑥
1 2
𝑥3 𝑥3
= [ 3 ] + [𝑥 2 − ]
0 3 1
=1
6
STA201 – Elements of Statistics and Probability Lecture 13 Notes
For example, for a random variable 𝑋 with probability function 𝑓(𝑥), the expected value of 𝑋 2 is
∑ 𝑋 2 ∙ 𝑓(𝑥); 𝑖𝑓 𝑋 𝑖𝑠 ⅆ𝑖𝑠𝑐𝑟𝑒𝑡𝑒
𝐸[𝑋 2 ] ={
∫ 𝑋 2 ∙ 𝑓(𝑥) ⅆ𝑥; 𝑖𝑓 𝑋 𝑖𝑠 𝑐𝑜𝑛𝑡𝑖𝑛𝑢𝑜𝑢𝑠
Linearity of Expectation
Let 𝑋 and 𝑌 be two random variables, and let 𝑐 be a constant.
Consequently, 𝐸[𝑋] and 𝐸[𝑌] are the expected values of 𝑋 and 𝑌 respectively
Then, the following properties are true:
• 𝐸[𝑐] = 𝑐
• 𝐸[𝑐𝑋] = 𝑐 𝐸[𝑋]
• 𝐸[𝑋 + 𝑐] = 𝐸[𝑋] + 𝑐
• 𝐸[𝑋 + 𝑌] = 𝐸[𝑋] + 𝐸[𝑌]
• 𝐸[𝑋 − 𝑌] = 𝐸[𝑋] − 𝐸[𝑌]
Multiplicity of Expectation
Let 𝑋 and 𝑌 be two independent random variables, and 𝐸[𝑋] and 𝐸[𝑌] are the expected values of 𝑋
and 𝑌 respectively.
Then,
𝐸 [𝑋𝑌 ] = 𝐸 [𝑋] ∙ 𝐸[𝑌]
7
STA201 – Elements of Statistics and Probability Lecture 13 Notes
Standard Deviation
2
𝜎 = 𝑆𝐷(𝑋) = √𝑉𝑎𝑟(𝑋)
Example:
You want to open a new Café. After your market research, you found that 20% of similar cafés make
a monthly loss of Tk. 50,000, 30% of them make no profit or loss, 40% make a profit of Tk. 50,000, and
10% of them make a profit of Tk. 150, 000.
a) What is your expected profit if you decide to open a new Café?
b) What is the standard deviation in your profit amount?
c) If your fixed cost increases by Tk. 10,000, what will be your new expected profit?
Solution: Let X = profit amount
Properties of Variance
Let 𝑋 and 𝑌 be two independent random variables, and 𝑉𝑎𝑟[𝑋] and 𝑉𝑎𝑟[𝑌] are the variances of 𝑋
and 𝑌 respectively. Let 𝑐 be a constant.
Then, the following properties are true:
• 𝑉𝑎𝑟(𝑐) = 0
• 𝑉𝑎𝑟 (𝑐 𝑋) = 𝑐 2 𝑉𝑎𝑟(𝑥)
• 𝑉𝑎𝑟 (𝑋 + 𝑐) = 𝑉𝑎𝑟 (𝑥)
• 𝑉𝑎𝑟 (𝑋 + 𝑌) = 𝑉𝑎𝑟(𝑋) + 𝑉𝑎𝑟(𝑌)
• 𝑉𝑎𝑟 (𝑋 − 𝑌) = 𝑉𝑎𝑟(𝑋) + 𝑉𝑎𝑟(𝑌)
8
STA201 – Elements of Statistics and Probability Lecture 13 Notes
Practice Problems
Probability & Statistics for Engineering and the Sciences (Devore)
Random Variables (Basic Concept)
Page 95-96: 7