You are on page 1of 11

Chapter 5: Discrete Random Variables and Their Distributions

Page 30

Discrete Random Variables and Their Distributions

5.1

Random Variables

Definition 1. A random variable is a real-valued function whose domain is the sample space of a
random experiment. That is, a random variable is a function X : S R, where S is the sample space
of the random experiment under consideration.

Note. In other words, for a given sample space S, a random variable is any rule that associates a
number with each outcome in S.

Note. When using random variables, the description of the outcomes of an event uses what is called
random variable notation. Using this notation, an event { S : X() A} is written more concisely
as {X A}.

Example 1. When a student attempts to log on to a computer time-sharing system, either all ports could
be busy (B), in which case the student fails to obtain access, or else there will be at least one port free
(F ), in which case the student will be successful at accessing the system. Here, let S={B,F }. We can
define a random variable X as: X(B)=1 and X(F )=0, i.e. the random variable X indicates whether or
not the student can log on, with a 1 indicating the student cannot and 0 can.

Definition 2. The range of a random variable is the set of all possible values of the random variable;
we let RX to denote the range of a random variable X.

Note. The range of a random variable is sometimes referred to as the support of the random variable.

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 31

Definition 3. A random variable X is a discrete random variable if its range is finite or infinite
countable.

In the next three examples, define the range of the random variables X.
Example 2. Suppose a coin is tossed three times and for each toss we observe what is facing up. Let X
be the number of heads in these three tosses.
Example 3. Suppose a pair of dice is rolled and we observe the number of dots facing up on each. Let X
be the total observed (sum of the dots facing up on the two dice).
Example 4. Suppose an experiment consists of repeating a trial until a success is observed for the first
time. Let X denote the number of trials conducted.
5.2

Probability Mass Functions

Definition 4. The probability mass function (PMF) of a discrete random variable X, denoted by
pX (x), is the real-valued function pX (x)=P r(X = x)=P r({ S : X() = x}), where x RX .
Proposition 1. (Basic Properties of a PMF) The PMF pX of a discrete random variable X satisfies:
(i) The values of pX are nonnegative, i.e., pX (x) 0 for all x RX .
(ii) {x RX : px (x) 6= 0} is countable; that is, the set of real numbers for which the PMF is nonzero
is countable.
(iii) The sum of the values of pX is 1, i.e.,

xRX

pX (x) = 1.

Note. We can interpret a PMF: in a large number of independent observations of a discrete random variable X, the proportion of times that each possible value occurs will approximate the PMF at that value.

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 32

Example 5. Determine the value of c so that each of the following functions can serve as PMFs for some
discrete random variable X:

c(x2 + 4) if x = 0, 1, 2, 3,
(i) pX (x)=

0
otherwise.

cx
3
(ii) pX (x)=

if x = 0, 1, 2, ....,
otherwise.

Example 6. Let Y be the maximum number of dots observed when two dice are rolled. It can be shown
that
pY (y) =

2y1
36

if y = 1, 2, 3, 4, 5, 6,

0 otherwise.

Verify this is a valid PMF.


Example 7. Suppose we go to the university bookstore during the first week of classes and observe whether
the next person buying a calculator buys a programmable one or a strictly algebraic one. Let

0 if the customer buys a programmable type


X=

1 if the customer buys an algebraic type


If 20% of all calculator purchasers during that week select a programmable type, what is the PMF of X?
Example 8. A local zoo imported six rare birds from a South American country. Suppose that the cargo
includes two birds with a potentially fatal disease. As usual, the customs officer at the point of entry
randomly selects two birds and sends them away for a medical diagnostic test. Let X denote the number
of disease-free birds selected by the customs officer. Find the PMF of X.

Proposition 2. (Fundamental Probability Formula) Let X be a discrete random variable with probability mass function pX (x). Then,
P r(X A) =

pX (x) for any A RX .

xA

In other words, we add the probabilities over all possible values of X that are in A.

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 33

