0% found this document useful (0 votes)
13 views

Topic 3_Expected Value and Variance of a Random Variable

The document discusses the concept of expected value for a random variable, using the example of university students and their course registrations. It explains how to calculate the expected value using the probability mass function (pmf) and provides numerical examples, including the Apgar score and Bernoulli random variables. Additionally, it covers the rules of expected value and variance, illustrating how to compute these metrics for different scenarios.

Uploaded by

Puneet Arora
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Topic 3_Expected Value and Variance of a Random Variable

The document discusses the concept of expected value for a random variable, using the example of university students and their course registrations. It explains how to calculate the expected value using the probability mass function (pmf) and provides numerical examples, including the Apgar score and Bernoulli random variables. Additionally, it covers the rules of expected value and variance, illustrating how to compute these metrics for different scenarios.

Uploaded by

Puneet Arora
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Expected Value of a Random Variable

• Consider a university having 15,000 students and let X = the number of courses for
which a randomly selected student is registered.
• The pmf of X is given by:
x 1 2 3 4 5 6 7

p(x) 0.01 0.03 0.13 0.25 0.39 0.17 0.02

• Since the total number of students is given and the probabilities are given, we can
calculate the absolute number of students registered for different number of courses.

x 1 2 3 4 5 6 7

p(x) 0.01 0.03 0.13 0.25 0.39 0.17 0.02

Number of 150 450 1950 3750 5850 2550 300


Students
Registered

1
1
Average number of courses per student = (On an average, what is the number of
courses a student has registered for?)

𝑇𝑜𝑡𝑎𝑙 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝐶𝑜𝑢𝑟𝑠𝑒𝑠 𝑡𝑎𝑘𝑒𝑛 𝑏𝑦 𝑎𝑙𝑙 𝑡ℎ𝑒 𝑠𝑡𝑢𝑑𝑒𝑛𝑡𝑠


𝑇𝑜𝑡𝑎𝑙 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑆𝑡𝑢𝑑𝑒𝑛𝑡𝑠
1 150 + 2 450 + ⋯ + 6 2550 + 7(300)
= = 4.57
15000
i.e. On an average, a student has registered for 4.57 courses.

Alternatively, this can be computed as follows:

150 2(450) 7(300)


= + + ⋯+
15000 15000 15000
= 1𝑝 1 + 2𝑝 2 + ⋯ + 7𝑝 7 = 4.57
3
3
• This shows that to compute the average value of X, we need only the possible
values of X along with their probabilities.

• The population size is irrelevant as long as the pmf is given.

• The average or mean value of X is then a weighted average of the possible values of
the random variable where the weights are the probabilities of those values.

4
4
Expected Value of a Random Variable

• Note that 𝜇 is also referred to as the population mean


• The word expected is not used in the colloquial sense of expected. It means, on an
average, what is the value of the Random Variable if the experiment is repeated many
times.

5
5
Expected Value of a Random Variable: Numericals
Q1. Calculate the Expected Value of X:

x 1 2 3 4 5 6 7

p(x) 0.01 0.03 0.13 0.25 0.39 0.17 0.02

𝐸 𝑋 = ෍ 𝑥𝑝 𝑥 = 1 0.01 + 2 0.03 + ⋯ 7 0.02 = 4.57

• Notice that the expected value here is not 4, the ordinary average of 1, . . . , 7, because
the distribution puts more weight on 4, 5, and 6 than on other X values.
• Further, the expected value of 4.57 is not a possible value of X. The word expected
should be interpreted with caution because one would not expect to see an X value of
4.57 when a single student is selected. It is a long-run observed value of X when an
experiment is performed repeatedly.
6
6
Expected Value of a Random Variable

7
7
Expected Value of a Random Variable: Numericals

8
8
Expected Value of a Random Variable: Numericals

9
9
Expected Value of a Random Variable: Numericals

10
10
11
11
Expected Value of a Random Variable: Numericals
Q2. Just after birth, each newborn child is rated on a scale called the Apgar scale. The
possible ratings are 0, 1, . . . , 10, with the child’s rating determined by colour, muscle
tone, respiratory effort, heartbeat, and reflex irritability (the best possible score
is 10). Let X be the Apgar score of a randomly selected child born at a certain hospital
during the next year, and suppose that the pmf of X is

Calculate the expected value of X.

12
12
Expected Value of a Random Variable: Numericals

𝑥𝑝 𝑥 = 𝜇 = 0 0.002 + 1 0.001 + 2 0.002 … + 9 0.12 + 10 (0.01)


𝐸 𝑋 =෍
= 7.15

• Notice again here that 7.15 is not a possible value of the variable X.

13
13
Expected Value of a Random Variable: Numericals

