ExamSaathi learning library · Government exams · SSC CGL quantitative foundations; published syllabus labelled 2024 · Quantitative aptitude
Continuous random variables: density functions and the uniform distribution
Work with a continuous random variable through its probability density function: find the constant k, read chances as areas, use the distribution function F(t) for intervals and the median, integrate simple polynomials for the mean and variance, and apply the uniform distribution.
Status: original pilot lesson. Teacher review is pending. It is not a complete course or official exam material.
You will learn to
- Explain why a continuous random variable has probability 0 at any single value, and read its probabilities as areas under the probability density function.
- Find the constant k in a probability density function from rectangle and triangle areas or by integrating a simple polynomial density.
- Use the distribution function F(t) = P(T <= t) of a continuous random variable to get interval probabilities, the median and the density.
- Calculate the mean and variance of a continuous random variable by integrating t x f(t) and t^2 x f(t) over the range of its density.
- Apply the uniform distribution on a to b, with density 1 / (b - a), mean (a + b) / 2 and variance (b - a)^2 / 12, to waiting times.
Before you start
A count, such as the number of late buses in a day, jumps from one whole number to the next, and its chances are added up from a table. A measurement, such as the minutes you wait on a platform or the litres of milk a cow gives, can take any value in an interval. For a measurement, chances come from areas under a curve, not from sums. You need the areas of a rectangle and a triangle, and one rule of integration: for n = 0, 1, 2 and so on, the integral of t^n is t^(n + 1) / (n + 1). To find an integral from a to b, put in b, put in a, and subtract the second result from the first. For example, the integral of t from 0 to 4 is 4^2 / 2 - 0 = 8. Here T or W is the random variable, t or w is a particular value, f(t) is the density and F(t) is the distribution function. The letter x always means multiply, and all data are invented for practice.
Probability as area under a density
A continuous random variable T can take every value in an interval, such as any time from 0 to 6 minutes. It is described by a probability density function f(t), drawn as a curve above the horizontal axis. A valid density obeys two rules: f(t) is never negative, and the total area between the curve and the axis is exactly 1. The chance that T falls between a and b is the area under the curve from a to b. A single value has no width, so P(T = a) = 0 for every a, and P(T < 3) equals P(T <= 3). The height f(t) is not a probability and may be bigger than 1: f(t) = 4 on 0 to 0.25 is a valid density, because 4 x 0.25 = 1. To find an unknown constant k, set the total area equal to 1. For f(t) = k on 2 to 7, the rectangle gives 5k = 1, so k = 0.2. For f(t) = k x t on 0 to a, the triangle has base a and height k x a, so k x a^2 / 2 = 1 and k = 2 / a^2. If the graph is curved, integrate instead: for f(t) = k x t^2 on 0 to 3, the integral of k x t^2 from 0 to 3 is k x (3^3 / 3 - 0) = 9k, so k = 1/9.
The distribution function F(t) and the median
The distribution function is F(t) = P(T <= t), the area under the density to the left of t. It is 0 below the range, never decreases, and reaches 1 at the top of the range. Once F is known, an interval needs only a subtraction: P(a < T <= b) = F(b) - F(a), and P(T > b) = 1 - F(b). Take f(t) = t/2 on 0 to 2. The area from 0 to t is a triangle with base t and height t/2, so F(t) = t^2/4. Then P(0.5 < T <= 1.5) = 2.25/4 - 0.25/4 = 0.5. The median is the value of t that leaves half the area on each side, so solve F(t) = 0.5. Here t^2 = 2, and the median is sqrt(2), about 1.4142, not the midpoint 1. Going the other way, the density is the slope of F, and the slope of t^n is n x t^(n - 1). So if F(t) = t^3/27 on 0 to 3, then f(t) = 3t^2/27 = t^2/9 there and 0 outside, which is the density whose k was found in the previous section.
Mean and variance by integration
For a count, the mean adds up value x probability. For a continuous variable the sum becomes an integral over the range: E(T) = integral of t x f(t), and E(T^2) = integral of t^2 x f(t). Then Var(T) = E(T^2) - (E(T))^2, and the SD is its square root. Work each integral in three steps: multiply out the expression into powers of t, raise each power by 1 and divide by the new power, then put in the top limit and subtract the value at the bottom limit. For f(t) = t/2 on 0 to 2, E(T) = integral of t^2/2 from 0 to 2 = 2^3/6 - 0 = 4/3, about 1.3333. Next, E(T^2) = integral of t^3/2 from 0 to 2 = 2^4/8 - 0 = 2. So Var(T) = 2 - 16/9 = 2/9, about 0.2222, and the SD is about 0.4714. This density rises towards 2, so the mean lies above the midpoint 1, pulled towards the heavier end. The mean always lies inside the range, and the variance is never negative.
The uniform distribution on a to b
If T is equally likely to fall in any two stretches of the same length inside an interval a to b, it has the uniform, or rectangular, distribution. Its density is flat: f(t) = 1 / (b - a) for a <= t <= b and 0 elsewhere, a rectangle of area 1. Probabilities become ratios of lengths: for c and d inside the interval, P(c < T < d) = (d - c) / (b - a). The mean and the median are both the midpoint (a + b) / 2, and the variance is (b - a)^2 / 12, so the SD is (b - a) / sqrt(12). The 12 comes from the integrals. On 0 to 1, E(T) = 1/2 and E(T^2) = integral of t^2 from 0 to 1 = 1/3, so the variance is 1/3 - 1/4 = 1/12. A Delhi Metro train that leaves every 6 minutes gives a typical case: a passenger who reaches the platform at a random moment waits a time that is uniform on 0 to 6. Likewise, a parcel promised between 2 pm and 5 pm, with no time more likely than another, arrives before 3 pm with chance 1/3.
Common mistakes
Reading the height f(t) as a probability; only areas are probabilities, and a density can rise above 1. Giving a single value such as P(T = 3) a positive chance, or treating 'less than' and 'at most' as different for a continuous variable. Forgetting the half in a triangle's area, which makes k half its true size. Integrating f(t) instead of t x f(t) for the mean; that simply returns the total area 1. Stopping at E(T^2) and calling it the variance, or squaring f(t) instead of t. Forgetting to subtract the value at the lower limit when the range does not start at 0. Taking the median as the middle of the range when the density is not symmetric. For the uniform distribution, dividing (b - a)^2 by 2 or 6 instead of 12, or giving the variance when the SD is asked for.
A routine for density questions
1. Sketch f(t) over its range and note where it is 0. 2. Find any constant k from total area = 1, using shapes for straight-line graphs and integration for curves. 3. When several intervals are asked, write F(t) first and use F(b) - F(a); remember that P(T = a) = 0. 4. For the median, solve F(t) = 0.5 and keep the root that lies inside the range. 5. For the mean and variance, integrate t x f(t) and t^2 x f(t), then use E(T^2) - (E(T))^2. 6. For a uniform variable, use 1 / (b - a), length ratios, (a + b) / 2 and (b - a)^2 / 12. 7. Sense-check: every probability lies from 0 to 1, F ends at 1, the mean lies inside the range and the variance is positive.
Worked examples
The time T, in hours, that a repair crew in Pune takes to mend a broken water line has density f(t) = k x (4 - t) for 0 <= t <= 4, and 0 elsewhere. Find k, and the probability that a repair takes at most 1 hour.
- The graph is a straight line falling from height 4k at t = 0 to 0 at t = 4, so the area under it is a triangle with base 4 and height 4k.
- Total area = (1/2) x 4 x 4k = 8k. Setting 8k = 1 gives k = 1/8 = 0.125, so f(t) = (4 - t) / 8.
- By integration: the integral of (4 - t) / 8 is (4t - t^2/2) / 8. At t = 1 this is (4 - 0.5) / 8 = 0.4375, and at t = 0 it is 0, so P(T <= 1) = 0.4375 - 0 = 0.4375.
- Check by shapes: P(T > 1) is the triangle from 1 to 4 with base 3 and height f(1) = 3/8, so its area is (1/2) x 3 x 3/8 = 9/16 = 0.5625, and 1 - 0.5625 = 0.4375.
Answer: k = 1/8 = 0.125, and P(T <= 1) = 7/16, about 0.4375.
Houses are spread evenly over a round town of radius 6 km, so the distance W, in km, of a house picked at random from the town centre has density f(w) = k x w for 0 <= w <= 6, and 0 elsewhere. Find k, the mean distance and the variance of the distance.
- Total area: the integral of k x w from 0 to 6 = k x (6^2/2 - 0) = 18k. So 18k = 1 and k = 1/18. The triangle (1/2) x 6 x 6k = 18k agrees.
- Mean: E(W) = integral of w x w/18 from 0 to 6 = integral of w^2/18 = (6^3/3) / 18 - 0 = 72/18 = 4 km.
- E(W^2) = integral of w^2 x w/18 from 0 to 6 = integral of w^3/18 = (6^4/4) / 18 - 0 = 324/18 = 18.
- Var(W) = E(W^2) - (E(W))^2 = 18 - 4^2 = 2, so the SD is sqrt(2), about 1.4142 km.
- The mean, 4 km, is above the midpoint 3 km because there is more room for houses in the outer rings of the town.
Answer: k = 1/18, the mean distance is 4 km and the variance is 2 (SD about 1.4142 km).
Trains on a Delhi Metro line leave a station every 6 minutes, and Kavya reaches the platform at a random moment, so her wait W is uniform on 0 to 6 minutes. Find the probability that she waits more than 4 minutes, and the mean and SD of her wait.
- Density: f(w) = 1 / (6 - 0) = 1/6 for 0 <= w <= 6, and 0 elsewhere. The rectangle has area 6 x 1/6 = 1.
- P(W > 4) is a ratio of lengths: (6 - 4) / 6 = 2/6 = 1/3, about 0.3333.
- Mean = (0 + 6) / 2 = 3 minutes.
- Variance = (6 - 0)^2 / 12 = 36/12 = 3, so the SD = sqrt(3), about 1.7321 minutes.
Answer: P(W > 4) = 1/3, about 0.3333; the mean wait is 3 minutes and the SD is about 1.7321 minutes.
Practice checks
- The distance W, in km, from a Pune warehouse to a customer's address has density f(w) = k x w for 0 <= w <= 10, and 0 elsewhere. What is k?
- A continuous random variable T has distribution function F(t) = t^2/25 for 0 <= t <= 5, with F(t) = 0 for t < 0 and F(t) = 1 for t > 5. What is P(2 < T <= 4)?
- The time T, in minutes, that a food-delivery rider in Bengaluru spends at a restaurant has density f(t) = t/32 for 0 <= t <= 8, and 0 elsewhere. What is the median time?
- The time T, in hours, for which a printing machine in Nagpur runs before it needs fresh ink has density f(t) = 3t^2/8 for 0 <= t <= 2, and 0 elsewhere. What is the variance of T?
- Buses on a Chandigarh route leave a stop every 15 minutes, and a commuter arrives at a random moment, so the wait W is uniform on 0 to 15 minutes. What is the variance of W?
Sources checked
- SSC CGL Scheme and Syllabus, labelled 2024 — Tier-II Paper-II Statistics (Random Variable and Probability Distributions: random variable, probability functions); not verified as the full 2026-cycle syllabus
- OpenStax, Introductory Statistics 2e — Section 5.1, continuous probability functions: probability as the area under the density curve, total area 1, and the probability of a single exact value being 0; mathematical relationships only
- OpenStax, Introductory Statistics 2e — Section 5.2, the uniform distribution: equally likely values over an interval, probabilities as areas of rectangles, and its mean and standard deviation; mathematical relationships only
- NIST/SEMATECH e-Handbook of Statistical Methods — Section 1.3.6.6.2, Uniform Distribution: density 1 / (B - A) on A to B, mean (A + B) / 2 and standard deviation sqrt((B - A)^2 / 12); mathematical relationships only