Mas C3
Mas C3
Department of Mathematics
Quynhon, 2024
Contents
3 Discrete Distributions
* These slides are made for educational purposes. You may not use or distribute these slides for commercial purposes.
* Some figures are copied from the lecture of DeepLearning.AI
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 2 / 36
Discrete random variables
Discrete random variables
Example.
1 Roll a dice twice: Let X be the number of times 4 comes up. Then X = 0, 1, or 2.
2 Toss a coin 5 times: Let X be the number of heads. Then X = 0, 1, 2, 3, 4, or 5.
3 X = The number of stocks in the Dow Jones Industrial. Average that have share
price increases on a given day, then X is a discrete random variable because its
share price increases can be counted.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 4 / 36
Determining a Discrete Random Variable
X x1 x2 ··· xn
P (x) p1 p2 ··· pn
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 5 / 36
Probability distribution: Example
Let the random variable X1 denote the number of heads in three tosses of a fair coin.
Determine the probability distribution of X1 .
Hint.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 6 / 36
Probability mass function (pmf)
For a discrete random variable X with possible values x1 , x2 , ..., xn , the Probability
Mass Function (PMF) is typically denoted as P (X = x) or f (x), where x is a
specific value that X can take.
Here are some key properties of the PMF:
Probability
f (xi ) = P (X = xi ).
Non-negativity f (x) ≥ 0 for all values of x.
Normalization n X
f (xi ) = 1.
i=1
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 7 / 36
Example
Suppose that a days production of 100 manufactured parts contains 10 parts that do
not conform to customer requirements. Two parts are selected at random, without
replacement, from the batch. Let the random variable X equal the number of
nonconforming parts in the sample. What is the probability mass function of X?
Solution.
89
110
if x = 0
,
2
, if x = 1
f (x) = 111
110
, if x = 2
0, otherwise
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 8 / 36
Cumulative distribution function (cdf)
(i) 0 ≤ F (x) ≤ 1
(ii) If x ≤ y, then F (x) ≤ F (y)
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 9 / 36
Example
Determine the probability mass function of X from the following cumulative distribution
function:
0,
if x < −2
0.2, if −2≤x<0
F (x) =
0.7, if 0≤x<2
x≥2
1, if
Hint.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 10 / 36
Mean and Variance
Mean and Variance
1 The mean or expected value of the discrete random variable X with probability
mass function P (X = xi ) = pi for all possible values xi , denoted as µ or E(X), is
given by:
X
µ = E(X) = xi pi
i
i
q
3 The standard deviation of X is σ = V (X)
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 12 / 36
Example. The number of messages sent per hour over a computer network has the
following distribution:
X 10 11 12 13 14 15
f (x) 0.08 0.15 0.30 0.20 0.20 0.07
Determine the mean and standard deviation of the number of messages sent per hour.
Hint.
µ = 10 × 0.08 + 11 × 0.15 + · · · + 15 × 0.07 = 12.5
σ = 102 × 0.08 + 112 × 0.15 + · · · + 152 × 0.07 − 12.52 = 1.85
2
Remark.
E(aX + b) = aE(X) + b
V (aX + b) = a2 V (X)
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 13 / 36
Discrete Distributions
Discrete uniform distribution
A random variable X has a discrete uniform distribution if each of the n values in its
range, say, x1 , x2 , · · · , xn has equal probability. Then,
1
f (xi ) = P (X = xi ) =
n
Example.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 15 / 36
Discrete uniform distribution: Properties
Theorem (Mean and Variance)
Suppose X is a discrete uniform random variable on the consecutive integers
a, a + 1, . . . , b for a ≤ b. The mean and variance of X are given by
b+a (b − a + 1)2 − 1
µ = E(X) = , σ 2 = V (X) =
2 12
Example.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 18 / 36
Binomial distribution
A random experiment consists of n trials such that:
(i) The trials are independent
(ii) Each trial results in only two possible outcomes, labeled as success andfailure
(iii) The probability of a success in each trial, denoted as p, remains constant
The random variable X = the number of successes in n trials has a binomial
distribution with parameters p and n.
Theorem
Let X be a binomial distribution with parameters p and n. The probability mass
function of X is !
n x
f (x) = p (1 − p)n−x , x = 0, 1, 2, ..., n
x
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 19 / 36
Binomial distribution
Quiz. Each sample of water has a 20% chance of containing a particular organic
pollutant. Assume that the samples are independent with regard to the presence of the
pollutant. Let X = the number of samples that contain the pollutant in the next 18
samples analyzed.
(a) Find P (X = 2).
(b) Determine the probability that at least four samples contain the pollutant.
(c) Determine the probability that 3 ≤ X < 7.
(d) Find the mean and standard deviation of X.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 20 / 36
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 21 / 36
Geometric distribution
Example. The probability of a successful optical alignment in a assembly of an optical
data storage product is 0.8. Assume the trials are independent. What is the probability
that the first successful alignment requires exactly four trials?
Hint. Let X = the number of trials to the first success.
P (X = 4) = P (F F F S)
Definition
In a series of Bernoulli trials (independent trials with constant probability p of a success),
let the random variable X = the number of trials until the first success. Then X has a
geometric distribution with parameter p, and the probability mass function of X is
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 22 / 36
Geometric distribution
Example. Assume that each of your calls to a popular radio station has a probability of
0.2 of connecting, that is, of not obtaining a busy signal. Assume that your calls are
independent.
a) What is the probability that your first call that connects is your tenth call?
b) What is the probability that it requires more than five calls for you to connect?
c) What is the mean number of calls needed to connect?
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 23 / 36
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 24 / 36
Negative Binomial distribution
Definition
In a series of Bernoulli trials (independent trials with constant probability p of a
success), let the random variable X = the number of trials until the first r successes
occur. Then X has a Negative Binomial distribution with parameter p, and the
probability mass function of X is
!
x−1
f (x) = (1 − p)x−r pr for x = r, r + 1, r + 2, . . .
r−1
Example. Find the probability that a man flipping a coin gets the fourth head on the
ninth flip.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 25 / 36
Negative Binomial distribution
r r(1 − p)
µ = E(X) = , σ 2 = V (X) =
p p2
Example. Find the mean and standard deviation of the number of flips until that man
gets four heads.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 26 / 36
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 27 / 36
Hyper-geometric distribution
Definition
A set of N objects contains: K objects classified as successes; N − K objects classified
as failures. A sample of size n objects is selected randomly (without replacement) from
the N objects, where K ≤ N , n ≤ N . Let the random variable X = the number of
successes in the sample. Then X has a hyper-geometric distribution and the
probability mass function of X is:
! !
K N −K
x n−x
f (x) = !
N
n
e−λ λx
f (x) = for x = 0, 1, 2, . . .
x!
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 31 / 36
Poisson distribution
µ = E(X) = λ, σ 2 = V (X) = λ
Example. For the case of the thin copper wire, suppose that the number of flaws
follows a Poisson distribution with a mean of 2.3 flaws per millimeter.
a. Determine the probability of exactly 2 flaws in 1 millimeter of wire.
b. Determine the probability of at least 1 flaw in 2 millimeters of wire.
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 32 / 36
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 33 / 36
Summary
Distribution PMF f Mean µ Variance σ 2
1 b+a (b − a + 1)2 − 1
Uniform distribution
b−a+1 2 12
Binomial distribution Cnx px (1 − p)n−x np np(1 − p)
1 1−p
Geometric distribution (1 − p)x−1 p
p p2
r−1 r r(1 − p)
Negative Binomial distribution Cx−1 (1 − p)x−r pr
p p2
x n−x
CK CN −K N −n
Hyper-geometric distribution np np(1 − p)
CNn N −1
−λ x
e λ
Poisson distribution λ λ
x!
Vo Van Nam - FPTU-BD Chapter. Discrete random variables Statistics & Probability 35 / 36
Thank you!
[email protected]