0% found this document useful (0 votes)
5 views42 pages

Discrete Random Variables in Statistics

The document outlines a lecture on discrete random variables as part of a mathematical statistics course. It covers key concepts such as random variables, probability mass functions, expectation, variance, and various distributions including binomial, Poisson, geometric, and negative binomial distributions. Additionally, it includes examples and exercises to reinforce understanding of these statistical concepts.

Uploaded by

24124037
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views42 pages

Discrete Random Variables in Statistics

The document outlines a lecture on discrete random variables as part of a mathematical statistics course. It covers key concepts such as random variables, probability mass functions, expectation, variance, and various distributions including binomial, Poisson, geometric, and negative binomial distributions. Additionally, it includes examples and exercises to reinforce understanding of these statistical concepts.

Uploaded by

24124037
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Ho Chi Minh City Faculty of Applied Sciences

University of Technology and Education Department of Mathematics

MATHEMATICAL STATISTICS FOR ENGINEERS


(MATH132901E)

DISCRETE RANDOM VARIABLES

Nguyễn Ngọc Tứ

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 1 / 39


Lecture outline

Random variables
Probability mass function (PMF)
Cummulative distribution function (CDF)
Expectation and Variance
Binomial distribution
Poisson distribution
Geometric distribution
Negative binomial distribution
Hypergeometric distribution

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 2 / 39


Random variables

Definition – Random variable


- A random variable X : Ω → R is a function
- A discrete random variable is a real-valued function of the outcome
of the experiment that can take a finite or countably infinite number
of values.
- We will denote random variables by capital letters X , Y , . . . and
their values by lowercase x, y , . . .

Example

Tossing a coin has Ω = {H, T }. Then, we define a random variable


X by
X (H) = 1, X (T ) = 0.

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 3 / 39


Probability mass function (PMF)
Let us consider an experiment whose outcomes X are integers. The
probability distribution of X is the function p : R → R defined by

pX (x) = P(X = x) = P({w ∈ Ω s.t. X (w ) = x}) for all x ∈ Z


P
pX (x) ≥ 0, x pX (x) = 1.

Example

Consider rolling a fair die. The possible outcomes are , , . . . , ,


