A computer job finishes at some time between and hour after it starts, and in a constructed model a stretch of later times is more likely than an equally long stretch of earlier times. What is the probability that it finishes in the second half of the hour? A discrete model would list a few possible times and give each one a probability, but here every time in the interval is allowed. So the model spreads probability along the time axis with a curve, and the probability of an interval is the area under the curve over that interval. This lesson builds that area from rectangles, defines the definite integral, and evaluates the integrals of powers that simple densities need.
Key terms
Probability density
Definition A probability density is a function defined for every real number with two properties. It is nonnegative, for every , and the total area between its graph and the horizontal axis is . The definite integral below makes this area precise, and the total area is written
When is outside an interval , the total area is the area over . If the values of carry a unit, such as hours, then carries the reciprocal unit, per hour, so that a height times a width is a pure number.
In plain words A density shows how probability is spread along a scale. Its height is probability per unit of width, not a probability. Near a point where the curve is continuous, the height times a short width is approximately the probability of that short interval, so a tall curve over a very narrow interval can still hold very little probability, and a height above breaks no rule.
Example In the constructed job model, the finishing time in hours has density
The graph is a triangle with base hour and height per hour, so its area is , and the hours cancel. The height at is a rate, not a probability of . The clause ” otherwise” is part of the model. The formula on its own is negative for and encloses more and more area as grows, so it is not a density.
Probability as area
Definition A random variable has density when, for all real numbers ,
the area between the graph of and the horizontal axis over . Taking gives an interval of width and area , so for every . Hence including or excluding an endpoint does not change the probability, and , and equal the same area.
In plain words In a density model, probability lives in areas over intervals. To find the probability of an event about , shade the part of the horizontal axis that the event describes and measure the area under the curve above it.
Example For the job model, the probability of finishing in the second half of the hour is the area over . That region is a trapezoid with width and parallel sides and , so
The first half of the hour is a triangle with base and height , so it has probability . The two halves have the same width but different probabilities, because the curve is higher over the second half.
Riemann sum
Definition Let be a function on an interval with . Split into pieces with endpoints , choose a point in each piece , and write for its width. The number
is a Riemann sum for on . With equal widths , choosing every left endpoint gives the left sum , and choosing every right endpoint gives the right sum . When is nonnegative, each term is the area of a rectangle. When is also nondecreasing on , every rectangle of a left sum lies under the graph and every rectangle of a right sum covers the region beneath the graph on its piece, so the left sum is at most the area and the right sum is at least the area.
In plain words Replace the curved region by a row of rectangles, each as wide as its piece and as tall as the curve at the chosen point. The rectangles may miss some area or include some extra, so a Riemann sum estimates an area. For a density, a Riemann sum is only an estimate of a probability, and it can even exceed .
Example For the density on , split into four pieces of width . The left endpoints give the heights , , and , which add to , and the right endpoints give , , and , which add to . So
The true area lies between these bounds. The value is not a probability of the model. It only shows that the right rectangles overshoot. With equal pieces the same computation gives and , for example and when .
Definite integral
Definition Let be a function on with . Suppose the Riemann sums of approach a single number as the widest piece shrinks to width , whatever points are chosen. Then is integrable on , and is its definite integral,
The limit exists, for example, when is continuous on , and also when is bounded with finitely many jumps. The numbers and are the lower and upper limits of integration, is the integrand, and names the variable that runs from to . The letter used for that variable does not matter, so is the same number. By convention the integral from to is . For a nonnegative the integral is the area under the graph over . When is integrable on and , integrals over adjacent intervals add,
In plain words The integral is the value the rectangle sums settle on as the rectangles get narrower. The limits of integration say where to start and stop collecting area, and the integrand says how tall the curve is along the way. The elongated S of the integral sign is a reminder that it comes from a sum.
Example The density is continuous on , so its integral exists. Because is increasing, every Riemann sum with equal pieces lies between and , and both bounds approach . Hence
which agrees with the triangle. The event has no upper end, but the density is above , so the limits of integration are and . Continuing the formula past would count area that the model does not have.
Accumulated probability
Definition For a random variable with density , the accumulated probability up to a real number is
which is the cumulative distribution function of evaluated at . When is below , this gives for , and for the integral can start at . The moving endpoint is the upper limit, so the variable of integration gets a different letter. For real numbers , subtracting accumulated probabilities gives the probability of the interval between them,
In plain words Sweep a vertical line from left to right and record how much area lies to its left. The probability of an interval is the amount the sweep adds between the two endpoints.
Example For the job model and , the region to the left of is a triangle with base and height , so
Also for and for . Halfway through the hour the accumulated probability is , not . The middle half-hour has probability
and the second half-hour has probability , which answers the opening question. The first, middle and last half-hours have the same width but probabilities , and .
Power rule for integrals
Definition For every nonnegative integer and real numbers ,
where means , so the case gives . For integrable functions and and a constant , integrals respect constant multiples and sums,
Together these rules integrate every polynomial over every interval .
In plain words To integrate a whole-number power of , raise the power by one, divide by the new power, and subtract the value at the lower limit from the value at the upper limit. A constant factor scales every strip of area, so it scales the total.
Example The constructed density for , and otherwise, is nonnegative because on . Its total area is
so it is a valid density, even though its peak height is . The probability of a value below is
Check yourself
- A quantity has density for and otherwise. Check that is a valid density, find the accumulated probability for , and find .
Show the answer
The function is nonnegative because , and by the power rule its total area is
so it is a valid density. For the accumulated probability is . By the complement rule,
- For the same , find and check that the answer is reasonable.
Show the answer
Subtract accumulated probabilities,
The endpoints have probability , so it does not matter that they are excluded. The answer, about , lies between and , as it must, because the event is part of the event . A negative result would point to a reversed subtraction.
- A classmate computes the right Riemann sum with four equal pieces for the density on and gets , which is more than . The classmate also notices that the density reaches the height at . Does either fact show that is not a valid density?
Show the answer
Neither does. The right heights are , , and , which add to , so is computed correctly. Because is increasing on , each right rectangle uses the tallest height on its piece, so overestimates the area. The left sum is , an underestimate, and the exact area lies between the two.
The height is probability per unit of . Just below , a short interval of width has probability close to , and indeed .