Chapter 4 Continuous Random Variables and...

28
Chapter 4 Continuous Random Variables and Probability Distributions Part 2: More on Continuous Random Variables Section 4.5 Continuous Uniform Distribution Section 4.6 Normal Distribution 1 / 28

Transcript of Chapter 4 Continuous Random Variables and...

Page 1: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Chapter 4Continuous Random Variables and ProbabilityDistributions

Part 2: More on Continuous Random Variables

Section 4.5 Continuous Uniform DistributionSection 4.6 Normal Distribution

1 / 28

Page 2: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

One more comment on the Poisson distribution...

The Poisson gives you a long-term rate of events per unit (e.g. 3 errorper page), and events are assumed to occur completely random.

So, more units coincides with a higher expected number of events(e.g. 6 errors for every 2 pages) .

Example (Poisson and a specific ‘time window’)

The number of false fire alarms in a suburb of Houston averages 2.1 perday and follows a Poisson distribution.

1) What is the expected number of false fire alarms in 2 days?

ANS: We are given the rate of occurrence as 2.1 per day. Assuming thefalse fire alarms occur at random over time, the expected number in 2days is 2× 2.1 = 4.2

2 / 28

Page 3: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

One more comment on the Poisson distribution...

Example (Poisson and a specific ‘time window’, cont.)

2) What is the probability that there will be at least 1false fire alarm in 2 days?

ANS: Let Y equal the number of false fire alarms in 2 days.

Y follows a Poisson distribution with anexpected number false fire alarms of 4.2.

P (Y = y) =e−4.24.2y

y! for y = 0, 1, 2, 3 . . .

P (Y ≥ 1) = 1− P (Y < 1)= 1− P (Y = 0)= 1− e−4.2= 0.9850

3 / 28

Page 4: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Continuous and Discrete Random Variables

Continuous Random Variable Discrete Random VariableX can take on all possible values X can take on only distinct

in an interval of real numbers. ‘discrete’ values in a set.e.g. X ∈ [0, 1] e.g. X ∈ {0, 1, 2, 3, . . . ,∞}

Probability density function, f(x) Probability mass function, f(x)

Cumulative distribution function, Cumulative distribution function,F (x) = P (X ≤ x) =

∫ x

∞ f(u)du F (x) = P (X ≤ x) =∑

xi≤x f(xi)

µ = E(X) =∫∞−∞ xf(x)dx µ = E(X) =

∑x xf(x)

σ2 = V (X) = E(X − µ)2 σ2 = V (X) = E(X − µ)2

=∫∞−∞(x− µ)2f(x)dx =

∑x(x− µ)2f(x)

= E(X2)− [E(X)]2 = E(X2)− [E(X)]2

=∫∞−∞ x2f(x)dx− µ2 =

∑x x

2f(x)− µ2

4 / 28

Page 5: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Continuous Uniform Distribution

The simplest continuous distribution

X falls between a and b.

It’s uniformly distributed over the interval [a, b].

f(x) has a constant value, and f(x) =1b−a

This coincides with the area under the curve being 1.

Example (Uniform(2,4))

0 1 2 3 4 5 60.0

0.2

0.4

0.6

0.8

1.0

x

f(x)

pdf

0 1 2 3 4 5 60.0

0.2

0.4

0.6

0.8

1.0

x

F(x)

CDF

5 / 28

Page 6: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Continuous Uniform Distribution

Definition (Continuous Uniform Distribution)

A continuous random variable X with probability density function

f(x) = 1b−a , a ≤ x ≤ b

is a continuous uniform random variable.

Definition (Mean and and Variance for Continuous Uniform Dist’n)

If X is a continuous uniform random variable over a ≤ x ≤ b

µ = E(X) = (a+b)2 ,

and

σ2 = V (X) = (b−a)212

6 / 28

Page 7: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Continuous Uniform Distribution

Example (Uniform(0,20))

For the uniform probability density function described earlier with a = 0and b = 20, f(x) = 1

20 = 0.05 for 0 ≤ x ≤ 20.

Find E(X) and V (X) using the formulas.

ANS: a = 0, b = 20

µ = E(X) = (0+20)2 = 10

σ2 = V (X) = (20−0)212 = 33.33

7 / 28

Page 8: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Continuous Uniform Distribution

