Lesson 2: Probability Density Functions (Of Continuous Random Variables)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

LESSON 2: PROBABILITY DENSITY FUNCTIONS (OF CONTINUOUS RANDOM VARIABLES)

In the previous lesson, we knew that for discrete random variable X, which takes on a finite or
countably infinite number of possible values, there is a probability distribution (or probability mass
function)
P(X = x) for all of the possible values of X
Now, for continuous random variables, the probability that X takes on any particular value x is zero
(0). That is, finding P(X = x) for a continuous random variable X is always known to be zero (0).
Instead, we will need to find the probability that X falls in some interval (a, b), that is, we’ll need to
find P(a < X < b). We can use a curve called the probability density function f(x), for this purpose.
Example: A fast food chain would claim that a hamburger weighs 100 grams, a randomly-selected
hamburgers might weigh 98 grams while another might weigh 103 grams. What is the
probability that a randomly-selected hamburger weighs between 95 to 205 grams?
That is, if we let X denote the weight (in grams) of a randomly-selected hamburger,
what is P(95 < X < 105)?
Assume that we selected 100 hamburgers and created a histogram of the resulting
weights. Perhaps, the histogram might look something like this:
If we decreased the length of the class intervals on the histogram, then, the histogram would look
something like this:

And if we pushed further and decreased the intervals even more (and selected even more
hamburgers, say 1000 or 10,000), the intervals would eventually get so small that we could present
the probability distribution of X, not as a histogram, but as a curve (by connecting the “dots” at the
tops of the tiny rectangles) that, in this case, might look like this:

A curve is denoted as f(x) and is called a (continuous) probability density function.


Recall that when a histogram is drawn, the area of each rectangle equals the relative frequency (or
rectangle) of the corresponding class, and the area of the entire histogram equals one (1).
Finding the probability that a continuous random variable X falls in some interval of values involves
finding the area under the curve f(x) sandwiched by endpoints of the interval. In the case of this
example, the probability that a randomly-selected hamburger weighs between 95 grams and 100
grams is then this area:

Definition: Let X be a random variable, the probability density function f(x) is a function that
satisfies the following properties:
(a) The height of the graph, i.e. f(x) must be greater than or equal to zero (0) (i,e nonnegative)
for all real numbers x. That is, the graph of the equation must lie on or above the horizontal
axis for all possible values of the random variable.
(b) The total area under the curve f(x) is 1.
The definition of the probability density function of a continuous random variable is analogous to the
probability mass function (or probability distribution) of a discrete random variable, i.e the first
property is about probabilities being nonnegative, and the second property is about probabilities
adding up to 1.
We can use the probability density function to find the probability that X lies in some interval from a
to b, by considering the area under the graph of the probability density function over the interval a
to b. that is:
𝑏
𝑃(𝑎 ≤ 𝑋 ≤ 𝑏) = ∫𝑎 𝑓(𝑥)𝑑𝑥 = the area under the curve f(x) sandwiched by a and b

This is also similar to the idea that probability that X lies in some discrete set A, may be obtained by
summing the probability for the distinct values in the set A, that is:

𝑃(𝑋 ∊ 𝐴) = ∑ 𝑃(𝑋 = 𝑖)
𝑖∊𝐴
Example 1: Uniform Distribution, also called Rectangular Distribution
Suppose that your friend is always late, and that the continuous random variable X represents the
time from when you are supposed to meet your friend until he/she shows up. Suppose that your
friend could arrive “a” minute later or up to “b” minutes late with all intervals of equal time between
and being equally likely.
For example, if a = 10 and b = 60, and your friend is just as likely to be from 10 to 20 minutes late as
he/she is to be 25 to 35 minutes late. The random variable X can be any value in the interval from 10
to 60, that is, because any two intervals of equal length between 10 and 60, inclusive, are equally
likely.
The random variable X is said to follow a uniform probability distribution, with probability density
function
f(x) = c if a<x<b for some constant c
and suppose f is zero (0) outside the interval a to b.
(i) What is the value of c?
(ii) Suppose that a = 0, and b = 1, what would be P(0.1 < X < 0.3) ; P(0.5 < X < 0.7); and
(d < X < d + 0.2) assuming d > a and d + 0.2 < b?
Answer: Draw the probability density function

