Chapter 5: Discrete Random Variables and Their …math.uhcl.edu/li/teach/stat3308/ch05_9e.pdf1...

22
1 Chapter 5: Discrete Random Variables and Their Probability Distributions 5.1 Random Variables 5.2 Probability Distribution of a Discrete Random Variable 5.3 Mean and Standard Deviation of a Discrete Random Variable 5.4 The Binomial Probability Distribution 5.5 The Hypergeometric Probability Distribution 5.6 The Poisson Probability Distribution STAT 3038 Dr. Yingfu (Frank) Li 5-1 Introduction We discussed concepts and rules of probability in chapter 4. Opening Example: Now that you know a little about probability, do you feel lucky enough to play the lottery? If you have $20 to spend on lunch today, are you willing to spend it all on four $5 lottery tickets to increase your chance of winning? Do you think you will profit, on average, if you continue buying lottery tickets over time? Can lottery players beat the state, on average? Not a chance! (See Case Study 5–1 for answers.) It helps in solving simple problem, but not complicated ones such as finding probability of getting at least 5 heads in 10 tosses of a fair coin. We want to study the probability mathematically, so we assign numerical values to experimental outcomes and define random variables. Study the probability characteristic of random variables – the topic of chapters 5 & 6 Dr. Yingfu (Frank) Li 5-2 STAT 3038

Transcript of Chapter 5: Discrete Random Variables and Their …math.uhcl.edu/li/teach/stat3308/ch05_9e.pdf1...

1

Chapter 5: Discrete Random Variables and Their Probability Distributions

5.1 Random Variables 5.2 Probability Distribution of a Discrete Random Variable 5.3 Mean and Standard Deviation of a Discrete Random

Variable 5.4 The Binomial Probability Distribution 5.5 The Hypergeometric Probability Distribution 5.6 The Poisson Probability Distribution

STAT 3038 Dr. Yingfu (Frank) Li5-1

Introduction

We discussed concepts and rules of probability in chapter 4. Opening Example: Now that you know a little about probability, do

you feel lucky enough to play the lottery? If you have $20 to spend on lunch today, are you willing to spend it all on four $5 lottery tickets to increase your chance of winning? Do you think you will profit, on average, if you continue buying lottery tickets over time? Can lottery players beat the state, on average? Not a chance! (See Case Study 5–1 for answers.)

It helps in solving simple problem, but not complicated ones such as finding probability of getting at least 5 heads in 10 tosses of a fair coin.

We want to study the probability mathematically, so we assign numerical values to experimental outcomes and define random variables.

Study the probability characteristic of random variables – the topic of chapters 5 & 6

Dr. Yingfu (Frank) Li5-2STAT 3038

2

5.1 Random Variables

A random variable is a variable whose value is determined by the outcome of a random experiment

Discrete Random Variable A random variable that assumes countable values is called a discrete

random variable

Examples of discrete random variables The number of cars sold at a dealership during a given month

The number of houses in a certain block

The number of fish caught on a fishing trip

The number of complaints received at the office of an airline on a given day

The number of customers who visit a bank during any given hour

The number of heads obtained in three tosses of a coin

Dr. Yingfu (Frank) Li5-3STAT 3038

Continuous Random Variable

A random variable that can assume any value contained in one or more intervals is called a continuous random variable

Examples of continuous random variables The length of a room

The time taken to commute from home to work

The amount of milk in a gallon (note that we do not expect “a gallon” to contain exactly one gallon of milk but either slightly more or slightly less than one gallon)

The weight of a letter

The price of a house

Dr. Yingfu (Frank) Li5-4STAT 3038

3

5.2 Probability Distribution of a Discrete Random Variable

The probability distribution of a discrete random variable lists all the possible values that the random variable can assume and their corresponding probabilities

Two Characteristics of a discrete probability distribution 0 ≤ P(x) ≤ 1 for each value of x

ΣP(x) = 1

Example of tossing 2 coins, X = # of heads

Dr. Yingfu (Frank) Li5-5

X

P

