While in the discussion about discrete random variables there is a term *probability function* or *probability mass function*, in the discussion about continuous random variables there is a term *probability density function *or briefly *density function*. Let’s look at a definition.

**Definition**

The function *f* is said to be a * probability density function *for the continuous random variable

**X**, defined over the set of all real numbers , if the following conditions are satisfied: 1) for each , 2) , and 3) . The expression P(

*a*<

**X**<

*b*) here denotes the probability that a<

**X**<b, that is, the probability that the value of

**X**is between

*a*and

*b*.

By the definition, the definite integral is nothing but the area bounded by: 1) curve of *f* , 2) the x- axis, 3) the vertical lines with equations x = *a* and x = *b*. (See Figure 1.)

**Figure 1**

**Example 1**

During the Covid-19 pandemic, a store is allowed to operate for a maximum of 120 minutes, which is from 08:00 to 10:00. Customers must not be in the store before 08:00 and must leave the store by 10:00. Let **X** be a random variable indicating the length of time (in minutes) a customer is in the store. The probability density function of **X** is as follows.

What is the probability that a customer will be in the store: a) between 10 and 90 minutes?, b) between 30 and 60 minutes? c) less than 20 minutes? d) more than 12 minutes?

**Answer**

By evaluating the definite integrals, we have the following:

Bearing in mind that definite integrals can be viewed as the areas under curves and above the x-axis, the integral in part a is the area of the shaded region in Figure 2.

**Figure 2**

The definite integral in part a can be determined by calculating the area of the shaded rectangle above, with length (90 – 10) = 80 and width . The area of the rectangle is . Similar to part a, the definite integral in part b can be viewed as the area of the shaded region in Figure 3.

**Figure 3**

Verify that the definite integral in part b, i.e. 0.25, can be obtained by calculating the area of the rectangle with length (60 – 30) = 30 and width as shown in Figure 3.

**Example 2**

In a bet, let **X** be the amount of money won (in IDR). The probability density function of **X** is given as follows:

What is the probability that someone who joins the bet: a) wins more than IDR 2, b) loses.

**Answer**

The probability density function for **X** can be portrayed as follows.

**Figure 4**

To answer part a, we calculate the area of the triangle in the figure below.

**Figure 5**

The length of base of the triangle is (4 – 2) = 2 and the length of altitude of the triangle is *f*(2) = 0.08 – (0.02)⋅2 = 0.04. Thus, the area of the triangle is . So, the probability that he or she wins more than IDR 2 is 0.04.

Another way to solve part a is by evaluating the definite integral as shown below.

Note that the result is equal to the area of the triangle in Figure 5.

To answer part b, we calculate the area of the trapezoid in Figure 6.

**Figure 6**

Note that the length of AD = *f *(-6) = 0.08 – 0.02⋅(-6) = 0.2, the length of BC = *f *(0) = 0.08 – 0.02⋅(0) = 0.08, and the length of AB = 6. Consequently, the area of the trapezoid ABCD is

If the definite integral is to be used, part b is solved as follows.