probability and cumulative distribution functions · pdf fileprobability and cumulative...

68
Probability and Cumulative Distribution Functions Lesson 20

Upload: vuongmien

Post on 31-Jan-2018

251 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Probability and CumulativeDistribution Functions

Lesson 20

Page 2: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

RecallIf p(x) is a density function for some characteristic of apopulation, then

Page 3: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

RecallIf p(x) is a density function for some characteristic of apopulation, then

We also know that for any density function,

Page 4: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

RecallWe also interpret density functions as probabilities:

If p(x) is a probability density function (pdf), then

Page 5: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Cumulative DistributionFunction

Suppose p(x) is a density function for a quantity.

The cumulative distribution function (cdf) for the quantity isdefined as

Gives:

• The proportion of population with value less than x

• The probability of having a value less than x.

Page 6: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Example: A Spinner

Last class: A spinner that could take on any value0º ≤ x ≤ 360º.

Density function: p(x) = 1/360 if 0 ≤ x ≤ 360, and 0everywhere else.

Page 7: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Example: A Spinner

Last class: A spinner that could take on any value0º ≤ x ≤ 360º.

Density function: p(x) = 1/360 if 0 ≤ x ≤ 360, and 0everywhere else.

CDF:

Page 8: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Example: A Spinner

Density Function:Cumulative

Distribution Function:

Page 9: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Properties of CDFs

• P(x) is the probability of values less than x– If P(x) is the cdf for the age in months of fish in

a lake, then P(10) is the probability a randomfish is 10 months or younger.

• P(x) goes to 0 as x gets smaller:

(In many cases, we may reach 0.)

Page 10: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Properties of CDFs

• Conversely,

• P(x) is non-decreasing.– The derivative is a density function, which

cannot be negative.– Also, P(4) can’t be less than P(3), for example.

Page 11: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

PracticeLife expectancy (in days) of electronic component has densityfunction , for x ≥ 1, and p(x) = 0 for x < 1.

a) Probability component lasts between 0 and 1 day?

b) Probability it lasts between 0 and 10 days?

c) More than 10 days?

d) Find the CDF for the life expectancy.

Page 12: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

PracticeLife expectancy (in days) of electronic component has densityfunction , for x ≥ 1, and p(x) = 0 for x < 1.

a) Probability component lasts between 0 and 1 day?

Zero!

Page 13: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

PracticeLife expectancy (in days) of electronic component has densityfunction , for x ≥ 1, and p(x) = 0 for x < 1.

b) Probability it lasts between 0 and 10 days?

Page 14: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

PracticeLife expectancy (in days) of electronic component has densityfunction , for x ≥ 1, and p(x) = 0 for x < 1.

c) More than 10 days?

Page 15: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

PracticeLife expectancy (in days) of electronic component has densityfunction , for x ≥ 1, and p(x) = 0 for x < 1.

c) More than 10 days?

Page 16: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

PracticeLife expectancy (in days) of electronic component has densityfunction , for x ≥ 1, and p(x) = 0 for x < 1.

d) Find the CDF for life expectancy.

If x < 1, then

If x ≥ 1, then

Page 17: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

PracticeLife expectancy (in days) of electronic component has densityfunction , for x ≥ 1, and p(x) = 0 for x < 1.

d) Find the CDF for life expectancy.

Page 18: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSomeone claims this is theCDF for grades on the 2015final exam.

Probability a random studentscored….

• 25 or lower?

1, or 100%.

• 50 or lower?

0.5, or 50%.

Conclusion?

They’re lying! This cannot bea cumulative distributionfunction! (It decreases.)

Page 19: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Relating the CDF and DF

According the FTC version 2, since

then P'(x) = p(x).

,

Page 20: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Relating the CDF and DF

According the FTC version 2, since

then P'(x) = p(x).

So the density function is the derivative, or rate of change,of the cumulative distribution function.

,

Page 21: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSketch the density function forthe cdf shown.

Page 22: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSketch the density function forthe cdf shown.

Slope?

Page 23: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSketch the density function forthe cdf shown.

Slope?0

Page 24: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Page 25: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Slope 0

Page 26: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Slope 0

Slope 1/2

Page 27: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Slope 0

Slope 1/2

Slope 0

Page 28: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Slope 0

Slope 1/2

Slope 0

DensityFunction

Page 29: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

DF vs. CDF

You must know which is which.

We work differently with density functions than withcumulative distribution functions.

Page 30: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Another Example

Suppose the cumulative distribution function for the height oftrees in a forest (in feet) is given by

Find the height, x for which exactly half the trees are tallerthan x feet, and half the trees are shorter than x.

In case - Quadratic Formula:

x =!b ± b

2! 4ac

2a

Page 31: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Another Example

Find the height, x for which exactly half the trees are tallerthan x feet, and half the trees are shorter than x.

0.1x ! 0.0025x 2= 0.5

!0.0025x 2+ 0.1x ! 0.5 = 0

!0.0025(x 2! 40x + 200) = 0

using quadratic : x = 20 ± 10 2 = 20 !10 2 " 5.86 ft

Page 32: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),
Page 33: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),
Page 34: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

(1)

(2)

(3)

(4)

ExampleAssume p(x) is the density function

p(x) =

1

2,!!!if !1! x ! 3

0,!!!if !x < 1!!or !!x > 3

"

#$

%$

Let P(x) represent the corresponding

Cumulative Distribution function.

Then (a) For the density function given above, what is the cumulative

distribution function P(x) for values of x between 1 and 3?

(b) P(5) = ?

(c) Choose the correct pair of graphs for p(x)!and!P(x) .

Page 35: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

In-class AssignmentThe time to conduct a routine maintenance check on a machine hasa cumulative distribution function P(t), which gives the fraction ofmaintenance checks completed in time less than or equal to tminutes. Values of P(t) are given in the table.

