• No results found

Probability from the Probability Density Function

Probability Distributions of Continuous Variables

6.1 Probability from the Probability Density Function

(a) Basic Relationships

The probability that a continuous random variable will be between limits a and b is given by an integral, or the area under a curve.

b

< < x

Pr

[

a X b

]

=

a f

( )

dx (6.1)

The function f(x) in equation 5.1 is called a probability density function. The probability that the continuous random variable, X, is between a and b corresponds to the area under the curve representing the probability density function between the limits a and b. This is the cross-hatched area in Figure 6.1. Compare this relation

with the relation for the probability that a discrete

Area gives probability

random variable is

Probability between limits a

Density and b, which is the

Function,

sum of the prob­

f(x)

ability functions for all values of the variable X between a and b,

p x

a b

( )

i .

x a x≤ ≤b i

Figure 6.1: Probability for a Continuous Random Variable

The cumulative distribution function for a continuous random variable is given by the integral of the probability density function between x = –∞ and x = x1, where x1 is a limiting value. This corresponds to the area under the curve from –∞ to x1. The cumulative distribution function is often represented by F(x1) or F(x).

x1

1 x1

Pr

[

X x

]

= F

( )

=−∞

f

(

x

)

dx (6.2)

This expression should be compared with the expression for the cumulative distribution function for a discrete random variable, which is given by equation 5.1 to be

p x

( )

i . Thus, a summation of individual probabilities (for a discrete case)

x x1

corresponds to an integral of the probability density function with respect to the variable (for a continuous case).

( )

f

(

x

)

dx (6.3)

i.e.,

p xi

(Discrete) (Continuous)

To include all conceivable values of the variable X, the limits in equation 6.2 become from x = –∞ to x = +∞. The probability of a value is that interval must be 1.

Then we have

+∞

∞ =

f

(

x

)

dx= 1 (6.4)

F

( )

−∞

In many cases only values of the variable in a certain interval are possible. Then outside that interval, the probability density function is zero. Intervals in which the probability density function is identically zero can be omitted in the integration.

Since any probability must be between 0 and 1, as we have seen previously, the probability density function must always be positive or zero, but not negative.

( )

≥ 0 (6.5)

f x

Example 6.1

A probability density function is given by:

f(x) = 0 for x < 0 f(x) 2 f(x) = 3x2 for 0 < x < 2 1.5

8

f(x) = 0 for x > 2

A graph of this density function is 1

shown in Figure 6.2.

0.5

0

0 0.5 1 1.5 2 2.5

x

It is not hard to show that f(x) meets the requirements for a probability density function. First, since x2 is always positive for any real value of x, f(x) is always greater than or equal to zero. Second, the integral of the probability density function from –∞ to +∞ is equal to 1, as we can show by integration:

(b) A Simple Illustration: Waiting Time

A student arrives at a bus stop and waits for the bus. He knows that the bus comes every 15 minutes (which we will assume is exact), but he doesn’t know when the next bus will come. Let’s assume the bus is as likely to come in any one instant as in any other within the next 15 minutes. Let the time the student has to wait for the bus be x minutes. Let us first explore the probabilities intuitively, and then apply equa­

tions 6.1 and 6.2.

i) What is the probability that the waiting time will be less than or equal to 15 minutes?

Since we know that the bus comes every 15 minutes, this probability must be 1.

ii) What is the probability that the waiting time will be less than 5 minutes?

Since the bus is as likely to come in any one instant as in any other to a maxi­

mum of 15 minutes, the probability that the waiting time is less than 5 minutes 5 1

must be = . 15 3

Similarly, the probability that the waiting time is less than 10 minutes must be 10 2

15 3 = .

iii) Then we can generalize the expression for probability. The probability that the waiting time will be less than x minutes, where 0 ≤ x ≤ 15, must be x .

15

iv) What is the probability that the waiting time will be between 5 minutes and 10 minutes? This must be:

Pr [5 < x < 10] = Pr [x < 10] – Pr [x < 5]

10 5 5 1

= − = or .

15 15 15 3

Comparison to equation 6.1 with a = 5 and b = 10 indicates that:

10

Pr 5

[

< < 10 X

]

=

f

( )

x dx= 10 −15 15 5

5 x

What simple expression for f(x) will integrate with respect to x to give 15 ? It must be 1.

15

Then the probability density function must be given by:

f(x) = 0 for x < 0 (since waiting time can’t be negative).

f(x) = 1 for 0 < x < 15 15

f(x) = 0 for x > 15 (since waiting time can’t be more than 15 minutes) Let’s check the integral of f(x) for x between 0 and 15, the only interval for which

151 15− 0

f(x) is not equal to zero. We have

015 dx = 15 = 1 (as required), so the constant value, 1 , is correct.

15

v) By comparison to equation 6.2 the probability that the waiting time will be less than 5 minutes must be: This agrees with part ii.

vi) Using the expressions for the probability density function from part iv, the general expression for the cumulative distribution function for this illustration must be:

0 15

= + + 0 15

The probability density function and the cumulative distribution function are shown graphically in Figure 6.3.

F(x1) = 1 for x1 > 15

1/15

0 15

x, minutes

Figure 6.3 (a): Probability Density Function for Waiting Time for a Bus

0 0.2 0.4 0.6 0.8 1 1.2

-10 -5 0 5 10 15 20 25

x, minutes

Figure 6.3 (b): Cumulative Distribution Function for Waiting Time for a Bus

(c) Example 6.2

A probability density function is given by:

f(x) = 0 for x < 1 f(x) = b / x2 for 1 < x < 5 f(x) = 0 for x > 5 a) What is the value of b?

b) From this obtain the probability that X is between 2 and 4.

c) What is the probability that X is exactly 2?

d) Find the cumulative distribution function of X.

Answer:

a) To satisfy equation 6.4:

1 5

0 dx +

xb 2 dx +

0 dx = 1

−∞ 1 5

5

Therefore

b x dx −2 = 1 1

5

−1

− b x 1 = 1

 1 

−b −1 =1  5  4 b = 1 5

b = 1.25 (In Example 6.1 the constant 3

8 was obtained in the same way).

Then a graph of the density function for this example is shown below:

1.4

f(x)

1.2 1 0.8 0.6 0.4

Figure 6.4: 0.2

Graph of Function for Example 6.2 0

0 1 2 3 4 5 6

x

4

b) Pr 2

[

< < 4X

]

=

1.25 x−2dx 2

4

−1

= −1.25 x 2

(

 1 1

= −1.25

)

 −  4 2 

= 0.3125

2

c) Pr

[

X = 2 exactly

]

=

1.25 x−2dx 2

2

−1

= −1.25 x 2

= 0

Note: The result obtained here is important and applies to all continuous random variables. The probability that any continuous random variable is exactly equal to a single quantity is zero. We will see this again in Example 7.2.

x1

d) For x1 < 1: F x

(

1

)

=−∞

0 dx = 0

x1

For 1 < x1 < 5: F x

( )

1 = +0

1.25 x2dx

1

= −1.25

( )

x −1  x 11

(

= −1.25

)

 1 −1

 x1

 1 

= 1.25 1  − 

 x1

x1

For 5 < x1 < ∞: F x

( )

1 =−∞

f

(

x

)

dx

1 5 x1

0 dx +

1.25x−2 dx + 0 dx

=

∫ ∫

0 1 3

5

−1  0

(

= + − 1.25

)

x 1 + 0

(

= −1.25

)

 1 −1 5 

= 1

Then to summarize, the cumulative distribution function of X is:

0 for x1 < 1

 1 

1.25 1 −  for 0 < x1 < 5

 x1

and 1 for x1 > 5

Problems

1. A probability density function for x in radians is given by:

f(x) = 0 for x < –π/2 1

f(x) = 2cos x for –π/2 < x < π/2 f(x) = 0 for x > π/2

a) Find the probability that X is between 0 and π /4.

b) Find an expression for the corresponding cumulative distribution function, F(x), for –π /2 ≤ x ≤ π /2.

c) If x = π /2, what is the value of f(x)? Explain why this is or is not a reason­

able result.

d) What is the probability that X is exactly π /4? Explain why this is or is not a reasonable result.

e) Repeat part (a) using F(x).

2. A probability density function is given by:

f(x) = 0 for x < –2 f(x) = 1/3 for –2 < x < 0

1  x f(x) =  1 − 

for 0 < x < 2 3  2 

f(x) = 0 for x > 2

a) What is the probability that X is between 0 and +1?

b) Find the cumulative distribution function of X for each interval. Is the cumulative distribution function for x > 2 reasonable? Why?

c) Sketch the cumulative distribution function, showing scales.

d) Use the results of part b to find the probabi1ity that X is between 0 and 1.

f) Find the median of this probability distribution.

3. A radar telemetry tracking station requires a vast quantity of high-quality mag­

netic tape. It has been established that the distance X (in meters) between tape-surface flaws has the following probability density functions:

f(x) = 0.005 e–0.005 x x ≥ 0

f(x) = 0 otherwise

a) Plot a graph of f(x) versus x for 0 ≤ x ≤ 800.

b) Find the cumulative probability distribution function,

x1

( )

=

f

(

x

)

dx for x > 0.

F xi 1

c) Suppose one flaw in the tape-surface has been identified. Calculate: −∞

(i) the probability that an additional flaw will be found within the next 100 m of tape.

(ii) the probability that an additional flaw will not be found for at least 200 m.

(iii) the probability that an additional flaw will be found between 100 and 200 m from the flaw already identified.

4. A continuous random variable X has the following probability density function:

f(x) = k x1/3 for 0 < x < 1 f(x) = 0 for x < 0 and x > 1 a) Find k.

b) Find the cumulative distribution function.

c) Find the probability that 0.3 < X < 0.6.