PRCCCCC
PRCCCCC
Aim :- Calculate expected value and variance in the context of single random variable.
Description
There are two main types of random variables:
1. Discrete Random Variable: Takes on a countable number of distinct values. For
example, the number of heads in a series of coin flips.
a) Expected Value (𝑬[𝑿]): is a measure of the central tendency of a random variable. It
represents mean of the possible values that a random variable can take, weighted by their
probabilities. It's calculated by summing the products of each value and its probability:
𝐸[𝑋] = 𝑥 𝑃(𝑋 = 𝑥 )
where 𝑥 are the possible values of the random variable 𝑋 and 𝑃(𝑋 = 𝑥 ) is the probability of 𝑋
taking the value 𝑥 .
b) Variance (Var(𝑿)): measures the spread or dispersion of a random variable's possible
values around the expected value. It quantifies how much the values of the random variable
differ from the expected value. A higher variance indicates greater variability in the values.
Variance is calculated as the expected value of the squared deviation of a random variable
from its mean:
OR
𝑉𝑎𝑟(𝑋) = 𝐸[𝑋 ] − (𝐸[𝑋])
where
𝐸[𝑋 ] = 𝑥 𝑃(𝑋 = 𝑥 )
Also,
2. Continuous Random Variable: Takes on an infinite number of possible values within
a given range. For example, the height of individuals in a population.
a) Expected Value (𝑬[𝑿]): It's calculated by integrating the product of the value and its
probability density function over the entire range.
𝐸[𝑋] = 𝑥 𝑓(𝑥 ) 𝑑𝑥
where 𝑓(𝑥) is the probability density function (PDF) of the random variable 𝑋.
b) Variance (Var(𝑿)):
OR
𝑉𝑎𝑟(𝑋) = 𝐸[𝑋 ] − (𝐸[𝑋])
where
𝐸[𝑋 ] = 𝑥 𝑓 (𝑥 ) 𝑑𝑥
Suppose we have a discrete random variable with possible values and their associated
probabilities.
Example 1:
Let 𝑋 be a discrete random variable with the following values and probabilities:
𝑥 = 1, 𝑃(𝑋 = 1) = 0.2
𝑥 = 2, 𝑃(𝑋 = 2) = 0.5
𝑥 = 3, 𝑃(𝑋 = 3) = 0.3
Input
Output
Example 2: A class XII has 20 students whose marks (out of 30) are 14, 17, 25, 14, 21, 17, 17,
19, 18, 26, 18, 17, 17, 26, 19, 21, 21, 25, 14 and 19 years. If random variable X denotes the
marks of a selected student given that the probability of each student to be selected is equally
likely.
Solution: a)
Input
Output
b) Input
Output
For Continuous Random Variable
Input
Output
Practice Questions
Ques1. Consider a discrete random variable 𝑋 with the following possible values and their
corresponding probabilities:
Values: 0, 3, 5, 10
Probabilities: 0.2, 0.1, 0.1, 0.6
Calculate the expected value 𝐸[𝑋] and variance 𝑉𝑎𝑟[𝑋] of the random variable.
Ques 2. Consider 𝑋 as a random variable representing the outcome of rolling a fair six-sided
die. Calculate the expected value and variance of the random variable.