STAT112 Lecture 2
STAT112 Lecture 2
LECTURE TWO
May 2024
Continuous Variables and Their Probability Distributions
Definition 2.1
Let X denote any random variable. the distribution function of X , denoted
by F (x), is such that F (x) = P(X ≤ x) for −∞ < x < ∞
Example 2.1
Suppose that X is a discrete r.v with pmf
2
2 1
p(x) = , x = 0, 1, 2.
x 2
1 1 3
F (1.5) = P(X ≤ 1.5) = P(X = 0) + P(X = 1) = + =
4 2 4
Properties of a Distribution Function
Theorem 2.1
Given that F(x) is a distribution function, then the following properties
hold:
P(X ≤ γp ) = F (γp ) ≥ p
F (γp ) = P(X ≤ γp ) = p
Example 2.5
A continuous r.v X has pdf given by
cx 2 , for 0 ≤ x ≤ 2
f (x)
0,
elsewhere
Find the value of c for which f(x) is a valid density function. Hence find
P(1 < X < 2)
Solution
We obtain the value of c such that
Z ∞ 2 2
x3
Z
F (∞) = f (x)dx = cx 2 dx = c
−∞ 0 3 0
8
c =1
3
Thus
3
c=
8
3
∴ f (x) = x 2 , 0 ≤ x ≤ 2
8
Z 2
3 2 2 7
Z
∴ P(1 < X < 2) = f (x)dx = x dx =
1 8 1 8
Expected Values for Continuous Random Variables
Definition 2.5
The expected value of a continuous r.v X is given by
Z ∞
E (X ) = xf (x)dx
−∞
1. E (c) = c
2. E [cg (X )] = cE [g (X )]
3. E [g1 (X )+g2 (X )+· · ·+gk (X )] = E [g1 (X )]+E [g2 (X )]+· · ·+E [gk (X )]
4. E [c1 g1 (X ) + c2 g2 (X ) + · · · + ck gk (X )] =
c1 E [g1 (X )] + c2 E [g2 (X )] + · · · + ck E [gk (X )]
Example 2.6
Let the r.v X has density given by:
3 x 2 , for 0 ≤ x ≤ 2
8
f (x)
0,
elsewhere
Find the mean and variance of X
Solution
By definition,
∞ 2
3
Z Z
E (X ) = xf (x)dx = x x 2 dx
−∞ 0 8
Z 2 2
3 3 3 1 4 3
= x = x = = 1.5
0 8 8 4 0 2
To find the variance, we find
∞ 2
3
Z Z
2 2 2
E (X ) = x f (x)dx = x x 2 dx
−∞ 0 8
3 4 3 2 4 3 1 5 2
Z 2 Z
2
E (X ) = x = x = x = 2.4
0 8 8 0 8 5 0
∴ σ 2 = Var (X ) = E (X 2 ) − E 2 (X )
Solution
Clearly the distribution function F(x) is continuous on the interval
0 ≤ x ≤ ∞, therefore, its density function, f(x) is given by
d
dx (0), for x ≤0
d x ,
for 0<x <2
d dx 8
f (x) = F (x) =
dx
2
d x
dx 16 , for 2≤x <4
d (1),
for x ≥4
dx
0, for x ≤ 0
1 , for 0 < x < 2
8
=
x
8 , for 2 ≤ x < 4
0, for x ≥ 4
0, for x ≤ 0
1,
for 0 < x < 2
8
x
8 , for 2 ≤ x < 4
0, elsewhere
By definition,
Z ∞
E (X ) = xf (x)dx
−∞
Z 2 Z 4 2
1 x
= xdx + xdx
0 8 2 8
2 2
1 x2 1 x3
= +
8 2 0 8 3 4
1 13
=
+
4 128
32 + 13 45
E (X ) = =
128 128
Also
Z ∞
E (X 2 ) = x 2 f (x)dx
−∞
Z 2
1 x3 4 3
Z
= x 2 dx + x dx
8 0 8 2
2 2
1 x3 1 x4
= +
8 3 0 8 4 4
1 8 13
= + (64 − 4)
8 3 128
1 15 47
E (X 2 ) = + =
3 2 6
Var (X ) = E (X 2 ) − E 2 (X )
45 2 378949
47
∴ Var (X ) = − = ≈ 7.7097
6 128 49152