Example 9. Suppose a die is rolled until a 6 is observed, each time observing the number of dots. Let X
be the number of rolls required. For this discrete random variable, it can be shown that the PMF of X is
x1
pX (x) = 61 65
for x RX ={1,2,3,. . .}, 0 otherwise. Then, find:
(i) P r(3 X 6).
(ii) P r(X k).
5.3

Standard Probability Models and Random Variables

Example 10. Suppose an experiment can result in either a failure or a success. Let X denote the number
of successes in this experiment. If we let p denote the probability of success, what is the PMF of X?

Definition 5. Bernoulli trials are trials of the same random experiment where
(i) the outcomes of all trials are independent of one another,
(ii) each trial results in one of two possible outcomes (usually called success and failure),
(iii) the probability of the two outcomes remain the same from trial to trial (usually the probability
of success is denoted by p and the probability of failure is denoted by q = 1 p).
Definition 6. Assume one Bernoulli trial takes place with probability of success as p and X takes
on only two values, say 0 and 1. Then X is a Bernoulli random variable with parameter p and its
probability mass function is given by

pX (x) =

px (1 p)1x if x = 0, 1,

otherwise.

and we write X Bernoulli(p).

A Tidbit: The Bernoulli distribution is named after the statistician Jacob Bernoulli (1654-1705). Born
in Basle, Switzerland, despite being schooled in theology, Jacob studied mathematics on his own and
was the first of the Bernoulli family of mathematicians. He and his brother Johann made several
contributions to calculus and were known to be very competitive. In his writings about games of
chances and expected winnings, the term Bernoulli trial was born.

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 34

Definition 7. Assume a sequence of n Bernoulli trials with probability p take place and let X be
the number of success(es) observed. Then, X is a binomial random variable and its probability mass
function is given as
pX (x) =

n
x

px (1 p)nx if x = 0, 1, . . . , n,

otherwise

We write X B(n, p) and say X has a Binomial distribution with parameters n and p.

Note. A Bernoulli random variable is just a special case of Binomial with n=1, so for X Bernoulli(p)
we can write X B(1, p).

Example 11. Suppose a coin is tossed four times and on each toss we observe Heads or Tails. Let X be
the number of Heads observed in these four tosses, then RX ={0,1,2,3,4}. What is the PMF of X?
Example 12. Each of six randomly selected cola drinkers is given a glass containing a cola P and one
containing cola C. The glasses are identical in appearance except for a code on the bottom to identify the
cola. Suppose there is actually no tendency among cola drinkers to prefer one cola to the other. Find the
probability that;
(i) exactly three of the drinkers prefer P
(ii) at least three prefer P .
Example 13. Going back to Example 4 where X was the number of experiments required until a first
success is observed. The support of X was infinite. What is the PMF of X?

Definition 8. Assume a sequence of Bernoulli trials are performed until a success occurs. Let X be
the number of trials required to observe this first success. Then X is a geometric random variable and
its probability mass function is
pX (x) =

p(1 p)x1 if x = 1, 2, . . . ,

otherwise.

We write X G(p) and say X has a geometric distribution with parameter p.

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 35

Example 14. Suppose a die is rolled until a 6 is observed, each time observing the number of dots facing
up. Let X denote the number of rolls required. What is the PMF of X?

Proposition 3. (Properties of Geometric random variables) Suppose X G(p), then


(i) P r(X > k)=(1-p)k for k N .
(ii) P r(X = n + k|X > n)=Pr(X = k) for all k, n N ,
(iii) P r(X > n + k|X > n)=Pr(X > k) for all k, n N .

Note. The second two properties are given the name Lack-of-memory Property. The Geometric random
variable is the only discrete random variable with this property.

Example 15. Suppose we know that the lifetimes of lightbulbs are distributed as G(p) with p=1/3000
(where p is the probability that a lightbulb will die within a given hour). What is the probability that such
a lightbulb will last for more than 1000 hours? Suppose the lightbulb has already lasted for 3000 hours,
what is the probability it lasts for at least another 2000 hours?

