Jump to a key chapter
Probability mass function and probability density function
You might think that because the names 'probability mass function' and 'probability density function' are so close that they really describe the same thing. Both of them do describe probabilities, and both are functions. The big difference is in what kind of random variable they are used with:
If \(X\) is a discrete random variable, then use a probability mass function, which is a summation.
If \(X\) is a continuous random variable, then use a probability density function, which is an integral.
Going forward you will see information and examples involving the probability density function for a continuous random variable \(X\). If you are interested in probability mass functions, check out the article Discrete Probability Distributions or the article on the Poisson Distribution.
Probability density function graph
First of all, what is a probability density function?
The probability density function, or PDF, of a continuous random variable \(X\) is an integrable function \(f_X(x)\) satisfying the following:
- \(f_X(x) \ge 0\) for all \(x\) in \(X\); and
- \(\displaystyle \int_X f_X(x) \, \mathrm{d} x = 1\).
Then the probability that \(X\) is in the interval \([a,b]\) is \[ P(a<X<b) = \int_a^b f_X(x) \, \mathrm{d} x .\]
That looks more complicated than it actually is. Let's relate it to the graph of a function.
Take the function
\[ f_X(x) = \begin{cases} 0.1 & 1 \le x \le 11 \\ 0 & \text{otherwise} \end{cases} \]
as seen in the graph below.
Let's check it for the properties of a probability density function. It is certainly at least always zero. The area under the curve is \(1\) since that area is just a rectangle with height \(0.1\) and width \(10\). And lastly, you can represent the probability as an area. For example, if you wanted to find \(P(5<X<7)\) you could do so by finding the area of the rectangle in the graph below, getting that \(P(5<X<7) = 0.2\).
So \(f_X(x)\) is a probability density function. If you were to graph the probability curve, you would need to integrate it, giving you
\[ P(a<X<b) = \begin{cases} 0 & a \text{ and } b \le 1 \\ 0.2(b-1) & a<1<b \le 11 \\ 0.2(b-a) & 1 \le a \le b \le 11 \\ 0.2(11-a) & 1 <a <11 < b \\ 1 & 11 \le a < b \end{cases} \]
That certainly seems like a lot of cases, but you can see it much more easily by looking at the graph below.
Notice that the minimum height of the graph above is \(0\), and the maximum height of the graph is \(1\). This makes sense because probabilities are always at least zero and at most one.
It turns out that the integral of the probability density function is quite useful, and it is called the Cumulative Distribution Function.
Probability density function properties
Using the definition of the probability density function, you can see an important property of them:
\[P(X=a) = 0.\]
It also doesn't matter if you use strict inequalities with continuous density functions:
\[ P(X<a) = P(X\le a).\]
Both of those properties come from the fact that
\[ P(a<X<b) = \int_a^b f_X(x) \, \mathrm{d} x .\]
You might ask if the probability density function can be greater than \(1\). Sure it can! The integral of the function still needs to be equal to \(1\), but the probability density function can take on values larger than that as long as it is also at least zero. One example of this is the probability density function
\[ f_X(x) = \begin{cases} 2 & 0 \le x \le \dfrac{1}{2} \\ 0 & \text{otherwise} \end{cases} .\]
This function is always at least zero, it is integrable, and the integral is \(1\), so it could be a probability density function for a continuous random variable \(X\). Don't confuse the probability density function for actual probabilities!
Probability density function of normal distribution
One of the probability density functions you will see often is the normal distribution. You can see the graph of the standard normal distribution probability density function below.
Just like with other probability density functions, the area under the curve of the standard normal distribution is \(1\).
Probability density function example
Let's look at some examples.
Suppose that someone tells you that
\[ f_X(x) = \begin{cases} 2x & 0 \le x \le 1 \\ 0 & \text{otherwise} \end{cases}\]
is the probability density function for the length of time, in hours, you will spend waiting in the doctor's office.
(a) Check to be sure this is a probability density function.
(b) Find the probability you will wait less than half an hour to see the doctor.
(c) Find the probability you will wait more than half an hour to see the doctor.
Solution
(a) First note that \(X\) is in fact a continuous random variable. In addition, \(f_X(x)\) is always at least zero. It is also integrable, so now it just remains to check that the integral is one. Doing the integration,
\[\begin{align} \int_X f_X(x) \, \mathrm{d} x &= \int_0^1 2x \, \mathrm{d} x \\ &= \left. 2\left(\frac{1}{2}\right)x^2\right|_0^1 \\ &= 1^2-0^2 \\ &= 1.\end{align}\]
So this is, in fact, a probability density function.
(b) You want to know the probability that you will wait less than half an hour. In other words, you need to find \(P(X<0.5)\). Then
\[\begin{align} P(X<0.5) &= \int_0^{0.5} 2x \, \mathrm{d} x \\ &= \left.\phantom{\frac{1}{2}} x^2 \right|_0^{0.5} \\ &= (0.5)^2 - 0^2 \\ &=0.25. \end{align}\]
So the probability that you will wait less than half an hour is \(0.25\). So \(25\%\) of the time, you will wait less than half an hour to see the doctor.
(c) Now you want to find the probability that you will wait more than half an hour to see the doctor. Remember that the area under the probability density function is \(1\), so
\[ P(X > 0.5) = 1 - P(X<0.5).\]
Then using the previous part of the problem, \(P(X> 0.5) =0.75\). This means that \(75\%\) of the time, you will wait at least half an hour to see the doctor!
Probability Density Function - Key takeaways
- A probability mass function is used with discrete random variables, and a probability density function is used with continuous random variables.
The probability density function, or PDF, of a continuous random variable \(X\) is an integrable function \(f_X(x)\) satisfying the following:
- \(f_X(x) \ge 0\) for all \(x\) in \(X\); and
- \(\displaystyle \int_X f_X(x) \, \mathrm{d} x = 1\).
The probability that a continuous random variable \(X\) is in the interval \([a,b]\) is \[ P(a<X<b) = \int_a^b f_X(x) \, \mathrm{d} x .\]
For a continuous random variable \(X\), \(P(X=a) = 0\), and it doesn't matter if you use strict inequalities: \( P(X<a) = P(x \le a)\).
Learn with 10 Probability Density Function flashcards in the free StudySmarter app
We have 14,000 flashcards about Dynamic Landscapes.
Already have an account? Log in
Frequently Asked Questions about Probability Density Function
What is PDF and CDF?
The PDF is the probability density function and the CDF is the cumulative distribution function.
What is probability density function give example?
An example of a probability density function for a continuous random variable would be the standard normal distribution.
Can probability density function be negative?
No. They are always at least zero.
What does the probability density function tell us?
A probability density function can tell you the probability of a continuous random variable being within a certain range.
Can a probability density function be greater than 1?
Yes. Remember that the area under the probability density function is 1. As long as that is satisfied, and the function is at least zero, it can take on values larger than 1.
About StudySmarter
StudySmarter is a globally recognized educational technology company, offering a holistic learning platform designed for students of all ages and educational levels. Our platform provides learning support for a wide range of subjects, including STEM, Social Sciences, and Languages and also helps students to successfully master various tests and exams worldwide, such as GCSE, A Level, SAT, ACT, Abitur, and more. We offer an extensive library of learning materials, including interactive flashcards, comprehensive textbook solutions, and detailed explanations. The cutting-edge technology and tools we provide help students create their own learning materials. StudySmarter’s content is not only expert-verified but also regularly updated to ensure accuracy and relevance.
Learn more