Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random...

31
Continuous Random Variables (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special case: the exponential distribution Continuous Random Variables (Ch. 5.2) Will Landau Iowa State University Feb 21, 2013 © Will Landau Iowa State University Feb 21, 2013 1 / 31

Transcript of Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random...

Page 1: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Continuous Random Variables (Ch. 5.2)

Will Landau

Iowa State University

Feb 21, 2013

© Will Landau Iowa State University Feb 21, 2013 1 / 31

Page 2: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Outline

Introduction to Continuous Random Variables

Probability Density Functions

Cumulative Distribution Functions

A special case: the exponential distribution

© Will Landau Iowa State University Feb 21, 2013 2 / 31

Page 3: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Continuous random variables

I Two types of random variables:I Discrete random variable: one that can only take on

a set of isolated points (X , N, and S).I Continuous random variable: one that can fall in an

interval of real numbers (T and Z ).

I Examples of continuous random variables:I Z = the amount of torque required to loosen the next

bolt (not rounded).I T = the time you’ll have to wait for the next bus home.I C = outdoor temperature at 3:17 PM tomorrow.I L = length of the next manufactured part.

© Will Landau Iowa State University Feb 21, 2013 3 / 31

Page 4: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Continuous random variables

I V : % yield of the next run of a chemical process.

I Y : % yield of a better process.I How do we mathematically distinguish between V and

Y , given:I Each has the same range: 0% ≤ V ,Y ≤ 100%I There are uncountably many possible values in this

range.

I We want to show that Y tends to take on higher %yield values than V .

© Will Landau Iowa State University Feb 21, 2013 4 / 31

Page 5: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

V and Y have continuous probabilitydistributions

0 20 60 100

0.00

00.

010

0.02

0

Distribution of V

v

f(v)

0 20 60 100

0.00

0.02

0.04

Distribution of Y

y

f(y)

I The heights of these curves are not themselvesprobabilities.

I However, the the curves tell us that process Y will yieldmore product per run on average than process X .© Will Landau Iowa State University Feb 21, 2013 5 / 31

Page 6: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

A generic probability density function (pdf)

© Will Landau Iowa State University Feb 21, 2013 6 / 31

Page 7: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Outline

Introduction to Continuous Random Variables

Probability Density Functions

Cumulative Distribution Functions

A special case: the exponential distribution

© Will Landau Iowa State University Feb 21, 2013 7 / 31

Page 8: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Definition: probability density function (pdf)

I A probability density function (pdf) of a continuousrandom variable X is a function f (x) with:

f (x) ≥ 0 for all x .∫ ∞−∞

f (x)dx = 1

P(a ≤ X ≤ b) =

∫ b

af (x)dx , a ≤ b

I The pdf is the continuous analogue of a discreterandom variable’s probability mass function.

© Will Landau Iowa State University Feb 21, 2013 8 / 31

Page 9: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Example

I Let Y be the time delay (s) between a 60 Hz AC circuit andthe movement of a motor on a different circuit.

I Say Y has a density of the form:

f (y) =

{c 0 < y < 1

60

0 otherwise

we say that Y has a Uniform(0, 1/60) distribution.

I f (y) must integrate to 1:

1 =

∫ ∞−∞

f (y)dy =

∫ 0

−∞0dy +

∫ 1/60

0

cdy +

∫ ∞1/60

0dy =c

60

I hence, c = 60, and:

f (y) =

{60 0 < y < 1

60

0 otherwise

© Will Landau Iowa State University Feb 21, 2013 9 / 31

Page 10: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

A look at the density

© Will Landau Iowa State University Feb 21, 2013 10 / 31

Page 11: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Your turn: calculate the following probabilities.

f (y) =

{60 0 ≤ y ≤ 1

60

0 otherwise

1. P(Y ≤ 1100)

2. P(Y > 170)

3. P(|Y | < 1120)

4. P(∣∣Y − 1

200

∣∣ > 1110)

5. P(Y = 180)

© Will Landau Iowa State University Feb 21, 2013 11 / 31

Page 12: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Answers: calculate the following probabilities

1.

P(Y ≤ 1

100) = P(−∞ < Y ≤ 1

100)

=

∫ 1/100

−∞f (y)dy

=

∫ 0

−∞0dy =

∫ 1/100

0

60dy

=60

100=

3

5

© Will Landau Iowa State University Feb 21, 2013 12 / 31

Page 13: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

2.

P(Y >1

70) = P(

1

70< Y ≤ ∞)

=

∫ ∞1/70

f (y)dy

=

∫ 1/60

1/7060dy +

∫ ∞1/60

0dy

= 60y |1/601/70 +0

= 60

(1

60− 1

70

)=

1

7≈ 0.143

© Will Landau Iowa State University Feb 21, 2013 13 / 31

Page 14: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

3.

P(|Y | < 1

120) = P(− 1

120< Y <

1

120)

=

∫ 1/120

−1/120f (y)dy

=

∫ 0

−1/1200dy +

∫ 1/120

060dy

= 0 + 60y |1/1200

= 60

(1

120− 0

)=

1

2

© Will Landau Iowa State University Feb 21, 2013 14 / 31

Page 15: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

4.

P(

∣∣∣∣Y − 1

200

∣∣∣∣ > 1

110)

= P(Y − 1

200>

1

110or Y − 1

200< − 1

110)

= P(Y >31

2200or Y < − 9

2200)

= P(Y >31

2200) + P(Y < − 9

2200)

=

∫ ∞31/2200

f (y)dy +

∫ −9/2200−∞

f (y)dy

=

∫ 1/60

31/220060dy +

∫ ∞1/60

0dy +

∫ −9/2200−∞

0dy

= 60|1/6031/2200 + 0 + 0

= 60

(1

60− 31

2200

)=

17

6600≈ 0.00258

© Will Landau Iowa State University Feb 21, 2013 15 / 31

Page 16: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

5.

P(Y =1

80) = P(

1

80≤ Y ≤ 1

80)

=

∫ 1/80

1/80f (y)dy =

∫ 1/80

1/8060dy

= 60 |1/801/80= 60

(1

80− 1

80

)= 0

In fact, for any random variable X and any real numbera:

P(X = a) = P(a ≤ X ≤ a)

=

∫ a

af (x)dx = 0

© Will Landau Iowa State University Feb 21, 2013 16 / 31

Page 17: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Outline

Introduction to Continuous Random Variables

Probability Density Functions

Cumulative Distribution Functions

A special case: the exponential distribution

© Will Landau Iowa State University Feb 21, 2013 17 / 31

Page 18: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Cumulative distribution functions (cdf)

I The cumulative distribution function of a randomvariable X is a function F such that:

F (x) = P(X ≤ x) =

∫ x

−∞f (t)dt

In other words:

d

dxF (x) = f (x)

I As with discrete random variables, F has the followingproperties:

I F (x) ≥ 0 for all x .I F is monotonically increasing.I limx→−∞ F (x) = 0I limx→∞ F (x) = 1

© Will Landau Iowa State University Feb 21, 2013 18 / 31

Page 19: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Example: calculating the cdf of YI Remember:

fY (y) =

{60 0 < y < 1/60

0 otherwise

I For y ≤ 0:

F (y) = P(Y ≤ y) =

∫ y

−∞f (t)dt =

∫ 0

−∞0dt = 0

I For 0 < y < 1/60:

F (y) = P(Y ≤ y) =

∫ y

−∞f (t)dt =

∫ 0

−∞0dt +

∫ y

060dt = 60y

I For y ≥ 1/60:

F (y) = P(Y ≤ y) =

∫ y

−∞f (t)dt

=

∫ 0

−∞0dt +

∫ 1/60

060dt +

∫ ∞1/60

0dt = 1

© Will Landau Iowa State University Feb 21, 2013 19 / 31

Page 20: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

A look at the cdf

© Will Landau Iowa State University Feb 21, 2013 20 / 31

Page 21: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Your turn: calculate the following using the cdf

F (y) =

0 y ≤ 0

60y 0 < y ≤ 160

1 y > 160

1. F (1/70)

2. P(Y ≤ 180)

3. P(Y > 1150)

4. P( 1130 ≤ Y ≤ 1

120)

© Will Landau Iowa State University Feb 21, 2013 21 / 31

Page 22: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Answers: calculate the following using the cdf

1. F ( 170) = 60 1

70 = 67

2. P(Y ≤ 180) = F ( 1

80) = 60 180 = 3

4

3.

P(Y >1

150) =

∫ ∞1/150

f (y)dy

=

∫ ∞−∞

f (y)dy −∫ 1/150

−∞f (y)dy

= 1− F (1/150) = 1− 60

150

=3

5

In fact, for any random variable X , discrete orcontinuous:

P(X ≥ x) = 1− P(X < x)

© Will Landau Iowa State University Feb 21, 2013 22 / 31

Page 23: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

4.

P(1

130≤ Y ≤ 1

120) =

∫ 1/120

1/130f (y)dy

=

∫ 1/120

−∞f (y)dy −

∫ 1/130

−∞f (y)dy

= F (1/120)− F (1/130)

= 60(1/120)− 60(1/130)

= 1/26 ≈ 0.0384

© Will Landau Iowa State University Feb 21, 2013 23 / 31

Page 24: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Outline

Introduction to Continuous Random Variables

Probability Density Functions

Cumulative Distribution Functions

A special case: the exponential distribution

© Will Landau Iowa State University Feb 21, 2013 24 / 31

Page 25: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

The exponential distribution

I A random variable X has an Exponential(α) distributionif:

f (x) =

{1αe−x/α x > 0

0 otherwise

© Will Landau Iowa State University Feb 21, 2013 25 / 31

Page 26: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Your turn: for X ∼ Exp(2), calculate thefollowing

f (x) =

{12e−x/2 x > 0

0 otherwise

1. P(X ≤ 1)

2. P(X > 5)

3. The cdf F of X

© Will Landau Iowa State University Feb 21, 2013 26 / 31

Page 27: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Answers: for X ∼ Exp(2), calculate the following

1.

P(X ≤ 1) =

∫ 1

−∞f (x)dx

=

∫ 0

−∞0dx +

∫ 1

0

1

2e−x/2dx

= 0 + (−e−x/2 |10= −e−1/2 − (−e−0/2)

= 1− e−1/2 ≈ 0.393

© Will Landau Iowa State University Feb 21, 2013 27 / 31

Page 28: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

2.

P(X > 5) =

∫ ∞5

f (x)dx

=

∫ ∞5

1

2e−x/2dx

= −e−x/2|∞5= −e−∞/2 + e−5/2

= e−5/2 ≈ 0.082

© Will Landau Iowa State University Feb 21, 2013 28 / 31

Page 29: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

3. For x < 0:

F (x) = P(X ≤ x) =

∫ x

−∞f (x)dx)

=

∫ x

−∞0dx = 0

For x ≥ 0:

F (x) = P(X ≤ x) =

∫ x

−∞f (x)dx

=

∫ 0

−∞0dx +

∫ x

0

1

2e−t/2dt

= −e−t/2 |x0= −e−x/2 − (−e−0/2)

= 1− e−x/2

© Will Landau Iowa State University Feb 21, 2013 29 / 31

Page 30: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Hence:

F (x) =

{1− e−x/2 x ≥ 0

0 otherwise

In general, an Exp(α) random variable has cdf:

F (x) =

{1− e−x/α x ≥ 0

0 otherwise

© Will Landau Iowa State University Feb 21, 2013 30 / 31

Page 31: Continuous Random Variables (Ch. 5.2) · (Ch. 5.2) Will Landau Introduction to Continuous Random Variables Probability Density Functions Cumulative Distribution Functions A special

ContinuousRandom Variables

(Ch. 5.2)

Will Landau

Introduction toContinuousRandom Variables

Probability DensityFunctions

CumulativeDistributionFunctions

A special case: theexponentialdistribution

Uses of the Exp(α) random variable

I An Exp(α) random variable measures the waiting timeuntil a specific event that has an equal chance ofhappening at any point in time.

I Examples:I Time between your arrival at a bus stop and the

moment the bus comes.I Time until the next person walks inside the library.I Time until the next car accident on a stretch of highway.

© Will Landau Iowa State University Feb 21, 2013 31 / 31