Say a bus arrives every 10 minutes, and you show up at the bus stop at a random time. Let X be your wait time in minutes. A quantity that depends on chance like this is called a random variable. We want the probability that you wait between 2 and 5 minutes, which we write as P(2≤X≤5).
P(2≤X≤5)=?
That's 3 minutes out of 10, so the probability is 103. To set it up with calculus, we treat probability the way we treated the mass of a rod, as the integral of a density. Every wait from 0 to 10 is equally likely, so the graph has a constant height h on [0,10] and is 0 everywhere else. You're sure to wait somewhere between 0 and 10 minutes, so the whole rectangle has area 1.
10⋅h=1→h=101
P(2≤X≤5)=3⋅101=103
We call this function f a probability density function, or density for short. Just as physical density is mass per unit length, probability density is probability per unit of x.
All outcomes together have probability 1, so the total area under any density across all real numbers is 1. We write that integral as ∫−∞∞f(x)dx. And a density can never be negative, because a negative f(x) on an interval would give that interval a negative probability.
∫−∞∞f(x)dx=1
f(x)≥0
The total area alone isn't enough. Take f(x)=x−21 on [0,2], and 0 outside.
Its integral from 0 to 2 is 1, but from 0 to 21 it's −81, and a probability can't be −81. So x−21 isn't a density.
The total area of 1 also lets us find an unknown constant in a density.
f(x)={cx(1−x)00≤x≤1otherwise
Find c so that f(x)=cx(1−x) on [0,1] is a probability density function
Text solution
Integrate only over [0,1]Outside [0,1],f(x) is 0, so the integral over all real numbers is the integral from 0 to 1.
∫−∞∞f(x)dx=∫01cx(1−x)dx
=c[2x2−3x3]01=6c
Set the area equal to 1The shape x(1−x) has area 61, so c is 1 divided by that area.
6c=1→c=6
With c=6, the height at x=21 is more than 1.
f(21)=6⋅21⋅21=23
That's fine, because f(x) is a density, not a probability. To get a probability, we always integrate the density over an interval.
2
The mean
Next, the average value of a random variable X. We call it μ, the mean of X, or the expected value. We find it the way we found the balance point xˉ of a rod. Each piece of width dx has probability f(x)dx, which acts as its mass, and the total mass is the total area, 1.
So the mean is the balance point of the region under f. Let's find it for the density from section 1.
Find the mean of 6x(1−x)
Text solution
Use the symmetryThe region under 6x(1−x) on [0,1] is symmetric about x=21, so it balances there.
μ=21
Check with the integral
μ=∫01x⋅6x(1−x)dx=∫01(6x2−6x3)dx
=[2x3−23x4]01=21
The picture shows why. For every d, the heights at 21−d and 21+d are equal, so the two sides balance on a pivot at 21.
3
The exponential density
Now for hold times on a customer help line. Let X be the time a caller waits, in minutes, with this density.
f(t)={ce−t/20t≥0t<0
A density like this is called an exponential density, and it comes up often for waiting times and equipment lifetimes. It's largest at t=0, where f(0)=c, and it falls toward 0 but stays positive for every t≥0. So every integral we need runs out to infinity.
Find c,P(X>4), and the mean μ for the exponential density f(t)=ce−t/2
Text solution
Find cThe total area must be 1. It's an improper integral, so we integrate up to b and let b→∞.
∫0∞ce−t/2dt=b→∞lim2c(1−e−b/2)=2c
2c=1→c=21
Find P(X>4)Integrate from 4 to ∞, or take the total area 1 minus the area from 0 to 4. Either way it's e−2≈0.135, so roughly 1 caller in 7 waits longer than 4 minutes.
P(X>4)=b→∞lim[−e−t/2]4b=e−2
P(X>4)=1−∫0421e−t/2dt=1−(1−e−2)=e−2
Find the mean by partsWith t times an exponential, we take u=t and dv=21e−t/2dt, so v=−e−t/2.
∫0bt⋅21e−t/2dt=−be−b/2−2e−b/2+2
Let b→∞Written as eb/2b, the first term is ∞∞, and L'Hôpital's rule sends it to 0.
μ=0−0+2=2
So the mean hold time is 2 minutes. That 2 in the exponent −t/2 was the mean all along. In general, the total area under e−t/μ is μ, so dividing by μ gives a total area of 1.
The probability that X falls between a and b is the area under the density curve from a to b. The height f(x) is probability per unit of x, not the probability of getting x, so f(x) can be larger than 1.
The two conditions for a density
f(x)≥0
∫−∞∞f(x)dx=1
A probability density can never be negative, and its total area across all real numbers must equal 1.
To find an unknown constant c, integrate only over the interval where f(x) is not zero, and set that integral equal to 1. For f(x)=cx(1−x) on [0,1], the integral from 0 to 1 is 6c, so setting 6c=1 gives c=6.
The mean
μ=∫−∞∞xf(x)dx
The mean μ is the balance point of the region under f(x). Because the total area is 1, we don't divide by anything. If a density is symmetric about a number c and its mean exists, then μ=c without integrating.
The exponential density
f(t)=μ1e−t/μfor t≥0
P(X>a)=e−a/μ
An exponential density models waiting times and lifetimes with positive mean μ. Because the integral of e−t/μ from 0 to ∞ is μ, dividing by μ makes the total area 1. For any nonnegative time a, the probability of waiting longer than a is e−a/μ.
4
Practice
Enter exact values where asked, or round decimals to the requested number of places.
1
Let f(x)=kx2 for 0≤x≤2, and f(x)=0 otherwise. (a) Find k so that f is a probability density function. (b) Find P(X>1). (c) Find the mean of X.
The total area under f(x) must equal 1. Where is f(x) not zero?
If you got k=41 Check whether the total area equals 1. A density's height can be greater than 1 as long as the total area under the curve is 1.
If you got P(X>1)=∞ Check the upper bound of the integral. Past x=2,f(x)=0.
To find the mean μ, what do we multiply each piece of area f(x)dx by?
If you got a mean of 1 Check the integral for the mean. It needs an extra factor of x inside the integral.
Find kThe total area under the density must equal 1, and f(x) is 0 outside [0,2].
∫−∞∞f(x)dx=∫02kx2dx=38k=1→k=83
f(2)=83⋅4=23
Find P(X>1)The density is 0 past x=2, so we integrate from 1 to 2.
P(X>1)=∫1283x2dx=[8x3]12=1−81=87
Find the meanThe mean μ is the weighted average of x, so we integrate x times the density.
μ=∫02x⋅83x2dx=[323x4]02=23
2
A battery's lifetime X, in hours, has an exponential density with mean 400 hours. Find the probability that the battery lasts longer than 400 hours.
An exponential density with mean μ is f(t)=μ1e−t/μ. What does this give when μ=400?
If you got 1−e−1≈0.63 That is the probability that the battery lasts at most 400 hours. We want the probability that it lasts longer than 400 hours.If you got e−160000 Check the constant in the exponent. An exponential density with mean 400 has exponent −400t, not −400t.
Write the densityFor an exponential distribution with mean μ, the density is μ1e−t/μ for t≥0.
f(t)=4001e−t/400 for t≥0
Find P(X>400)We integrate the density from 400 to infinity.
P(X>400)=∫400∞4001e−t/400dt=e−400400=e−1≈0.37
3
Let f(t)=cte−t/2 for t≥0, and f(t)=0 for t<0. (a) Find c so that f is a probability density function. (b) Find the mean of X. (Challenge)
If you got c=4 The integral of te−t/2 is 4, so we need 4c=1.
For part (b), we need ∫0∞t⋅f(t)dt. With u=t2, what integral do you get from integration by parts?
If you got a mean of 1 Remember to multiply by an extra factor of t inside the integral when finding the mean.
Set up integration by partsThe total area from 0 to ∞ must equal 1, so we use integration by parts with u=t.
u=t,dv=e−t/2dt,du=dt,v=−2e−t/2
Find cThe boundary term goes to 0 as b→∞ by L'Hôpital's rule.