Lesson 2 of 8 · 18 min
Probability density functions
Check that a function is a probability density function, find an unknown constant, and calculate probabilities as areas with definite integrals, including for the continuous uniform distribution.
What you will be able to do
- State the two conditions for to be a probability density function.
- Find an unknown constant so that the total area under is 1.
- Calculate , by integration or by geometry.
- Recognise and use the continuous uniform distribution and other simple densities in context.
Last lesson the bars of a density histogram settled into a smooth curve as the data grew. Mathematics replaces that curve with a function, the probability density function (pdf), usually written . Its job is simple: the area under it over an interval is the probability that lands in that interval. Since you can now find areas with definite integrals, you can now calculate those probabilities exactly.
Definition
Probability density function
A function is a probability density function of a continuous random variable if
- for every (a density is never negative), and
- (the total probability is 1).
Then for any ,
A pdf is usually given by a rule on an interval, and is 0 everywhere else.
The curve is on . Slide until the total area is exactly 1. Only then is it a probability density, and only then is the shaded area .
The widget shows the key idea for finding an unknown constant: the shape is fixed and only stretches it vertically, so there is exactly one value of that makes the total area 1. Set the integral over the whole interval equal to 1 and solve.
Worked example
Find for and use it
A continuous random variable has probability density function
(a) Find the value of .
(b) Find .
Step 1: Set the total area equal to 1
The total probability is 1. Outside the density is 0, so only contributes.
Step 2: Expand and integrate
Step 3: Solve for k and check the sign
, so . Since on and , there, so is a valid pdf.
A pdf needs both conditions: total area 1 and never negative.
Step 4: Integrate over the interval for (b)
Try it yourself first, then check the working one step at a time.
Answer
(a) (b)
Method
Write over the support.
Antidifferentiate, substitute the limits, solve for .
Check on the support.
Integrate over the required interval for each probability.
Watch out for
Integrating as if it were a variable: it is a constant factor and comes outside.
Leaving out the check that in a "show that" question.
The random variable has probability density function for , and elsewhere. Find the value of .
Once you have a valid pdf, every probability is a definite integral over the interval you want. If the interval runs past the end of the support, cut it off there: the density is 0 outside.
The time hours a delivery driver waits at a depot has pdf for , and 0 elsewhere. Find .
Common mistake
Mind the support
If only for , then is , never (which is not even finite). And the value is a density, not a probability: .
The simplest continuous model is the continuous uniform distribution: every value in an interval is "equally likely" in the sense that intervals of equal width inside it have equal probability. Its density is a horizontal line, so its probabilities are areas of rectangles.
Key idea
Continuous uniform distribution on [a, b]
For , : the fraction of the interval covered.
Worked example
Waiting for a bus that comes every 12 minutes
A bus stops outside a Toowoomba school every 12 minutes. A student arrives at the stop at a random time, so their waiting time minutes is uniformly distributed on .
(a) Write down the probability density function of .
(b) Find the probability that the student waits more than 8 minutes.
(c) Find .
Step 1: Write the uniform density
for , and elsewhere.
A uniform density is constant, and the rectangle must have area 1: width 12, so height .
Step 2: Use the area of a rectangle for (b)
Step 3: Same idea for (c)
Any two intervals of the same width inside have the same probability: that is what "uniform" means.
Try it yourself first, then check the working one step at a time.
Answer
(a) for , 0 elsewhere (b) (c)
Method
Uniform on : .
Probability = (width of the interval inside ) .
Watch out for
Using a height of 1 instead of : the total area would be 12, not 1.
A 10 m rope is cut at a point chosen uniformly at random along its length. Let m be the distance from the left end to the cut. Find the probability that the cut is within 2 m of either end.
| Shape | Example pdf | Typical context |
|---|---|---|
| Uniform (constant) | , | Waiting for a regular bus, arriving at random |
| Linear (triangular) | , | Values more likely towards one end |
| Quadratic (hump) | , | A measurement that clusters in the middle of a range |
| Exponential decay | , | Lifetime of a component, time until the next call |
| Trigonometric | , | Angles, positions on a swinging arc |
Exam tip
Show the area is 1
"Show that is a probability density function" needs both conditions: say why on the interval, and evaluate with the antiderivative and limits written out. An answer that only does the integral loses a mark.
Summary
A pdf satisfies and ; it is 0 outside its stated interval.
To find an unknown constant, set the total integral equal to 1 and solve.
: integrate only over the part of the interval where is non-zero.
For straight-line densities, areas of rectangles, triangles and trapeziums give the same answers as integration.
The continuous uniform distribution on has , so probabilities are fractions of the interval.
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.