Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lecture Note L4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 49

Ch 03: 1

Chapter 3
Mathematical
Expectation

Fall 2023
Mean of a Set of Observations Ch 03: 2

Suppose an experiment involves tossing 2 coins. The


result is either 0, 1, or 2 heads. Suppose the experiment
is repeated 15 times, and suppose that 0 heads is
observed 3 times, 1 head 8 times, and 2 heads 4 times.
• What is the average number of heads flipped?
• x bar = (0+0+0+1+1+1+1+1+1+1+1+2+2+2+2) / 15
= ((0)*(3) + (1)*(8) + (2)*(4)) / 15 = 1.07
• This could also be written as a weighted average,
• x bar = (0)(3/15) + (1)(8/15) + (2)(4/15) = 1.07
where 3/15, 8/15, etc. are the fraction of times the given
number of heads came up.
The average is also called the mean.

Fall 2023
Mean of a Set of Observations Ch 03: 3

The method described above for calculating the expected


number of heads per toss of 2 coins suggests that the mean,
or expected value, of any discrete random variable may be
obtained by multiplying each of the values x1 , x2, . . . , xn of
the random variable X by its corresponding probability
f(x1), f(x2), . . . , f(xn) and summing the products. This is true,
however, only if the random variable is discrete.

Fall 2023
Mean of a Random Variable Ch 03: 4

A similar technique, taking the probability of an


outcome times the value of the random variable for that
outcome, is used to calculate the mean of a random
variable.
The mean or expected value x or simply  of a random
variable X with probability distribution f(x), is

 = E (X) = x x f(x) if discrete, or

 = E (X) = x x f(x) dx if continuous

Fall 2023
Ch 03: 5

Example:
A salesperson for a medical device company has two appointments on a given day.
At the first appointment, he believes that he has a 70% chance to make the deal,
from which he can earn $1000 commission if successful. On the other hand, he
thinks he only has a 40% chance to make the deal at the second appointment,
from which, if successful, he can make $1500. What is his expected commission
based on his own probability belief? Assume that the appointment results are
independent of each other.
Solution:
4 possible commission totals: $0, $1000, $1500, and $2500.
calculate their associated probabilities. By independence, we obtain
f($0) = (1 − 0.7)(1 − 0.4) = 0.18, f($1000) = (0.7)(1 − 0.4) = 0.42,
f($1500) = (1 − 0.7)(0.4) = 0.12. f($2500) = (0.7)(0.4) = 0.28,

Therefore, the expected commission for the salesperson is


E(X) = ($0)(0.18) + ($1000)(0.42) + ($1500)(0.12) + ($2500)(0.28)
= $1300.

Fall 2023
Mean of a Random Variable Ch 03: 6

Example:
A lot containing 7 components is sampled by a quality inspector; the lot
contains 4 good components and 3 defective components. A sample of 3
is taken by the inspector. Find the expected value of the number of good
components in this sample.

Solution:

Simple calculations yield f(0) = 1/35, f(1) = 12/35, f(2) = 18/35, and
f(3) = 4/35. Therefore,

Fall 2023
Mean of a Random Variable Ch 03: 7

Example:
Let X be the random variable that denotes the life in hours of a certain
electronic device. The probability density function is

Find the expected life of this type of device.


Solution:
 = E (X) = x x f(x) dx

Fall 2023
Mean of a Random Variable Depending on X Ch 03: 8

Now let us consider a new random variable g(X), which


depends on X; that is, each value of g(X) is determined
by the value of X.
For instance, g(X) might be X2 or 3X − 1, and whenever X
assumes the value 2, g(X) assumes the value g(2).

If X is a random variable with distribution f(x). The


mean g(X) of the random variable g(X) is
g(X) = E [g(X)] = x g(x) f(x) if discrete, or

g(X) = E [g(X)] = x g(x) f(x) dx if continuous

Fall 2023
Mean of a Random Variable Depending on X Ch 03: 9