STAT 3038

Example 5-1

Recall the frequency and relative frequency distributions of the number of vehicles owned by families given in Table 5.1. That table is reproduced below as Table 5.2. Let x be the number of vehicles owned by a randomly selected family. Write the probability distribution of x.

Dr. Yingfu (Frank) Li5-6STAT 3038

4

Example 5-2

Using the probability distribution listed in Table 5.3 of Example 5–1, find the following probabilities: The probability that a randomly selected family owns two vehicles

Answer: P(selected family owns 2 vehicles)

= P(2) = .455

The probability that a randomly selected family owns at least 2 vehicles

Answer: P(selected family owns at least 2 vehicles)

= P(2 or 3 or 4) = P(2) + P(3) + P(4) = .455 + .290 + .080 = .825

The probability that a randomly selected family owns at most 1 vehicle

Answer: P(selected family owns at most one vehicle)

= P(0 or 1) = P(0) + P(1) = .015 + .160 = .175

The probability that a randomly selected family owns 3 or more vehicles

Answer: P(selected family owns three or more vehicles)

= P(3 or 4) = P(3) + P(4) = .290 + .080 = .370MATH 3038 - 01 Dr. Yingfu (Frank) Li5-7

Example 5-3

Each of the following tables lists certain values of x and their probabilities. Determine whether or not each table represents a valid probability distribution

Solutiona) No, since the sum of all probabilities is not equal to 1.0.

b) Yes

c) No since one of the probabilities is negative.

Dr. Yingfu (Frank) Li5-8STAT 3038

5

Example 5-4

The following table lists the probability distribution of the number of breakdowns per week (x) for a machine based on past data

Present this probability distribution graphically.

Find the probability that the number of breakdowns for this machine during a given week is exactly 2

0 to 2

more than 1

at most 1

Dr. Yingfu (Frank) Li5-9STAT 3038

Example 5-4: Solution

Let x denote the number of breakdowns

for this machine during a given week.

Table 5.4 lists the probability

distribution of x.

Finding probabilities P(exactly 2 breakdowns) = P(x = 2) = .35

P(0 to 2 breakdowns) = P(0 ≤ x ≤ 2) = P(x = 0) + P(x = 1) + P(x = 2) = .15 + .20 + .35 = .70

P(more then 1 breakdown) = P(x > 1) = P(x = 2) + P(x = 3)

= .35 +.30 = .65

P(at most one breakdown) = P(x ≤ 1) = P(x = 0) + P(x = 1)

= .15 + .20 = .35

Dr. Yingfu (Frank) Li5-10STAT 3038

6

Example 5-5

According to a survey, 60% of all students at a large university suffer from math anxiety. Two students are randomly selected from this university. Let x denote the number of students in this sample who suffer from math anxiety. Develop the probability distribution of x.

Solution Let us define the following two events:

N = the student selected does not suffer from math anxiety

M = the student selected suffers from math anxiety

Then

P(x = 0) = P(NN) = .16

P(x = 1) = P(NM or MN) =

P(NM)+P(MN) = .24+.24 =.48

P(x = 2) = P(MM) = .36Dr. Yingfu (Frank) Li5-11STAT 3038

5.3 Mean and Standard Deviation of a Discrete Random Variable

The mean of a discrete variable x is the value that is expected to occur per repetition, on average, if an experiment is repeated a large number of times. It is denoted by µ and calculated as µ = Σ x P(x)

The mean of a discrete random variable x is also called its expected value and is denoted by E(x); that is, E(x) = Σ x P(x)

Example of tossing a coin twice, x = # of heads

Dr. Yingfu (Frank) Li5-12

X 0 1 2

P 1/4 2/4 ¼

xP 0 2/4 2/4

µ = Σ x P(x) = 1

STAT 3038

7

Example 5-6

Recall Example 5-4 of Section 5-2. The probability distribution Table 5.4 from that example is reproduced on the next slide. In this table, x represents the number of breakdowns for a machine during a given week, and P(x) is the probability of the corresponding value of x. Find the mean number of breakdown per week for this machine.