.98.80.38.21.08.030P(t), fraction completed302520151050t, minutes

a. What fraction of maintenance checks are completed in 15 minutesor less?

b. What fraction of maintenance checks take longer than 30minutes?

c. What fraction take between 10 and 15 minutes?

Page 36: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

In-class AssignmentThe time to conduct a routine maintenance check on a machine hasa cumulative distribution function P(t), which gives the fraction ofmaintenance checks completed in time less than or equal to tminutes. Values of P(t) are given in the table.

.98.80.38.21.08.030P(t), fraction completed302520151050t, minutes

a. What fraction of maintenance checks are completed in 15 minutesor less? 21%

b. What fraction of maintenance checks take longer than 30minutes? 2%

c. What fraction take between 10 and 15 minutes? 13%

Page 37: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Mean and Median

Lesson 21

Page 38: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

The MedianThe median is the halfway point: Half thepopulation has a lower value, and half a highervalue.

If p(x) is a density function, then the median of thedistribution is the point M such that

p(x)dx!"

M

# = 0.5

Page 39: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Suppose an insect life span ofmonths, and 0 elsewhere. What’s the median life span?

We need

Then solve for M:

months

Example

Page 40: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Median From CDFIf we have a CDF P(x), the median M is the point where

P(M) = 0.5

(This of course says 1/2 of the population has a value lessthan M!)

Page 41: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

CDF: P(t) = t2, 0 ≤ t ≤ 1.

What’s the median of this distribution?

Example

Page 42: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

CDF: P(t) = t2, 0 ≤ t ≤ 1.

What’s the median of this distribution?

Example

Page 43: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

The Mean

What most people think of as the average:

Add up n values and divide by n.

How should we represent this for something represented by adensity function p(x)?

Page 44: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

The MeanWe define the mean of a distribution given by densityfunction p(x) to be

Page 45: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Previous insect population example:

and p(x) = 0 elsewhere.

What’s the mean lifespan?

Example

Page 46: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Previous insect population example:

and p(x) = 0 elsewhere.

What’s the mean lifespan? 8 months.

The mean is slightly below the median. This means

Example

Page 47: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Previous insect population example:

and p(x) = 0 elsewhere.

What’s the mean lifespan? 8 months.

The mean is slightly below the median. This meansmore than half the insects live longer than the meanlifespan.

Example

Page 48: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Example 2From “Another Example”,

p(x) = 0.1! 0.005x

mean = x p(x)dx!"

"

# = x(0

20

# 0.1! 0.005x)dx =

0.1x ! 0.005x2

0

20

# dx = 0.05x2 ! 0.0016 x

3

0

20

= 6.64 ft

Page 49: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

GeometryTurns out: the mean is the point where the graph of thedistribution would balance if we cut it out.

Page 50: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Find the mean and median forand zero elsewhere.

Median: Solve for M

Example

Page 51: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Find the mean and median forand zero elsewhere.

Mean: Evaluate

Example

Page 52: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Find the mean and median forand zero elsewhere.

medianmean

Example

Page 53: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

A special distribution:

The Normal Distribution

Page 54: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

A special distribution:

The Normal Distribution

Page 55: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Here’s an example with µ = 0 and σ = 1:

The distribution is symmetric about x = µ.

So the mean is µ, and so is the median.

σ is called the standard deviation, and describes how spreadout the curve is.

The Normal Distribution

Page 56: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

The Normal Distribution

Unfortunately, has no elementary antiderivative.

So we must use numerical means to evaluate integralsinvolving the normal distribution.

Page 57: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Suppose a density function for number of people (inmillions) on the internet at one time were

What are the mean and median?

2

Example

Page 58: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Suppose a density function for number of people (inmillions) on the internet at one time were

What are the mean and median?

Here, µ = 10, so both the mean and median are10 million people.

2

Example

Page 59: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Suppose a density function for number of people (inmillions) on the internet at one time were

What is the standard deviation?

2

Example

Page 60: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Suppose a density function for number of people (inmillions) on the internet at one time were

What is the standard deviation?

Here, we see that σ = 2, so 2 million people.

2

Example

Page 61: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Suppose a density function for number of people (inmillions) on the internet at one time were

What is the standard deviation?

Here, we see that σ = 2, so 2 million people.

2

Example

Page 62: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Suppose a density function for number of people (inmillions) on the internet at one time were

Write an integral for the fraction of time between 8and 12 million people are on the internet.

2

Example

Page 63: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

ExampleSuppose a density function for number of people (inmillions) on the internet at one time were

Write an integral for the fraction of time between 8and 12 million people are on the internet.

2

2

Page 64: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

How to calculate the required integral?

2

Evaluating the Integral

Page 65: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

How to calculate the required integral?

We could use our Simpson’s rule calculator:

2

Evaluating the Integral

Page 66: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

Evaluating the IntegralHow to calculate the required integral?

We could use our Simpson’s rule calculator:

2

n !x Result

2 2 0.693237

4 1 0.683058

8 0.5 0.682711

16 0.25 0.682691

32 0.125 0.68269

Page 67: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

How to calculate the required integral?

We could use our Simpson’s rule calculator:

2

n !x Result

2 2 0.693237

4 1 0.683058

8 0.5 0.682711

16 0.25 0.682691

32 0.125 0.68269

Seems to convergeto about 0.68.

Evaluating the Integral

Page 68: Probability and Cumulative Distribution Functions · PDF fileProbability and Cumulative Distribution Functions Lesson 20. Recall ... If p(x) is a probability density function (pdf),

In Class AssignmentFind the mean and median of the distribution withdensity function:

(calculations should be to 2 decimal places)

p(x) =1

4x

3 for 0 < x < 2!and!0!elsewhere