17
Chapter 5 Continuous Random Variables As we have seen in Chapter 1, continuous random variables arise when deal- ing with quantities that are measured on a continuous scale. For example, when we consider the height of a unit, the speed of a car, the consumption of electrical power etc. In the previous chapter we have seen that the outcomes in the sample space of an experiment are sometimes not numerical. In this chapter we see the basic properties and some specific distributions of con- tinuous random variables. In the previous chapter we introduced the concept of a random variable. As we have seen, rv’s are real valued functions defined over a sample space of an experi- ment, which in the continuous case has a continuous scale. Usually, in the case of continuous rv’s the value of the rv is given directly by a measurement or observa- tion, and thus we do not differentiate the rv and the outcome of the experiment. 5.1 Probability Distributions The probability density function (pdf) of a continuous random variable X , de- noted by f (x), completely specifies its probability characteristics. The pdf has the following properties: f (x) 0, for every x R. and +R -∞ f (x) dx =1. Two immediate consequences that are useful in calculating probabilities are: b R a f (x) dx = P (a X b). 111

Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

Chapter 5

Continuous Random Variables

As we have seen in Chapter 1, continuous random variables arise when deal-ing with quantities that are measured on a continuous scale. For example, whenwe consider the height of a unit, the speed of a car, the consumption of electricalpower etc. In the previous chapter we have seen that the outcomes in the samplespace of an experiment are sometimes not numerical.

In this chapter we see the basic properties and some specific distributions of con-tinuous random variables.In the previous chapter we introduced the concept of a random variable. As wehave seen, rv’s are real valued functions defined over a sample space of an experi-ment, which in the continuous case has a continuous scale. Usually, in the case ofcontinuous rv’s the value of the rv is given directly by a measurement or observa-tion, and thus we do not differentiate the rv and the outcome of the experiment.

5.1 Probability Distributions

The probability density function (pdf) of a continuous random variable X , de-noted by f(x), completely specifies its probability characteristics. The pdf has thefollowing properties:

• f(x) ≥ 0, for every x ∈ R. and

•+∞∫−∞

f(x) dx = 1.

Two immediate consequences that are useful in calculating probabilities are:

•b∫a

f(x) dx = P (a ≤ X ≤ b).

111

Page 2: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES

•a∫a

f(x) dx = P (X = a) = 0, for every a ∈ R

Recall that the definite integral of a positive continuous function is the area betweenits curve an the x-axis. Therefore, the probability that a continuous random variableobtains a value on an interval from a to b is equal to the area under the curve of thepdf and above the x-axis as illustrated in the following figure:

Figure 5.1: Probability equivalent to the area under the curve.

Example 5.1.1 Consider a random variable X with pdf

f(x) =