which we convert to a numerical outcome X ∈ {1, 2, . . . , 6} in the
obvious way. Then
(
1
, x ∈ {1, 2, 3, 4, 5, 6}
p(x) = 6
0, otherwise.

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 4 / 39


Probability mass function (PMF)
13. A mail-order computer business has six telephone lines. Let X denote
the number of lines in use at a specified time. Suppose the pmf of X is as
given in the accompanying table.
x 0 1 2 3 4 5 6
p(x) 0.10 0.15 0.20 0.20 0.25 0.04 0.06
Calculate the probability of each of the following events.
a. at most three lines are in use
b. fewer than three lines are in use
c. at least three lines are in use
d. between three and six lines, inclusive, are in use
e. between three and five lines, inclusive, are not in use
f. at least three lines are not in use

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 5 / 39


Probability mass function (PMF)

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 6 / 39


Expectation

Definition
Let X be a discrete random variable with PMF pX (x). The expecta-
tion value of X is defined by
X
E (X ) = xpX (x).
x

Properties of expectations

If α, β are constants, then


1. E (α) = α
2. E (αX ) = αE (X )
3. E (αX + β) = αE (X ) + β

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 7 / 39


Variance
Second moment: E (X 2 ) = x 2 pX (x)
P
x
Variance:
Var (X ) = E [(X − E (X ))2 ]
X
= (x − E (X ))2 pX (x)
x
= E (X 2 ) − E 2 (X )

p
Standard deviation: σ(X ) = Var (X )

Properties

1. Var (X ) ≥ 0
2. Var (αX + β) = α2 Var (X )

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 8 / 39


Expectation and Variance - Example

A store carries flash drives with either 1 GB, 2 GB, 4 GB, 8 GB, or 16 GB
of memory. The accompanying table gives the distribution of of memory in
a purchased drive:
x 1 2 4 8 16
p(x) 0.05 0.10 0.35 0.40 0.10

Then, we have

µX = EX = 1 · 0.05 + 2 · 0.1 + 4 · 0.35 + 8 · 0.4 + 16 · 0.1 = 6.45


E (X 2 ) = 12 · 0.05 + 22 · 0.1 + 42 · 0.35 + 82 · 0.4 + 162 · 0.1 = 57.25
σX2 = V (X ) = E (X 2 ) − (EX )2 = 57.25 − 6.452 = 15.6475

σX = 15.6475 = 3.95569

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 9 / 39


Expectation and Variance - Exercises
An electronics store sells TVs with screen sizes of 32, 40, 50, 55, 65, 75, and
85 inches. Let X represent the screen size of the TV purchased by the next
customer. Suppose X has the following probability mass function (pmf):
x 32 40 50 55 65 75 85
p(x) 0.1 0.15 0.2 0.15 0.15 0.15 0.1
a. Compute E (X ), E X 2 , and V (X ).


b. If the price of a TV with screen size X inches is 25X + 200, what is the
expected price paid by the next customer?
c. What is the variance of the price 25X + 200 paid by the next customer?

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 10 / 39


Expectation and Variance - Exercises

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 11 / 39


The Binomial distribution
A biased coin is tossed n times. Let P(H) = p.
X : numbers of heads in n independent coin tosses.
n = 4, X = 2, P(X = 2) =?

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 12 / 39


The Binomial distribution
A biased coin is tossed n times. Let P(H) = p.
X : numbers of heads in n independent coin tosses.
n = 4, X = 2, P(X = 2) =?

pX (2) = P(HHTT ) + P(HTHT ) + P(HTTH)


+ P(THHT ) + P(THTH) + P(TTHH)
 
2 2 4 2
= 6p (1 − p) = p (1 − p)2
2

In general, X is a binomial random variable with parameters n and p.


Then the PMF of X is
 
n k
pX (k) = P(X = k) = p (1 − p)n−k , k = 0, 1, . . . , n
k

Notation: X ∼ B(n, p) and EX = np, Var (X ) = np(1 − p)


Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 12 / 39
The Binomial distribution - Exercises
50. A particular telephone number is used to receive both voice calls and
fax messages. Suppose that 35% of the incoming calls involve fax messages,
and consider a sample of 30 incoming calls. What is the probability that
a. Exactly 6 of the calls involve a fax message?
b. At least 6 of the calls involve a fax message?
c. More than 6 of the calls involve a fax message?
d. What is the expected and the standard deviation of the number among
the 30 calls that involve a fax message?
e. What is the probability that the number of calls among the 30 that involve
a fax transmission exceeds the expected number by more than 2 standard
deviations?
Solution.
X = the number of calls involve a fax message. Then
X ∼ B(n, p) where n = . . . , p = . . .

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 13 / 39


The Binomial distribution - Exercises

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 14 / 39


The Binomial distribution - Exercises
2. Suppose that 30% of all customers who buy a coffee at a café choose a
large size (the successes!), while the other 70% choose a small size. Consider
randomly selecting 40 customers.
a. What are the mean value and standard deviation of the number who
choose a large coffee?
b. What is the probability that the number who choose a large coffee is
more than one standard deviation away from the mean value?
c. The café has 12 large cups and 35 small cups in stock. If 40 customers
come in one by one to purchase a coffee, what is the probability that all 40
will get the size they want from current stock? [Hint: Let X represent the number
who choose a large coffee. For what value of X will all 40 customers get the size they want?]
d. Suppose large coffees cost 5 each and small coffees cost 3 each. Assume
the café currently has sufficient stock for all sizes. What is the expected
total revenue from the sale of the next 40 coffees purchased?
[Hint: Let h(X ) represent the revenue generated from X customers choosing large coffees. Express
this as a linear function.]

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 15 / 39


The Binomial distribution - Exercises

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 16 / 39


The Binomial distribution - Homework
3. A particular brand of smartphone comes in two versions: a standard model and a
pro model. Seventy percent of all customers at a certain store want the pro model.
a. Among 15 randomly selected customers who want this smartphone, what is the
probability that at least 10 want the pro model?
b. Among 15 randomly selected customers, what is the probability that the number
who want the pro model is within 1 standard deviation of the mean value?
c. The store currently has 10 smartphones of each version in stock. What is the
probability that all of the next 15 customers who want this smartphone can get the
version they want from current stock?

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 17 / 39


The Poisson distribution
Let λ be a positive real number. The Poisson distribution with
parameter λ is defined by
λk
pX (k) = e −λ
, k = 0, 1, . . .
k!
Notation: X ∼ P(λ) and EX = λ = Var (X )

1. Suppose customers arrive at a coffee shop according to a Poisson process


with a rate of λ = 5 per hour, so the number of arrivals during a time period
of t hours is a Poisson random variable with parameter µ = 5t.
a. What is the probability that exactly 8 customers arrive during a 1-hour
period? At least 6?
b. What are the expected value and standard deviation of the number of
customers that arrive during a 45-minute period?
c. What is the probability that at least 12 customers arrive during a 3-hour
period? That at most 7 customers arrive during this period?
Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 18 / 39
The Poisson distribution

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 19 / 39


The Poisson distribution
The Poisson PMF with parameter λ is a good approximation for a
binomial PMF with parameter n and p, provided λ = np, n is very
large, and p is very small, i.e.,
λk n!
e −λ ≈ p k (1 − p)n−k , k = 0, 1, . . . , n
k! k!(n − k)!
The number of typos in a book with a total of n words and the
probability p that any one word is misspelled is very small.
- n = 100 and p = 0.01. Then the probability of k = 5 successes in
n = 100 trails
1. Using the binomial PMF
100!
0.015 (1 − 0.01)95 = 0.00290.
95!5!
2. Using the Poisson PMF with λ = np = 100 · 0.01 = 1
1
e −1 = 0.00306.
5!
Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 20 / 39
The Poisson distribution
2. Of the emails received by a company’s customer support team, 1% are
flagged as spam. Let X represent the number of spam emails among a
randomly selected group of 1000 emails.
a. What is the (approximate) pmf of X ?
b. Compute P(X = 10).
c. Compute P(X ≥ 10).

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 21 / 39


The Poisson distribution - Exercises
2. In a quality control test of lightbulbs, the probability that any particular
bulb is defective is 0.02. Suppose a batch contains 500 lightbulbs.
a. How many lightbulbs would you expect to be defective, and what is the
standard deviation of the number that are expected to be defective?
b. What is the (approximate) probability that at least six lightbulbs in the
batch will be defective?
c. If three batches are shipped to a customer, how likely is it that at least
two of them will be free of defects? (A batch is defect-free only if none of
its lightbulbs are defective.)

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 22 / 39


The Poisson distribution - Exercises

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 23 / 39


The geometric distribution
Tossing a coin until it comes up H. How long must we wait for the
game to end?
X = number of coin tosses until first head.
Assume independent tosses, 0 < P(H) = p < 1.
The PMF of X is

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 24 / 39


The geometric distribution
Tossing a coin until it comes up H. How long must we wait for the
game to end?
X = number of coin tosses until first head.
Assume independent tosses, 0 < P(H) = p < 1.
The PMF of X is

pX (k) = P(X = k) = P(TT . . . TH) = (1 − p)k−1 p, k = 1, 2 . . .

and
∞ ∞ ∞
X X
k−1
X 1
pX (k) = (1 − p) p=p (1 − p)k−1 = p =1
1 − (1 − p)
k=1 k=1 k=1

1 1−p
Notation: X ∼ Geo(p) and EX = , Var (X ) =
p p2
Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 24 / 39
The geometric distribution - Exercise
1. When Maria plays a dice game, she rolls a six-sided die, and the proba-
bility of rolling a is 16 . Assume independence.
a. What is the probability that Maria rolls exactly 4 sixes (4 ) in 12 rolls?
b. What is the probability that Maria’s first roll of a happens on her fifth
roll?
c. What is the probability that Maria obtains her third six (3 ) exactly on
her eighth roll?

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 25 / 39


The negative binomial distribution

Tossing a coin until it comes up k heads. How long must we wait for
the game to end?
X = number of coin tosses until the kth head is observed.
Assume independent tosses, 0 < P(H) = p < 1.
The trial is repeated until we attain k successes (heads).
n trails:
* k − 1 successes in the first n − 1 trails
* the nth trial was a success.
By independence,
k−1 k−1 k−1 k
P(X = n) = Cn−1 p (1 − p)n−k p = Cn−1 p (1 − p)n−k , n ≥ k.

k k(1 − p)
Notation: X ∼ NB(n; k, p) EX = , Var (X ) =
p p2

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 26 / 39


The negative binomial distribution - Example
2. A medical researcher is recruiting 10 subjects for a study on an exper-
imental drug for COVID-19. Each person that she interviews has a 65%
chance of being eligible to participate in the study.
a. What is the probability that she will have to interview 30 people?
b. What is the probability that she will have to interview more than 30
people?
Solution.
X = the number of people must be interviewed before selecting 10 subjects.

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 27 / 39


The negative binomial distribution
3. A company is hiring employees for a project, and each candidate inter-
viewed has a 70% chance of meeting the qualifications for the position. The
company needs to hire 12 qualified employees.
a. What is the probability that the company will have to interview exactly
25 candidates to find 12 qualified ones?
b. What is the probability that the company will have to interview more
than 25 candidates to find 12 qualified ones?
c. What are the mean value and variance of the number of candidates the
company will have to interview to find 12 qualified ones?

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 28 / 39


The hypergeometric distribution

The assumptions leading to the hypergeometric distribution are as follows:


1. The set to be sampled consists of N elements (a finite population).
2. Each individual can be characterized as a success (S) or a failure (F),
and there are M successes in the population.
3. A sample of n individuals is selected without replacement in such a
way that each subset of size n is equally likely to be chosen.
The random variable of interest is X = the number of S’s in the
sample. The probability distribution of X depends on the parameters
n, M, and N, so we wish to obtain

P(X = x) = h(x; n, M, N).

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 29 / 39


The hypergeometric distribution

Proposition

If X is the number of S’s in a completely random sample of size n


drawn from a population consisting of M S’s and (N-M) F’s, then
the probability distribution of X, called the hypergeometric distri-
bution, is given by
x C n−x
CM N−M
P(X = x) = h(x; n, M, N) =
CNn

for x, an integer, satisfying max(0, n − N + M) ≤ x ≤ min(n, M).


 
M N −n M M
E (X ) = n · , V (X ) = ·n· · 1−
N N −1 N N

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 30 / 39


The hypergeometric distribution - Example
Five individuals from an animal population thought to be near extinction in a certain
region have been caught, tagged, and released to mix into the population. After
they have had an opportunity to mix, a random sample of 10 of these animals is
selected. Let X = the number of tagged animals in the second sample. If there are
actually 25 animals of this type in the region. Compute
a) P(X = 2) b) P(X ≤ 2) c) EX , V (X ).

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 31 / 39


