Mathematical Expectation
Mathematical Expectation
Mathematical Expectation
Mathematical expectation
(Of a random variable)
X 1, 2, 3,…., or 10
f(x)
The probability of the system producing each outcome can be collectively
described by the probability distribution (function) of the random variable, as
discussed in Lecture 3.
CH2010 Engineering Statistics AY2023 v6 PL 3
4.1 Mean of a random variable
If we record three specific outcomes, e.g. 3, 4 & 9, we are doing random sampling.
In Lecture 1, we have learnt to calculate the sample mean: 3 + 4 + 9
= 5.333
3
and the sample variance: (3 - 5.333) 2 + (4 - 5.333) 2 + (9 - 5.333) 2
= 10.33
3 -1
Today, we look at the mean and the variance of the random variable, that is
equivalent to the sample mean and sample variance if the sample size is infinitely
large, i.e. population mean.
X 1, 2, 3,…., or 10
CH2010 Engineering Statistics AY2023 v6 PL 4
Example 4.1
A process produces a random variable that is an integer between 1 – 10. The
probability distribution function f(x) can be expressed as:
If we sample X infinite number of times, the sample mean becomes the mean of the
random variable X or the mean of the probability distribution of X, written as μx
or simply as μ.
æ 1 ö æ 12 ö æ 18 ö æ 4 ö 12
µ = E ( X ) = (0)ç ÷ + (1)ç ÷ + (2)ç ÷ + (3)ç ÷ = = 1.7
è 35 ø è 35 ø è 35 ø è 35 ø 7
Thus, if a sample of 3 components is selected at random over and over again (for
infinite number of times) from a lot of 4 good and 3 defective components. We put
the sampled components back to the lot every time after sampling. The average
number of good components in the sample would be 1.7.
g(X) is a function of X.
If X is a random variable, then so is g(X).
So how about the mean of g(X)?
Now, we extend the definition to functions of two random variables, i.e. g(X, Y), where X
and Y have a joint probability function f(x, y).
CH2010 Engineering Statistics AY2023 v6 PL 12
Definition 4.2
x 1 2 3 x 0 1 2 3 4
f(x) 0.3 0.4 0.3 f(x) 0.2 0.1 0.3 0.3 0.1
Solution
To find the variances, we firstly need the means
µ A = E ( X ) = (1)(0.3) + (2)(0.4) + (3)(0.3) = 2.0
= 0.6
4
s = å ( x - 2) 2 f ( x)
2
B
x =0
\s B2 > s A2
N.B.
Variance = mean of the squared error of one random variable
Covariance = mean of the product of errors of two random variables
Variance is a measure of variability/spread of one random variable
Covariance is a measure of correlation of between the variabilities of two
random variables
Negative covariance: if X is large, it is more likely to have small Y. The two are
negatively correlated.
s XY = E ( XY ) - µ X µY
suggests that the magnitude of the covariance depends on the magnitude of X and Y.
In science and engineering, we always like to have a dimensionless “generalisation”.
The dimensionless version of covariance is called the correlation coefficient.
where −1 ≤ ρXY ≤ 1.
( ) æ5ö
( )
æ 15 ö
( )
æ 3 ö 27
E ( X 2 ) = 0 2 ç ÷ + 12 ç ÷ + 2 2 ç ÷ = ( ) ( )
æ 15 ö æ3ö
( ) æ 1 ö 4
E (Y 2 ) = 0 2 ç ÷ + 12 ç ÷ + 2 2 ç ÷ =
è 14 ø è 28 ø è 28 ø 28 è 28 ø è7ø è 28 ø 7
By Definition 4.5.
9
-
s XY 56 1
r XY = = =-
s XsY 45 9 5
112 28
CH2010 Engineering Statistics AY2023 v6 PL 35
4.5 Means and variances of linear combinations of random
variables
The means and variances of linear functions of random variables can be calculated
conveniently using the means and variances of the random variables, using various short
cut methods.
N.B. Linear means that in the function, the combined power of all variables = 1. For
example:
g1(x) = 3x – 1 is linear h1(x, y) = 2x + 6y – 10 is linear
g2(x) = x2 + 1 is non-linear h2(x, y) = 4xy is non linear
g3(x) = log(x) + 2 is non linear h3(x, y) = 5xy is non linear
E(aX) = aE(X)
E(X + b) = E(X) + b
E(aX + b) = aE(X) + b
Var(aX) = a2Var(X)
Var(X + b) = Var(X)
Cov(aX,bY) = abCov(X,Y)
CH2010 Engineering Statistics AY2023 v6 PL 37
Summary