{x2 , for 0 ≤ x ≤ 20, otherwise

• We can verify that the given function is a pdf since,

– f(x) ≥ 0, for every x ∈ R. and

–+∞∫−∞

f(x) dx =2∫0

x2 dx =

[x2

2·2]2

0= 4

4 − 0 = 1.

• Using the pdf we can calculate the following probabilities:

– P (X = 1) = 0

– P (1 ≤ X ≤ 1.5) =1.5∫1

x2 dx =

[x2

2·2]1.5

1= 1.52

4 − 12

4 = 0.3125

– P (X < 1.5) =1.5∫0

x2 dx =

[x2

2·2]1.5

0= 1.52

4 − 0 = 0.5625

– P (X ≥ 0.25) =2∫

0.25

x2 dx =

[x2

2·2]2

0.25= 22

4 − 0.252

4 = 0.984375

– P (X < 3) = 1.

Page 3: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

5.1. PROBABILITY DISTRIBUTIONS 113

Example 5.1.2 (for practice) Consider a random variable X with pdf

f(x) =

{c · x2, for − 1 ≤ x ≤ 10, otherwise

1. Show that c = 32 .

2. Calculate the following probabilities:

(a) P (X = 0.5)

(b) P (−0.5 ≤ X ≤ 0.25)

(c) P (X < 0.75)

(d) P (X ≥ 0)

(e) P (0 < X < 3)

Page 4: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

114 CHAPTER 5. CONTINUOUS RANDOM VARIABLES

5.2 Cumulative distribution function

Similarly to the discrete rv case, we can define the cumulative distribution func-tion (cdf) in the case of continuous rv in the following way

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

x∫

−∞f(x) dx.

The cumulative distribution function has the following properties:

• It is an increasing function.

• F (−∞) = 0 and F (∞) = 1.

• 0 ≤ F (x) ≤ 1 .

Two immediate consequences are:

• P (a ≤ X ≤ b) = F (b)− F (a)

• f(x) = ddxF (x).

We note that F (x) can be calculated from f(x) using integration and f(x) can becalculated from F (x) using differentiation.

Example 5.2.1 Let as consider the random variable of Example 5.1.1 with pdf

f(x) =

{x2 , for 0 ≤ x ≤ 20, otherwise

The cdf of X can be calculated as follows:

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

−∞f(x) dx

• For x < 0: F (x) = 0;

• For 0 ≤ x ≤ 2: F (x) =x∫0

x2 dx =

[x2

4

]x

0= x2

4 ;

• For x > 2: F (x) = 1.

Therefore, we can write

F (x) =

0, for x < 0x2

4 , for 0 ≤ x ≤ 21, for x > 0.

Using the cdf we can obtain the following probabilities (without having to integratethe pdf):

Page 5: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

5.2. CUMULATIVE DISTRIBUTION FUNCTION 115

• P (X < 1.5) = F (1.5) = 1.52

4 = 0.5625

• P (1 < X ≤ 1.5) = F (1.5)− F (1) = 1.52

4 − 12

4 = 0.3125

• P (X ≥ 0.25) = 1− P (X < 0.25) = 1− 0.52

4 = 0.9375

Example 5.2.2 (for practice) Consider the random variable of Example 5.1.2 withpdf

f(x) =

{3x2

2 , for − 1 ≤ x ≤ 10, otherwise

1. Define the cdf of X .

2. Using the cdf, calculate the following probabilities:

(a) P (X < 0.75)

(b) P (0.25 ≤ X ≤ 0.5)

(c) P (−0.25 ≤ X ≤ 0.75)

(d) P (X ≥ 0)

(e) P (0 < X < 3)

Page 6: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

116 CHAPTER 5. CONTINUOUS RANDOM VARIABLES

5.3 Expected value and variance of a continuous rv

The mean and the variance of a continuous rv are calculated in a similar way as inthe case of a discrete rv, substituting the summation with an integral. That is,

E(X) = µX =

+∞∫

−∞xf(x) dx

V ar(X) = σ2X =

+∞∫

−∞x2f(x) dx− µ2

X

Finally the standard deviation of a random variable can be calculated by

σX =√

σ2X .

Example 5.3.1 In Example 5.2.1 we considered the rv X with the following pdf

f(x) =

{x2 , for 0 ≤ x ≤ 20, otherwise

The mean and the variance of X can be calculated as follows:

E(X) = µX =+∞∫−∞

xf(x) dx =2∫0

x · x2 dx =

2∫0

x2

2 dx =[

x3

2·3]2

0= 8

6 = 43 ,

V ar(X) = σ2X =

+∞∫−∞

x2f(x) dx− µ2X =

2∫0

x2 · x2 dx− (

43

)2

=2∫0

x3

2 dx− 169 =

[x4

4·2]2

0− 16

9 = 168 −

(169

)= 0.222.

Finally,

σX =√

σ2X =

√0.222 = 0.47.

Example 5.3.2 (for practice) Consider the rv X of Example 5.1.2. Calculate themean, the variance and the standard deviation of the random variable.

Page 7: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

5.4. CONTINUOUS DISTRIBUTIONS 117

5.4 Continuous Distributions

In the following sections we will study two special continuous distributions, thenormal distribution and the exponential distribution.

5.4.1 Normal Distribution

The Normal distribution plays a fundamental role in statistics. The Normal distri-bution, its properties and some of its applications are discussed in this section.A rv X is said to be normally distributed with parameters µ and σ2, if its probabilitydensity function is

f(x) =1√2πσ

· e−(x−µ)2/2σ2, x ∈ R

where −∞ < µ < ∞ and σ > 0. We write X ∼ N(µ, σ2).

Properties of Normal Distribution

• The normal density is a bell-shaped curve that is symmetric about µ and thatattains its maximum at x = µ.

f (x)

x

Figure 5.2: Graph of Normal densities.

• The total area under the pdf curve is 1 and for X ∼ N(µ, σ2), the total areabounded by the pdf curve and the interval:

a. (µ− σ < x < µ + σ) is 68.26%;

b. (µ− 2σ < x < µ + 2σ) is 95.44%;

c. (µ− 3σ < x < µ + 3σ) is 99.74%;

Page 8: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

118 CHAPTER 5. CONTINUOUS RANDOM VARIABLES

Figure 5.3: Areas under the normal curve.

• For X ∼ N(µ, σ2), E(X) = µ, V ar(X) = σ2 and standard deviation ofX is

√V ar(X). That is, the parameters µ and σ2 are respectively the mean

and the variance of X .

Example 5.4.1 The lifetime of a certain electrical part is a normal random vari-able with mean 100 hours and standard deviation 20 hour (i.e. µ = 100 andσ = 20). We have the following statements:

• There is 68.26% chance that the lifetime of a randomly selected electricalpart will be from 80 to 120 hours.

• There is 95.44% chance that the lifetime of a randomly selected electricalpart will be from 60 to 140 hours.

• There is 99.74% chance that the lifetime of a randomly selected electricalpart will be from 40 to 160 hours.

Standard Normal DistributionA normal distribution with µ = 0 and σ = 1 is called standard normal distributionand it is denoted by Z. Thus Z ∼ N(0, 1).We have the following important property:

X ∼ N(µ, σ2) then the rv Z =X − µ

σ∼ N(0, 1).

Computing probabilities using the normal tablesProbabilities relating to the standard normal distribution are obtained from special

Page 9: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

5.4. CONTINUOUS DISTRIBUTIONS 119

Figure 5.4: Standard Normal curve.

tables, such as the table given in Section 5.6. The entries of this table are the valesof the cumulative density function of Z ∼ N(0, 1)

FZ(z) = P (Z < z), for z > 0.

Any other type of probability for Z of any other normal rv X can be evaluatedusing the following properties:For a nonnegative value c,

a. P (Z < z) = P (Z ≤ z), can be read off directly from the table;

b. P (Z > z) = 1− P (Z < z);

c. P (Z < −c) = P (Z > c);

d. P (Z > −c) = P (Z < z);

e. P (a < Z < b) = P (Z < b)− P (Z < a), which can be obtained using theabove results.

f. Let X ∼ N(µ, σ2). To calculate any probability of X we transform it intoZ and then we use one of the identities (a) - (e) to be albe to use the table.For example,

P (X < c) = P

(X − µ

σ<

c− µ

σ

)= P

(Z <

c− µ

σ

)

Example 5.4.2 Let Z ∼ N(0, 1), then we have the following equalities

a. P (Z < 1.35) = 0.9115

b. P (Z > 0.78) = 1− P (Z < 0.78) = 1− 0.7823 = 0.2177

c. P (Z < −1.35) = P (Z > 1.35) = 1− P (Z < 1.35)= 1− 0.9115 = 0.0885

Page 10: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

120 CHAPTER 5. CONTINUOUS RANDOM VARIABLES

d. P (0.5 < Z < 1.2) = P (Z < 1.2)− P (Z < 0.5)= 0.8849− 0.6915 = 0.1575

e. P (−0.5 < Z < 1.35) = P (Z < 1.35)− P (Z < −0.5)= P (Z < 1.35)− P (Z > 0.5)= P (Z < 1.35)− (1− P (Z < 0.5))= 0.9115− 1 + 0.6915 = 0.603

Example 5.4.3 Let X be a normal random variable with mean 5 and variance 4(i.e. µ = 5, σ = 2). Then,

a. P (X < 7) = P(

X−42 < 7−5

2

)= P (Z < 1) = 0.8413

b. P (X ≥ 6) = P(Z ≥ 6−5

2

)= P (Z ≥ 0.5) = 1− P (Z < 0.5)

= 1− 0.6915 = 0.3085

c. P (1 < X < 5) = P(

1−52 < Z < 5−5

2

)

= P (−2 < Z < 0) = P (Z < 0)− P (Z < −2)= 0.5− P (Z > 2) = 0.5− [1− P (Z < 2)]= 0.5− 1 + 0.9772 = 0.4772

Example 5.4.4 (for practice) Consider the r.v. of Example 5.4.1. We have thatX ∼N(100, 202), where X is the lifetime of the electrical parts. If an electrical part israndomly selected, find the probability

1. That the part has less than 70 hours lifetime;

2. That the part has more than 80 hours lifetime;

3. That the part lasted between 90 and 140 hours.

Page 11: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

5.4. CONTINUOUS DISTRIBUTIONS 121

5.4.2 Exponential Distribution

Let X be the time between events in a Poisson Process. Then, X has an exponen-tial distribution. The pdf of an exponential distribution has the form

f(x) =

{λe−λx, for x ≥ 00, x < 0

where λ > 0 is the parameter of the distribution, often called the rate parameter.

Xf

X

Figure 5.5: Exponential pdf curve.

Properties of Exponential Distribution If X is an Exponential random variablewith parameter λ > 0 then

a. The cdf of X is given by

F (x) =

{1− e−λx, for x ≥ 00, x < 0

b. E(X) = µX = 1λ

c. V ar(X) = σX = 1λ2

Example 5.4.5 The number of times that a car’s battery is damaged follows aPoisson distribution with mean once every 15000 miles. Let X be the miles that acar run between consecutive damages of the battery.

• X is exponentially distributed with λ = 1/15000.

Page 12: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

122 CHAPTER 5. CONTINUOUS RANDOM VARIABLES

• If someone wants to travel 3000 miles, the chance the trip will be completedwithout any battery damage is

P (X > 3000) = 1− P (X < 3000) = 1− F (3000)= 1− (

1− e−λ·3000)

= e−300015000 = e−

15 = 0.8187

• The probability that the car will travel from 10000 to 15000 thousands milesuntil the battery is damaged is

P (10000 < X < 15000) = F (15000)− F (10000)

= 1− e−1500015000 −

(1− e−

1000015000

)

= e−23 − e−1 = 0.1455

Page 13: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

5.4. CONTINUOUS DISTRIBUTIONS 123

Page 14: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

124 CHAPTER 5. CONTINUOUS RANDOM VARIABLES

5.5 Summary of Chapter 5

Continuous Random Variables

Probability Density Function :

f(x) such that P (X ∈ A) =∫

Af(x) dx

Properties and their consequences:

• f(x) ≥ 0, for every x ∈ R. and

•∞∫−∞

f(x) dx = 1.

•b∫a

f(x) dx = P (a ≤ X ≤ b).

•a∫a

f(x) dx = P (X = a) = 0, for every a ∈ R

Cumulative Distribution Function:

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

x∫

−∞f(x) dx.

Properties and their consequences:

• It is an increasing function.

• F (−∞) = 0 and F (∞) = 1.

• It is right continuous.

• P (a ≤ X ≤ b) = F (b)− F (a)

• f(x) = ddxF (x).

Mean and Variance:

E(X) = µ =

∞∫

−∞x · f(x) dx,

V ar(X) = σ2 =

∞∫

−∞x2 · f(x) dx− µ2.

Page 15: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

5.5. SUMMARY OF CHAPTER 5 125

Normal DistributionIf X ∼ Normal(µ, σ2) the pdf of X is:

f(x) =1√2πσ

· e−(x−µ)2/2σ2, x ∈ R, −∞ < µ < ∞, σ > 0.

Mean and Variance:E(X) = µ,

V ar(X) = σ2.

Results:

a. There is 68.26% chance to get a value in (µ− σ, µ + σ);

b. There is 95.44% chance to get a value in (µ− 2σ, µ + 2σ);

c. There is 99.74% chance to get a value in (µ− 3σ, µ + 3σ);

Standard Normal r.v.: Z ∼ N(0, 1)

Exponential DistributionIf X with rate parameter λ > 0:

f(x) =

{λe−λx, for x ≥ 00, x < 0

The cdf of X is:

F (x) =

{1− e−λx, for x ≥ 00, x < 0

Mean and Variance:E(X) =

,

V ar(X) =1λ2

.

Page 16: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

126 CHAPTER 5. CONTINUOUS RANDOM VARIABLES

5.6 The Standard Normal Table

Figure 5.6: The cdf for the standard normal distribution.

Page 17: Continuous Random Variables - FITstaff.fit.ac.cy/bus.ane/amat300/Chapter5.pdf · 112 CHAPTER 5. CONTINUOUS RANDOM VARIABLES † Ra a f(x)dx = P (X = a) = 0, for every a 2 R Recall

5.7. REVIEW EXERCISES FOR CHAPTER 5 127

5.7 Review Exercises for Chapter 5

Exercise 5.7.1 The gap width is an important property of a magnetic recordinghead. In coded unit, if the width is a continuous random variable its probabilitydensity function is:

f(x) =

{k · x2, for 0 ≤ x ≤ 30, otherwise

1. Determine the constant k.

2. Determine the cumulative distribution function of the gap width.

3. Find the probability that the gap width is between 1 and 2 units.

4. Calculate the expected value and the variance of the gap width.

5. Calculate the probabilities

(a) P (X < 2)

(b) P (X ≤ 2)

(c) P (X < 2.5)

(d) P (X > 5)

(e) P (X ≥ 4.5)

(f) P (1.2 ≤ X < 4.5).

Exercise 5.7.2 The line width for semiconductor manufacturing is assumed to benormally distributed with a mean of 0.5 micrometer and a standard deviation of0.05 micrometer.

1. What is the probability that a line width is greater than 0.62 micrometer?

2. What is the probability that a line width is less than 0.4 micrometer?

3. What is the probability that a line width is between 0.47 and 0.63 microme-ter?

Exercise 5.7.3 The number of times that a system fails follows a Poisson distri-bution with mean 4 times per month. [Hint: Therefore the time between failuresfollows exponential distribution with λ = 4/1 = 4.]

1. What is the expected time until the next failure?

2. What is the probability that there will be a failure in less than half month.

3. What is the probability that there will not be a failure in a month.

4. Derive the reliability function and the failure rate function of the system.