The hypergeometric distribution - Example
Five individuals from an animal population thought to be near extinction in a certain
region have been caught, tagged, and released to mix into the population. After
they have had an opportunity to mix, a random sample of 10 of these animals is
selected. Let X = the number of tagged animals in the second sample. If there are
actually 25 animals of this type in the region. Compute
a) P(X = 2) b) P(X ≤ 2) c) EX , V (X ).
Solution. We have n = 10, M = 5, N = 25 and
10−x
C5x C20
P(X = x) = h(x; 10, 5, 25) = 10
, x = 0, 1, 2, 3, 4, 5
C25

C52 C20
8
a) P(X = 2) = h(2; 10, 5, 25) = = 0.385
C 10
P25 2
b) P(X ≤ 2) = P(X = 0, 1, 2) = x=0 h(x; 10,  5, 25) 
= 0.699
5 15 5 5
c) EX = 10 · = 2, V (X ) = · 10 · 1− =1
25 24 25 25

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 31 / 39


The hypergeometric distribution - Homework
69. Each of 17 refrigerators of a certain type has been returned to a distributor
because of an audible, high-pitched, oscillating noise when the refrigerators are
running. Suppose that 8 of these refrigerators have a defective compressor and
the other 9 have less serious problems. If the refrigerators are examined in random
order, let X be the number among the first 10 examined that have a defective
compressor. Compute the following:
a. P(X = 5), P(X ≤ 5).
b. The probability that X exceeds its mean value by more than 1 standard deviation.

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 32 / 39


