Why Ratios Need Careful Transformations
A ratio such as \(R=X/Y\) is not obtained by simply dividing the densities of \(X\) and \(Y\). Its distribution depends on the possible values of both variables, including how the denominator varies. When \(Y\) can be close to zero, even moderate values of \(X\) can produce large values of \(R\). A reliable method must account for both the changing scale and the support of the original variables.
Suppose \(X\) and \(Y\) are independent continuous random variables and \(P(Y=0)=0\), so the ratio is defined with probability one. The density can be found by treating the ratio as one coordinate in a transformation of the pair \((X,Y)\), then integrating out the other coordinate. Independence gives the joint density \(f_X(x)f_Y(y)\); the transformation accounts for how areas change.
The condition \(P(Y=0)=0\) is important: if \(Y\) has positive probability of being zero, \(X/Y\) is not defined on that event unless a separate convention is supplied. A continuous \(Y\) can have density values near zero without having positive probability at zero. In that case the ratio is defined almost surely, though its density may have substantial tails.
Deriving the Ratio-Density Formula
Use the new coordinates \(R=X/Y\) and \(W=Y\). For \(y\ne 0\), the inverse transformation is \(x=rw\), \(y=w\). Thus each pair \((r,w)\) corresponds to the original pair \((x,y)=(rw,w)\). The absolute Jacobian determinant supplies the factor that measures the local change in area.
Set \(R=X/Y\) and \(W=Y\). The inverse is \(X=RW\), \(Y=W\), valid for \(W\ne 0\).
The derivative matrix of the inverse transformation is \(\begin{pmatrix}w&r\\0&1\end{pmatrix}\), whose determinant is \(w\). The absolute Jacobian is therefore \(|w|\).
By independence, the original joint density is \(f_X(x)f_Y(y)\). Substituting \(x=rw\), \(y=w\), and multiplying by the absolute Jacobian gives \(f_{R,W}(r,w)=|w|f_X(rw)f_Y(w)\).
Integrating the joint density of \((R,W)\) over all \(w\) gives \(f_R(r)=\int_{-\infty}^{\infty}|w|f_X(rw)f_Y(w)\,dw\). Renaming \(w\) as \(y\) yields the stated formula.
This derivation also explains why the absolute value is necessary. If the denominator is negative, the determinant is negative, but a density cannot be negative. Area changes by the magnitude of the determinant, \(|w|\), regardless of its sign. The integration over \(y\) must include positive and negative values whenever they are in the support of \(Y\).
Worked Examples
Worked Example: A Ratio of Uniform Variables on Positive Intervals
Let \(X\sim\operatorname{Uniform}(0,2)\) and \(Y\sim\operatorname{Uniform}(1,2)\), independently. Find the density of \(R=X/Y\), state its support, and check that it integrates to one.
Method. Apply the ratio-density formula. The densities are \(f_X(x)=1/2\) for \(0<x<2\), and \(f_Y(y)=1\) for \(1<y<2\). Since both variables are positive, \(R>0\). For a fixed \(r>0\), the integrand is nonzero when \(1<y<2\) and \(0<ry<2\), or \(y<2/r\). Therefore $$ f_R(r)=\frac12\int_{1}^{\min(2,\,2/r)} y\,dy $$ when the upper limit exceeds 1, and it is zero otherwise. A nonempty interval requires \(r<2\).
For \(0<r\leq 1\), \(2/r\geq 2\), so the full interval \(1<y<2\) contributes: $$ f_R(r)=\frac12\left[\frac{y^2}{2}\right]_{1}^{2} =\frac12\left(\frac{4-1}{2}\right)=\frac34. $$ For \(1<r<2\), the upper limit is \(2/r\), giving $$ f_R(r)=\frac12\left[\frac{y^2}{2}\right]_{1}^{2/r} =\frac14\left(\frac{4}{r^2}-1\right) =\frac{1}{r^2}-\frac14. $$ For \(r\leq 0\) or \(r\geq 2\), the density is zero. Hence $$ f_R(r)= \begin{cases} \frac34, & 0<r\leq 1,\\ \frac{1}{r^2}-\frac14, & 1<r<2,\\ 0, & \text{otherwise}. \end{cases} $$
Check. Its total integral is $$ \int_0^1\frac34\,dr+\int_1^2\left(\frac{1}{r^2}-\frac14\right)dr =\frac34+\left[-\frac1r-\frac r4\right]_1^2 =\frac34+\frac14=1. $$ The density is nonnegative on its support and joins continuously at \(r=1\), where both formulas give \(3/4\). The common mistake to avoid is omitting the Jacobian factor \(y\); the resulting expression would not integrate to one.
Worked Example: A Ratio of Independent Exponential Variables
Let \(X\sim\operatorname{Exponential}(\text{rate }2)\) and \(Y\sim\operatorname{Exponential}(\text{rate }1)\), independently. Find the density of \(R=X/Y\), then calculate \(P(R>1)\).
Method. Both variables are positive, with \(f_X(x)=2e^{-2x}\) for \(x>0\) and \(f_Y(y)=e^{-y}\) for \(y>0\). Thus \(r>0\), and $$ f_R(r)=\int_0^\infty y(2e^{-2ry})(e^{-y})\,dy =2\int_0^\infty y e^{-(2r+1)y}\,dy. $$ For \(a>0\), integration by parts gives \(\int_0^\infty ye^{-ay}\,dy=1/a^2\): take \(u=y\), \(dv=e^{-ay}dy\), so the boundary term \(-ye^{-ay}/a\) is zero at both endpoints, leaving \((1/a)\int_0^\infty e^{-ay}dy=1/a^2\). Substituting \(a=2r+1\) gives $$ f_R(r)=\frac{2}{(2r+1)^2},\qquad r>0, $$ and \(f_R(r)=0\) otherwise.
To find the requested probability, integrate the density over \(r>1\): $$ P(R>1)=\int_1^\infty\frac{2}{(2r+1)^2}\,dr =\left[-\frac{1}{2r+1}\right]_1^\infty =\frac13. $$ As a density check, \(\int_0^\infty 2/(2r+1)^2\,dr=[-1/(2r+1)]_0^\infty=1\). The common mistake is to reverse the exponential rates or forget that the rate of \(X\) appears multiplied by \(r\) after substituting \(x=ry\). The transformed exponent is \(-(2r+1)y\), not \(-(r+1)y\).
Worked Example: A Ratio When the Denominator Can Be Negative
Let \(X\) and \(Y\) be independent, each uniformly distributed on \((-1,1)\). Find the density of \(R=X/Y\) and verify its total probability. Although \(Y\) can be negative, \(P(Y=0)=0\), so the ratio is defined almost surely.
Method. Each density is \(1/2\) on \((-1,1)\). For a fixed \(r\), the integrand is \(|y|/4\), subject to \(|y|<1\) and \(|ry|<1\). If \(|r|\leq 1\), the binding condition is \(|y|<1\). If \(|r|>1\), it is \(|y|<1/|r|\). Write \(a=1\) in the first case and \(a=1/|r|\) in the second. Then $$ f_R(r)=\frac14\int_{-a}^{a}|y|\,dy =\frac14\left(2\int_0^a y\,dy\right) =\frac{a^2}{4}. $$ Consequently, $$ f_R(r)= \begin{cases} \frac14, & |r|\leq 1,\\ \frac{1}{4r^2}, & |r|>1. \end{cases} $$
The density is nonnegative, and its integral is $$ \int_{-1}^{1}\frac14\,dr+ 2\int_1^\infty\frac{1}{4r^2}\,dr =\frac12+\frac12=1. $$ The two-sided tail occurs because values of \(Y\) near zero can produce large ratios of either sign. The common mistake is to integrate only over positive \(y\); that would discard cases where the denominator is negative and would give an incorrect density and total probability.
Support, Assumptions, and Exam Traps
The formula is compact, but its correct use depends on translating the original support into conditions on the integration variable. For each proposed \(r\), retain only the \(y\)-values for which both \(y\) is possible for \(Y\) and \(ry\) is possible for \(X\). These conditions may lead to different integration limits in different ranges of \(r\). A density expression derived without these support restrictions can assign positive density to impossible ratios.
Independence is used specifically to write the joint density as \(f_X(x)f_Y(y)\). If \(X\) and \(Y\) are dependent, the same change of variables still works when a joint density exists, but the formula becomes \(f_R(r)=\int_{-\infty}^{\infty}|y|f_{X,Y}(ry,y)\,dy\). Replacing that joint density by a product without independence is not valid. If the denominator can equal zero with positive probability, the ratio needs additional treatment and the continuous-density formula alone does not describe the resulting situation.
A practical solution sequence is to identify the sign and support of the ratio, impose the two support conditions, evaluate the integral on each resulting range, and finally check nonnegativity and total integral. This is especially useful when the denominator has support on both sides of zero: do not assume the ratio is positive, and do not discard the negative-\(y\) part of the integral.
Check Your Understanding
For each problem, apply the ratio-density formula and keep the support restrictions explicit before evaluating the integral.
- Independent \(X\sim\operatorname{Uniform}(0,1)\) and \(Y\sim\operatorname{Uniform}(1,3)\) define \(R=X/Y\). Find the density of \(R\), including its support. (Answer: \(f_R(r)=2\) for \(0<r\leq1/3\), \(f_R(r)=\frac14(r^{-2}-1)\) for \(1/3<r<1\), and \(0\) otherwise.)
- Independent \(X\sim\operatorname{Exponential}(\text{rate }3)\) and \(Y\sim\operatorname{Exponential}(\text{rate }2)\) define \(R=X/Y\). Find \(f_R(r)\) and \(P(R>2)\). (Answer: \(f_R(r)=6/(3r+2)^2\) for \(r>0\), zero otherwise; \(P(R>2)=1/4\).)
- Independent \(X,Y\sim\operatorname{Uniform}(-2,2)\) define \(R=X/Y\). Find its density in the central region and in the tails, and state \(P(|R|>1)\). (Answer: \(f_R(r)=1/4\) for \(|r|\leq1\), \(f_R(r)=1/(4r^2)\) for \(|r|>1\); \(P(|R|>1)=1/2\).)
- Independent \(X\sim\operatorname{Uniform}(0,2)\) and \(Y\sim\operatorname{Uniform}(1,2)\) define \(R=X/Y\). Use the density to find \(P(R>1)\). (Answer: \(P(R>1)=1/4\).)