Why Affine Transformations Matter
Uniform distributions model outcomes that are equally likely across an interval. In applications, however, a quantity may be recorded in a different unit or shifted to a new origin. If \(X\) is uniform on an interval and \(Y=c+dX\), the transformation shifts and rescales the interval. When \(d\) is negative, it also reverses the order of values. Getting the transformed support and density right requires accounting for that reversal.
Assume throughout that \(X\sim\operatorname{Uniform}(a,b)\), where \(a<b\), and that \(c,d\) are fixed real constants. The density of \(X\) is \(1/(b-a)\) on \([a,b]\) and zero outside it; endpoint values of a density do not affect probabilities.
Support and Distribution When \(d\ne0\)
The transformed endpoints are found by applying \(x\mapsto c+dx\) to \(a\) and \(b\). If \(d>0\), this map preserves order, so \(c+da<c+db\). If \(d<0\), it reverses order, so \(c+db<c+da\). In either case, the interval width is \(|d|(b-a)\).
The following result gives both the CDF and density. It is useful to state the cases explicitly: the negative-\(d\) CDF comes from reversing the inequality when solving for \(X\).
Proof. By definition, \(F_Y(y)=P(Y\le y)\). First suppose \(d>0\). Then \(c+dX\le y\) is equivalent to \(X\le (y-c)/d\). For \(c+da\le y\le c+db\), the threshold \((y-c)/d\) lies in \([a,b]\). The uniform CDF of \(X\) therefore gives
Below this interval the event has probability zero, and above it the event has probability one. This proves the stated CDF for \(d>0\).
Now suppose \(d<0\). Dividing the inequality \(c+dX\le y\) by \(d\) reverses its direction, so it is equivalent to \(X\ge (y-c)/d\). For \(c+db\le y\le c+da\), this threshold lies in \([a,b]\). Since \(X\) is continuous, the probability of equality at the threshold is zero, and
The final equality uses \(d=-|d|\). Below the transformed interval the event is impossible; above it the event is certain. Thus the CDF has the stated negative-\(d\) form. In either case, the CDF increases linearly across an interval of width \(|d|(b-a)\), with slope \(1/(|d|(b-a))\). Differentiating on the interval's interior gives the stated density. It integrates to one because its height times the interval width is \(\{1/(|d|(b-a))\}|d|(b-a)=1\). The CDF is continuous at both endpoints, so there are no endpoint point masses. \(\square\)
Worked Transformations
Worked Example: A Positive Rescaling and Shift
Let \(X\sim\operatorname{Uniform}(2,8)\), and define \(Y=3+2X\). Find its support, density, CDF, and \(P(9\le Y\le15)\).
Since \(d=2>0\), the endpoints remain in order: \(3+2(2)=7\) and \(3+2(8)=19\). Thus \(Y\) has support \([7,19]\), of width \(12\), and its density is \(1/12\) on that interval and zero outside.
For \(7\le y\le19\), the CDF is \[ F_Y(y)=\frac{y-7}{12}. \] It is zero below 7 and one above 19. The probability requested is
As a check using \(X\), the event \(9\le3+2X\le15\) is equivalent to \(3\le X\le6\). Its probability is \((6-3)/(8-2)=3/6=1/2\), matching the result.
Worked Example: A Negative Scale Factor
Let \(X\sim\operatorname{Uniform}(1,5)\), and set \(Y=10-3X\). Find the support and CDF, and calculate \(P(-2\le Y\le4)\).
Here \(d=-3\), so the transformed endpoints appear in reverse order: \(10-3(5)=-5\) and \(10-3(1)=7\). The support is \([-5,7]\), with width \(12\), and the density is \(1/12\) on its interior.
For \(-5\le y\le7\), the CDF is
It is zero for \(y<-5\) and one for \(y>7\). In particular, \(F_Y(-5)=0\) and \(F_Y(7)=1\), as a CDF must be. Therefore,
To check by transforming the event, \(-2\le10-3X\le4\). Subtracting 10 gives \(-12\le-3X\le-6\); dividing by \(-3\) reverses both inequality directions, giving \(2\le X\le4\). Its probability is \((4-2)/(5-1)=2/4=1/2\).
Worked Example: Shifting and Shrinking an Interval
Suppose \(X\sim\operatorname{Uniform}(-2,4)\), and define \(Y=5-\tfrac12 X\). Find the support and density, then calculate \(P(3.5<Y\le5)\).
The scale factor is negative. The endpoint images are \(5-\tfrac12(-2)=6\) and \(5-\tfrac12(4)=3\), so the support is \([3,6]\), of width \(3\). The density is therefore \(1/3\) on \((3,6)\) and zero outside. For \(3\le y\le6\), its CDF is \(F_Y(y)=(y-3)/3\).
Because \(Y\) has a continuous distribution, including or excluding a single endpoint does not change the probability. Thus
The event can also be checked on the original scale. The inequality \(3.5<5-\tfrac12X\le5\) is equivalent to \(0\le X<3\): the first inequality gives \(X<3\), and the second gives \(X\ge0\). Hence its probability is \((3-0)/(4-(-2))=3/6=1/2\).
The Zero-Scale Case and a Common Pitfall
If \(d=0\), then \(Y=c\) with probability one, regardless of the distribution of \(X\). This is a point mass at \(c\), not a continuous uniform distribution on an interval of positive width. Its CDF is zero for \(y<c\) and one for \(y\ge c\); it has no density with respect to ordinary length on the real line.
A common mistake is to transform the endpoints and then use them in their original order even when \(d<0\). For example, with \(Y=10-3X\) and \(X\) uniform on \([1,5]\), the image of \(a=1\) is 7 and the image of \(b=5\) is \(-5\). Using 7 as the lower endpoint would produce a decreasing CDF across the interval, which is impossible: if \(y_1\le y_2\), then \(\{Y\le y_1\}\subseteq\{Y\le y_2\}\), so \(F_Y(y_1)\le F_Y(y_2)\). The correction is to sort the two image endpoints and, for the CDF, use \((y-\text{lower endpoint})/(\text{interval width})\) within the support.
The absolute value in the density is another essential safeguard. The density height is the reciprocal of the transformed interval's width, \(|d|(b-a)\), so it must be positive for either sign of \(d\). The total probability is then the height times that width, equal to one.
Check Your Understanding
Work through these questions, paying particular attention to endpoint order when the scale factor is negative.
- If \(X\sim\operatorname{Uniform}(0,6)\) and \(Y=2+3X\), what is the support and density of \(Y\)?
- If \(X\sim\operatorname{Uniform}(2,7)\) and \(Y=9-2X\), state the support and write the CDF on that support.
- For \(X\sim\operatorname{Uniform}(-1,3)\) and \(Y=4-\tfrac12X\), calculate \(P(3\le Y\le4)\).
- Why is the transformed density proportional to \(1/|d|\), rather than \(1/d\), when \(d\ne0\)?
- What is the distribution of \(c+0X\), and why can it not have a density that is constant on an interval of positive width?