Definition 9. Assume a sequence of Bernoulli trials where the probability of success is p take place
and X is the number of trials required to observe r successes. Then, X is called a negative binomial
random variable and its probability mass function is

x1 pr (1 p)xr if x = r, r + 1, . . . ,
r1
pX (x) =

0
otherwise.
We write X N B(r, p) and say X has a negative binomial distribution with parameters r and p.

Note. A geometric random variable is just a special case of the negative binomial, i.e., if X G(p) we
can also write X N B(1, p).

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Definition 10. For a R and k Z, we define the generalized binomial coefficient


(i)

a
0

(ii)

a
k

=0 if k < 0,

(iii)

a
k

a!
= a(a1)(ak+1)
= k!(ak)!
if 1 k a.
k!

Page 36

a
k

by:

=1,

Example 16. Suppose a die is rolled until two 6s have been observed, having observed the number of dots
on each die on each roll. What is the probability that at least four rolls are required in this experiment?
Example 17. In a certain game, John beats Paul with probability 35 . They play a series of games until
one of them has won six games. Each game is independent of the other.
(i) Find the probability that the series will end after 10 games.
(ii) Given that the series ended in 10 games, find the probability that John won.
(iii) Find the probability that John will eventually win.

Proposition 4. (Tail Probabilities for Negative Binomial) If X is a negative binomial random variable
with parameters r and p, then P r(X > n) = P r(Y < r) where Y is a binomial random variable with
parameters n and p.

Definition 11. Suppose a population of N subjects can be divided into two classes, with proportion
p in the first class and proportion 1 p in the second class. (So there are N p and N (1 p) subjects
in these two classes respectively). Suppose a random sample of size n is selected from this population
without replacement. Let the notion of success be selecting from the first class and let X denote the
number of successes among the n selected. Then we call X a hypergeometric random variable. The
probability mass function of X is
N p N (1p)

( x )(Nnx )
(n)
pX (x) =

if x = 0, . . . , n,
otherwise.

We write X H(N, n, p) and say X has a hypergeometric distribution with parameters N , n and p.

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 37

Example 18. Consider a version of our Lotto 6/49 draws with the only difference being there is no bonus
number. Let X be the number of balls drawn on a given draw that match the numbers on a ticket youve
bought. Find the range and probability distribution of X. Also, using this, calculate the probability of
winning a prize on any given draw (assume you need three matches to win).
Example 19. Out of 100 students in Stats 1000, 60 are liberals and 40 are non-liberals. Three are selected
at random from the 100. What is the probability that:
(i) there are no liberals?
(ii) there is exactly one liberal?
(iii) there are at least two liberals?
Example 20. Suppose we are drawing balls from two urns each containing 15 balls:
Urn 1 :

2 red balls
13 blue balls

Urn 2:

5 red balls
10 blue balls

An urn is randomly selected by flipping a fair coin (say we choose from Urn I if Heads turns up), and then,
three balls are drawn without replacement from the selected urn. Let X denote the number of red balls
drawn. Find the PMF of X.

Proposition 5. (Binomial Approximation to Hypergeometric) Suppose X H(N, n, p) where the


sample size n is small in comparison to N (the population size), with typical rule that

n
N

0.05 is

required. Then
Np
x

limN pX (x) = limN

N (1p)
nx

N
n

 
n x
=
p (1 p)nx .
x

That is, the hypergeometric distribution can be approximated by the binomial distribution under suitable
conditions.

Note. The above result implies sampling with replacement (binomial) yields values for probabilities that
are very close to the corresponding probabilities for sampling without replacement (hypergeometric)
provided N (population size) is large and n (sample size) is small compared to N .

Example 21. Ten seeds are selected from a bin that contains 1000 flower seeds, of which 400 are red
flowering seeds and the rest are other colours. How likely is it to obtain exactly five red flowering seeds?

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 38

