Discrete Random Variables and Probability Distributions
Discrete Random Variables and Probability Distributions
and Probability
3
Distributions
LO
• Describe a discrete random variable
• Check if a function is a probability mass function and use it to
calculate probability
• Find the cumulative distribution function of a discrete
random variable
• Compute the mean and variance of a discrete random variable
• Determine the probability, mean and variance of uniform,
binomial, geometric and negative binomial, hypergeometric
and Poisson distributions
X = number of trials until
the 1st success
X = number of successes
in a series of n Bernoulli trials
Hyper-
-geometric
Discrete Uniform
Distribution RV Distribution
X 0 1 2 3
P(X = x) 1/8 3/8 3/8 1/8
Probability
distribution for
xP(x) = 1 number of heads.
Probability Distribution - Ex2
• Ex. (Digital Channel) There is a chance that a bit transmitted through a digital
transmission channel is received in error. Let X equal the number of bits in
error in the next four bits transmitted. The possible values for X are {0, 1, 2, 3,
4}. Suppose that the probabilities are
X 0 1 2 3 4
P(X = x) 0.6561 0.2916 0.0486 0.0036 0.0001
a/ P(X = 4) b/ P(X 3)
c/ P(2 X 4) d/ P(X > -3)
---
c/ P(2 X 4) = P(X = 2) + P(X = 3) + P(X = 4)
= (22 +1)/25 + (23 + 1)/25 + (24 + 1)/25 = 21/25
Cumulative Distribution Function (cdf)
The cumulative distribution function (cdf) of a discrete random
variable X, denoted as F(x), is
F(x) = P(X x)
For discrete random variable X, F(x) satisfies
(1) F(x) = σx x f(xi)
i x -1 0 1 2 otherwise
(2) 0 F(x) 1
f(x) 0.2 0.5 0 0.3 0
(3) If x y, then F(x) F(y) Find F(-1), F(1), F(1.9)
---
F(-1) = f(-1) = 0.2, F(1) = f(-1) + f(0) + f(1) = 0.7
F(1.9) = f(-1) + f(0) + f(1) = 0.7
Pmf vs cdf
x 0 1 2
f(x) 0.886 0.111 0.003
x -3 -2 -1 0 1 2 3
Find f(x) from F(x):
f(x) = F(x) – F(x-) F(x) 0 0.2 0.2 0.7 0.7 1 1
f(x) 0 0.2 0 0.5 0 0.3 0
Mean and Variance
• The mean or expected value of X, denoted as or E(X) is
= E(X) = xxf(x)
• The variance of X, denoted as 2 or V(X), is
V(X) = 2 = x(x - )2f(x) = x x2f(x) – 2
• The standard deviation of X is = 2
Parts (a) and (b) illustrate equal means, but Part (a) illustrates a larger variance
Mean and Variance - Ex
Ex. (Digital Channel) There is a chance that a bit transmitted through a
digital transmission channel is received in error. Let X equal the number of
bits in error in the next four bits transmitted. Suppose that the probabilities
are
x 0 1 2 3 4
f(x) = P(X = x) 0.6561 0.2916 0.0486 0.0036 0.0001
= E(X)
= xxf(x) = 0.4
2 = V(X)
= x(x - )2f(x) = 0.36
Mean and Variance - Ex
Ex. Given the pmf of a discrete r. v. X.
x 0 1 2 3
f(x) 0.5 0.3 0.1 0.1
2 = V(X)
= x(x - )2f(x)
= E[(X- )2]
= E[X2 - 2X + 2]
= E(X2) – 2
= E(X2) – E(X)2
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,
f(xi) = 1/n
n = number of trials
X = number of successes
Binomial p = probability of success
Distribution P(x) = n px(1 – p)n-x
x
E(X) = np
V(X) = np(1 – p)
Geometric Distribution
In a series of Bernoulli trials (independent trials with constant probability p of
a success), let the random variable X denote the number of trials
until the first success. Then X is a geometric random variable with
parameter 0 < p < 1 and
P(the 1st success occurs on the x-th trial) is
f(x) = (1 - p)x-1p, x = 1, 2, …
x-1 trials with failures the last trial (x-th trial) with a success
Ex. A search engine goes through a list of sites looking for a given key phrase.
Suppose the search terminates as soon as the key phrase is found. The number
of sites visited has geometric distribution.
Geometric Distribution - Ex
The probability that a bit transmitted through a digital
transmission channel is received in error is 0.1. Assume the
transmissions are independent events, and let the random
variable X denote the number of bits transmitted until the first
error. Find P(X = 5)
p = 0.2 p = 0.6
Geometric Distribution – Mean
x 1 2 … k …
f(x) p (1-p)p … (1-p)k-1p
The mean of X is
= E X = 𝑘𝑝(1 − 𝑝)𝑘−1 = 𝑝 𝑘𝑞𝑘−1
𝑘=1 𝑘=1
𝜕 𝑘
𝜕 𝑞 1 1
=𝑝 𝑞 =𝑝 =𝑝 2
=
𝜕𝑞 𝜕𝑞 1 − 𝑞 1−𝑞 𝑝
𝑘=1
Ex. Geometric Distribution - Mean
The probability that a bit transmitted through a digital
transmission channel is received in error is 0.1. Assume the
transmissions are independent events, and let the random
variable X denote the number of bits transmitted until the first
error. What is the expected number of bits transmitted until the
first error?
X = number of trials
Geometric p = probability of success
P(x) = p(1 – p)x-1, x = 1, 2, …
Distribution E(X) = 1/p
V(X) = (1 – p)/p2
Negative binomial distribution
In a series of Bernoulli trials (independent trials, Prob(success) =
p = constant), let the random variable X denote the number of
trials until r successes occur. Then X is a negative binomial
random variable with parameters 0 < p < 1 and r = 1, 2, 3, …,
and
𝑥−1
f(x) = 𝑟−1
pr(1-p)x-r, x = r, r + 1, …
Smaller value of p, larger number of trials Larger value of r, larger number of trials
Negative binomial distribution – Ex
Ex. Applicants for a new student internship are accepted with
probability p = 0.2 independently from person to person. Several
hundred people are expected to apply. Find the probability that it will
take no more than 100 applicants to find 10 students for the program.
Let X be the number of people who apply for the internship until the
10th student is accepted. Then X has a negative binomial distribution
with parameters r = 10 and p = 0.2.
The desired probability is
Negative binomial distribution
Negative binomial random variable represented
as a sum of geometric random variables.
Ex. (Web Servers) A Web site contains three identical computer servers. Only one is used to operate
the site, and the other two are spares that can be activated in case the primary system fails. The
probability of a failure in the primary computer (or any activated spare system) from a request for
service is 0.0005. Assuming that each request represents an independent trial, what is the mean
number of requests until failure of all three servers?
E(X) = r/p = 3/(0.0005) = 6000 requests.
Negative binomial distribution – Ex
A Web site randomly selects among 10 products to discount each
day. The color printer of interest to you is discounted today.
(a) What is the expected number of days until this product is
again discounted? (b) What is the probability that this product is
first discounted again exactly 10 days from now? (c) If the
product is not discounted for the next five days, what is the
probability that it is first discounted again 15 days from now?
(d) What is the probability that this product is first discounted
again within three or fewer days?
Negative Binomial Distribution
finite population
p: the proportion of successes in the set of N objects correction factor
Hyper-
-geometric
Discrete Uniform
Distribution RV Distribution