Q3. Calculate the expected value of a Bernoulli Random Variable.

14
14
Expected Value of a Random Variable: Numericals

Pmf of a Bernoulli Random Variable is given by:

𝑝, 𝑖𝑓 𝑥 = 1
𝑝 𝑥 =𝑓 𝑥 =ቊ
1 − 𝑝, 𝑖𝑓 𝑥 = 0

Therefore, expected value of the random variable X = p(1)+(1-p)(0)=p

15
15
Expected Value of a Random Variable: Numericals

Q4. Starting at a fixed time, we observe the gender of each newborn child at a certain
hospital until a boy (B) is born. Let p=P(B), assume that successive births are independent,
and define the rv X by x= number of births observed. Find the expected value of X.

16
16
Expected Value of a Random Variable: Numericals
We need to first find out the pmf of the random variable X. X can take the values 1, 2, 3,

𝑝 1 =𝑓 1 =𝑃 𝑋=1 =𝑃 𝐵 =𝑝

𝑝 2 = 𝑓 2 = 𝑃 𝑋 = 2 = 𝑃 𝐺𝐵 = 1 − 𝑝 𝑝

𝑝 3 = 𝑓 3 = 𝑃 𝑋 = 3 = 𝑃 𝐺𝐺𝐵 = 1 − 𝑝 1 − 𝑝 𝑝 = (1 − 𝑝)2 𝑝
…..
Hence, a general formula emerges
(1 − 𝑝)𝑥−1 𝑝, 𝑖𝑓 𝑥 = 1,2,3 …
𝑝 𝑥 =𝑓 𝑥 =ቊ
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

17
17
∞ ∞

𝐸 𝑋 = ෍ 𝑥𝑝 𝑥 = ෍ 𝑥𝑝(1 − 𝑝)𝑥−1 = 𝑝 ෍ 𝑥(1 − 𝑝)𝑥−1


𝑥=1 𝑥=1


−𝑑
=𝑝෍ (1 − 𝑝) 𝑥
𝑑𝑝
𝑥=1


𝑑 𝑥
𝑑 1−𝑝 𝑑 1−𝑝
= −𝑝 ෍ 1−𝑝 = −𝑝 = −𝑝 ( )
𝑑𝑝 𝑑𝑝 1 − 1 − 𝑝 𝑑𝑝 𝑝
𝑥=1

𝑑 1 −1 1
= −𝑝 − 1 = −𝑝 2 =
𝑑𝑝 𝑝 𝑝 𝑝
If p is near 1, we expect to see a boy very soon, whereas if p is near 0, we expect many
births before the first boy.
18
18
Expected Value of a Function of a Random Variable
• The cost of a certain vehicle diagnostic test depends on the number of cylinders X inthe
vehicle’s engine. Suppose the cost function is given by ℎ 𝑋 = 20 + 3𝑋 + 0.5𝑋 2 . Since
X is a random variable, so is 𝑌 = ℎ(𝑋). The pmf of X is as follows:

x 4 6 8

p(x) 0.5 0. 3 0.2

Find the expected value of Y.

19
19
Expected Value of a Function of a Random Variable
• The cost of a certain vehicle diagnostic test depends on the number of cylinders X inthe
vehicle’s engine. Suppose the cost function is given by ℎ 𝑋 = 20 + 3𝑋 + 0.5𝑋 2 . Since
X is a random variable, so is 𝑌 = ℎ(𝑋). The pmf of X is as follows:

x 4 6 8

p(x) 0.5 0. 3 0.2

y 20+3(4)+0.5(4)(4)=40 20+3(6)+0.5(6)(6)= 20+3(8)+0.5(8)(8)=


56 76
p(x) 0.5 0. 3 0.2

E(Y) = (40)(0.5) + (56)(0.3) + (76)(0.2) = 52

20
20
Expected Value of a Function of a Random Variable

21
21
Expected Value of a Function of a Random Variable:
Numericals

Q. A computer store has purchased three computers of a certain type at $500 apiece. It will
sell them for $1000 apiece. The manufacturer has agreed to repurchase any computers still
unsold after a specified period at $200 apiece. Let X denote the number of computers sold,
and suppose that p(0)=0.1, p(1)=0.2, p(2)=0.3 and p(3)=0.4. Find the expected profit of
the computer store.

22
22
Expected Value of a Function of a Random Variable:
Numericals

ℎ 𝑋 = 𝑅𝑒𝑣𝑒𝑛𝑢𝑒 − 𝐶𝑜𝑠𝑡 = 1000𝑋 + 200 3 − 𝑋 − 1500 = 800𝑋 − 900

23
23
Rules of Expected Value

