Discrete Random
3 Variables and
Probability Distributions
Random Variables
Definition
2
Random Variables
Random variables: Denoted by uppercase letters, such as
X and Y.
X(s) = x: x is the value associated with the outcome s by
the rv X.
3
Example 1
A student calls a university help desk for technical support,
he/she will either immediately be able to speak to someone
(S, for success) or will be placed on hold (F, for failure).
With = {S, F},
Define an rv X:
X(S) = 1, student can immediately speak to someone.
X(F) = 0, student cannot immediately speak to someone.
4
Random Variables
5
Two Types of Random Variables
6
Example 2
The Cal Poly Department of Statistics has a lab with six
computers reserved for statistics majors.
Let X be the number of computers in use at a given time of
day. Given the probability distribution of X below.
a. Find P(X 2) and P(X 3)
b. Find the probability that the number of computers in use
is between 2 and 5 inclusive
c. Find the probability that the number of computers in use
is strictly between 2 and 5
8
Probability Distributions for Discrete Random Variables
9
The Cumulative Distribution Function
10
The Cumulative Distribution Function
11
Example 3
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 Y = the amount of memory in a
purchased drive. Define cumulative distributions
12
Example 3 cont’d
F(1) = P(Y 1) = P(Y = 1)= p(1) = .05
F(2) = P(Y 2) = P(Y = 1 or 2) = p(1) + p(2) = .15
F(4) = P(Y 4) = P(Y = 1 or 2 or 4) = p(1) + p(2) + p(4) = .50
F(8) = P(Y 8) = p(1) + p(2) + p(4) + p(8) = .90
F(16) = P(Y 16) = 1
13
Example 3 cont’d
If y is less than 1, F(y) = 0; F(.58) = 0],
If y is at least 16, F(y) = 1; F(25) = 1
The cdf:
14
Example 4
15
The Expected Value of X
16
The Expected Value of X
17
Example 5
A University has 15,000 students
X = Courses for which a randomly selected student is
registered. What is the expected value of X.
18
The Expected Value of a Function
Sometimes interest will focus on the expected value of
some function h(X) rather than on just E(X).
19
Example 6
A computer store has purchased three computers of a certain
type at $500 apiece. It will sell them for $1000 apiece. The
manufacturer has agreed to repurchase any computers still
unsold after a specified period at $200 apiece.
Let X denote the number of computers sold, and suppose that
p(0) = .1, p(1) = .2, p(2) = .3 and p(3) = .4. Calculate the profit
that the store is expected to make.
20
Expected Value of a Linear Function
21
The Variance of X
22
Example 7
A library has an upper limit of 6 on the number of videos that can be
checked out to an individual at one time. Consider only those who
check out videos,
X = number of videos checked out to a randomly selected individual.
Calculate the mean and standard deviation of X
23
Variance of a Linear Function
24
Example 8
Refer to Example 7, Calculate the standard deviation of the
profit
25
Example 9
26
The Binomial Probability
Distribution
27
The Binomial Probability Distribution
Conditions:
1. Experiment consists of a sequence of n smaller
experiments called trials,n is fixed in advance
2. Each trial results in one of the same two possible
outcomes denoted success (S) and failure (F).
3. The trials are independent, outcome on any particular
trial does not influence the outcome on any other trial.
4. The probability of success P(S) is constant from trial to
trial; we denote this probability by p.
28
The Binomial Probability Distribution
29
The Binomial Random Variable and Distribution
30
The Binomial Random Variable and Distribution
31
Using Binomial Tables
32
The Mean and Variance of X
33
Example 10
In a test, a student randomly guesses at the ten multiple-
choice questions. Each question has four possible choices.
a) A score of six is passing. Find the probability the
students passed the test.
b) How many questions is the student expected to guess
correctly?
c) Which is more likely, 2 correct answers or 4 correct
answers out of 10?
d) A score of 9 or 10 earns an A grade. Find the probability
of getting an A grade.
e) What is the probability of getting no right answers?
34
Example 11
35
36
The Hypergeometric Distribution
37
The Hypergeometric Distribution
The assumptions leading to the hypergeometric distribution
1. The population or set to be sampled consists of N
individuals, objects, or elements (a finite population).
2. Each individual can be characterized as a success (S) or
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.
38
The Hypergeometric Distribution
Proposition
39
Example 12
During a particular period a university’s information
technology office received 20 service orders for problems
with printers, of which 8 were laser printers and 12 were
inkjet models. A sample of 5 of these service orders is to be
selected for inclusion in a customer satisfaction survey.
Suppose that the 5 are selected in a completely random
fashion, so that any particular subset of size 5 has the
same chance of being selected as does any other subset.
What is the probability that exactly x (x = 0, 1, 2, 3, 4, or 5)
of the selected service orders were for inkjet printers?
40
Example 12 cont’d
N = 20, n = 5, M = 12, and N – M = 8,
Consider the value x = 2. Because all outcomes (each
consisting of 5 particular orders) are equally likely,
P(X = 2) = h(2; 5, 12, 20)
41
Example 13
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. Suppose there are actually 25 animals of this type in the
region.
a. Find the probability that exactly two of the animals in the
second sample are tagged.
b. Find the probability that at most two of the animals in the
recapture sample are tagged
42
Example 13
Parameter values: n = 10, M = 5 (5 tagged animals in the
population), N = 25
43
The Poisson Probability
Distribution
44
The Poisson Probability Distribution
45
Example 14
Let X denote the number of traps (defects of a certain kind)
in a particular type of metal oxide semiconductor transistor,
and suppose it has a Poisson distribution with μ = 2.
a. Find the probability that there are exactly three traps:
b. Find the probability that there are at most three traps:
46
47
The Poisson Distribution as a Limit
Any binomial experiment in which n is large and p is small,
b(x; n, p) p(x; ), where = np.
As a rule of thumb, the approximation can safely be applied
if n > 50 and np < 5.
48
Example 15
A publisher of nontechnical books takes great pains to ensure that
its books are free of typographical errors, so that the probability of
any given page containing at least one such error is .005 and errors
are independent from page to page
a. what is the probability that one of its 600-page novels will
contain exactly one page with errors?
b. At most three pages with errors?
49
Example 15 cont’d
The number X of pages containing at least one error is a
binomial rv with n = 600 and p = .005, so np = 3.
b(1; 600, .005) = .14899, ( a good approximation)
50
The Mean and Variance of X
Refer to Example 17
Both the expected number of creatures trapped and the
variance of the number trapped equal 2 and
X = = 2 = 1.414
51
Example 16
52
The Poisson Process
53
Example 17
54
Example 18
Vehicles pass through a junction on a busy road based at an
average rate of 320 per hour. The actual number in any hour is a
random variable that can be described by the Poisson distribution
a) Find the probability that none pass in a minute.
b) Find the probability that none pass in a 5-minute period.
c) What is the expected value of the number passing in two
minutes?
55
The Negative Binomial
Distribution
56
The Negative Binomial Distribution
The negative binomial rv and distribution are based on an
experiment satisfying the following conditions:
1. The experiment consists of a sequence of independent
trials.
2. Each trial can result in either a success (S) or a failure
(F).
3. The probability of success is constant from trial to trial,
so for i = 1, 2, 3, . . . .
4. The experiment continues (trials are performed) until a
total of r successes have been observed, where r is a
specified positive integer.
57
The Negative Binomial Distribution
The random variable of interest, X = the number of failures
that precede the rth success.
Or
The random variable of interest, Y = the number of trial until
rth success is observed.
y−1 𝑟
𝑛𝑏 y; 𝑟, 𝑝 = 𝑝 (1 − 𝑝ሻy−𝑟
𝑟−1
Note: y = x + r
58
Example 19
A pediatrician wishes to recruit 5 couples, each of whom is
expecting their first child, to participate in a new natural
childbirth regimen. Let p = P(a randomly selected couple
agrees to participate) = 0.2
What is the probability that 15 couples must be asked
before 5 are found who agree to participate? That is, what
is the probability that 10 F’s occur before the fifth S?
Substituting r = 5, p = .2 , and x = 10 into nb(x; r, p) gives
59
Example 19
Alternatively,
What is the probability that the fifteenth couple is the fifth
couple that agrees to participate?
14 5 10
𝑛𝑏 15: 5, 0.2 = 0.2 0.8 = 0.034
4
60
The Negative Binomial Distribution
If X is a negative binomial rv with pmf nb(x; r, p), then
61
Example 20
In a championship series, the winner emerges by winning 5
out of eight games. Teams A and B play in the
championship, but team A has a 60% chance of winning
compared to team B.
a. Find the probability that team A wins the championship
b. What is the probability that team A wins in 7 games.
c. If there’s a playoff series in which the winner emerges
by winning 2 out of 3 games, what is the probability that
team A wins the series.
62