45
Chapter 5. Continuous Random Variables

Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Embed Size (px)

Citation preview

Page 1: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Chapter 5. Continuous Random Variables

Page 2: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Uniform Random Variable

• X is a uniform random variable on the interval (α, β) if its probability function is given by

otherwise 0

if 1

)(

x

xf

1

0

)(

x

xx

x

xF

2

Page 3: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 3a. Let X be uniformly distributed over (α, β). Find (a) E[X] and (b) Var(X).

• The expected value of a random variable uniformly distributed over some interval is equal to the midpoint of that interval.

2

)(2

)(][ )a(

22

dxx

dxxxfXE

3

Page 4: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

4

)(

3)(Var

3

)(3

1][

][ calculatefirst we),Var( find To (b)

222

22

33

22

2

X

dxxXE

XEX

4

Page 5: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 3b. If X is uniformly distributed over (0, 10), calculate the probability that (a) X < 3, (b) X > 6, and (c) 3 < X < 8.

• f(x) = 1/10, 0 ≤ x ≤ 10.

10/3)10/1()3( )a(3

0 dxXP

10/4)10/1()6( )b(10

6 dxXP

2/1)10/1()83( )c(8

3 dxXP

5

Page 6: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 3c. Buses arrive at a specified stop at 15-minute intervals starting at 7AM. That is, they arrive at 7, 7:15, 7:30, 7:45, and so on. If a passenger arrives at the stop at a time that is uniformly distributed between 7 and 7:30, find the probability that he waits

(a) less than 5 minutes for a bus;

(b) more than 10 minutes for a bus.

f(x) = 1/30, 0 ≤ x ≤ 30.

3/130

1

30

1)3025()1510( )a(

30

25

15

10 dxdxXPXP

3/130

1

30

1)2015()50( )b(

20

15

5

0 dxdxXPXP

6

Page 7: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Normal Random Variables

• The distribution associated with Normal random variable is called Normal distribution.

• It was first studied by French mathematician Abraham DeMoivre.

• Carl Friedrich Gauss analyzed astronomical data using Normal distribution and defined the equation of its probability density function.– The distribution is also called Gaussian distribution.

2 2( ) / 21( )

2xf x e

7

Page 8: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Importance of Normal Distribution

• Describes many random processes of continuous phenomena

– Height of a man, velocity of a molecule in gas, error made in measuring a physical quantity.

• Can be used to approximate discrete probability distributions– Example: binomial

• Basis for classical statistical inference

– Central limit theorem.

8

Page 9: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Normal Distribution

X

f(X)

X

f(X)

2 2( ) / 21( )

2xf x e

= Mean of random variable x = Standard deviation = 3.14159…e = 2.71828…

• ‘Bell-shaped & symmetrical

• Random variable has infinite range

• Mean measures the center of the distribution

• Standard deviation measures the spread of the distribution

9

Page 10: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Effect of Varying Parameters ( & )

X

f(X)

CA

B

A: = 3.7 =1B: = 3.7 =0.5C: = 5.3 =1 10

Page 11: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• If X is normally distributed with parameter μ and σ2, then Y = aX + b is normally distributed with parameters aμ + b and (aσ)2.

)(

)(

)(

)()(

a

bxF

a

bxXP

xbaXP

xYPxF

X

Y

])(2/))((exp[2

1

])(2/)(exp[2

1

]2/)(exp[2

1

)(1

)(

22

22

22

abaxa

aabxa

a

bx

a

a

bxf

axf XY

11

Page 12: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Standard Normal

• Normal distribution with parameter (0, 1), N(0,1), is also called standard normal.

• If X is N(μ, σ2), then Z = (X - μ)/σ is standard normal.

2/2

2

1)( xexf

12

Page 13: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 4a. Find E[X] and Var[X] when X is a normal random variable with parameters μ and σ2.

0

|2

1

2

1

)(][

have wenormal, standardFor

2/

2/

2

2

x

x

Z

e

dxxe

dxxxfZE

13

Page 14: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

1 2

1

)|(2

1)(Var

gives )( partsby n Integratio

2

1

][)(Var

2/

2/2/

2

2/2

2

2

22

2

2

dxe

dxexeZ

xex,dvu

dxex

ZEZ

x

xx

/-x

x

b

a

ba

b

adxxgxfxgxfdxxgxf )()(|)]()([)()(

:partsby n Integratio

''

14

Page 15: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Because X = μ + σZ,

E[X] = μ + σE[Z] = μ

Var(X) = σ2Var(Z) = σ2.

15

Page 16: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

For negative values of x:

For standard normal: P(Z ≤ -x) = P(Z > x)

For X ~ N(μ, σ)

dyex

xx y

2/2

2

1)(

).Φ(by denoted is variablerandom normal

standard a offunction on distributi cumulative The

xxx - )(1)(

)()()()(

aaXPaXPaFX

16

Page 17: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Φ(x) can be found from the table for standard normal distribution.

17

Page 18: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 4b. If X is a normal random variable with parameter μ = 3 and σ2 = 9, find (a) P(2 < X < 5); (b) P(X > 0); (c) P(|X-3| > 6).

3779.

)6293.1(7486.

3

11

3

2

3

1

3

2

)3

2

3

1(

)3

35

3

3

3

32()52(

)a(

ZP

XPXP

18

Page 19: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

8413.)1(

)1(1

)1(

)3

30

3

3()0( )b(

ZP

XPXP

0456.)]2(1[2

)2()2(1

)2()2(

)3

33

3

3()

3

39

3

3(

)3()9()6|3(|

)c(

ZPZP

XP

XP

XPXPXP

19

Page 20: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 4c. An examination is often regarded as being good if the test scores of those taking the examination can be approximated by a normal density function.

• The instructor often uses the test scores to estimate the normal parameters μ, and σ2 and then assign the letter grade A to those whose test score is greater than μ + σ, B to those whose score is between μ and μ + σ, C to those whose score is between μ - σ and μ, D to those whose score is between μ - 2σ and μ - σ, and F to those getting a score below μ - 2σ. This is sometimes referred to as grading “on the curve”.

20

Page 21: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Approximately 16 percent of the class will receive an A grade on the examination, 34 percent a B grade, 34 percent a C grade, and 14 percent a D grade; 2 percent will fail.

0228.)2()2()2(

1359.)1()2()12()2(

3413.)1()0()01()(

3413.)0()1()10()(

1587.)1(1)1()(

XPXP

XPXP

XPXP

XPXP

XPXP

21

Page 22: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 4e. Suppose that a binary message – either 0 or 1 must be transmitted by wire from location A to location B. However, the data sent over the wire are subject to a channel noise disturbance, so to reduce the possibility of error, the value 2 is sent over the wire when the message is 1 and the value -2 is sent when the message is 0. If x, x = ±2, is the value sent at location A, then R, the value received at location B is given by R = x + N, where N is the channel noise disturbance. When the message is received at location B the receiver decodes it according to the following rule:If R ≥ .5, then 1 is concludedIf R < .5, then 0 is concluded.Assuming the channel noise is normally distributed, determine the error probabilities when N is a standard normal random variable.

22

Page 23: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• There are two types of errors: one is that the message 1 can be incorrectly concluded to be 0, and the other that 0 is concluded to be 1. The first type of error will occur if the message is 1 and 2 + N<.5, whereas the second will occur if the message is 0 and -2 + N ≥ .5.

.0668(1.5)-1-1.5)( 1) is message|error( NPP

.0062(2.5)-12.5)( 0) is message|error( NPP

23

Page 24: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Normal Approximation to the Binomial Distribution

• When n is large, a binomial random variable with parameter n and p will have approximately the same distribution as a normal random variable with the same mean and variance.

24

Page 25: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 4f. Let X be the number of times that a fair coin, flipped 40 times, lands heads. Find the probability that X = 20. Use the normal approximation and then compare it to the exact solution.

• Since binomial is discrete and normal is continuous, we need to apply a continuity correction

– we compute P(i-1/2 < X < i+1/2) instead of P(X = i).

1254.2

1

20

40)20(

:is Binomial usingresult Exact

1272.)16.()16(.

)16.10

2016.(

)10

205.20

10

20

10

205.19(

)5.205.19()20(

40

XP

XP

XP

XPXP

25

Page 26: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 4g. The ideal size of a first-year class at a particular college is 150 students. The college, knowing from past experience that on the average only 30 percent of those accepted for admission will actually attend, uses a policy of approving the applications of 450 students. Compute the probability that more than 150 first-year students attend this college.

0559.0

)59.1(1

)7)(.3(.450

)3(.4505.150

)7)(.3(.450

)3(.450)5.150(

XPXP

26

Page 27: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 4h. To determine the effectiveness of a certain diet in reducing the amount of cholesterol in the bloodstream, 100 people are put on the diet. After they have been on the diet for a sufficient length of time, their cholesterol count will be taken. The nutritionist running this experiment has decided to endorse the diet if at least 65 percent of the people have a lower cholesterol count after going on the diet. What is the probability that the nutritionist endorses the new diet if, in fact, it has no effect on the cholesterol level?

0019.

)9.2(1

9.2)2/1)(2/1(100

)2/1)(100(

)5.64(2

1100100

65

100

XP

XPii

27

Page 28: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Exponential Random Variables

• pdf of exponential random variable

• The distribution of the amount of time until some specific event occurs.– The amount of time until an earthquake occurs.

0 if 0

0 if )(

x

xexf

x

28

Page 29: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Exponential Distribution

29

Page 30: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 5a. Let X be an exponential random variable with parameter λ. Calculate (a) E[X] and (b) Var(X).

a

ax

a x

e

e

dxe

aXPaF

1

|

)()(

:functionon Distributi

0

0

30

Page 31: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

22

1

0

1

0

10

0

/2][)/2(][

/1][

gives 2, then and 1, Letting

][

0

|][

yields ) ( partsby gIntegratin

][

0 if 0

0 if )(

XEXE

XE

nn

XEn

dxexn

dxenxexXE

xu,edv

dxexXE

x

xexf

n

xn

xnxnn

nx

xnn

x

22

2/1

12)(Var

X

dxduvuvdxudvb

a

ba

b

a |

:partsby n Integratio

31

Page 32: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 5b. Suppose that the length of a phone call in minutes is an exponential random variable with parameter λ = 1/10. If someone arrives immediately ahead of you at a public telephone booth, find the probability that you will have to wait

(a) more than 10 minutes;

(b) between 10 and 20 minutes.

1)10/1(10 )1(1)10(1)10( )a( eeFXP

21)10()20(

)10()20()2010( )b(

eeFF

XPXPXP

aeaF 1)(

32

Page 33: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Memory of A Random Variable

• We say a nonnegative random variable X is memoryless if

0 , allfor )()|( tssXPtXtsXP

)()()(

or

)()(

),(

tXPsXPtsXP

sXPtXP

tXtsXP

.memoryless are variablesrandom lexponentia , Since )( tsts eee

33

Page 34: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 5c. Consider a post office that is staffed by two clerks. Suppose that Ms. Jones is being served by one of the clerks and Mr. Brown by the other. Suppose also that Mr. Smith is told that his service will begin as soon as either Jones or Brown leaves. If the amount of time that a clerk spends with a customer is exponentially distributed with parameter λ. what is the probability that, of the three customers, Mr. Smith is the last to leave the post office?

• Because exponential random variable is memoryless, the probability of Mr. Smith is the last to leave the post office is 1/2.

34

Page 35: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 5d. Suppose that the number of miles that a car can run before its battery wears out is exponentially distributed with an average value of 10,000 miles. If a person desires to take a 5000-mile trip, what is the probability that he or she will be able to complete the trip without having to replace the battery? What can be said when the distribution is not exponential?

The remaining lifetime of the battery is exponential with parameter 1/10 (in thousands of miles).

604.)5(1)5lifetime remaining( 2/15 eeFP

)(1

)5(1

)lifetime(

)lifetime ,5lifetime()lifetime|5lifetime(

l,exponentianot ison distributi lifetime theIf

tF

tF

tP

ttPttP

35

Page 36: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Gamma Distribution

• Gamma distribution is often used as the distribution of the amount of time one has to wait until a total of n events has occurred.– A generalization of exponential distribution

)!1()(

)(

0 0

0 )(

)()(

0

1

1

nn

dyye

x

xxe

xf

y

x

36

Page 37: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Gamma Distribution

37

Page 38: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 6a. Let X be a gamma variable with parameters α and λ. Calculate (a) E[X] and Var(X).

( 1)[ ]

( )E X

1

0

1

0

1[ ] ( )

( )

1 ( )

( )

( )

( )

k k x

x kk

k

E X x e x dx

e x dx

k

22 2

( 2) ( 1)[ ]

( )E X

222 ])[(][)(Var

XEXEX

38

Page 39: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Gamma Distribution – Special Cases

• When α = 1, the distribution reduce to exponential.

• When λ = 1, α = n/2, the distribution is also called chi-square distribution with n degree of freedom.– Model errors involved in attempting to hit a target in n

dimensional space when each coordinate error is normally distributed.

– Comparison of categorical data.

1 ,)()(

)()(

1

x

x

exfxe

xf

39

Page 40: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Beta Distribution

• Used to model a random phenomenon whose set of possible values is some finite interval [c, d] – which can be transformed into the interval [0, 1].

• Frequently used in Bayesian inference.

)(

)()(),(

otherwise 0

10 )1(),(

1)(

11

ba

babaB

xxxbaBxf

ba

40

Page 41: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Beta Distribution

41

Page 42: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Distribution of a Function of a Random Variable

• Sometimes we would like to know the distribution function of g(X) when the pdf of X is known.

• Ex 7a. Let X be uniformly distributed over (0,1). What is the distribution function of the random variable Y, defined by Y = Xn?

42

Page 43: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Distribution function

• Probability density function

n

nX

n

n

Y

y

yF

yXP

yXP

yYPyF

/1

/1

/1

)(

)(

)(

)()(

10 )/1()( 1/1 yynyf nY

43

1

0

)(

x

xx

x

xF

Page 44: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

• Ex 7b. If X is a continuous random variable with probability density fX, then the distribution of Y = X2 is:

)]()([2

1)(

yieldsation Differenti

)()(

)(

)(

)()(2

yfyfy

yf

yFyF

yXyP

yXP

yYPyF

XXY

XX

Y

44

Page 45: Chapter 5. Continuous Random Variables. Uniform Random Variable X is a uniform random variable on the interval (α, β) if its probability function is given

Summary of Chapter 5

• Continuous random variables• Expectation and expectation of function of random variables• Variance• Uniform random variable• Normal random variable

– Standard normal

• Other random variables– Exponential– Gamma – Beta

• Distribution function of function of random variables

45