Example (Shampoo bottle volume)

The volume, X, of shampoo filled into a container is uniformly distributedbetwee 374 and 380 milliliters.

1) Find the cumulative distribution function (CDF) for X.

2) Use the CDF to find the volume of shampoo that is exceeded by 95%of all the volumes (i.e the threshold for the lowest 5%).

ANS: 1)

2)

8 / 28

Page 9: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution

x

f(x)

Perhaps the most widely used distribution of a random variable.

Arises naturally in physical phenomena.

Two parameters completely define a normal probability densityfunction, µ and σ2.

µ is the expected value, or center of the distribution.

σ2 is the variance of the distribution, and quantifies spread.

Symmetrical distribution.

9 / 28

Page 10: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution

A normal distribution can occur anywhere along the real number line.

It always has a bell-shape.

The parameter µ tells us where it is centered, and where there’s ahigh probability of X occurring.

σ2 tells us how spread-out the distribution is.

Recall that the area under the curve must be a 1.10 / 28

Page 11: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: 68-95-99.7 Rule

Special result of normal distribution:

Recall: σ is the standard deviation of X, σ =√V (X)

68% of the observations lie within 1 std. deviation of the mean.

95% of the observations lie within 2 std. deviation of the mean.

99.7% of the observations lie within 3 std. deviation of the mean.

Very little area under the curve lies beyond 3σ away from the mean.

11 / 28

Page 12: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: 68-95-99.7 Rule

Example (Weight of contents in cereal box)

A box of Quazar cereal states there are 15 oz. of cereal in a box.

In reality, the amount of cereal in a box varies from box to box. Supposethe amount has a normal distribution with µ = 15 and σ2 = 0.04.

What percentage of boxes have between 14.6 oz and 15.4 oz. of cereal?

ANS:

12 / 28

Page 13: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution (pdf)

What about computing probabilities for values other thanµ± 1σ, µ± 2σ, µ± 3σ

Definition (Normal distribution)

A random variable X with probability density function

f(x) =1√2π·σ e

− 12σ2 (x−µ)

2

−∞ < x <∞

is a normal random variable with parameters µ and σ, where−∞ < µ <∞, and σ > 0, and π = 3.14159 . . . and e = 2.71828 . . .

Also, E(X) = µ and V (X) = σ2

The notation N(µ, σ2) will be used to denote the distribution.

13 / 28

Page 14: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution

Example (Weight of contents in cereal box)

What percent of boxes contain less than 14.5 oz. of cereal?

P (X ≤ 14.5) =F (14.5) =

∫ 14.5

−∞f(x)dx

=

∫ 14.5

−∞

1√2π · σ

e−1

2σ2(x−µ)2dx

=1√

2π · (0.2)

∫ 14.5

−∞e− 1

2(0.04)(x−15)2

dx

x

f(x)

14.0 14.5 15.0 15.5 16.0

This can not be done in closed form, instead we’ll usestatistical tables (p.742 in book) to calculate.

14 / 28

Page 15: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standard Normal N(0, 1)

There is an infinite number of distinct normal distributions(any µ and σ2 define one).

But, we only need one statistical table to compute probabilities forEVERY normal.

This is because every normal distribution can be shifted and scaled(i.e. stretched or shrunk) to look like the Standard NormalDistribution (shown below).

15 / 28

Page 16: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standard Normal N(0, 1)

Definition (Standard Normal Distribution)

A normally distributed random variable with

µ = 0 and σ2 = 1

is a standard normal random variable and is denoted as Z.

We say Z is distributed N(0, 1), or Z ∼ N(0, 1).

The cumulative distribution function, F (x), of a standard normalrandom variable is denoted as

Φ(z) = P (Z ≤ z)

16 / 28

Page 17: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standard Normal N(0, 1)

The Standard Normal Distribution

Φ(1.5) = P (Z ≤ 1.5) = 0.93319

Appendix A Table III on p.742-743 in book.Table for determining probabilities for Z:

17 / 28

Page 18: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standard Normal N(0, 1)

Example (Standard Normal Distribution)

Find P (Z ≤ 1.52) = Φ(1.52).

ANS: : See Table III. Find row and column for Z=1.52P (Z ≤ 1.52) = 0.93574

The table provides cumulative distributions. These are areas under thenormal curve of f(x) to the left of a given z-value.

