Chapitre 25
Discrete Random Variables
5.1 General Notions on Discrete Random Variables
Definition 5.1 (Random Variable). A random variable is a variable that can take on
different real values to which it is possible to assign a probability.
Definition 5.2 (Real-valued Random variable). A real-valued random variable, often
denoted by X (or some other upper-case letter), is a function mapping a probability space
(ω, P ) into the real line R. In formal terms, we write
X :Ω −→ X(Ω) ⊂ R
ω −→ X(ω)
Definition 5.3 (Domain of a random variable). The set X(Ω) of possible realizations
that the random variable X can take is called the domain of the random variable X.
Definition 5.4 (Discrete random variable ). A random variable is said to be discrete if
its domain has either a finite or an infinite but countable number of elements. In this
case, the domain X(Ω) is given by X(Ω) = {x1 , x2 , . . . , xk } with the assumption that
x1 < x2 < · · · < xk .
5.2 Probability Distributions
Definition 5.5 (Probability Distribution Function). The probability distribution function
(p.d.f ) of a discrete random variable X is a list of each possible value of X (i.e. X(Ω)) to-
gether with the probabilities pi = P (X = xi ) that X takes the value xi for i ∈ {1, 2, . . . , k}.
The probability distribution is given by an explicit formula or in tabular form as
follows :
1
INFO
USTHB:ING ST 1st year 2023/2024 Probability and Statistics
xi x1 x2 ... xk
pi p1 p2 ... pk
The probabilities in the probability distribution function of a discrete random variable
X must satisfy the following two conditions :
• Each probability pi must be between 0 and 1 :
0 ≤ pi ≤ 1;
• The sum of all the possible probabilities is 1 :
i=k
X
pi = 1
i=1
Definition 5.6 (Cumulative Distribution Function). If X is a discrete random variable,
the cumulative distribution function is given by
FX :R −→ [0, 1]
X
x −→ FX (x) = P (X ≤ x) = P (X = xi )
xi ≤x
which yields to
0 if x < x1 ;
p1 if x1 ≤ x < x2 ;
p1 + p 2 if x2 ≤ x < x3 ;
FX (x) = ..
.
p1 + p 2 + · · · + p i if xi ≤ x < xi+1 ;
..
.
1 if x ≥ xk .
Remark 5.1. An analogy can be made with descriptive statistics. We find again the notion
of cumulative frequencies : ficum = f1 + f2 + · · · + fi .
Properties 5.1. A cumulative distribution function has these four properties :
1. 0 ≤ FX (x) ≤ 1, ∀x ∈ R ;
2
USTHB:ING INFO
ST 1st year 2023/2024 Probability and Statistics
2. FX (x) is an increasing function ;
3. FX (x) is a right-hand continuous function ;
4. lim FX (x) = 0 and lim FX (x) = 1.
x→−∞ x→+∞
Furthermore, and in general, we can show that for any discrete random variable X and
a, b ∈ R, we have :
• P (a < X ≤ b) = P (X ≤ b) − P (X ≤ a) = FX (b) − FX (a);
• P (a ≤ X ≤ b) = P (X ≤ b) − P (X < a) = FX (b) − FX (a) + P (X = a) ;
• P (a ≤ X < b) = P (X < b) − P (X < a) = FX (b) − FX (a) − P (X = b) + P (X = a);
• P (a < X < b) = P (X < b) − P (X ≤ a) = FX (b) − FX (a) + P (X = b).
5.3 Position and Dispersion Parameters
5.3.1 Mathematical Expectation
Definition 5.7 (Mathematical Expectation). The mathematical expectation of a discrete
random variable X, with domain X(Ω) = {x1 , x2 , . . . , xk }, is the number denoted E(X)
and defined by
Xk k
X
E(X) = xi p i = xi P (X = xi ).
i=1 i=1
Remark 5.2.
• The expectation E(X) is the (theoretical) mean of the random variable X ;
k
• An analogy can be made with the descriptive statistics : X = xi fi which is the
P
i=1
observed mean of X, calculated on a sample.
Properties 5.2. For any random variables X and Y and any real numbers a and b, we
have
• E(a) = a ;
• E(aX) = aE(X) ;
• E(aX + b) = aE(X) + b ;
• E(aX + bY ) = aE(X) + bE(Y ).
5.3.2 Variance and Standard Deviation
Definition 5.8 (Variance). The variance of a discrete random variable X with domain
X(Ω) = {x1 , x2 , . . . , xk } is the positive number denoted V (X) and defined by
X
V (X) = E(X − E(X))2 = (xi − E(X))2 P (X = xi ).
xi ∈X(Ω)
3
USTHB:ING INFO
ST 1st year 2023/2024 Probability and Statistics
Definition 5.9 (Standard Deviation). The standard deviation of the random variable X,
denoted σX (or σ(X)), is given by
p
σX = V (X).
Definition 5.10 (Koening formula). We show that
V (X) = E(X 2 ) − E 2 (X)
where
k
X
2
E(X ) = x2i P (X = xi ).
i=1
Properties 5.3. For any random variables X and Y and any real numbers a and b, we
have
• V (a) = 0 ;
• V (aX) = a2 V (X) ;
• V (aX + b) = a2 V (X) =⇒ σ(aX + b) = |a|σ(X) ;
• V (aX + bY ) = a2 V (X) + b2 V (Y ), if X and Y are independent.
5.4 Independence of two random variables
Definition 5.11 (Independence of two real random variables). Two real random variables
X and Y are said to be independent if and only if the probability distribution function of
the dual variable (X, Y ) is equal to the product of the probability distribution functions of
the marginal variables X and Y , that is :
FX,Y (x, y) = FX (x) × FY (y) ∀x ∈ X(Ω), and ∀y ∈ Y (Ω),
i.e.
P (X ≤ x, Y ≤ y) = P (X ≤ x) × P (Y ≤ y) ∀x ∈ X(Ω), and ∀y ∈ Y (Ω).
Definition 5.12. Two discrete random variables X and Y are said to be independent if
and only if
P (X = x, Y = y) = P (X = x) × P (Y = y) ∀x ∈ X(Ω), and ∀y ∈ Y (Ω).
4
USTHB:ING INFO
ST 1st year 2023/2024 Probability and Statistics
5.5 Example
A random experiment consists in drawing (simultaneously) 2 balls from an urn contai-
ning 2 red balls (R) and 3 white balls (W). Let X be the random variable associating to
each draw the number of white balls obtained.
1. What is the number of possible drawings ?
2. Determine the probability distribution function of X.
3. Calculate the cumulative distribution function.
4. Calculate the expectation, variance and standard deviation of X.
5. Assume Y = 5X − 3. Calculate E(Y ), V (Y ), and σ(Y ).
Solution :
1. Ω = {Combinations of 2 balls among 5}. Then, the number of possible draws is
equal to |Ω| = C52 = 10.
2. The probability distribution function of X :
(a) We have X(Ω) = {0, 1, 2}
C22 1
(b) P (X = 0)=P ("to have 2 R balls and 0 W balls") = C52
= 10
C21 C31 6
P (X = 1)=P ("to have 1 R balls and 1 W balls") = C52
= 10
C32 3
P (X = 2)=P ("to have 0 R balls and 2 W balls") = C52
= 10
P
xi 0 1 2
1 6 3
pi 10 10 10
1
This probability distribution function can be summarized by the following for-
mula :
C22−k C3k
P (X = k) = P ("to have 2 − k R balls and k W balls") = , ∀k ∈ {0, 1, 2}.
C52
3. The cumulative distribution function is given by
0 if x < 0;
1
if 0 ≤ x < 1;
10
FX (x) =
7
if 1 ≤ x < 2;
10
1 if x ≥ 2.
5
INFO
USTHB:ING ST 1st year 2023/2024 Probability and Statistics
4. Calculation of the expectation, the variance and the standard deviation of the
random variable X using the statistical table
P
xi 0 1 2
1 6 3
pi 10 10 10
1
6 6 12
xi p i 0 10 10
E(X) = 10
6 12 18
x2i pi 0 10 10
E(X 2 ) = 10
3
P 12
(a) E(X) = xi p i =
i=1 10
3 18
(b) V (x) = E(X 2 ) − E 2 (X) = x2i pi − E(X)2 = − 1.22 = 0.36
P
i=1 10
p √
(c) σ(X) = V (X) = 0.36 = 0.6
5. Calculation of the expectation, the variance and the standard deviation of the
random variable Y = 5X − 3
(a) E(Y ) = E(5X − 3) = 5E(X) − 3 = 3
(b) V (Y ) = V (5X − 3) = 52 V (Y ) = 9
√
(c) σ(Y ) = 9 = 3