Example:
Suppose that the number of cars X that pass through a car wash
between 4:00 P. M . and 5:00 P.M. on any sunny Friday has the
following probability distribution:

Let g(X) = 2X− 1 represent the amount of money, in dollars, paid to the
attendant by the manager. Find the attendant’s expected earnings for
this particular time period.
Solution:

Fall 2023
Mean of a Random Variable Depending on X Ch 03: 10

Example:
Let X be a random variable with density function

Find the expected value of g(X) = 4X + 3.


Solution:

Fall 2023
Expected Value for a Joint Distribution Ch 03: 11

If X and Y are random variables with joint probability


distribution f (x,y). The mean or expected value g(X,Y)
of the random variable g (X,Y) is

g(X,Y) = E [g(X,Y)] = x y g(x,y) f(x,y) if discrete, or

g(X,Y) = E [g(X,Y)] = x y g(x,y) f(x,y) dy dx if continuous

Fall 2023
Mean of a Random Variable Depending on X Ch 03: 12

Example:
Let X and Y be the random variables with joint probability
distribution indicated in Table

Find the expected value of g(X,Y) = XY.

Solution:

Fall 2023
Mean of a Random Variable Depending on X Ch 03: 13

Solution:

+ 0 2 𝑓(0,2)

Fall 2023
Mean of a Random Variable Depending on X Ch 03: 14

Example:

Solution:

Fall 2023
Variance Ch 03: 15

What was the variance of a set of observations?


It characterizes the variability in the distribution.

Fall 2023
Variance Ch 03: 16

The variance 2 of a random variable X with


distribution f(x) is

2 = E [(X - )2] = x (x - )2 f(x) if discrete, or

2 = E [(X - )2] = x (x - )2 f(x) dx if continuous

• The positive square root of the variance, σ, is called the


standard deviation of X.

Fall 2023
Variance Ch 03: 17

Example:
Let the random variable X represent the number of automobiles that
are used for official business purposes on any given workday. The
probability distribution for company A is

and that for company B is

Show that the variance of the probability distribution for company B is


greater than that for company A.

Fall 2023
Variance Ch 03: 18

Solution:
For company A, we find that

From variance definition 2 = E [(X - )2] = x (x - )2 f(x)

Similarly, For company B, we have

The variance of the number of automobiles that are used for official business
purposes is greater for company B than for company A

Fall 2023
Variance of a Sample Ch 03: 19

2 = E [(X - )2] = x (x - )2 f(x)

An equivalent and easier computational formula, also easy to


remember, is

2 = E [X2] - E [X]2 = E [X2] - 2 ???

"The expected value of X2 - the expected value of


X...squared."

Fall 2023
Variance Ch 03: 20

Example:
Let the random variable X with the probability distribution as shown.

calculate σ2.
Solution:
2 = E [X2] - 2

Fall 2023
Variance Ch 03: 21

Example:
A continuous random variable X having the probability density

Find the mean and variance of X.


2 = E [X2] - 2

Fall 2023
Variance Ch 03: 22

Fall 2023
Variance Ch 03: 23

Example:
Calculate the variance of g(X) = 2X + 3, where X is a random
variable with probability distribution

Solution:

First, we find the mean of the random variable 2X +3

Fall 2023
Variance Ch 03: 24

Example:
Calculate the variance of g(X) = 2X + 3, where X is a random
variable with probability distribution

Solution:

1 1
= 4 0 − 12 0 + 9 ∙ + 4 1 − 12 1 + 9 ∙ +
4 8
1 1
4 4 − 12 2 + 9 ∙ + 4 9 − 12 3 + 9 ∙ =4
2 8

Fall 2023
Variance Ch 03: 25

Example:
X is a random variable with probability distribution

Find the variance of the random variable g(X) = 4X + 3.

Solution:

2 𝑥2 1 2
𝜇(4𝑋+3) = ‫׬‬−1 4𝑥 + 3 𝑑𝑥 = ‫׬‬−1 4𝑥 3 + 3𝑥 2 𝑑𝑥
3 3
1 4 3
2
= 𝑥 +𝑥 ቚ =8
3 −1

Fall 2023
Variance Ch 03: 26

Example:
X is a random variable with probability distribution

Find the variance of the random variable g(X) = 4X + 3.

Solution:

Fall 2023
Covariance Ch 03: 27

• The covariance is a measure of the nature of the association between two


variables.
• If large values of X often result in large values of Y the product (X −μ )(Y −μ )
X Y

will tend to be positive.


• if large X values often result in small Y values, the product (X−μ )(Y −μ ) will
X Y

tend to be negative.
• When X and Y are statistically independent, it can be shown that the covariance
is zero
Fall 2023
Covariance Ch 03: 28

If X and Y are random variables with joint probability


distribution f (x,y), the covariance, XY , of X and Y is
defined as

XY = E [(X - X)(Y - Y)]


The better computational formula for covariance is

XY = E (XY) - X Y ???

Note that although the standard deviation  can't be


negative, the covariance XY can be negative.
Covariance will be useful later when looking at the
linear relationship between two random variables.

Fall 2023
Covariance Ch 03: 29

Example:
X and Y are two random variables with joint probability distribution

Find the covariance of X and Y.

Fall 2023
Covariance Ch 03: 30

Solution:

Fall 2023
Covariance Ch 03: 31

Example:
X and Y are two random variables with joint probability distribution

Find the covariance of X and Y.


Solution
We first compute the marginal density functions. They are

g ( x) =  f ( x, y) dy
−
for all x


h( y ) =  f ( x, y) dx
−
for all y

Fall 2023
Covariance Ch 03: 32

Solution:

Fall 2023
Correlation Coefficient Ch 03: 33

Although the covariance between two random variables does


provide information regarding the nature of the relationship, the
magnitude of σXY does not indicate anything regarding the
strength of the relationship, since σXY is not scale-free. Its
magnitude will depend on the units used to measure both X and
Y . There is a scale-free version of the covariance called the
correlation coefficient that is used widely in statistics.
If X and Y are random variables with covariance XY
and standard deviations X and Y respectively, the
correlation coefficient XY is defined as

XY = XY / ( X Y )

Fall 2023
Correlation Coefficient Ch 03: 34

If X and Y are random variables with covariance XY


and standard deviations X and Y respectively, the
correlation coefficient XY is defined as

XY = XY / ( X Y )

Correlation coefficient notes:


• What are the units of XY ? Free unit
• What is the possible range of XY ? -1 ≤ XY ≤ 1
• What is the meaning of the correlation coefficient?
• If XY = 1 or -1, then there is an exact linear relationship
between Y and X (i.e., Y = a + bX). If XY = 1, then b > 0, and
if XY = -1, then b < 0.

Fall 2023
Correlation Coefficient Ch 03: 35

Example:
Find the correlation coefficient between X and Y with joint probability
distribution

Fall 2023
Correlation Coefficient Ch 03: 36

Solution:

Fall 2023
Correlation Coefficient Ch 03: 37

Example:
X and Y are two random variables with joint probability distribution

Find the correlation coefficient between of X and Y.


Solution:
x2 = E [X2] - 2

Fall 2023
Correlation Coefficient Ch 03: 38

Solution:

Fall 2023
Linear Combinations of Random Variables Ch 03: 39

If a and b are constants,

E (aX + b) = a E(X) + b

• Also holds if a = 0 or b = 0.
If we add two functions,

E [g(X)  h(X)] = E [g(X)]  E [h(X)]

• Also true for functions of two or more random variables.


That is,

E [g(X,Y)  h(X,Y)] = E [g(X,Y)]  E [h(X,Y)]

Fall 2023
Ch 03: 40
Linear Combinations of Random Variables
Example:
Suppose that the number of cars X that pass through a car wash
between 4:00P.M. and 5:00 P.M. on any sunny Friday has the
following probability distribution

