Professional Documents
Culture Documents
Chapter 2
Part I: Discrete Random Variable and Probability
Distributions
vankien.tt@gmail.com
January 8, 2021
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 1 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Outline
1 Random variable
4 Expectation
5 Variance
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 2 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
A random variable is a function from a sample space S into the real numbers. We
usually denote random variables with uppercase letter, e.g., X, Y , . . .
X : S → R.
Example:
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 3 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
A random variable is a function from a sample space S into the real numbers. We
usually denote random variables with uppercase letter, e.g., X, Y , . . .
X : S → R.
Example:
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 3 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
A random variable is a function from a sample space S into the real numbers. We
usually denote random variables with uppercase letter, e.g., X, Y , . . .
X : S → R.
Example:
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 3 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Sample space of random variable (khæng gian m¨u cõa bi¸n ng¨u nhi¶n)
• In defining a random variable, we have also defined a new sample space. For
example, in the experiment of tossing a coin 2 times, the original sample
space is
S = {HH, HT, T H, T T } .
• The new sample space Range(X) is called the range (mi·n gi¡ trà) of the
random variable X .
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 4 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Sample space of random variable (khæng gian m¨u cõa bi¸n ng¨u nhi¶n)
• In defining a random variable, we have also defined a new sample space. For
example, in the experiment of tossing a coin 2 times, the original sample
space is
S = {HH, HT, T H, T T } .
• The new sample space Range(X) is called the range (mi·n gi¡ trà) of the
random variable X .
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 4 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Sample space of random variable (khæng gian m¨u cõa bi¸n ng¨u nhi¶n)
• In defining a random variable, we have also defined a new sample space. For
example, in the experiment of tossing a coin 2 times, the original sample
space is
S = {HH, HT, T H, T T } .
• The new sample space Range(X) is called the range (mi·n gi¡ trà) of the
random variable X .
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 4 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
A random variable X is said to be discrete (ríi r¤c) if it takes only a countable
number of possible values, i.e., Range(X) is a finite or countably infinite set.
Otherwise, it said to be continuous (li¶n töc).
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 5 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 6 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 6 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 6 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 6 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
Let X be a discrete random variable with range {x1 , x2 , . . .}. The probability
mass function (pmf) of X, denoted fX : R → R, is defined as
(
P (X = xi ) if x = xi , for i = 1, 2, . . .
fX (x) =
0 for all other x
Example: Let X be the numerical outcome of a single toss of a fair coin (0 for tails
and 1 for heads). Then its pmf is
2 if x = 0
1
fX (x) = 21 if x = 1
0 for all other x .
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 7 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
Let X be a discrete random variable with range {x1 , x2 , . . .}. The probability
mass function (pmf) of X, denoted fX : R → R, is defined as
(
P (X = xi ) if x = xi , for i = 1, 2, . . .
fX (x) =
0 for all other x
Example: Let X be the numerical outcome of a single toss of a fair coin (0 for tails
and 1 for heads). Then its pmf is
2 if x = 0
1
fX (x) = 21 if x = 1
0 for all other x .
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 7 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
Let X be a discrete random variable with range {x1 , x2 , . . .}. The probability
mass function (pmf) of X, denoted fX : R → R, is defined as
(
P (X = xi ) if x = xi , for i = 1, 2, . . .
fX (x) =
0 for all other x
Example: Let X be the numerical outcome of a single toss of a fair coin (0 for tails
and 1 for heads). Then its pmf is
2 if x = 0
1
fX (x) = 21 if x = 1
0 for all other x .
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 7 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Displaying pmf
x x1 x2 ···
P (X = x) p1 p2 ···
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 8 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
x 1 2 3 4 5 6
1 1 1 1 1 1
P (X = x) 6 6 6 6 6 6
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 9 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
x 1 2 3 4 5 6
1 1 1 1 1 1
P (X = x) 6 6 6 6 6 6
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 9 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
x x1 x2 ···
P (X ≤ x) p1 p1 + p2 ···
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 12 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
Let X be a discrete random variable with range RX = {x1 , x2 , x3 , . . .} (finite or
countably infinite). The expected value of X is defined as
X X
µ = E(X) = xi P (X = xi ) = xi fX (xi ).
xi ∈RX xi ∈RX
Note: E(X) represents the mean value of X over a large number of repetitions of
the experiment.
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 13 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Expectation
Example: The number of email messages received per hour has the following dis-
tribution:
x = number of messages 10 11 12 13 14 15
fX (x) 0.08 0.15 0.30 0.20 0.20 0.07
Determine the expected value of the number of messages received per hour.
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 14 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Expectation
Example: The number of email messages received per hour has the following dis-
tribution:
x = number of messages 10 11 12 13 14 15
fX (x) 0.08 0.15 0.30 0.20 0.20 0.07
Determine the expected value of the number of messages received per hour.
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 14 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Theorem
Let X be a discrete random variable with range RX = {x1 , x2 , x3 , . . .}. Let h be
a real-valued function defined on the range of X . The expected value of h(X) is
defined as
X X
E(h(X)) = h(xi )P (X = xi ) = h(xi )fX (xi ).
xi ∈RX xi ∈RX
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 15 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Expectation
Example: The number of email messages received per hour has the following dis-
tribution:
x = number of messages 10 11 12 13 14 15
fX (x) 0.08 0.15 0.30 0.20 0.20 0.07
Determine the expected value of the square of the number of messages received per
hour.
6
X
E X2 = x2i fX (xi )
i=1
= 10 · 0.08 + 112 · 0.15 + 122 · 0.30 + 132 · 0.20 + 142 · 0.20 + 152 · 0.07
2
= 158.1.
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 16 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Expectation
Example: The number of email messages received per hour has the following dis-
tribution:
x = number of messages 10 11 12 13 14 15
fX (x) 0.08 0.15 0.30 0.20 0.20 0.07
Determine the expected value of the square of the number of messages received per
hour.
6
X
E X2 = x2i fX (xi )
i=1
= 10 · 0.08 + 112 · 0.15 + 122 · 0.30 + 132 · 0.20 + 142 · 0.20 + 152 · 0.07
2
= 158.1.
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 16 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Answer. We have
X
E (sin(X)) = sin(xi )fX (xi )
xi ∈RX
1 π 1 π 1 3π 1 1
= sin(0) · + sin( ) · + sin( ) · + sin( ) · + sin(π) ·
√ 5 4 5 2 5 4 5 5
2+1
= .
5
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 17 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Answer. We have
X
E (sin(X)) = sin(xi )fX (xi )
xi ∈RX
1 π 1 π 1 3π 1 1
= sin(0) · + sin( ) · + sin( ) · + sin( ) · + sin(π) ·
√ 5 4 5 2 5 4 5 5
2+1
= .
5
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 17 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Properties of expectation
Theorem
Let X be a discrete random variable with pmf fX (x). Suppose that h1 , h2 , . . . , hk
are real-valued functions, and let c be a real constant. The expectation of X
satisfies the following properties:
1 E(c) = c
2 E(c · X) = c · E(X)
P P
k k
3 E i=1 hi (X) = i=1 E (hi (X)).
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 18 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Remark: There are few equations which you might think are true, but they do not
hold true in general:
• E(|X|) 6= |E(X)|
• E(X 2 ) 6= E(X)2
• E X1 1
6= E(X)
• E eX =
6 eE(X)
• E(XY ) 6= E(X)E(Y ) unless X, Y are independent
E(X)
• E X
Y 6= E(Y )
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 19 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
Let X be a discrete random variable with range RX = {x1 , x2 , x3 , . . .}. The
variance of X is defined as
h i
2
σ 2 = Var(X) = E (X − E(X)) .
Note:
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 20 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
Let X be a discrete random variable with range RX = {x1 , x2 , x3 , . . .}. The
variance of X is defined as
h i
2
σ 2 = Var(X) = E (X − E(X)) .
Note:
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 20 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
Let X be a discrete random variable with range RX = {x1 , x2 , x3 , . . .}. The
variance of X is defined as
h i
2
σ 2 = Var(X) = E (X − E(X)) .
Note:
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 20 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
Let X be a discrete random variable with range RX = {x1 , x2 , x3 , . . .}. The
variance of X is defined as
h i
2
σ 2 = Var(X) = E (X − E(X)) .
Note:
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 20 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Ùng döng: Trong cæng nghi»p, ph÷ìng sai biºu thà ë ch½nh x¡c cõa s£n xu§t. Trong
ch«n nuæi, nâ biºu thà ë çng ·u cõa c¡c con gia sóc. Trong trçng tråt, nâ biºu
thà mùc ë ên ành cõa n«ng su§t, ...
Theorem
Suppose X and Y are random variable with finite variance. Let c be a constant.
• Var(c) = 0
• Var(cX) = c2 Var(X)
• Suppose X and Y are independent, then
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 21 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Remark: In general,
• Var(|X|) 6= |Var(X)|
• Var(X 2 ) 6= Var(X)2
• Var X1 1
6= Var(X)
• Var eX =
6 eVar(X)
• Var(XY ) 6= Var(X)Var(Y )
6= Var(Y ) .
Var(X)
• Var X
Y
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 22 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Definition
The standard deviation of X is the positive square root of the variance:
√ p
σ= σ2 = Var(X).
Note: We see that the unit of the measure of variance is equals to the square of the
unit of measure of the random variable. So when we need to evaluate the dispersion
of a random variable in its units, we often use the standard deviation instead of the
variance.
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 23 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Expectation
Example: The number of email messages received per hour has the following dis-
tribution:
x = number of messages 10 11 12 13 14 15
fX (x) 0.08 0.15 0.30 0.20 0.20 0.07
Determine the variance and the standard deviation of the number of messages
received per hour.
Answer. We have
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 24 / 25
Random variable Probability mass function Cumulative distribution function Expectation Variance
Expectation
Example: The number of email messages received per hour has the following dis-
tribution:
x = number of messages 10 11 12 13 14 15
fX (x) 0.08 0.15 0.30 0.20 0.20 0.07
Determine the variance and the standard deviation of the number of messages
received per hour.
Answer. We have
Dr. Cao Van Kien Discrete R.V. and Probability Distributions January 8, 2021 24 / 25
Thank you very much for your attention!