Solution

Dr. Yingfu (Frank) Li5-13

The mean is µ = Σx P(x) = 1.80

STAT 3038

Standard Deviation of a Discrete Random Variable

The standard deviation of a discrete random variable, denoted by σ, measures the spread of its probability distribution. A higher value for the standard deviation of a discrete random

variable indicates that x can assume values over a larger range about the mean.

A smaller value for the standard deviation indicates that most of the values that x can assume are clustered closely about the mean.

Definition of variance - 2

Deviation Standard deviation = square root of variance

Book’s definition of σ

Interpretation of the Standard Deviation same way as Section 3.4 of Chapter 3

Dr. Yingfu (Frank) Li5-14

2 2( )x P x

STAT 3038

8

Example 5-7

Baier’s Electronics manufactures computer parts that are supplied to many computer companies. Despite the fact that two quality control inspectors at Baier’s Electronics check every part for defects before it is shipped to another company, a few defective parts do pass through these inspections undetected. Let x denote the number of defective computer parts in a shipment of 400. The following table gives the probability distribution of x. Compute the standard deviation of x.

Dr. Yingfu (Frank) Li5-15STAT 3038

Book’s Method to Find the Standard Deviation

Dr. Yingfu (Frank) Li5-16

2 = x2P(x) - 2 = 7.7 – 2.52 = 1.45 => =

STAT 3038

9

Recommended Method

Computations to Find the Mean and Standard Deviation

Dr. Yingfu (Frank) Li5-17

X P(x) xP(x) (X-)2 = (X - )2 (X-)2 P(x)

0 0.02 0 6.25 0.125

1 0.2 0.2 2.25 0.45

2 0.3 0.6 0.25 0.075

3 0.3 0.9 0.25 0.075

4 0.1 0.4 2.25 0.225

5 0.08 0.4 6.25 0.5

1 2.5 2 = 1.45

1.45σ

STAT 3038

Easy Example

Dr. Yingfu (Frank) Li5-18

The following table gives the probability distribution for a random Variable X, the number of DVDs that were returned late in a local Blockbuster per week.

1. Find the probability that one or two DVDs were returned late.

2. Find the probability that at least one DVD was returned late.

3. Find X's mean

4. Find X's variance 2

5. Find X's standard deviation

Why not use Excel?

X 0 1 2 3 4

P 0.45 0.3 ? 0.1 0.05

STAT 3038

10

5.4 The Binomial Probability Distribution

Binomial Experiment: an experiment satisfying the following four conditions There are fixed n identical trials Each trial has only two outcomes, success & failure Probability of success p remains constant for each trial The trials are independentX = the number of successes in n trials

X is called a binomial random variable and its distribution called BPD X ~ B(n, p)

Examples of binomial experiment Tossing a coin 10 times Rolling a die (trial, not experiment, has 2 outcomes) Random guess for answers of a multiple-choice test/quiz

Dr. Yingfu (Frank) Li5-19STAT 3038

Example 5-10

Seventy five percent of students at a college with a large student population use Instagram. A sample of five students from this college is selected, and these students are asked whether or not they use Instagram. Is this experiment a binomial experiment? Check whether all four conditions of the binomial probability

distribution are satisfied. Five identical trials; two outcomes - a student uses Instagram or a

student does not use Instagram; the probability p that a student uses Instagram is .75; each trial (student) is independent.

In a group of 12 students at a college, 9 use Instagram. Five students are selected from this group of 12 and are asked whether or not they use Instagram. Is this experiment a binomial experiment? Answer: last 2 conditions are not met

MATH 3038 - 01 Dr. Yingfu (Frank) Li5-20

11

Notation and Formula

Notationn = total number of trialsp = probability of successq = 1 − p = probability of failurex = number of successes in n trialsn − x =number of failures in n trials

Formula for X ~ B(n, p)

, x = 0, 1, …, n

For a problem, first check if it is binomial experiment by using the four conditions If answer is a yes, then identify n, p, x. Use formula to obtain binomial probability distribution