Find the attendant’s expected earnings that calculated by


g(X) = 2X − 1.

Solution:

Fall 2023
Linear Combinations of Random Variables Ch 03: 41

Example:
Find the Expected value of g(X) = 4X + 3, where the probability
distribution is given by

Solution:

Fall 2023
Functions of Two or More Random Variables Ch 03: 42

The expected value of the sum of two random variables


is equal to the sum of the expected values.

E (X  Y) = E(X)  E(Y)

The expected value of the product of two independent


random variables is equal to the product of the
expected values.

E (X Y) = E(X) E(Y)

Fall 2023
Functions of Two or More Random Variables Ch 03: 43

Example:
X and Y are independent random variables with the joint density
function

Show that E(XY) = E(X)E(Y)

1 1 2 2 1 2
𝐸 𝑋𝑌 = න න 𝑥 𝑦 𝑑𝑥𝑑𝑦 + න න 3𝑥 2 𝑦 3 𝑑𝑥𝑑𝑦
4 0 0 0 0

2
1 1 1 1
1 𝑥3 2 1 8
= න อ 𝑦 𝑑𝑦 + න 𝑥 3 ቚ 𝑦 3 𝑑𝑦 = න 𝑦 𝑑𝑦 + න 8 𝑦 3 𝑑𝑦
4 0 3 0 0 4 0 3 0
0

Fall 2023
Functions of Two or More Random Variables Ch 03: 44

1 1
1 8 𝑦2 𝑦4 1 4 5
𝐸(𝑋𝑌) = อ +8 อ = +2 =
4 3 2 4 4 3 6
0 0

𝐸 𝑋 = න 𝑥𝑔 𝑥 𝑑𝑥 𝐸 𝑌 = න 𝑦ℎ 𝑦 𝑑𝑦

 

g ( x) =  f ( x, y) dy for all x h( y ) =  f ( x, y) dx
−
for all y
−

1 1 𝑥 1 2 1 3𝑦 2
2
𝑔 𝑥 = න 𝑥 + 3𝑥𝑦 𝑑𝑦 = h 𝑦 = ‫׬‬ 𝑥+ 3𝑥𝑦 2 𝑑𝑥 = ( + )
4 0 2 4 0 2 2

2 1
𝑥 4 1 3𝑦 2 5
𝐸 𝑋 =න 𝑥 𝑑𝑥 = , 𝐸 𝑌 =න 𝑦 + 𝑑𝑦 =
0 2 3 0 2 2 8
4 5 20 5
𝐸 𝑋 𝐸 𝑌 = ∙ = =
3 8 24 6

Fall 2023
Variance Relationships Ch 03: 45

For a random variable X with variance 2

2aX + b = a2 2X ???

• So adding a constant does what?


• And multiplying by a constant does what?
For two random variables X and Y,

2aX + bY+c = a2 X2 + b2 Y2 + 2abXY ????

• What if X and Y are independent?


• XY = 0. Note that the correlation coefficient is also 0.

Fall 2023
Variance Relationships Ch 03: 46

Proof

Fall 2023
Variance Relationships Ch 03: 47

Example:
If X and Y are random variables with variances σ2X= 2 and σ2Y = 4
and covariance σXY = −2, find the variance of the random variable
Z = 3X − 4Y + 8.

Solution:

Fall 2023
Variance Relationships Ch 03: 48

For two independent random variables X and Y,

2aX + bY = a2 X2 + b2 Y2


or 2aX - bY = a2 X2 + b2 Y2

• X1,X2, . . . , Xn are independent random variables, then

•2a1X + a2X+….anX = a12 X12 + a22 X22 +…. an2 Xn2

Fall 2023
Variance Relationships Ch 03: 49

Example:
Suppose that X and Y are independent random variables with
variances σ2X = 2 and σ2Y = 3. Find the variance of the random
variable Z = 3X − 2Y + 5.

Fall 2023

You might also like