68
Probability and Cumulative Distribution Functions Lesson 20

Cumulative Distribution

Embed Size (px)

DESCRIPTION

Cumulative Distribution

Citation preview

Page 1: Cumulative Distribution

Probability and CumulativeDistribution Functions

Lesson 20

Page 2: Cumulative Distribution

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

Page 3: Cumulative Distribution

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

We also know that for any density function,

Page 4: Cumulative Distribution

RecallWe also interpret density functions as probabilities:

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

Page 5: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

Example: A Spinner

Density Function:Cumulative

Distribution Function:

Page 9: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

Relating the CDF and DF

According the FTC version 2, since

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

,

Page 20: Cumulative Distribution

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: Cumulative Distribution

ExampleSketch the density function forthe cdf shown.

Page 22: Cumulative Distribution

ExampleSketch the density function forthe cdf shown.

Slope?

Page 23: Cumulative Distribution

ExampleSketch the density function forthe cdf shown.

Slope?0

Page 24: Cumulative Distribution

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Page 25: Cumulative Distribution

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Slope 0

Page 26: Cumulative Distribution

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Slope 0

Slope 1/2

Page 27: Cumulative Distribution

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Slope 0

Slope 1/2

Slope 0

Page 28: Cumulative Distribution

ExampleSketch the density function forthe cdf shown.

Slope?0 Slope 1/2

Slope 0

Slope 1/2

Slope 0

DensityFunction

Page 29: Cumulative Distribution

DF vs. CDF

You must know which is which.

We work differently with density functions than withcumulative distribution functions.

Page 30: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution
Page 33: Cumulative Distribution
Page 34: Cumulative Distribution

(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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

Mean and Median

Lesson 21

Page 38: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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

What’s the median of this distribution?

Example

Page 42: Cumulative Distribution

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

What’s the median of this distribution?

Example

Page 43: Cumulative Distribution

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: Cumulative Distribution

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

Page 45: Cumulative Distribution

Previous insect population example:

and p(x) = 0 elsewhere.

What’s the mean lifespan?

Example

Page 46: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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

Page 50: Cumulative Distribution

Find the mean and median forand zero elsewhere.

Median: Solve for M

Example

Page 51: Cumulative Distribution

Find the mean and median forand zero elsewhere.

Mean: Evaluate

Example

Page 52: Cumulative Distribution

Find the mean and median forand zero elsewhere.

medianmean

Example

Page 53: Cumulative Distribution

A special distribution:

The Normal Distribution

Page 54: Cumulative Distribution

A special distribution:

The Normal Distribution

Page 55: Cumulative Distribution

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: Cumulative Distribution

The Normal Distribution

Unfortunately, has no elementary antiderivative.

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

Page 57: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

How to calculate the required integral?

2

Evaluating the Integral

Page 65: Cumulative Distribution

How to calculate the required integral?

We could use our Simpson’s rule calculator:

2

Evaluating the Integral

Page 66: Cumulative Distribution

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: Cumulative Distribution

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: Cumulative Distribution

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