The hypergeometric distribution - Homework
2. A laboratory has collected 12 samples of contaminated soil and 12 samples of
uncontaminated soil. A technician is tasked with randomly selecting 18 of these
samples for detailed testing.
a. What is the pmf of the number of uncontaminated soil samples selected for
testing?
b. What is the probability that all the selected samples are of one type (either all
contaminated or all uncontaminated)?
c. What is the probability that the number of uncontaminated soil samples selected
is within 1 standard deviation of its mean value?

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 33 / 39


Cummulative distribution function (CDF)

Definition

The function F : R → R defined by


X
F (x) = p(t) = P(X ≤ x)
t≤x

is called the cummulative distribution function of X .

Example

A store carries flash drives with either 1 GB, 2 GB, 4 GB, 8 GB, or 16 GB
of memory. The accompanying table gives the distribution of of memory in
a purchased drive:

x 1 2 4 8 16
p(x) 0.05 0.10 0.35 0.40 0.10

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 34 / 39


Distribution function (CDF)
F (x) is defined as follows:

F (1) = P(X ≤ 1) = P(X = 1) = p(1) = 0.05


F (2) = P(X ≤ 2) = P(X = 1, 2) = p(1) + p(2) = 0.15
F (4) = P(X ≤ 4) = P(X = 1, 2, 4) = p(1) + p(2) + p(4) = 0.5
F (8) = P(X ≤ 8) = P(X = 1, 2, 4, 8) = p(1) + p(2) + p(4) + p(8) = 0.9
F (16) = P(X ≤ 16) = 1.