Since the total area under the curve (which is the area of the rectangle formed in the graph) should
up to one, then
c (b – a) = 1
Thus, c = 1/(b – a).
If a = 0, b = 1, the c = 1. In this case, show that the probabilities P(0.1 < X < 0.3) ; P(0.5 < X < 0.7); and
P(d < X < d + 0.2) assuming d > a and d + 0.2 < b would all be 0.2 because we would be forming
rectangles with a height of 1, and a width of 0.2, whose areas would be 0.2.
This is why we call this a uniform distribution. Probabilities would be uniformly on the width of the
interval.
Example 2: (Triangular Distribution)
Let X be a continuous random variable whose probability density function is
f(x) = 1 - |x| if -1 < x < 1
Verify if f is a probability density function, and calculate P(0 < X < ½)
Answer:
Draw the probability density function and observe the “triangular distribution”

Since the total area under the curve (which is the sum of two right triangles, each with area of one
half) add up to one.
Now to calculate P(0 < X < ½), always remember about the symmetry is at zero (0) (i,e. that there are
two right triangles to the left and right of zero). This means that

P(0 < X < 1) = P(-1 < X < 0) = ½

We can form a smaller right triangle from ½ to 1, whose area is (1/2) x (1/2) x (1/2 = 1/8 so that we
should know that

P(1/2 < X < 1) = 1/8

And thus, we can compute. Remember that, about the symmetry at zero (0) (i,e. that there are two
right triangles to the left and right of zero (0)). This means that

P(0 < X < ½) = P(0 < X < 1 P(1/2 < X < 1)) = (1/2) – (1/8) = 3/8

An alternative way to calculate P(0 < X < 1/2) is to remember the area of a trapezoid, the sum of the
bases multiply to half of the height. A trapezoid can be formed as shown below with bases 1 and 1/2,
and a height of ½.
1
(2)
Thus P(0 < X < ½) = (1 + (1/2) ) = 3/8
2

KEY POINTS

 For a continuous random variable X, the probability P(X = a) for some value a is
always zero (0).
 For continuous random variables, we must consider the probability that it lies in an
interval. To find this probability, we need to find the area under the probability
density function on the given interval.
 The total area under a probability density function equals 1.
 A probability density function cannot be negative, since if they were, a negative
probability could be obtained, which is not allowed.
 The probability density function is analogous to, but different form, the probability
distribution function for a discrete random variable. For the discrete case, the
probability distribution sums up to 1, while for the continuous case, the total area
under the curve is 1.
APPLICATION AND ASSESSMENT

1. Suppose that in a certain class, grades will be given in a uniform distribution where a = 80,
b = 100. Let X be the grade of a randomly-selected student,
What is:
a. P(X < 90)
b. P(X > 90)
c. P(X = 90)
d. P( 85 < X < 95)

2. Let X have a triangular distribution. Determine:

a. P(0 < X < 0.2)


b. P(X > 0.3)
c. P(0.2 < X < 0.3)
3. Let X have the following probability density function
𝑥 0≤𝑥≤1
𝑓(𝑥) = { 2 − 𝑥 1 ≤𝑥≤2
0 otherwise
Calculate P(0.5 < X < 1.3 and show the graph.
4. Let X have the following probability density function
𝑥
0<𝑥<2
𝑓(𝑥) = {10
0 otherwise
Find P(X > 1) and show the graph.
5. Let X have the following probability density function
𝑥
1<𝑥<𝑘
𝑓(𝑥) = { 4
0 otherwise
Determine k and show the graph.

You might also like