18 / 28

Page 19: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standard Normal N(0, 1)

Example (Standard Normal Distribution)

Find P (Z ≤ −1.25) = Φ(−1.25).

ANS: : From Table III, P (Z ≤ −1.25) = 0.10565

19 / 28

Page 20: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standard Normal N(0, 1)

Example (Standard Normal Distribution)

Find P (Z > 1.26).

ANS: P (Z > 1.26) = 1− P (Z ≤ 1.26)= 1− 0.89616= 0.10384

20 / 28

Page 21: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standard Normal N(0, 1)

Example (Standard Normal Distribution)

Find P (−1.25 ≤ Z ≤ 0.37).

ANS: : P (−1.25 ≤ Z ≤ 0.37) = P (Z ≤ 0.37)− P (Z ≤ −1.25)= 0.64431− 0.10565= 0.53866

21 / 28

Page 22: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standardizing

How do we compute probabilities for our cereal example?

For X ∼ N(15, 0.22), how do we use the table to find P (X ≤ 14.5)?

We first shift the random variable to be centered at 0 (i.e. subtractthe mean).

X∗ = X − µ = X − 15

Then, we scale it to have a standard deviation of 1 (i.e. divide by thestandard deviation).

X∗∗ =X∗

σ = X−15σ

After this shift and scale phrased as “subtract the mean, divide by thestandard deviation”, then this new variable X∗∗ = X−µ

σ is a Zrandom variable, or a standard normal random variable, or a N(0, 1)random variable.

22 / 28

Page 23: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standardizing

Definition (Standardizing a Normal Random Variable)

If X is a normal random variable with E(X) = µ and V (X) = σ2,then the random variable, then

Z =X−µσ

is a normal random variable with E(Z) = 0 and V (Z) = 1. That is, Z is astandard normal random variable.

Z represents “the distance X is from its mean” in terms of the number ofstandard deviations.

23 / 28

Page 24: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standardizing

Let X ∼ N(10, 22) {i.e. X is not a std. normal r.v. }

“Subtract the mean, divide by the standard deviation” Z =X−µσ

P (X ≤ 13) = P

(X − µσ

≤ 13− 10

2

)= P (Z ≤ 1.5)

= 0.9332 {from table III}

24 / 28

Page 25: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standardizing

Standardizing to Calculate a Probability

Suppose X is a normal random variable with mean µ and variance σ2

or X ∼ N(µ, σ2), then

P (X ≤ x) = P(X−µσ ≤ x−µ

σ

)= P (Z ≤ z)

where Z is a standard normal random variable, andz = (x−µ)

σ is the z-value obtained by standardizing X.

Then, we obtain probabilities from Z−table or Table III.

Again, there are an infinite number of normal distributions, but weonly need one table since any N(µ, σ2) can be related to the N(0, 1).

25 / 28

Page 26: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Standardizing

Example (Weight of contents in a cereal box, cont.)

Back to the cereal example...

What percent of boxes contain less than 14.5 oz. of cereal?

Recall that the amount in a cereal box is normally distributed with mean15 oz. and standard deviation of 0.2 oz.

ANS:

26 / 28

Page 27: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Using the table in reverse

Example (Weight of contents in a cereal box, cont.)

Find the cereal box amount (in oz.) at which 20% of the cereal boxes haveless than this much cereal. (Find the threshold at which 20% of the boxesfall below this amount).

ANS: Recall, X ∼ N(15, 0.22)<sketch here>

First, find the probability 0.20 in the middle of the Z-table.

Find the z-value that coincides with this probability (by finding a row andcolumn). Continued next slide...

27 / 28

Page 28: Chapter 4 Continuous Random Variables and …homepage.stat.uiowa.edu/~rdecook/stat2020/notes/ch4_pt2.pdfContinuous Random Variables and Probability Distributions ... One more comment

Normal Distribution: Using the table in reverse

Example (Weight of contents in a cereal box, cont.)

The z-value goes where the ? is at:

P (Z ≤ ? ) = 0.20

P (Z ≤ −0.84) = 0.20

z-value= −0.84

“Unstandardize” the z-value to get the x-value:

z =x−µσ ⇒ x = µ+ zσ

x = 15 + (−0.84)0.2x = 14.832

28 / 28