Lecture 15 N
Lecture 15 N
1/37
Mathematical Expectation and Variance
Mathematical Expectation
E (X ) = ∑ xk .P(X = xk ) = ∑ xk pX (x)
2/37
Mathematical Expectation
Mathematical Expectation and Variance
3/37
Mathematical Expectation
Mathematical Expectation and Variance
4/37
Mathematical Expectation
Properties
5/37
Mathematical Expectation
Properties
6/37
Examples
7/37
Expectation
Result
Consider the probability mass function f (x) = xc2 of the random variable
X, where x = 1, 2, .... Find the expected value of X.
∞
E (x ) = ∑ xf (x)
x =1
∞
c
= ∑ x. x2
x=1
∞
c
= ∑x
x =1
∞
1
=c∑
x=1 x
8/37
Expectation
Result
The series
∞
1
∑x
x=1
9/37
Expectation
Example, textbook p. 97
10/37
Expectation
Example
11/37
Expectation
Example
Then,
E (X ) = (C − 15)(.98) + (C − 15 − 1000)(.02)
= 50
=⇒ C = $85.
12/37
Mathematical Expectation and Variance
Variance
13/37
Variance
14/37
Variance
Result
Theorem
Var (X ) = E [X 2 ] − [E (X )]2
Proof:
Var (X ) = E [(X − µX )2 ]
= E [X 2 − 2µX X + µ2X ]
= E [X 2 ] − 2E [µX X ] + E [µ2X ]
by linearity of expectation.
= E [X 2 ] − 2E [X ]E [X ] + [E (X )]2
= E [X 2 ] − [E (X )]2
15/37
Variance
Fair die roll
1 1 1
E (X 2 ) = 1 × + 22 × + 32 ×
6 6 6
2 1 2 1 2 1
+4 × +5 × +6 ×
6 6 6
2 2 2
σ = Var (X ) = E [X ] − [E (X )]
2
91 7
= −
6 2
≈ 2.92
q √
σX = σX2 ≈ 2.921 ≈ 1.71
16/37
Mathematical Expectation and Variance
More Examples
17/37
Mathematical Expectation and Variance
More Examples
1 2
E [X 2 ] = (1 + 22 + .... + n2 )
n
1 n(n + 1)(2n + 1)
=
n 6
(n + 1)(2n + 1)
=
6
Var (X ) = E [X 2 ] − [E (X )]2
2
(n + 1)(2n + 1) n+1
= −
6 2
n2 − 1
=
12
18/37
Moments of a distribution
19/37
Moments of a distribution
1. Moments can be very useful in finding the mean and the variance of
a random variable X.
2. The mean of the random variable X, E (X ) is the first moment of X
about the origin.
3. The variance of the random variable X, E (X − µ)2 is the second
moment of X about the mean.
20/37
Moments of a distribution
Factorial Moments
21/37
Moments of a distribution
Factorial Moments
22/37
Mean and Variance of the uniform Distribution
N
E (X ) = ∑ xk .P(X = xk )
k =1
N
= ∑ xk .pX (x)
k =1
N
1
=
N ∑ xk = x̄
k =1
23/37
Mean and Variance of the uniform Distribution
N
1
=
N ∑ xk2 − x̄2
k =1
24/37
Mean and Variance of the Bernoulli Distribution
x P(X = x )
0 1−p
1 p
25/37
Mean and Variance of the Bernoulli Distribution
E (X ) = 0(1 − p) + 1(p) = p
E (X 2 ) = 02 (1 − p) + 12 (p) = p
Var (X ) = E [X 2 ] − [E (X )]2
= p − p2 = p ( 1 − p )
26/37
Mean and Variance of the Binomial Distribution
The mean of X is
n n
n x
E (X ) = ∑ x.P(X = x) = ∑ x.
x
p (1 − p )n−x
x=0 x=0
27/37
Mean and Variance of the Binomial Distribution
n
n x
E (X ) = ∑ x. p (1 − p )n−x
x=0 x
n
n!
= ∑ x. x!(n − x)! px (1 − p)n−x
x=0
n
n(n − 1) !
= ∑ ( x − 1 ) ! ( n − x ) !
px (1 − p)n−x
x=1
28/37
Mean and Variance of the Binomial Distribution
n
n(n − 1) !
= ∑ ( x − 1 ) ! (( n − 1) − (x − 1))!
ppx−1 (1 − p)((n−1)−(x−1))
x=1
n
n − 1 x−1
= np ∑ p (1 − p)((n−1)−(x−1))
x−1=0 x − 1
= np
29/37
Mean and Variance of the Binomial Distribution
Var (X ) = E (X 2 ) − [E (X )]2
Expected value of X 2 is E (X 2 ) = ∑nx=0 x2 .P(X = x)
Instead of using the previous method of simplification we will use E (X (X − 1))
to find E (X 2 ).
n
E (X (X − 1)) = ∑ x(x − 1).P(X = x)
x=0
n
= ∑ x(x − 1).P(X = x)
x=2
30/37
Mean and Variance of the Binomial Distribution
n
E (X (X − 1)) = ∑ x (x − 1).
x=0
n
n x
= ∑ x (x − 1). p (1 − p )n−x
x=2 x
n
n!
= ∑ x(x − 1). x!(n − x)! px (1 − p)n−x
x=2
n
n(n − 1)(n − 2)! x
= ∑ x (x − 1). x!(n − x)!
p (1 − p )n−x
x=2
31/37
Mean and Variance of the Binomial Distribution
n
n(n − 1)(n − 2)!
= ∑ . (x − 2)!(n − x)! p2 p( x − 2)(1 − p)n−x
x=2
n
n(n − 1)(n − 2)!
= ∑ . (x − 2)!((n − 2) − (x − 2))! p2 p( x − 2)(1 − p)(n−2)−(x−2)
x=2
n
n − 2 x−2
= n(n − 1)p 2
∑ x−2
p (1 − p)((n−2)−(x−2))
x−2=0
= n(n − 1)p2
32/37
Mean and Variance of the Binomial Distribution
Var (X ) = E (X 2 ) − [E (X )]2
E (X (X − 1)) = E (X 2 − X ) = E (X 2 ) − E (X )
E (X 2 ) = E (X (X − 1)) − E (X )
= n(n − 1)p2 − np = n2 p2 − np2 + np
Var (X ) = n2 p2 − np2 + np − n2 p2
= np − np2 = np(1 − p)
33/37
Mean and Variance of the Poisson Distribution
λ x eλ
P(X = x ) = x = 0, 1, 2, ..
x!
∞
λ x eλ
E (X ) = ∑x x!
x=0
∞
λ x eλ
= ∑x x!
x=1
∞
λ x eλ
= ∑
x=1 (x − 1 ) !
34/37
Mean and Variance of the Poisson Distribution
∞
λ x−1 eλ
E (X ) = λ ∑
x−1=0 (x − 1 ) !
=λ
E (X ) = λ
Var (x) = E (X 2 ) − [E (X )]2
∞
λ x eλ
E (X (X − 1)) = ∑ x (x − 1) x!
x=0
∞
λ x eλ
= ∑ x (x − 1)
x!
x=2
35/37
Mean and Variance of the Poisson Distribution
∞
λ x eλ
E (X (X − 1)) = ∑ x (x − 1) (x − 2) !
x=2
∞
λ x−2 eλ
= λ2 ∑
x=2 (x − 2 ) !
= λ2
E (X (X − 1)) = E (X 2 ) − E (X )
= λ2
=⇒ E (X 2 ) = λ2 + λ
36/37
Mean and Variance of the Poisson Distribution
Therefore,
37/37