Calculus3Applications of Integration6 of 6
Applications of Integration · 6

Probability

1

Probability as area under a density

Say a bus arrives every 1010 minutes, and you show up at the bus stop at a random time. Let XX 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 22 and 55 minutes, which we write as P(2≤X≤5)\pb{P(2 \le X \le 5)}.

P(2≤X≤5)\displaystyle \pb{P(2 \le X \le 5)} =  ?\displaystyle = \;?

That's 33 minutes out of 1010, so the probability is 310\frac{3}{10}. 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 00 to 1010 is equally likely, so the graph has a constant height h\fd{h} on [0,10][0, 10] and is 00 everywhere else. You're sure to wait somewhere between 00 and 1010 minutes, so the whole rectangle has area 11.

00
minutes\text{minutes}
probability per minute\text{probability per minute}
110\htmlClass{lc-blue}{\dfrac{1}{10}}
22
55
1010
310\dfrac{3}{10}
10⋅h\displaystyle 10 \cdot \fd{h} =1  →  h\displaystyle = 1 \;\to\; \fd{h} =110\displaystyle = \frac{1}{10}
P(2≤X≤5)\displaystyle \pb{P(2 \le X \le 5)} =3⋅110\displaystyle = 3 \cdot \fd{\frac{1}{10}} =310\displaystyle = \frac{3}{10}

