From a Density to a Calculation
A density can often be recognized by its support and functional form: a constant on an interval suggests a uniform law, powers of \(x\) and \(1-x\) on \((0,1)\) suggest a beta law, and exponential decay on the positive half-line suggests an exponential or gamma law. Recognizing the family is only the first step. The support, parameters, and normalizing constant must all agree before using a distribution formula.
The calculations below use the uniform distribution on an interval, the beta distribution with shape parameters \(a,b\), the exponential distribution with rate \(\lambda\), and the gamma distribution with shape \(k\) and rate \(\lambda\). In particular, the gamma density uses a rate, not a scale.
For a gamma density, \(k\) is the shape and \(\lambda\) is the rate. The exponential law is the gamma law with shape \(k=1\); its density is \(\lambda e^{-\lambda x}\). Matching an exponential term \(e^{-\lambda x}\) while overlooking the factor in front, or reading a rate as a scale, can produce an incorrect identification.
A Reliable Recognition Procedure
When given a proposed density, compare it to the family formulas in a fixed order. First check where the density is positive. Then compare its algebraic form with the candidate density, including its constant. Finally, check that each parameter meets the restrictions needed for that density to integrate to one.
A constant density on a finite interval points to a uniform law; a beta density lives on \((0,1)\); exponential and gamma densities live on \((0,\infty)\).
On \((0,1)\), compare powers of \(x\) and \(1-x\) with \(a-1\) and \(b-1\). On \((0,\infty)\), compare the power of \(x\) and the exponential decay.
A matching shape is not enough: the leading constant must normalize the density, and the parameters must be admissible.
Use the support and distribution function for probabilities and quantiles, and the appropriate moment formula for expectations.
Worked Calculations
Worked Example: Uniform Probability and Quantile
Suppose \(X\) has density \(f(x)=1/6\) for \(2<x<8\), and zero otherwise. Find \(P(3<X\leq 5)\) and the 90th percentile.
The density is constant on the interval \((2,8)\), whose length is \(8-2=6\). Its value \(1/6\) is the reciprocal of that length, so \(X\sim\operatorname{Unif}(2,8)\).
For an interval inside the support, the probability is its length divided by the support length:
For \(2\leq x\leq 8\), the CDF is \(F(x)=(x-2)/6\). The 90th percentile \(q_{0.9}\) solves \(F(q_{0.9})=0.9\), so
This value lies in \([2,8]\), as a valid quantile must.
Worked Example: A Beta Density and a Probability
A density on \(0<x<1\) is \(f(x)=12x(1-x)^2\). Identify the distribution and calculate \(P(X\leq 1/2)\).
The powers are \(x^1\) and \((1-x)^2\), so the beta shape parameters are \(a=2\) and \(b=3\). The normalizing constant is
Thus the proposed constant agrees with the beta density, and \(X\sim\operatorname{Beta}(2,3)\). Integrate the density over the requested interval:
The result is between zero and one. The shape parameters are positive, and the density’s support is exactly the beta support.
Worked Example: Exponential Survival Probability
A lifetime \(T\) has density \(f(t)=3e^{-3t}\) for \(t>0\), and zero otherwise. Find the probability that it lasts longer than \(0.2\) time units but no longer than \(1\).
The support is positive, the exponential rate is \(\lambda=3>0\), and the leading constant equals that rate. Hence \(T\sim\operatorname{Exp}(3)\). Its CDF for \(t\geq0\) is \(F(t)=1-e^{-3t}\), so
The subtraction removes the probability accumulated up to \(0.2\), leaving only the requested interval. The result is positive because \(e^{-0.6}>e^{-3}\).
Worked Example: Gamma Density and Integer-Shape CDF
Let \(X\) have density \(f(x)=4x^2e^{-2x}\) for \(x>0\). Identify its parameters and calculate \(P(X\leq1)\).
The power \(x^2\) gives \(k-1=2\), hence \(k=3\), and the exponential term gives rate \(\lambda=2\). The gamma normalizing constant is
The constant matches, so \(X\sim\operatorname{Gamma}(3,2)\). For a positive integer shape \(m\), the gamma CDF is
Using \(m=3\), \(\lambda=2\), and \(x=1\):
The expression is a valid probability. The positive support, integer shape, and rate are all consistent with the gamma model.
Two Useful Derivations
Proof. The condition \(r>-a\) ensures integrability near zero, while \(b>0\) ensures integrability near one. Substituting the beta density into the expectation gives
For the mean, the beta-function identity \(B(a+1,b)=aB(a,b)/(a+b)\) gives the stated result. To verify that identity, first note that splitting \(1=x+(1-x)\) in the beta integral gives \(B(a,b)=B(a+1,b)+B(a,b+1)\). Integrating the derivative of \(x^a(1-x)^b\) from zero to one gives \(aB(a,b+1)=bB(a+1,b)\); the boundary terms vanish because \(a,b>0\). Combining these two equalities yields \(B(a+1,b)=aB(a,b)/(a+b)\). \(\square\)
Proof. The survival probability is the integral of the density from \(x\) to infinity. Set \(u=\lambda t\) in that integral:
Write the integral on the right as \(I_m(z)=\int_z^\infty u^{m-1}e^{-u}\,du\), where \(z=\lambda x\). Integration by parts gives \(I_m(z)=z^{m-1}e^{-z}+(m-1)I_{m-1}(z)\), and \(I_1(z)=e^{-z}\). Repeatedly applying this recurrence yields \(I_m(z)=(m-1)!e^{-z}\sum_{j=0}^{m-1}z^j/j!\). Dividing by \((m-1)!\) gives the survival probability; subtracting it from one gives the CDF formula. \(\square\)
Common Pitfall: Matching Shape but Not Parameters
A density proportional to \(x^2e^{-2x}\) on the positive half-line has the shape of a gamma density with \(k=3\) and \(\lambda=2\). That does not by itself establish that the expression is a probability density. Its constant must be \(2^3/\Gamma(3)=4\). For example, \(2x^2e^{-2x}\) has the same support and shape but integrates to \(1/2\), not one, so it is not a density as written.
A related error is to use a gamma rate as though it were a scale. With rate \(\lambda\), the exponential factor is \(e^{-\lambda x}\) and the mean is \(k/\lambda\); with scale \(\theta\), the factor is \(e^{-x/\theta}\). Check which convention the displayed density uses before substituting into a formula.
Check Your Understanding
For each question, verify the support and parameters before calculating.
- A density is \(1/4\) on \(1<x<5\). What is the distribution, and what is its 75th percentile?
- For \(X\sim\operatorname{Beta}(1,2)\), use the density to find \(P(X>1/2)\).
- A density is \(5e^{-5x}\) for \(x>0\). Identify its rate and calculate \(P(X>0.4)\).
- For \(X\sim\operatorname{Gamma}(2,3)\), write \(P(X\leq x)\) using the integer-shape CDF formula.
- Why does \(7x^2e^{-2x}\) fail to be a gamma density as written, even though its support and shape match a gamma kernel?