Definition 12. A discrete random variable is a Poisson random variable if its probability mass function
has the form
pX (x) =

e x
x!

if x = 0, 1, 2, . . . ,
otherwise.

where >0. We write X P () and say X has a Poisson distribution with parameter .

Note. In the case of the Poisson distribution, the parameter has a physical interpretation: the average
number of events. Also, the Poisson distribution is typically used to model the occurrence of rare
events, such as number of plane crashes.

A Tidbit: The Poisson distribution is named after the French mathematician Simeon-Denis Poisson
(1781-1840). Homeschooled by his father and encouraged to study medicine, Poisson found math to
be both work and play. In fact, it has been noted in the literature that Poisson is said to have
once remarked that life is only good for two things: to do mathematics and to teach it. He made
significant contributions to many areas of mathematics and in particular, to probability theory. In
1837, he published his research in which he introduced what is now known as the Poisson distribution.
Example 22. Suppose, in the analysis of accidents in an industrial plant, it is known that the average
number of accidents in a year is =1. Then, what is the probability in the next year that:
(i) there is no accident?
(ii) there are at least 3 accidents?

Proposition 6. (Poisson Approximation to Binomial) Let be a positive real number. Suppose that,
for each n N, the random variable X has the binomial distribution with parameters n and p where
np as n . Then
limn pX (x) = limn

n
x

px (1 p)nx =

e x
x!

if x=0,1,. . .,n.

In other words, the binomial distribution with parameters n and p, under suitable conditions, can be
approximate by the Poisson distribution with parameter = np.

STAT 2400 Lecture Notes

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 39

Example 23. A large number of insects are attracted to the rose plants in a garden. Suppose that 10, 000
insects infest the garden and that a commercial insecticide has been applied prior to the infestation. It
is known that the insecticide is 99.5% effective in killing insects that come in contact with it and that all
insects entering the garden will eventually come in contact with the insecticide. Calculate the probability
that between 52 and 55 (inclusive) of the 10, 000 insects survive entering the garden.

Definition 13. A random variable X is called a discrete uniform random variable if its possible values
form a finite set of size n and those values are equally likely. We say that X has the discrete uniform
distribution with parameter n. In this case, the PMF of X is

1 if x = 1, 2, . . . , n,
n
pX (x) =

0
otherwise.
We can write X DU (n).

Example 24. Suppose a charitable organization is holding a raffle and selling 5000 tickets, each numbered
0001, 0002, . . ., 5000. One winning ticket stub will be selected at random from the 5000 ticket stubs. Let
X denote the number on the winning ticket. Find the PMF of X and find the probability that a person
holding tickets numbered 1003-1025 wins.

Definition 14. An indicator variable is a random variable which only takes on two values: 0 and 1.
Let E be an event. The indicator random variable takes on the value 1 if E occurs and 0 if E does not
occur. An indicator random variable has a Bernoulli distribution with parameter p where p=P r(E).

5.4

Functions of a Discrete Random Variable

Proposition 7. (Probability Mass Function of a Function of a Discrete Random Variable) Let X be


a discrete random variable and let g be a real-valued function on the range of X. Then the probability
mass function of Y = g(X) is
pY (y) =

xg 1 (y) pX (x)

STAT 2400 Lecture Notes

if y RY ,
otherwise.

Katherine Davies

Chapter 5: Discrete Random Variables and Their Distributions

Page 40

Example 25. Let us look at the discrete random variable with the following probability mass function:
x

pX (x)

0.10

0.20

0.20

0.15

0.15

0.20

i.e.,

pX (x) =

0.10

0.20

0.15

if x = 2,
if x = 1, 0, 3,
if x = 1, 2,
otherwise.

What is the PMF of Y = X 2 and use it to find P r(Y 2).

STAT 2400 Lecture Notes

Katherine Davies

You might also like