We call this function f\fd{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 xx.

All outcomes together have probability 11, so the total area under any density across all real numbers is 11. We write that integral as ∫−∞∞f(x) dx\pb{\int_{\ik{-\infty}}^{\ik{\infty}}} \fd{f(x)}\,\pb{dx}. And a density can never be negative, because a negative f(x)\fd{f(x)} on an interval would give that interval a negative probability.

∫−∞∞f(x) dx\displaystyle \pb{\int_{\ik{-\infty}}^{\ik{\infty}}} \fd{f(x)}\,\pb{dx} =1\displaystyle = 1
f(x)\displaystyle \fd{f(x)} ≥0\displaystyle \ge 0

The total area alone isn't enough. Take f(x)=x−12\fd{f(x)} = \fd{x - \frac12} on [0,2][0, 2], and 00 outside.

00
xx
12\tfrac12
22
x−12\htmlClass{lc-blue}{x - \tfrac12}
98\dfrac{9}{8}
−18\htmlClass{lc-pink}{-\dfrac{1}{8}}

Its integral from 00 to 22 is 11, but from 00 to 12\frac12 it's −18-\frac18, and a probability can't be −18-\frac18. So x−12\fd{x - \frac12} isn't a density.

The total area of 11 also lets us find an unknown constant in a density.

00
xx
11
c x(1−x)c\,\htmlClass{lc-blue}{x(1-x)}
f(x)={c x(1−x)0≤x≤10otherwise\displaystyle \fd{f(x)} = {\begin{cases} c\,\fd{x(1-x)} & 0 \le x \le 1 \\ \fd{0} & \text{otherwise} \end{cases}}
Find cc so that f(x)=c x(1−x)\fd{f(x)} = c\,\fd{x(1-x)} on [0,1][0, 1] is a probability density function
minutes\text{minutes}
00
22
55
1010
P(2≤X≤5)=  ?\htmlClass{lc-pink}{P(2 \le X \le 5)} = \;?
Text solution
Integrate only over [0,1][0, 1]Outside [0,1][0, 1], f(x)\fd{f(x)} is 00, so the integral over all real numbers is the integral from 00 to 11.
∫−∞∞f(x) dx\displaystyle \pb{\int_{\ik{-\infty}}^{\ik{\infty}}} \fd{f(x)}\,\pb{dx} =∫01c x(1−x) dx\displaystyle = \pb{\int_{\ik{0}}^{\ik{1}}} c\,\fd{x(1-x)}\,\pb{dx}
=c[x22−x33]01\displaystyle = c\Big[\frac{x^2}{2} - \frac{x^3}{3}\Big]_0^1 =c6\displaystyle = \frac{c}{6}
Set the area equal to 11The shape x(1−x)\fd{x(1 - x)} has area 16\frac16, so cc is 11 divided by that area.
c6\displaystyle \frac{c}{6} =1  →  c\displaystyle = 1 \;\to\; c =6\displaystyle = 6

With c=6c = 6, the height at x=12x = \frac12 is more than 11.

f(12)\displaystyle \fd{f\Big(\frac12\Big)} =6⋅12⋅12\displaystyle = 6 \cdot \frac12 \cdot \frac12 =32\displaystyle = \fd{\frac32}

That's fine, because f(x)\fd{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 XX. We call it μ\mn{\mu}, the mean of XX, or the expected value. We find it the way we found the balance point xˉ\mn{\bar x} of a rod. Each piece of width dxdx has probability f(x) dx\fd{f(x)}\,\pb{dx}, which acts as its mass, and the total mass is the total area, 11.

xˉ=∫x⋅density dxtotal massμ=∫−∞∞x f(x) dx1=∫−∞∞x f(x) dx\displaystyle \begin{aligned} \mn{\bar{x}} &= \frac{\int \wt{x} \cdot \fd{\text{density}}\,dx}{\text{total mass}} \\[8pt] \mn{\mu} &= \frac{\int_{-\infty}^{\infty} \wt{x}\,\fd{f(x)}\,dx}{1} \\[4pt] &= \int_{-\infty}^{\infty} \wt{x}\,\fd{f(x)}\,dx \end{aligned}

So the mean is the balance point of the region under f\fd{f}. Let's find it for the density from section 1.

Find the mean of 6x(1−x)\fd{6x(1 - x)}
00
xx
f\htmlClass{lc-blue}{f}
Text solution
Use the symmetryThe region under 6x(1−x)\fd{6x(1-x)} on [0,1][0, 1] is symmetric about x=12x = \frac12, so it balances there.
μ\displaystyle \mn{\mu} =12\displaystyle = \frac12
Check with the integral
μ\displaystyle \mn{\mu} =∫01x⋅6x(1−x) dx\displaystyle = \int_0^1 \wt{x} \cdot \fd{6x(1-x)}\,dx =∫01(6x2−6x3) dx\displaystyle = \int_0^1 (6x^2 - 6x^3)\,dx
=[2x3−32x4]01\displaystyle = \Big[2x^3 - \frac32 x^4\Big]_0^1 =12\displaystyle = \frac12

The picture shows why. For every dd, the heights at 12−d\frac12 - d and 12+d\frac12 + d are equal, so the two sides balance on a pivot at 12\frac12.

00
xx
11
12−d\tfrac12 - d
12+d\tfrac12 + d
12\tfrac12
6x(1−x)\htmlClass{lc-blue}{6x(1-x)}
3

The exponential density

Now for hold times on a customer help line. Let XX be the time a caller waits, in minutes, with this density.

00
tt
22
44
66
c e−t/2c\,\htmlClass{lc-blue}{e^{-t/2}}
f(t)={c e−t/2t≥00t<0\displaystyle \fd{f(t)} = {\begin{cases} c\,\fd{e^{-t/2}} & t \ge 0 \\ \fd{0} & t < 0 \end{cases}}

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=0t = 0, where f(0)=c\fd{f(0)} = c, and it falls toward 00 but stays positive for every t≥0t \ge 0. So every integral we need runs out to infinity.

Find cc, P(X>4)\pb{P(X > 4)}, and the mean μ\mn{\mu} for the exponential density f(t)=c e−t/2\fd{f(t)} = c\,\fd{e^{-t/2}}
00
tt
c e−t/2c\,\htmlClass{lc-blue}{e^{-t/2}}
Text solution
Find ccThe total area must be 11. It's an improper integral, so we integrate up to bb and let b→∞b \to \infty.
∫0∞c e−t/2 dt\displaystyle \pb{\int_{\ik{0}}^{\ik{\infty}}} c\,\fd{e^{-t/2}}\,\pb{dt} =lim⁡b→∞2c(1−e−b/2)\displaystyle = \lim_{b\to\infty} 2c\big(1 - e^{-b/2}\big) =2c\displaystyle = 2c
2c\displaystyle 2c =1  →  c\displaystyle = 1 \;\to\; c =12\displaystyle = \frac12
Find P(X>4)\pb{P(X > 4)}Integrate from 44 to ∞\infty, or take the total area 11 minus the area from 00 to 44. Either way it's e−2≈0.135e^{-2} \approx 0.135, so roughly 11 caller in 77 waits longer than 44 minutes.
P(X>4)\displaystyle \pb{P(X > 4)} =lim⁡b→∞[−e−t/2]4b\displaystyle = \lim_{b\to\infty} \Big[-e^{-t/2}\Big]_4^{b} =e−2\displaystyle = e^{-2}
P(X>4)\displaystyle \pb{P(X > 4)} =1−∫0412e−t/2 dt\displaystyle = 1 - \vt{\int_{\ik{0}}^{\ik{4}}} \fd{\frac12 e^{-t/2}}\,\vt{dt} =1−(1−e−2)\displaystyle = 1 - \big(1 - e^{-2}\big) =e−2\displaystyle = e^{-2}
Find the mean by partsWith tt times an exponential, we take u=tu = \wt{t} and dv=12e−t/2 dtdv = \fd{\frac12 e^{-t/2}}\,dt, so v=−e−t/2v = -e^{-t/2}.
∫0bt⋅12e−t/2 dt\displaystyle \int_0^{b} \wt{t} \cdot \fd{\frac12 e^{-t/2}}\,dt =−b e−b/2−2e−b/2+2\displaystyle = -b\,e^{-b/2} - 2e^{-b/2} + 2
Let b→∞b \to \inftyWritten as beb/2\frac{b}{e^{b/2}}, the first term is ∞∞\frac{\infty}{\infty}, and L'Hôpital's rule sends it to 00.
μ\displaystyle \mn{\mu} =0−0+2\displaystyle = 0 - 0 + 2 =2\displaystyle = 2

So the mean hold time is 22 minutes. That 2\mn{2} in the exponent −t/2-t/\mn{2} was the mean all along. In general, the total area under e−t/μ\fd{e^{-t/\mn{\mu}}} is μ\mn{\mu}, so dividing by μ\mn{\mu} gives a total area of 11.

∫0∞e−t/μ dt=μ(μ>0)f(t)=1μ e−t/μfor t≥0P(X>a)=e−a/μ(a≥0)\displaystyle \begin{aligned} \int_0^{\infty} \fd{e^{-t/\mn{\mu}}}\,dt &= \mn{\mu} \qquad (\mn{\mu} > 0) \\[6pt] \fd{f(t)} &= \fd{\frac{1}{\mn{\mu}}\,e^{-t/\mn{\mu}}} \quad \text{for } t \ge 0 \\[6pt] \pb{P(X > a)} &= e^{-a/\mn{\mu}} \qquad (a \ge 0) \end{aligned}

Summary

Probability as area under a density
00
xx
xx
34\tfrac34
11
6x(1−x)\htmlClass{lc-blue}{6x(1-x)}
f(x) dx\htmlClass{lc-pink}{\htmlClass{lc-blue}{f(x)}\,dx}
P(X≥34)\htmlClass{lc-pink}{P\big(X \ge \tfrac34\big)}
P(a≤X≤b)\displaystyle \pb{P(a \le X \le b)} =∫abf(x) dx\displaystyle = \pb{\int_{\ik{a}}^{\ik{b}}} \fd{f(x)}\,\pb{dx}

The probability that XX falls between aa and bb is the area under the density curve from aa to bb. The height f(x)\fd{f(x)} is probability per unit of xx, not the probability of getting xx, so f(x)\fd{f(x)} can be larger than 11.

The two conditions for a density
f(x)\displaystyle \fd{f(x)} ≥0\displaystyle \ge 0
∫−∞∞f(x) dx\displaystyle \pb{\int_{\ik{-\infty}}^{\ik{\infty}}} \fd{f(x)}\,\pb{dx} =1\displaystyle = 1

A probability density can never be negative, and its total area across all real numbers must equal 11.

To find an unknown constant cc, integrate only over the interval where f(x)\fd{f(x)} is not zero, and set that integral equal to 11. For f(x)=c x(1−x)\fd{f(x)} = c\,\fd{x(1 - x)} on [0,1][0, 1], the integral from 00 to 11 is c6\frac{c}{6}, so setting c6=1\frac{c}{6} = 1 gives c=6c = 6.

The mean
μ\displaystyle \mn{\mu} =∫−∞∞x f(x) dx\displaystyle = \int_{-\infty}^{\infty} \wt{x}\,\fd{f(x)}\,dx

The mean μ\mn{\mu} is the balance point of the region under f(x)\fd{f(x)}. Because the total area is 11, we don't divide by anything. If a density is symmetric about a number cc and its mean exists, then μ=c\mn{\mu} = c without integrating.

The exponential density
f(t)\displaystyle \fd{f(t)} =1μ e−t/μfor t\displaystyle = \fd{\frac{1}{\mn{\mu}}\,e^{-t/\mn{\mu}}} \quad \text{for } t ≥0\displaystyle \ge 0
P(X>a)\displaystyle \pb{P(X > a)} =e−a/μ\displaystyle = e^{-a/\mn{\mu}}

An exponential density models waiting times and lifetimes with positive mean μ\mn{\mu}. Because the integral of e−t/μ\fd{e^{-t/\mn{\mu}}} from 00 to ∞\infty is μ\mn{\mu}, dividing by μ\mn{\mu} makes the total area 11. For any nonnegative time aa, the probability of waiting longer than aa is e−a/μe^{-a/\mn{\mu}}.

4

Practice

Enter exact values where asked, or round decimals to the requested number of places.

1
Let f(x)=kx2f(x) = kx^2 for 0≤x≤20 \le x \le 2, and f(x)=0f(x) = 0 otherwise. (a) Find kk so that ff is a probability density function. (b) Find P(X>1)P(X > 1). (c) Find the mean of XX.

The total area under f(x)f(x) must equal 11. Where is f(x)f(x) not zero?

If you got P(X>1)=∞P(X > 1) = \infty Check the upper bound of the integral. Past x=2x = 2, f(x)=0f(x) = 0.

To find the mean μ\mu, what do we multiply each piece of area f(x) dxf(x)\,dx by?

Find kkThe total area under the density must equal 11, and f(x)\fd{f(x)} is 00 outside [0,2][0, 2].
∫−∞∞f(x) dx\displaystyle \pb{\int_{\ik{-\infty}}^{\ik{\infty}}} \fd{f(x)}\,\pb{dx} =∫02kx2 dx\displaystyle = \pb{\int_{\ik{0}}^{\ik{2}}} k\fd{x^2}\,\pb{dx} =8k3\displaystyle = \frac{8k}{3} =1  →  k\displaystyle = 1 \;\to\; k =38\displaystyle = \frac38
f(2)\displaystyle \fd{f(2)} =38⋅4\displaystyle = \frac38 \cdot 4 =32\displaystyle = \fd{\frac32}
Find P(X>1)\pb{P(X > 1)}The density is 00 past x=2x = 2, so we integrate from 11 to 22.
P(X>1)\displaystyle \pb{P(X > 1)} =∫1238x2 dx\displaystyle = \pb{\int_{\ik{1}}^{\ik{2}}} \fd{\frac38 x^2}\,\pb{dx} =[x38]12\displaystyle = \Big[\frac{x^3}{8}\Big]_1^2 =1−18\displaystyle = 1 - \frac18 =78\displaystyle = \frac78
Find the meanThe mean μ\mn{\mu} is the weighted average of x\wt{x}, so we integrate x\wt{x} times the density.
μ\displaystyle \mn{\mu} =∫02x⋅38x2 dx\displaystyle = \int_0^2 \wt{x} \cdot \fd{\frac38 x^2}\,dx =[3x432]02\displaystyle = \Big[\frac{3x^4}{32}\Big]_0^2 =32\displaystyle = \frac32
2
A battery's lifetime XX, 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 μ\mu is f(t)=1μe−t/μf(t) = \frac{1}{\mu}e^{-t/\mu}. What does this give when μ=400\mu = 400?

Write the densityFor an exponential distribution with mean μ\mn{\mu}, the density is 1μe−t/μ\fd{\frac{1}{\mn{\mu}}e^{-t/\mn{\mu}}} for t≥0t \ge 0.
f(t)\displaystyle \fd{f(t)} =1400 e−t/400 for t\displaystyle = \fd{\frac{1}{\mn{400}}\,e^{-t/\mn{400}}} \text{ for } t ≥0\displaystyle \ge 0
Find P(X>400)\pb{P(X > 400)}We integrate the density from 400400 to infinity.
P(X>400)\displaystyle \pb{P(X > 400)} =∫400∞1400 e−t/400 dt\displaystyle = \pb{\int_{\ik{400}}^{\ik{\infty}}} \fd{\frac{1}{\mn{400}}\,e^{-t/\mn{400}}}\,\pb{dt} =e−400400\displaystyle = e^{-\frac{400}{400}} =e−1≈0.37\displaystyle = e^{-1} \approx 0.37
3
Let f(t)=c t e−t/2f(t) = c\,t\,e^{-t/2} for t≥0t \ge 0, and f(t)=0f(t) = 0 for t<0t < 0. (a) Find cc so that ff is a probability density function. (b) Find the mean of XX. (Challenge)

For part (b), we need ∫0∞t⋅f(t) dt\int_0^{\infty} t \cdot f(t)\,dt. With u=t2u = t^2, what integral do you get from integration by parts?

Set up integration by partsThe total area from 00 to ∞\infty must equal 11, so we use integration by parts with u=tu = t.
u\displaystyle u =t,dv\displaystyle = t, \qquad dv =e−t/2 dt,du\displaystyle = e^{-t/2}\,dt, \qquad du =dt,v\displaystyle = dt, \qquad v =−2e−t/2\displaystyle = -2e^{-t/2}
Find ccThe boundary term goes to 00 as b→∞b \to \infty by L'Hôpital's rule.
∫0∞t e−t/2 dt\displaystyle \int_0^{\infty} \fd{t\,e^{-t/2}}\,dt =lim⁡b→∞[−2t e−t/2]0b+2∫0∞e−t/2 dt\displaystyle = \lim_{b\to\infty}\Big[-2t\,e^{-t/2}\Big]_0^{b} + 2\int_0^{\infty} e^{-t/2}\,dt =0+2⋅2\displaystyle = 0 + 2 \cdot 2 =4\displaystyle = 4
4c\displaystyle 4c =1  →  c\displaystyle = 1 \;\to\; c =14\displaystyle = \frac14
Set up integration by parts for the meanFor the mean, we integrate t\wt{t} times the density, so we need ∫0∞t2e−t/2 dt\int_0^{\infty} t^2 e^{-t/2}\,dt with u=t2u = t^2.
u\displaystyle u =t2,dv\displaystyle = t^2, \qquad dv =e−t/2 dt,du\displaystyle = e^{-t/2}\,dt, \qquad du =2t dt,v\displaystyle = 2t\,dt, \qquad v =−2e−t/2\displaystyle = -2e^{-t/2}
Find the meanThe boundary term goes to 00 by L'Hôpital's rule applied twice, and the remaining integral is the one from part (a).
μ\displaystyle \mn{\mu} =14∫0∞t2e−t/2 dt\displaystyle = \frac14\int_0^{\infty} t^2 e^{-t/2}\,dt =14(lim⁡b→∞[−2t2e−t/2]0b+4∫0∞t e−t/2 dt)\displaystyle = \frac14\Big(\lim_{b\to\infty}\Big[-2t^2 e^{-t/2}\Big]_0^{b} + 4\int_0^{\infty} t\,e^{-t/2}\,dt\Big) =14(0+4⋅4)\displaystyle = \frac14(0 + 4 \cdot 4) =4\displaystyle = 4