Lecture Notes
Lecture Notes
In this chapter we consider real valued functions, called random variables, de-
X : S → RX
1
Example Toss a balanced coin 3 times. Our interest is the number of heads
obtained and not necessarily on the order of the outcomes. Each point in
1
(HHH) 3 0 8
1
(HHT ) 2 1 8
1
(HT H) 2 1 8
1
(HT T ) 1 2 8
1
(T HH) 2 1 8
1
(T HT ) 1 2 8
1
(T T H) 1 2 8
1
(T T T ) 0 3 8
Here, RX = {0, 1, 2, 3}and hence X is discrete. The pmf is given by the table
x 0 1 2 3
1 3 3 1
f(x) 8 8 8 8
Example Let X be the number of e-mails received during the time interval
(0, t) and let Y be the time between e-mails. The random variable X
is discrete and takes values 0, 1, 2, .... On the other hand, the random
t.
2
Defiinitions
i) f (x) ≥ 0
P
ii) f (x) = 1
X
F (x) = f (t) , −∞ < x < ∞
t≤x
attaches to each value. We see for example that the value 2 is taken 3 times
and the probability for each instance is 81 . Hence the probability of the random
1
variable taken the value 3 is 3 8
3
Example1 Coin tossing
4
Example Find the constant c which makes the following a proper density
f (x) = cx, x = 1, 2, 3
P P3 1
We must have 1 = f (x) = c x=1 x = 6c. Hence c = 6
5
1.1 Continuous probability distributions
P (a < X < b)
Definition The function f (x) is a probability density function for the contin-
Z x
F (x) = P (X ≤ x) = f (t) dt
−∞
6
Example1 f (x) = 1, 0 < x < 1
Rt
Example2 f (x) = e−x , 0 < x < ∞. F (t) = 0
e−x dx = 1 − e−t , t > 0
Example Find the constant c which makes f (x) = cx, 0 < x < 1 a proper
density.
R1 2
xdx = c x2 |10 = 2c . Hence, c = 2.
R
We must have 1 = f (x) dx = c 0
We may calculate
Z 3
1 3 4 1
P <X< = 2xdx =
4 4 1
4
2
x 0<x<1
f (x) = 2 − x 1 ≤ x < 2
0
elsewhere
R 1.2 R1 R 1.2
a) P (X < 1.2) = 0
f (x) dx = 0
xdx + 1
(2 − x) dx = 0.68
R1 3
b) P (0.5 < X < 1) = 0.5
xdx = 8
7
1.2 Joint probability distributions
toss a pair of dice once. The discrete sample space consists of the pairs
where X, Y are the random variables representing the results of the first and
8
Definition The function f (x, y) is a joint probability distribution or probabil-
P P
ii) x y f (x, y) = 1
iii) P (X = x, Y = y) = f (x, y)
PP
iv) P ((X, Y ) A) = (x,y)A f (x, y)
9
1
Example One toss of a pair of dice: P (X = x, Y = y) = 36
1 2 3 4 5 6
1 1 1 1 1 1
1 36 36 36 36 36 36
1 1 1 1 1 1
2 36 36 36 36 36 36
1 1 1 1 1 1
X 3 36 36 36 36 36 36
1 1 1 1 1 1
4 36 36 36 36 36 36
1 1 1 1 1 1
5 36 36 36 36 36 36
1 1 1 1 1 1
6 36 36 36 36 36 36
10
Definition The function f (x, y) is a joint probability distribution of the con-
11
Example1 Find the constant c which makes f (x, y) = cxy 2 , 0 < x < 1, 0 <
R1R1 2 3
xy 2 dxdy = c x2 |10 y3 |10 = c
RR
We must have 1 = f (x, y) dxdy = c 0 0 6
Hence, c = 6
12
It is possible to retrieve the individual distribution of a random variable from
the joint distribution. This is done through the notion of marginal distributions.
X X
g (x) = f (x, y) , h (y) = f (x, y)
y x
Z Z
g (x) = f (x, y) dy, h (y) = f (x, y) dx
13
Example1 Suppose that the joint density of X, Y is given as f (x, y) = 8xy, 0 <
Z 1
8xydy = 4x 1 − x2 , 0 < x < 1
gX (x) =
x
Z y
gY (y) = 8xydx = 4y 3 , 0 < y < 1
0
Example2 Suppose we draw two balls from an urn containing 5 white, 2 blue
and 4 red balls. Let X and Y be the number of white and red balls drawn
2
5
4
x y 2−x−y
f (x, y) = 11
,x + y ≤ 2
2
y gX (x)
0 1 2
1 8 6 15
x 0 55 55 55 55
10 20 30
1 55 55 0 55
10 10
2 55 0 0 55
21 28 6
gY (y) 55 55 55 1
The marginal densities are expressed in the “margins”.
14
1.3 Conditional distributions
is
f (x, y)
f (y|x) = , g (x) > 0
g (x)
f (x, y)
f (x|y) = , h (y) > 0
h (y)
Example Suppose that the joint density of X, Y is given as f (x, y) = 8xy, 0 <
x < y < 1.
8xy
f (y|x) = ,0 < x < y < 1
4x (1 − x2 )
2y
= ,0 < x < y < 1
1 − x2
R1
We may easily verify that f (y|x) is a proper density since x
f (y|x) dy = 1
1
y=0
15
f (y|x) = 8
y=1
15
6
15 y=2
15
The variables are said to be independent if
For random variables X1 , ..., Xn with joint density f (x1 , ..., xn ) and marginals
f1 (x1 ) , ..., fn (xn ) we say they are mutually independent if and only if
Examples In the urn example, X and Y are not independent. Similarly for
16
1.4 Properties of random variables
X , say L (X) is
P
L (x) f (x) X discrete
µ = E [L (X)] =
R
L (x) f (x) dx
X continuous
X, Y , say L (X, Y ) is
P
L (x, y) f (x, y) X Y, discrete
µ = E [L (X, Y )] =
R
L (x, y) f (x, y) dxdy
X Y, continuous
17
15 30 10 50
Example (Urn example) E (X) = 0 55 +1 55 +2 55 = 55 = 0.909.
21 28 6 40
E (Y ) = 0 55 +1 55 +2 55 = 55 = 0.727.
15 30 10 70
E X2 = 0 55 + 12 55 + 22 55 = 55 = 1.272.
15 28 6 52
E Y2 =0 55 + 12 55 + 22 55 = 55 = 0.945.
20 20
E (XY ) = 1 (1) 55 = 55
18
Definition The covariance of two random variables X, Y is σXY = E [(X − µX ) (Y − µY )] =
E (XY ) − µX µY .
2 2
Definition The variance of a random variable X is σX = E (X − µX ) =
2
E (X) − µ2X
σXY
Definition The correlation between X, Y is ρ = σX σY
into account the weighting given to the values of the random variable. The
19
70 50 2 54 20 50 40
2
Example (urn example) σX = 55 − 55 = 121 = 0.446,σXY = 55 − 55 55 =
36
− 121 = −0.2975 ρ = − − .690
Example Suppose that the joint density of X, Y is given as f (x, y) = 8xy, 0 <
8
µX =
15
4
µY =
5
2 11
σX =
225
2
σY2 =
75
4
σXY =
225
ρ = 0.49237
20
In this section, we assemble several results on the calculation of expectation
constants. Also, let h1 (x) , h2 (x) , h3 (x, y) , h4 (x, y) be real valued func-
tions. Then,
E (aX + b) = aE (X) + b
2
σaX+bY +c = a2 σX
2
+ b2 σY2 + 2abσXY
21
Theorem Let X, Y be two independent random variables and let a, b be two
E (XY ) = E (X) E (Y )
σXY = 0
2
σaX+bY = a2 σX
2
+ b2 σY2
22
This theorem generalizes to several independent random variables X1 , ..., Xn
constants. Then
P P
i) E [ ai Xi ] = ai E [Xi ]
X
2
σP a
= a2i σX
2
i
i Xi
the results of the tosses are independent and performed under indentical
1 P P1 1
i) E n Xi = n E [Xi ] = n (np) = p
1 2 σ2 p(1−p)
ii) σ 21 P 2
P
= n σX i
= n = n
Xi
n
variables preserves the mean and importantly reduces the variance by a factor
23