Chapter 5

Continuous Random Variables As we have seen in Chapter 1, continuous random variables arise when dealing 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 continuous 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 experiment, 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 observation, 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, denoted 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: •

Rb

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

a

111

CHAPTER 5. CONTINUOUS RANDOM VARIABLES

112 •

Ra

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

a

Recall that the definite integral of a positive continuous function is the area between its curve an the x-axis. Therefore, the probability that a continuous random variable obtains a value on an interval from a to b is equal to the area under the curve of the pdf 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 ( x 2 , for 0 ≤ x ≤ 2 f (x) = 0, otherwise • We can verify that the given function is a pdf since, – f (x) ≥ 0, for every x ∈ R. and h 2 i2 +∞ R R2 x – f (x) dx = x2 dx = 2·2 = −∞

0

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 R 1

– P (X < 1.5) =

1.5 R 0

– P (X ≥ 0.25) =

x 2

R2 0.25

– P (X < 3) = 1.

x 2

h dx = h

dx = x 2

i1.5 x2 2·2 1

i1.5 x2 2·2 0 h

dx =

=

i2 x2 2·2 0.25

=

1.52 4

=

1.52 4



12 4

= 0.3125

− 0 = 0.5625

22 4



0.252 4

= 0.984375

5.1. PROBABILITY DISTRIBUTIONS Example 5.1.2 (for practice) Consider a random variable X with pdf ( c · x2 , for − 1 ≤ x ≤ 1 f (x) = 0, 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)

113

CHAPTER 5. CONTINUOUS RANDOM VARIABLES

114

5.2 Cumulative distribution function Similarly to the discrete rv case, we can define the cumulative distribution function (cdf) in the case of continuous rv in the following way Zx F (x) = P (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) =

d dx F (x).

We note that F (x) can be calculated from f (x) using integration and f (x) can be calculated from F (x) using differentiation. Example 5.2.1 Let as consider the random variable of Example 5.1.1 with pdf ( x 2 , for 0 ≤ x ≤ 2 f (x) = 0, otherwise The cdf of X can be calculated as follows: Rx

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

f (x) dx

−∞

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

Rx x 0

2

h dx =

ix x2 4 0

=

x2 4 ;

• For x > 2: F (x) = 1. Therefore, we can write F (x) =

   0,

x2 4 ,

  1,

for x < 0 for 0 ≤ x ≤ 2 for x > 0.

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

5.2. CUMULATIVE DISTRIBUTION FUNCTION • P (X < 1.5) = F (1.5) =

1.52 4

115

= 0.5625

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

1.52 4

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



12 4

0.52 4

= 0.3125

= 0.9375

Example 5.2.2 (for practice) Consider the random variable of Example 5.1.2 with pdf ( 2 3x 2 , for − 1 ≤ x ≤ 1 f (x) = 0, 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)

CHAPTER 5. CONTINUOUS RANDOM VARIABLES

116

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 in the case of a discrete rv, substituting the summation with an integral. That is,

E(X) = µX

+∞ Z = xf (x) dx −∞

V ar(X) =

2 σX

+∞ Z = x2 f (x) dx − µ2X −∞

Finally the standard deviation of a random variable can be calculated by q 2 . σX = σX Example 5.3.1 In Example 5.2.1 we considered the rv X with the following pdf ( x 2 , for 0 ≤ x ≤ 2 f (x) = 0, otherwise The mean and the variance of X can be calculated as follows: E(X)

= µX =

2 = V ar(X) = σX

=

R2 0

x3 2

+∞ R −∞ +∞ R −∞

dx −

xf (x) dx =

R2



0

x 2

x2 f (x) dx − µ2X = 16 9

h =

Finally, σX =

i2 x4 4·2 0



16 9

dx = R2

R2 0

x2 ·

0

=

16 8



x 2

x2 2

h dx =

dx −

¡ 16 ¢ 9

i2 x3 2·3 0

=

8 6

= 43 ,

¡ 4 ¢2 3

= 0.222.

q √ 2 = σX 0.222 = 0.47.

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

5.4. CONTINUOUS DISTRIBUTIONS

117

5.4 Continuous Distributions In the following sections we will study two special continuous distributions, the normal distribution and the exponential distribution.

5.4.1

Normal Distribution

The Normal distribution plays a fundamental role in statistics. The Normal distribution, 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 probability density function is 1 2 2 f (x) = √ · e−(x−µ) /2σ , x ∈ R 2πσ 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 that attains 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 area bounded 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%;

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 of p X 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 variable 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 electrical part will be from 80 to 120 hours. • There is 95.44% chance that the lifetime of a randomly selected electrical part will be from 60 to 140 hours. • There is 99.74% chance that the lifetime of a randomly selected electrical part will be from 40 to 160 hours. Standard Normal Distribution A normal distribution with µ = 0 and σ = 1 is called standard normal distribution and 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 tables Probabilities relating to the standard normal distribution are obtained from special

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 vales of 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 evaluated using 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 the above results. f. Let X ∼ N (µ, σ 2 ). To calculate any probability of X we transform it into Z and then we use one of the identities (a) - (e) to be albe to use the table. For example, µ ¶ µ ¶ X −µ c−µ c−µ P (X < c) = P < =P Z< σ σ σ 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

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, ¡ ¢ 7−5 a. P (X < 7) = P X−4 = P (Z < 1) = 0.8413 2 < 2 ¡ ¢ b. P (X ≥ 6) = P Z ≥ 6−5 = P (Z ≥ 0.5) = 1 − P (Z < 0.5) 2 = 1 − 0.6915 = 0.3085 ¡ ¢ 5−5 < Z < c. P (1 < X < 5) = P 1−5 2 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 is randomly 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.

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 exponential distribution. The pdf of an exponential distribution has the form ( λe−λx , for x ≥ 0 f (x) = 0, x 0 is the parameter of the distribution, often called the rate parameter.

fX

X

Figure 5.5: Exponential pdf curve.

Properties of Exponential Distribution If X is an Exponential random variable with parameter λ > 0 then a. The cdf of X is given by ( F (x) =

b. E(X) = µX =

1 − e−λx , for x ≥ 0 0, x 3000) = 1 − P (X < 3000) = 1 − F (3000) ¡ ¢ = 1 − 1 − e−λ·3000 1 3000 = e− 15000 = e− 5 = 0.8187 • The probability that the car will travel from 10000 to 15000 thousands miles until the battery is damaged is P (10000 < X < 15000) = F (15000) − F³(10000) = 1−e = e

− 23

− 15000 15000



e−1

− 1−e = 0.1455

− 10000 15000

´

5.4. CONTINUOUS DISTRIBUTIONS

123

CHAPTER 5. CONTINUOUS RANDOM VARIABLES

124

5.5 Summary of Chapter 5 Continuous Random Variables

Probability Density Function : Z f (x) such that P (X ∈ A) =

f (x) dx A

Properties and their consequences: • f (x) ≥ 0, for every x ∈ R. and •

R∞

f (x) dx = 1.

−∞



Rb

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

a



Ra

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

a

Cumulative Distribution Function: Zx F (x) = P (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) =

d dx F (x).

Mean and Variance: Z∞ E(X) = µ =

x · f (x) dx, −∞

Z∞ 2

x2 · f (x) dx − µ2 .

V ar(X) = σ = −∞

5.5. SUMMARY OF CHAPTER 5

Normal Distribution If X ∼ N ormal(µ, σ 2 ) the pdf of X is: 1 2 2 f (x) = √ · e−(x−µ) /2σ , x ∈ R, −∞ < µ < ∞, σ > 0. 2πσ 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 Distribution If X with rate parameter λ > 0: ( f (x) =

λe−λx , for x ≥ 0 0, x