24
24
Rules of Expected Value
𝐸 𝑎𝑋 + 𝑏 = 𝑎𝐸 𝑋 + 𝑏

Proof:

𝐸 𝑎𝑋 + 𝑏 = ෍ 𝑎𝑥 + 𝑏 𝑝 𝑥 = 𝑎 ෍ 𝑥𝑝 𝑥 + 𝑏 ෍ 𝑝 𝑥 = 𝑎𝐸 𝑋 + 𝑏

25
25
Variance of a Random Variable
Let the random variable X have pmf p(x) and expected value 𝜇.

Then, the variance of X denoted by V(X) or 𝜎𝑋2 or just 𝜎 2 is:

𝜎2 = 𝑉 𝑋 = ෍ 𝑥 − 𝜇 2𝑝 𝑥 = 𝐸(𝑋 − 𝜇)2 = 𝐸[𝑋 − 𝐸 𝑋 ]2

This is also known as expected squared deviation.

26
26
Variance of a Random Variable
• If most of the probability distribution or pmf is close to 𝜇, then 𝜎 2 will be relatively
small.
• However, if there are x values far away from 𝜇, then variance will be quite large.

• Although both distributions pictured in Figure 3.7 have the same center 𝜇, the
distribution of Figure 3.7(b) has greater spread or variability or dispersion than does
that of Figure 3.7(a).
27
27
Alternative Formula for Calculating Variance

𝜎 2 = ෍ 𝑥 − 𝜇 2 𝑝 𝑥 = ෍ 𝑥 2 + 𝜇2 − 2𝜇𝑥 𝑝(𝑥)

= ෍ 𝑥 2 𝑝 𝑥 + 𝜇2 ෍ 𝑝 𝑥 − 2𝜇 ෍ 𝑥𝑝(𝑥)

= 𝐸 𝑋 2 + 𝜇2 − 2𝜇2 = 𝐸 𝑋 2 − 𝜇2 = 𝐸 𝑋 2 − (𝐸(𝑋))2

28
28
Variance of a Random Variable: Numericals

Q. Find the mean, variance and standard deviation of the Random Variable X whose pmf is
given by:

29
29
Variance of a Random Variable: Numericals
Expected Value = E(X)=(1)(0.30)+(2)(0.25)+…+(6)(0.15) = 2.85

Using Alternative Formula for Variance,

30
30
Variance of a Function of Random Variable
ℎ 𝑋 = 𝑎𝑋 + 𝑏

𝑉 ℎ 𝑋 = 𝐸[ℎ 𝑋 − 𝐸(ℎ 𝑋 ]2 = 𝐸[ 𝑎𝑋 + 𝑏 − 𝐸 𝑎𝑋 + 𝑏 ]2

= 𝐸[𝑎𝑋 + 𝑏 − 𝐸 𝑎𝑋 − 𝐸(𝑏)]2 = 𝐸[𝑎𝑋 + 𝑏 − 𝑎𝐸 𝑋 − 𝐸(𝑏)]2

= 𝐸[𝑎𝑋 + 𝑏 − 𝑎𝐸 𝑋 − 𝑏]2 = 𝐸[𝑎(𝑋 − 𝐸(𝑋)]2 = 𝑎2 𝐸[(𝑋 − 𝐸(𝑋)]2 = 𝑎2 V X

2
Therefore, 𝑉 𝑎𝑋 + 𝑏 = 𝜎𝑎𝑋+𝑏 = 𝑎2 𝜎𝑋2

Also, 𝜎𝑎𝑋+𝑏 = |𝑎|𝜎𝑋/


31
31
Variance of a Function of a Random Variable:
Numericals

Q. A computer store has purchased three computers of a certain type at $500 apiece. It will
sell them for $1000 apiece. The manufacturer has agreed to repurchase any computers still
unsold after a specified period at $200 apiece. Let X denote the number of computers sold,
and suppose that p(0)=0.1, p(1)=0.2, p(2)=0.3 and p(3)=0.4. Find the variance of the profit
of the computer store.

32
32
Variance of a Function of a Random Variable:
Numericals

𝐸 𝑋 = 0.1 0 + 0.2 1 + 0.3 2 + 0.4 3 = 2


ℎ 𝑋 = 𝑅𝑒𝑣𝑒𝑛𝑢𝑒 − 𝐶𝑜𝑠𝑡 = 1000𝑋 + 200 3 − 𝑋 − 1500 = 800𝑋 − 900

𝑉(ℎ 𝑋 = 𝑉 800𝑋 − 900 = 6400𝑉(𝑋)

2
𝑉 𝑋 = 𝐸(𝑋)2 − 𝐸 𝑋

33
33

You might also like