Dr. Yingfu (Frank) Li5-21

( ) x n xn xP x C p q

STAT 3038

Example 5-11

Seventy five percent of students at a college with a large student population use the social media site Instagram. Three students are randomly selected from this college. What is the probability that exactly two of these three students use Instagram?

Solution Here, we are given that: n = 3, x = 2, and p = .75

The probability of two successes is denoted by P(x=2) or P(2)

Dr. Yingfu (Frank) Li5-22STAT 3038

12

Example 5-12

At the Express House Delivery Service, providing high-quality service to customers is the top priority of the management. The company guarantees a refund of all charges if a package it is delivering does not arrive at its destination by the specified time. It is known from past data that despite all efforts, 2% of the packages mailed through this company do not arrive at their destinations within the specified time. Suppose a corporation mails 10 packages through Express House Delivery Service on a certain day. (a). Find the probability that exactly one of these 10 packages will

not arrive at its destination within the specified time.

(b). Find the probability that at most one of these 10 packages will not arrive at its destination within the specified time.

n = total number of packages mailed = 10; p = P(success) = .02; q = P(failure) = 1 – .02 = .98

Dr. Yingfu (Frank) Li5-23STAT 3038

Example 5-12: Solution

(a).

Thus, there is a .1667 probability that exactly one of the 10 packages mailed will not arrive at its destination within the specified time.

(b).

Thus, the probability that at most one of the 10 packages mailed will not arrive at its destination within the specified time is .9838.

MATH 3038 - 01 Dr. Yingfu (Frank) Li5-24

