Chapitre 1.
Random Variables
Prof. REMITA Mohamed Riad
National School of Arti…cial Intelligence.
2023-2024
De…nitions and notations
Example
A coin is tossed twice. The possible results are
fPP, PF , FP et FF g . We de…ne variable X representing the
number of tails P obtained. Then the values of X are
f0, 1 and 2g .
Example
A die is rolled until a 6 is rolled. The possible outcomes are
f6, (1, 6) , (2, 6) , , (5, 6) , (1, 1, 6) , , (5, 5, 6) , g . We
de…ne a variable X representing the number of throws needed until
a 6 is obtained. Then the values of X are f1, 2, 3, g=N .
Example
The service life of a spare part can be represented by a r.r.v.
De…nitions and notations
We have a probabilized space (Ω, A, P) and a probabilizable space
(R, BR ) .
De…nition
We call a real random variable, noted r.r.v. any application X of
(Ω, A) in (R, BR ) such that:
8B 2 BR , X 1 (B ) = f ω 2 Ω : X ( ω ) 2 B g 2 A.
B can be presented in several forms
If B = ]a, b ] : X 1
(B ) = fa < X b g
1
If B = fag : X (B ) = fX = ag
If B = [a, +∞[ : X 1 (B ) = fX ag
If B = ] ∞, a] : X (B ) = fX
1 ag
De…nitions and notations
Since the Borel σ algebra is generated by all the intervals
] ∞, x ] , then a random variable can be de…ned by the following
de…nition:
De…nition
The application X of (Ω, A) in (R, BR ) is a real random variable
if for all x 2 R and 8B 2 BR the subset
Ax = X 1 (] ∞, x ]) = fω 2 Ω : X (ω ) x g 2 A.
Example
We throw two coins and let X be the number of tails obtained. We
know that Ω = f(F , F ) ; (F , P ) ; (P, F ) ; (P, P )g and the values of
X are f0, 1, 2g .
1. Show that X is a random variable on Ω endowed with the
algebra P (Ω) .
2. Show that X is not a random variable on Ω endowed with the
algebra A1 = fΩ, ∅, f(F , F )g , f(F , F ) ; (F , P ) ; (P, F )gg .
De…nitions and notations
Let Ω be the space of trials associated to a Bernoulli random
experiment and let IA ( ) be the function from Ω to f0, 1g de…ned
by
1 if ω 2 A
IA ( ) = .
0 if ω 2/A
IA ( ) is called indicator function (or Dirac measure) of the event
A.
We can show easily that IA ( ) is a random variable for the algebra
AIA ( ) = Ω, ∅, A, A .
Properties. The indicator function IA ( ) satis…es the following
properties:
1. IA (ω ) = 1 IA (ω ) , 8A 2 A,
2. I\A i (ω ) = ∏i IA i (ω ) , 8Ai 2 A,
3. P (IA (ω ) = 1) = P (A) , 8A 2 A,
4. P (IA (ω ) = 0) = 1 P (A) = P A , 8A 2 A.
Induced probability
Theorem
Let X be a r.r.v. de…ned on probabilized space (Ω, A, P) with
values in a probabilizable space (R, BR ). The application PX of
BR in R de…ned by PX (B ) = P X 1 (B ) , is a probability on
(R,BR ).
Remark
The de…nition is due to the existence of P on (Ω, A), hence the
notion of induced probability.
Induced probability
Proof.
It is obvious that PX is an application with values in [0, 1].
Moreover P veri…es these conditions:
PX (R) = P X 1
(R) = P ( Ω ) = 1
Let (Bi )i 1 be two by two incompatible borelean sequences. Then
PX [ Bi = P X 1
[ Bi =P [X 1
(Bi )
i 1 i 1 i 1
= ∑P X 1
(Bi ) = ∑ PX (Bi ) ,
i 1 i 1
1 1
noting that X (Bi ) and X (Bj ) are incompatible 8i 6= j.
Cumulative distribution function of a random variable
De…nition
The cumulative ditribution function of a r.r.v. is the function F or
FX de…ned by:
F ( x ) = FX ( x ) = P ( X x) .
Properties of a cumulative distribution function
De…nition
A sequence of events (An )n 1 is increasing (resp. decreasing) if
An An +1 (resp. An +1 An ) for all n 1.
(An )n 1 is said to be monotonic if it is increasing or decreasing.
In this case we put lim An = [ An if it is increasing (resp.
n !∞ n 1
lim An = \ An if it is decreasing).
n !∞ n 1
Cumulative distribution function of a random variable
Remark
lim An exists if and only if the sequence (An )n 1 is monotonic.
n !∞
Lemma
(Property of the continuity of P)
If (An )n 1 is a monotonic sequence of events, then we have:
lim P (An ) = P lim An .
n !∞ n !∞
Cumulative distribution function of a random variable
Theorem
If F is the cumulative distibution function of X then
1. 8x 2 R 0 F (x ) 1;
2. F is an increasing function;
3. F is right continuous;
4. lim F (x ) = 1 and lim F (x ) = 0.
x !∞ x! ∞
Cumulative distribution function of a random variable
Proof.
1. Obvious because F (X ) = P (X x) so 0 F (X ) 1.
2. Suppose that x1 x2 , hence ] ∞, x1 ] ] ∞, x2 ] and
X 1 (] ∞, x1 ]) X 1 (] ∞, x2 ]) . It follows that
P X 1 (] ∞, x1 ]) P X 1 (] ∞, x2 ]) hence
F (x1 ) F (x2 ) .
3. Let us show that for any real sequence (εn ) decreasing and
converging to 0, limn !∞ F (x + εn ) = F (x ) . We set An =
]x, x + εn ] . The (An ) are decreasing and limn !∞ An = ∅,
hence from the lemma
limn !∞ PX (An ) = PX (limn !∞ An ) = PX (∅) = 0. Since
PX (An ) = P (x < X x + εn ) = P (X x + εn ) P (X x)
= F (x + εn ) F (x ) ,
then limn !∞ F (x + εn ) = F (x ) .
Cumulative distribution function of a random variable
Proof.
4. Let Bn = ] ∞, xn ] where the xn is decreasing and converging
to ∞. We deduce that (Bn ) is a decreasing sequence and
lim Bn = ∅, and according to the lemma
lim PX (Bn ) = PX lim Bn = PX (∅) = 0
n !∞ n !∞
or limn !∞ PX (Bn ) = limn !∞ PX (X xn ) =
limn !∞ F (xn ) = 0.
Let us consider the sequence de…ned by Cn = ] ∞, yn ] where
(yn ) is an increasing real sequence such that
limn !∞ yn = +∞. We deduce that the (Cn ) are increasing
and limn !∞ Cn = R.
We have limn !+∞ F (yn ) = limn !+∞ P (X yn ) =
limn !+∞ PX (Cn ) = PX (limn !+∞ Cn ) = PX (R) = 1.
Support of a real random variable
We call the support of an r.v. X the set X (Ω). This support
comes in several forms:
If X (Ω) is …nite or in…nite countable X is said to be a
discrete (or discontinuous) random variable, denoted d.r.v.
If X (Ω) is in…nite uncountable X is said to be a continuous
random variable, denoted c.r.v.
Moreover a c.r.v. is said to be absolutely continuous if it
admits a continuous and derivable distribution function
(except possibly at some points).
Discrete random variables
De…nition
The random variable X is said to be discrete if it takes a …nite or
in…nite countable number of values.
Notation: When the r.v. X takes the value x we write fX = x g
to describe the event fω 2 Ω, X (ω ) = x g .
Example
In the example of tossing a coin twice X = 0 correspond to the
case where there is no tail P, this means that fX = 0g = fFF g .
In the same way we have fX = 1g = fPF , FP g and
fX = 2g = fPP g .
Discrete random variables
Probability distribution of a discrete random variable
De…nition
Let X be a d.r.v. one calls probability distribution or mass function
of the r.v. X the application
p : R ! [0, 1]
x 7 ! p (x ) = P (X = x ) .
Properties:
1.8x 2 R, p (x ) 0;
2. ∑x 2R p (x ) = 1.
Discrete random variables
Example. When we throw a coin twice, we have
p (0) = P (X = 0) = P (fFF g) = 14 ;
p (1) = P (X = 1) = P (fPF , FP g) = 24 = 12 ;
p (2) = P (X = 2) = P (fPP g) = 14 .
The distribution is usually written in the following form
x 0 1 2 ∑xx = 2
=0 p ( x )
P (X = x ) 1
4
1
2
1
4 1
Discrete random variables
Cumulative distribution function
1. If X is a discrete r.v. then
FX ( x ) = ∑ P (X = xi ) = ∑ p (xi ) .
xi x xi x
2. The cumulative distribution function allows to determine the
probability law of the r.v. X .
Indeed, 8xj 2 X (Ω)
j j 1
P ( X = xj ) = ∑ P (X = xi ) ∑ P (X = xi ) = FX (xj ) F X ( xj 1) .
i =1 i =1
Discrete random variables
Example
We throw 3 dice and de…ne the r.v. X as the number of 6
obtained.
The probability law of X is
x 0 1 2 3 ∑xx = 2
=0 p ( x )
53 3 52
P (X = x ) 63 63
35
63
1
63
1
8
>
> 0 if x < 0
>
> 125
< 216 if 0 x < 1
200
FX ( x ) = 216 if 1 x < 2
>
> 215
>
> 216 if 2 x < 3
:
1 if 3 x
Continuous random variables
De…nition
A real random variable X is said to be absolutely continuous if its
cumulative distribution function FX ( ) satisfy the two following
conditions:
1. FX is continuous on R;
2. FX is derivable in every point x 2 R except perhaps on a
…nite set D.
Continuous random variables
Theorem
Let X be an absolutely continuous random variable, with
cumulative distribution function FX , then for any pair (a, b ) 2 R2
such that a < b, we have
1. P (X = a) = 0.
2. P (X 2 ]a, b ]) = P (X 2 ]a, b [) = P (X 2 [a, b [) =
P (X 2 [a, b ]) = FX (b ) FX (a) .
3. P (X 2 ]a, ∞[) = P (X 2 [a, ∞[) = 1 FX ( a ) .
4. P (X 2 ] ∞, b ]) = P (X 2 ] ∞, b [) = FX (b ) .
Continuous random variables
De…nition
A real random variable X de…ned on a probability space (Ω, A, P)
with cumulative distribution function FX is said to be absolutely
continuous random variable, if there exists a real function fX
satisfying the following conditions:
1. fX (x ) 0; 8x 2 R;
2. fX is continuous on R, except perhaps on a …nite number of
points where it has a …nite left limit and …nite right limit.
R +∞
3. The integral ∞ fX (x ) dx exists and is equal to 1.
4. The cumulative distribution function FX can be written, for all
x 2 R in the form
Z x
FX ( x ) = fX (s ) ds.
∞
Continuous random variables
De…nition
A function f that satis…es the four previous conditions is called a
probability density function or distribution function of an absolutely
continuous random variable X .
Continuous random variables
Example
Let X be a random variable with cumulative distribution function
FX given by
0 if x < 0
FX ( x ) = 1 x
1 2 (x + 2) e 2 if x 0
1. Show that the random variable X is absolutely continuous.
2. Find the constant C such that the function f de…ned by
x
Cxe 2 if x 0
f (x ) =
0 elsewhere
be the probability density of the random variable X .
3. Verify that Z x
FX ( x ) = f (s ) ds.
∞
Solution
1. FX is continuous on ] ∞, 0[ and on ]0, +∞[ show that it is
x
continuous in 0. We have limx !0 1 21 (x + 2) e 2 = 0 hence
FX is continuous in 0.
FX is derivable on ] ∞, 0[ and on ]0, +∞[ show that it is
F (x ) F (0 )
derivable in 0. We have limx !0 X x X =0
FX is derivable on R, hence X is an absolutely continuous variable.
Solution
2. To show that f is a density function we determine …rst the
constant
R +∞ C using the condition 3 of the de…nition i.e.
∞
f ( x ) dx = 1, then we verify the other conditions.
We have
Z +∞ Z +∞ h i Z +∞
x x ∞ x
f (x ) dx = Cxe dx = C
2 2xe 2 +2 e 2 dx
∞ 0 0 0
h i
x ∞
= C 4e 2 = 4C = 1.
0
1
hence C = 4 and
0 if x < 0
f (x ) = x x
4e if x 0
2
We have fX (x ) 0; 8x 2 R.
It is a continuous fuction in 0 and then continuous on R.
Then f is a probability density function of the random variable X .
Solution
Rx
3. If x < 0, ∞
f (s ) ds = 0 since on ] ∞, 0[ , FX (x ) = 0
If x 0,
Z x Z 0 Z x Z x
s s
f (s ) ds = f (s ) ds + f (s ) ds = 0 + e 2 ds
∞ ∞ 0 0 4
h ix Z x
1 s s
= 2se 2 +2 e 2 ds
4 0 0
1 x
h s ix
= 2xe 2 4 e 2
4 0
1 x x 1 x
= 2xe 2 4e 2 +4 = 1 (x + 2) e 2
4 2
Rx
hence FX (x ) = ∞
f (s ) ds.
Mathematical expectation and variance
De…nition
Let X be a d.r.v. with possible values x1 , x2 , and mass function
p (x ) . The mathematical expectation of X is
E [X ] = ∑ xi p (xi ) = ∑ xi P (X = xi )
i 1 i 1
provided that the above serie is absolutely convergent, otherwise
we will say that X does not have a mathematical expectation.
Remark
If X has a …nite number of values then E [X ] exists.
Mathematical expectation and variance
De…nition
Let X be a c.r.v. with distribution function f , the mathematical
expectation of X is
Z +∞
E [X ] = xf (x ) dx
∞
provided that the above integral is absolutely convergent, otherwise
we will say that X does not have a mathematical expectation.
Example
Let T be a c.r.v. with distribution function f de…ned by
1
t2
if t > 1
f (t ) =
0 elswhere
Determine E [T ] .
Mathematical expectation and variance
Solution : We have
Z +∞ Z +∞
1
jtf (t )j dt = dt
∞ 1 t
Z x
1
= lim dt = lim log x log 1 = +∞
x !∞ 1 t x !∞
hence the expectation doesn’t exist.
De…nition
Let G be a function of a random variable X , the expectation of
G (X ) is given by
E [G (X )] = R +∑
∞
x 2R G (x ) p (x ) if X is discrete
∞
G (x ) f (x ) dx if X is continuous
provided that the above serie and integral are absolutely
convergent.
Mathematical expectation and variance
Theorem
Let X be a random variable, then
1. E [c ] = c where c is a constant,
2. E [αH (X ) + βG (X )] = αE [H (X )] + βE [G (X )] where H
and G are functions of X and α, β are reals. Provided that
the di¤erent expectations exist.
De…nition
Let X be a random variable, we call moment of order k (k 2 N)
the following value
h i k
E Xk = R∑ x 2R x p (x ) if X is discrete
+∞ k
∞
x f (x ) dx if X is continuous
provided that the above serie and integral are absolutely
convergent.
Mathematical expectation and variance
De…nition
Let X be a random variable, the variance of X , noted σ2X or
Var (X ) is
h i
σ2X = E (X E [X ])2 = E X 2 E [X ]2 .
We call standard deviation of X the number
q
σX = Var (X ).
If E [X ] = 0 we say that the random variable is centrend.
If Var (X ) = 1 we say that the random variable is reduced.
Mathematical expectation and variance
Theorem
Let X be a random variable with expectation E [X ] and variance
σ2X . If Y = aX + b where a and b are real constants, then
E [Y ] = aE [X ] + b and σ2Y = a2 σ2X .