0 x <1




0.05 1 ≤ x < 2

0.15 2 ≤ x < 4
The probability distribution is F (x) =


0.5 4≤x <8

0.9


 8 ≤ x < 16

1 16 ≤ x
Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 35 / 39
CDF - Histogram

F (x) 1
1 0.9
0.9

0.5
0.5

0.15
0.15 0.05
5 · 10−2 x
2 4 8 16

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 36 / 39


CDF

Proposition

For any two numbers a and b with a ≤ b

P(a ≤ X ≤ b) = F (b) − F (a−)

where a− represents the largest possible X that is strictly less than


a. In particular, if the only possible values X are integers and if a and
b are integers, then

P(a ≤ X ≤ b) = F (b) − F (a − 1).

If a = b then
P(X = a) = F (a) − F (a − 1).

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 37 / 39


CDF

Example

Let X = the number of days of sick leave taken by a randomly selected


employee of a large company during a particular year. If the maximum
number of allowable sick days per year is 14, possible values of X are
0, 1, . . . , 14. With F (0) = 0.58, F (1) = 0.72, F (2) = 0.76, F (3) =
0.81, F (4) = 0.88, and F (5) = 0.94. Then, we have

P(2 ≤ X ≤ 5) = F (5) − F (1) = 0.22

and
P(X = 3) = F (3) − F (2) = 0.05.

Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 38 / 39


CDF
23. A consumer organization that evaluates new automobiles customarily
reports the number of major defects in each car examined. Let X denote
the number of major defects in a randomly selected car of a certain type.
The cdf of X is as follows:



0 x <0

0.08 0 ≤ x < 1







0.23 1 ≤ x < 2

0.46 2 ≤ x < 3
F (x) =


0.70 3 ≤ x < 4




0.88 4 ≤ x < 5




0.98 5 ≤ x < 6

1 6≤x
Calculate the following probabilities directly from the cdf:
a. P(X = 2) b. P(X > 3) c. P(2 ≤ X ≤ 5) d. P(2 < X < 5)
Nguyễn Ngọc Tứ DISCRETE RANDOM VARIABLES 39 / 39

You might also like