1667.)83374776)(.02)(.10(

)98(.)02(.)!110(!1

!10)98(.)02(.)1( 9191

110

CxP

.9838 .1667.8171

.83374776)(10)(.02)(707281)(1)(1)(.81

)98(.)02(.)98(.)02(.

)1()0()1(91

110100

010

CC

xPxPxP

13

Example 5 – 13

According to a survey, 33% of American employees do not plan to change their jobs in the near future. Let x denote the number of employees in a random sample of three American employees who do not plan to change their jobs in the near future. Write the probability distribution of x and draw a histogram for this probability distribution. n = total employees in the sample = 3 p = P(an employee does not plan to change his/her job in the near

future) = .33 q = P(an employee does plan to change his/her job in the near future)

= 1 - .33 = .67

Dr. Yingfu (Frank) Li5-25STAT 3038

Example 5-13: Solution

n = 3; p = 0.33; q = 0.67

MATH 3038 - 01 Dr. Yingfu (Frank) Li5-26

0 33 0

1 23 1

2 13 2

3 03 3

( 0) (.33) (.67) (1)(1)(.300763) .3008

( 1) (.33) (.67) (3)(.33)(.4489) .4444

( 2) (.33) (.67) (3)(.1089)(.67) .2189

( 3) (.33) (.67) (1)(.03593)(1) .0359

P x C

P x C

P x C

P x C

14

Automatic Way to Find Binomial Probabilities

Table I in Appendix C, the table of binomial probabilities. List the probabilities of x for n = 1 to n = 25.

List the probabilities of x for selected values of p

Hence the table is very limited

Using Excel Binom.dist(number_s, trials, probability_s, cumulative) =

binomdist(x, n, p, cumulative) Cumulative = 0, false for cumulative, it gives P(x) Cumulative = 1, true for cumulative, it gives cumulative probabilities

from 0 to x, i.e., sum of P(0) through P(x).

Calculator TI – 83: 2nd => DISTR => 0 (A) binompdf(n, p, x): gives P(x). binomcdf(n, p, x): gives cumulative probabilities from 0 to x, i.e.,

binomcdf(n, p, x) = P(0) + P(1) + … + P(x).

Smart phone app – Probability distributions from U of IowaDr. Yingfu (Frank) Li5-27STAT 3038

Example 5 – 14

According to a survey, 30% of college students said that they spend too much time on Facebook. (The remaining 70% said that they do not spend too much time on Facebook or had no opinion.) Suppose this result holds true for the current population of all college students. A random sample of six college students is selected.

(a) Find the probability that exactly three of these six college students will say that they spend too much time on Facebook.

(b) Find the probability that at most two of these six college students will say that they spend too much time on Facebook.

(c) Find the probability that at least three of these six college students will say that they spend too much time on Facebook.

(d) Find the probability that one to three of these six college students will say that they spend too much time on Facebook.

(e) Let x be the number in a random sample of six college students who will say that they spend too much time on Facebook. Write the probability distribution of x and draw a histogram for this probability distribution.

Dr. Yingfu (Frank) Li5-28STAT 3038

15

Determining P(x = 3) for n = 6 and p = .30

Table way

Excel way In a cell of Excel type in “binom.dist(3, 6, 0.3, 0)” and hit enter key

P(x = 3) = binom.dist(3, 6, 0.3, 0) = 0.18522

Dr. Yingfu (Frank) Li5-29STAT 3038

Example 5-14: Solution

(a) P(3) = .1852

(b) P(at most 2) = P(0 or 1 or 2) = P(0) + P(1) + P(2)

= .1176 + .3025 + .3241 = .7442

(c) P(at least 3) = P(3 or 4 or 5 or 6)=P(3) + P(4) + P(5) + P(6) = .1852 + .0595 + .0102 + .0007 = .2556

(d) P(1 to 3) = P(1) + P(2) + P(3) = .3025 + .3241 + .1852

= .8118

Other ways to calculate the probabilities Graphing calculator

Smart phone app – probability distributions

MATH 3038 - 01 Dr. Yingfu (Frank) Li5-30

16

Example 5-14: Solution

(e) Probability Distribution and Histogram for the Probability Distribution

MATH 3038 - 01 Dr. Yingfu (Frank) Li5-31

Probability of Success and the Shape of the Binomial Distribution

The binomial probability distribution is symmetric if p = .50 For any n, it gives a symmetric bell-shape

The binomial probability distribution is skewed to the right if p is less than .50.

The binomial probability distribution is skewed to the left if p is greater than .50. For large n, any p, it gives rough bell-shaped

Using Excel to show such feature

Dr. Yingfu (Frank) Li5-32STAT 3038

17

Mean and Standard Deviation of the Binomial Distribution

General formula Mean

Variance

Special formula = n p

2 = n p q

Examples Examples from the book

Tossing a fair coin twice, X = # of heads

Tossing a fair coin 10 times, X = # of heads

Finding any kind of probability

Example 5-15

Dr. Yingfu (Frank) Li5-33STAT 3038

5.5 The Hypergeometric Probability Distribution

Notations N = total number of elements in the population

r = number of successes in the population

N – r = number of failures in the population

n = number of trials (sample size)

x = number of successes in n trials

n – x = number of failures in n trials

The probability of x successes in n trials is given by

Dr. Yingfu (Frank) Li5-34

( ) r x N r n x

N n

C CP x

C

STAT 3038

18

Example 5-16

Brown Manufacturing makes auto parts that are sold to auto dealers. Last week the company shipped 25 auto parts to a dealer. Later, it found out that 5 of those parts were defective. By the time the company manager contacted the dealer, 4 auto parts from that shipment had already been sold. What is the probability that 3 of those 4 parts were good parts and 1 was defective?

Solution: N = 25, r = 20, N – r = 5, n = 4, x = 3, n – x = 1

Dr. Yingfu (Frank) Li5-35

4506.650,12

)5)(1140(

)!425(!4!25

)!15(!1

!5

)!320(!3

!20

)3(425

15320

C

CC

C

CCxP

nN

xnrNxr

STAT 3038

Example 5-17

Dawn Corporation has 12 employees who hold managerial positions. Of them, 7 are female and 5 are male. The company is planning to send 3 of these 12 managers to a conference. If 3 managers are randomly selected out of 12, (a) Find the probability that all 3 of them are female

(b) Find the probability that at most 1 of them is a female

Solutions: N = 12, r = 7, N – r = 5, n = 3 (a) x = 3, n – x = 0

(b) x = 0 (and 1), n – x = 3 (and 2)

MATH 3038 - 01 Dr. Yingfu (Frank) Li5-36

1591.220

)1)(35( )3(

312

0537

C

CC

C

CCP

nN

xnrNxr

3637.3182.0455.)1()0()1(

3182.220

)10)(7( )1(

0455.220

)10)(1( )0(

312

2517

312

3507

PPxP

C

CC

C

CCP

C

CC

C

CCP

nN

xnrNxr

nN

xnrNxr

19

5.6 The Poisson Probability Distribution

The following three conditions must be satisfied to apply the Poisson probability distribution. x is a discrete random variable.

The occurrences are random.

The occurrences are independent.

Examples of Poisson Probability Distribution The number of accidents that occur on a given highway during a 1-

week period.

The number of customers entering a grocery store during a 1–hour interval.

The number of television sets sold at a department store during a given week.

Dr. Yingfu (Frank) Li5-37STAT 3038

Poisson Probability Distribution Formula

According to the Poisson probability distribution, the probability of x occurrences in an interval is

where λ (pronounced lambda) is the mean number of

occurrences in that interval, the value of e is approximately

2.71828, and x = 0, 1, 2, 3, …, ∞

Mean and Standard Deviation

Dr. Yingfu (Frank) Li5-38

( )!

x eP x

x

2

STAT 3038

20

Example 5-18

On average, a household receives 9.5 telemarketing phone calls per week. Using the Poisson distribution formula, find the probability that a randomly selected household receives exactly 6 telemarketing phone calls during a given week.

Solution Formula way

Excel way:

POISSON.DIST(6, 9.5, 0) =

TI-84 calculator way

poissonpdf(9.5, 6) = 0.07642

Smart phone app

Dr. Yingfu (Frank) Li5-39

0764.0 720

)00007485)(.8906.091,735(

!6

)5.9(

!)6(

5.96

e

x

exP

x

STAT 3038

Example 5-19

A washing machine in a laundromat breaks down an average of three times per month. Using the Poisson probability distribution formula, find the probability that during the next month this machine will have exactly two breakdowns

at most one breakdown

Solution Formula way

Excel way

Calculator way

Dr. Yingfu (Frank) Li5-40STAT 3038

2 3

0 3 1 3

( ) P(exactly two breakdowns)

(3) (9)(.04978707)( 2) .2240

2 ! 2

( ) P(at most 1 breakdown) = P(0 or 1 breakdown)

(3) (3)( 0) ( 1)

0 ! 1!(1)(.04978707) (3)

1

a

eP x

b

e eP x P x

(.04978707)

1 .0498 .1494 .1992

21

Example 5-20

Cynthia’s Mail Order Company provides free examination of its products for 7 days. If not completely satisfied, a customer can return the product within that period and get a full refund. According to past records of the company, an average of 2 of every 10 products sold by this company are returned for a refund. Using the Poisson probability distribution formula, find the probability that exactly 6 of the 40 products sold by this company on a given day will be returned for a refund.

Solution: λ = 8, x = 6

MATH 3038 - 01 Dr. Yingfu (Frank) Li5-41

1221.720

)00033546)(.144,262(

!6

)8(

!)6(

86

e

x

eP

x

Example 5-21

On average, two new accounts are opened per day at an Imperial Saving Bank branch. Using Table III of Appendix B, find the probability that on a given day the number of new accounts opened at this bank will be exactly 6

at most 3

at least 7

Solution Table III way

Excel way

Calculator way

Smart phone app way

Dr. Yingfu (Frank) Li5-42STAT 3038

22

Example 5-22

An auto salesperson sells an average of .9 car per day. Let xbe the number of cars sold by this salesperson on any given day. Find the mean, variance, and standard deviation.

Solutions

Dr. Yingfu (Frank) Li5-43

car 949.9.

9.

car 9.2

STAT 3038