|
|
Probability Density Function

If you are flipping a coin, it is pretty easy to see that the probability of getting a head is \(0.5\).  But what if you want to find the probability of someone being exactly \(2\) metres tall?  Height is a continuous variable, not a discrete one, so you can't use the basic probability rules you might already know. Instead, you will need a probability density function. So don't be dense, read on to find out about continuous random variables and probability density functions!

Mockup Schule

Explore our app and discover over 50 million learning materials for free.

Probability Density Function

Illustration

Lerne mit deinen Freunden und bleibe auf dem richtigen Kurs mit deinen persönlichen Lernstatistiken

Jetzt kostenlos anmelden

Nie wieder prokastinieren mit unseren Lernerinnerungen.

Jetzt kostenlos anmelden
Illustration

If you are flipping a coin, it is pretty easy to see that the probability of getting a head is \(0.5\). But what if you want to find the probability of someone being exactly \(2\) metres tall? Height is a continuous variable, not a discrete one, so you can't use the basic probability rules you might already know. Instead, you will need a probability density function. So don't be dense, read on to find out about continuous random variables and probability density functions!

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.

Probability Density Function graph of uniform function of height 0.1 StudySmarterFig. 1 - Graph of a potential probability density function.

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\).

Probability Density Function graph showing a rectangle of height 0.1 and width 2 whose area represents a probability StudySmarterFig. 2 - \(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.

Probability Density Function graph of probabilities related to \(f_X(x)\) StudySmarterFig. 3 - Graph of probabilities related to \(f_X(x)\).

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.

Probability Density Function for the standard normal distribution StudySmarterFig. 4 - The standard normal distribution.

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)\).

Frequently Asked Questions about Probability Density Function

The PDF is the probability density function and the CDF is the cumulative distribution function.

An example of a probability density function for a continuous random variable would be the standard normal distribution.

No.  They are always at least zero.

A probability density function can tell you the probability of a continuous random variable being within a certain range.

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.

Test your knowledge with multiple choice flashcards

Suppose you are rolling a \(20\) sided die in a game.  You could use a ____ to model the probability of rolling \(13\) twice in a row.

Suppose you want to model the probability that someone will spend at least \(2\) minutes paying attention to an advertisement. To do this you would use a ____.

Probability density functions are used with ____ random variables.

Next

Join over 22 million students in learning with our StudySmarter App

The first learning app that truly has everything you need to ace your exams in one place

  • Flashcards & Quizzes
  • AI Study Assistant
  • Study Planner
  • Mock-Exams
  • Smart Note-Taking
Join over 22 million students in learning with our StudySmarter App Join over 22 million students in learning with our StudySmarter App

Sign up to highlight and take notes. It’s 100% free.

Entdecke Lernmaterial in der StudySmarter-App

Google Popup

Join over 22 million students in learning with our StudySmarter App

Join over 22 million students in learning with our StudySmarter App

The first learning app that truly has everything you need to ace your exams in one place

  • Flashcards & Quizzes
  • AI Study Assistant
  • Study Planner
  • Mock-Exams
  • Smart Note-Taking
Join over 22 million students in learning with our StudySmarter App