Functions of a random variable
A telescope’s camera records how bright a star is, but astronomers report its magnitude, a logarithm of the brightness. If the brightness is random with a known distribution, what is the distribution of the magnitude, or of any quantity computed from a random one?
Where you are 5 in Random variables
Why this exists
A star’s distance is the reciprocal of its parallax, and its magnitude is a logarithm of its brightness. Expectation, linearity and indicators found the mean of g(X) from the distribution of X alone, and Variance and covariance found how aX + b spreads. Neither answers P(g(X) > 40) or names the median of g(X): that needs the whole distribution of Y = g(X).
The distribution function always gives it, because \{g(X) \le y\} is an event about X. When g is smooth and monotone on pieces, a change-of-variables formula turns f_X into f_Y in one line. Read backward, the same ideas let a computer that makes only uniform random numbers produce any distribution.
Definition
Let X be a random variable and g a real function. Then Y = g(X) is the random variable with Y(\omega) = g(X(\omega)). Throughout, g is monotone, or continuous except at finitely many points of each bounded interval; for such g, P(g(X) \le y) is determined by the distribution of X (for a general g this is a question of measure theory).
The distribution function method rewrites the event as a statement about X:
If F_Y meets the conditions of Result 4 of Densities and cumulative distribution functions, Y has the density F_Y'.
The quantile function of X is
The minimum exists: by Result 2 of Discrete distributions: binomial, geometric, Poisson, F_X is nondecreasing with limits 0 and 1, so the set is an interval, nonempty, bounded below and running to +\infty, and it contains its left end because F_X is continuous from the right. Where F_X is continuous and strictly increasing, Q_X is the inverse function F_X^{-1}.
Intuition
Push X through g. A short interval of length dx at x carries probability about f_X(x) \, dx, and g carries it onto an interval of length about |g'(x)| \, dx. Spread over that length, the probability has thickness f_X(x) / |g'(x)|: where g stretches, the density thins, and where g squeezes, it piles up. When g is not one-to-one, several strips of x values land on the same band of y values and their contributions add (Figure 1).
Results
Result 1 (discrete variables). If X is discrete, then Y = g(X) is discrete, and for each value y
Result 2 (one monotone piece). Let X have a density f_X that is 0 outside an open interval I and continuous on I except at finitely many points. Let g have a continuous derivative with g'(x) \ne 0 for x \in I. Then g is strictly monotone on I and maps it onto an open interval J, its inverse h : J \to I has h'(y) = 1/g'(h(y)), and Y = g(X) has the density
and 0 off J. In particular, for constants a \ne 0 and b, aX + b has the density \displaystyle \frac{1}{|a|} f_X\!\left(\frac{y - b}{a}\right); its mean and variance are in Result 2 of Variance and covariance.
Result 3 (monotone pieces). Let f_X be 0 outside the union of disjoint open intervals I_1, \dots, I_k, and on each I_j let f_X and g be as in Result 2, with g mapping I_j onto J_j and inverse h_j : J_j \to I_j. Then Y = g(X) has the density
Moreover \int |y| \, f_Y(y) \, dy and \int |g(x)| \, f_X(x) \, dx are equal, both finite or both infinite, and when finite
This proves Result 1 of Expectation, linearity and indicators for every g that is smooth and strictly monotone on finitely many pieces.
Result 4 (the probability integral transform). If F_X is continuous, then F_X(X) \sim \operatorname{Uniform}(0, 1).
Result 5 (the inverse transform). Let X be any random variable and U \sim \operatorname{Uniform}(0, 1). Then Q_X(U) has the distribution function F_X. (The values U = 0 and U = 1, where Q_X is undefined, have probability 0.)
Why it is true
Result 1. Y takes countably many values because X does, and \{g(X) = y\} is the disjoint union of the events \{X = x\} with g(x) = y, so countable additivity adds their probabilities, as in the proof of Result 1 of Expectation, linearity and indicators.
Results 2 and 3. On I_j, g' is continuous and never 0, so by the intermediate value theorem it keeps one sign, and by the mean value theorem g is strictly monotone there. So g maps I_j onto an open interval J_j = (\alpha, \beta), and its inverse has h_j' = 1/g'(h_j) (Derivatives of inverse functions), continuous with the sign of g'. Result 2 is the case k = 1, so we prove Result 3.
Let I_j = (a, b) and suppose g increases there. For y \in J_j, the x \in I_j with g(x) \le y form (a, h_j(y)], and the substitution x = h_j(s) gives
An improper end is handled by substituting on closed subintervals and taking limits, allowed because the integrands are nonnegative. If g decreases on I_j, the x with g(x) \le y form [h_j(y), b), where x = b corresponds to s = \alpha, and the same substitution gives \int_\alpha^y f_X(h_j(s)) \, |h_j'(s)| \, ds. The probability is 0 for y \le \alpha and P(X \in I_j) for y \ge \beta. So in every case it is \int_{-\infty}^{y} \varphi_j(s) \, ds, where \varphi_j = f_X(h_j) \, |h_j'| on J_j and 0 off it.
Outside I_1 \cup \dots \cup I_k the density is 0, so that set has probability 0, and adding over j gives F_Y(y) = \int_{-\infty}^{y} f_Y(s) \, ds for every y. Hence F_Y is continuous, P(Y = c) = 0 for every c, and P(c \le Y \le d) = \int_c^d f_Y: f_Y is a density of Y. For the mean, the same substitution with the factor |s| = |g(x)| inserted gives \int_{J_j} |s| \, \varphi_j(s) \, ds = \int_{I_j} |g(x)| \, f_X(x) \, dx; add over j. When these are finite, each piece converges absolutely and the computation without absolute values gives E(g(X)).
Result 4. Write F = F_X and fix 0 < u < 1. F is continuous with limits 0 and 1, so by the intermediate value theorem \{x : F(x) = u\} is nonempty; it is closed, and bounded above because F(x) \to 1. Let x_u be its largest element. If X \le x_u, then F(X) \le F(x_u) = u, since F is nondecreasing. If X > x_u, then F(X) \ge u, and F(X) \ne u by the choice of x_u, so F(X) > u. Hence \{F(X) \le u\} = \{X \le x_u\}, and
Since 0 \le F(X) \le 1, and P(F(X) \le 0) \le u for every u > 0, this is the distribution function of \operatorname{Uniform}(0, 1) (Result 6 of Densities and cumulative distribution functions).
Result 5. Write Q = Q_X and F = F_X, and fix 0 < u < 1. If F(x) \ge u, then x lies in the set whose minimum is Q(u), so Q(u) \le x. If Q(u) \le x, then F(x) \ge F(Q(u)) \ge u, because F is nondecreasing and Q(u) lies in that set. So Q(u) \le x exactly when u \le F(x), and since P(0 < U < 1) = 1,
Worked examples
The night of the first clear sky
Amara starts watching for a comet on a Monday night, which she counts as night 1. Each night, independently, is clear with probability 0.3. Let N be the first clear night and W its weekday, numbered 1 for Monday through 7 for Sunday. Find the pmf of W and the probability that the first clear night is a Saturday or Sunday night.
SolutionN \sim \operatorname{Geometric}(0.3), so p_N(n) = 0.3 \, (0.7)^{n-1} for n = 1, 2, 3, \dots (Discrete distributions: binomial, geometric, Poisson). Night n falls on weekday k exactly when n = k + 7j for a whole number j, so W is a function of N, and Result 1 with the geometric series gives, for k = 1, \dots, 7,
Here 1 - 0.7^7 = 0.9176457, so P(W = 1) \approx 0.3269, and each later weekday is 0.7 times the one before it. The weekend is k = 6 or 7:
Parallax and distance
A star’s parallax X, in arcseconds, is the yearly shift in its direction as the Earth orbits, and its distance in parsecs is D = 1/X. For a star in a cluster, Isaac models X \sim \operatorname{Uniform}(0.02, 0.05). Find the density of D, P(D > 40), and the mean and median of D.
SolutionOn I = (0.02, 0.05), \displaystyle g(x) = \frac{1}{x} has \displaystyle g'(x) = -\frac{1}{x^2} \ne 0 and maps I onto J = (20, 50), with inverse \displaystyle h(d) = \frac{1}{d} and \displaystyle |h'(d)| = \frac{1}{d^2}. Since \displaystyle f_X = \frac{1}{0.03} = \frac{100}{3} on I, Result 2 gives
and 0 otherwise. Then
and directly, D > 40 exactly when X < 0.025, with probability \displaystyle \frac{0.005}{0.03} = \frac16. The mean is
while \displaystyle \frac{1}{E(X)} = \frac{1}{0.035} \approx 28.57: the mean of a reciprocal is not the reciprocal of the mean. The median does pass through: \displaystyle D \ge \frac{1}{0.035} exactly when X \le 0.035, the median of X, so D has median \displaystyle \frac{1}{0.035}, about 28.57 parsecs (Exercise 19).
A guide star off its mark
Isaac’s guiding camera measures how far the guide star sits from its target along the drive axis. At a random moment this offset X, in arcseconds, is \operatorname{Uniform}(-1, 2), and the guiding software works with Y = X^2. Find the density of Y, P(Y > 2) and the median of Y.
Solutiong(x) = x^2 decreases on I_1 = (-1, 0), onto J_1 = (0, 1) with \displaystyle h_1(y) = -\sqrt{y}, and increases on I_2 = (0, 2), onto J_2 = (0, 4) with \displaystyle h_2(y) = \sqrt{y}; the point 0 has probability 0. Both have \displaystyle |h_j'(y)| = \frac{1}{2\sqrt{y}}, and \displaystyle f_X = \frac13. For 0 < y < 1 both pieces count, and for 1 < y < 4 only I_2 does (Figure 1), so Result 3 gives
and 0 otherwise. It is unbounded near 0, yet its improper integral is \displaystyle \frac23 + \frac13 = 1. The distribution function method agrees: \displaystyle F_Y(y) = P(-\sqrt{y} \le X \le \sqrt{y}) = \frac{2\sqrt{y}}{3} for 0 \le y \le 1, and \displaystyle F_Y(y) = P(X \le \sqrt{y}) = \frac{\sqrt{y} + 1}{3} for 1 \le y \le 4, whose derivatives are the two lines above. So
Since \displaystyle F_Y(1) = \frac23 > \frac12, the median m solves \displaystyle \frac{2\sqrt{m}}{3} = \frac12, so \displaystyle m = \frac{9}{16}, not the square \displaystyle \frac14 of the median of X.
The square of a standard normal
Let Z \sim N(0, 1) (The standard normal distribution), with density \displaystyle \varphi(z) = \frac{1}{\sqrt{2\pi}} e^{-z^2/2}. Prove that Y = Z^2 has density \displaystyle f_Y(y) = \frac{1}{\sqrt{2\pi y}} e^{-y/2} for y > 0, and 0 for y \le 0. Then the pointing error X of Amara’s mount after a slew, in arcminutes along one axis, is N(0, 4); find P(X^2 > 4).
SolutionTake I_1 = (-\infty, 0) and I_2 = (0, \infty); the point 0 has probability 0, and g(z) = z^2 has g'(z) = 2z \ne 0 on each. Both map onto (0, \infty), with \displaystyle h_j(y) = \mp\sqrt{y} and \displaystyle |h_j'(y)| = \frac{1}{2\sqrt{y}}. By Result 3, for y > 0, since \varphi is even,
As Y \ge 0, f_Y = 0 for y \le 0. \blacksquare This is the chi-square distribution with one degree of freedom; its relatives with more degrees of freedom underlie the Chi-square tests of statistics.
For the mount, the linear case of Result 2 with \displaystyle a = \frac12 shows that X/2 has density \displaystyle 2 f_X(2z) = 2 \cdot \frac{1}{2\sqrt{2\pi}} e^{-4z^2/8} = \varphi(z), so Z = X/2 is standard normal. Then X^2 > 4 exactly when |Z| > 1, and
the complement of the roughly 68\% within one standard deviation in the empirical rule.
Simulating meteor gaps
Isaac’s simulation program produces independent \operatorname{Uniform}(0, 1) numbers. During a meteor shower he models the gap T between meteors, in minutes, as \operatorname{Exponential}(0.2). Find Q_T, the gaps it produces from u = 0.7 and u = 0.1, and why Q_T(U) has the right distribution.
SolutionBy Result 6 of Densities and cumulative distribution functions, F_T(t) = 1 - e^{-0.2t} for t \ge 0, continuous and strictly increasing there, so Q_T(u) is the one solution t of 1 - e^{-0.2t} = u:
So u = 0.7 gives -5 \ln 0.3 \approx 6.020 minutes and u = 0.1 gives -5 \ln 0.9 \approx 0.527 minutes (Figure 2). Result 5 says Q_T(U) \sim \operatorname{Exponential}(0.2), and here it can be seen directly: Q_T is increasing, so for t \ge 0
Because 1 - U is also uniform (Exercise 20), -5 \ln U serves as well.
Why faint stars outnumber bright ones
Amara models the stars her telescope can detect as all of one true brightness, scattered evenly through a ball of radius R around the Earth, where R is the distance at which such a star is just detectable. For a detected star chosen at random, the chance that its distance D is at most r is the volume ratio \displaystyle \frac{r^3}{R^3}, for 0 \le r \le R. Brightness falls with the square of distance, so as a multiple of the faintest detectable brightness the star’s brightness is \displaystyle B = \left(\frac{R}{D}\right)^2. A star B times as bright as another is 2.5 \log_{10} B magnitudes brighter, so the star stands K = 2.5 \log_{10} B magnitudes above the detection limit. Find the distributions of B and K.
SolutionF_D is continuous, so P(D = r) = 0 for every r, and B \ge 1. B decreases as D increases, so for b \ge 1
So F_B(b) = 1 - b^{-3/2} for b \ge 1, and by Result 4 of Densities and cumulative distribution functions B has density \displaystyle \frac32 b^{-5/2} there. K increases with B, so for k \ge 0
By Result 6 of Densities and cumulative distribution functions, K \sim \operatorname{Exponential}(\lambda) with \lambda = 0.6 \ln 10 \approx 1.382. Each extra magnitude above the limit makes stars 10^{0.6} \approx 3.981 times rarer; the mean is \displaystyle E(K) = \frac{1}{\lambda} \approx 0.7238 magnitudes, and P(K > 2) = 10^{-1.2} \approx 0.0631.
Boundaries
A flat piece makes a mass. If g is constant on an interval that X reaches with positive probability, g(X) has a mass there and no density: \min(T, 4) in Example 2 of Expectation, linearity and indicators is mixed. An isolated zero of g', as for x^3 at 0, is harmless: split the pieces there.
Finitely many pieces. For X with a density on the whole line, \sin X has infinitely many monotone pieces; Result 3 still holds with the sum read as a series, stated here without proof.
Discrete and continuous. A function of a variable with a density can be discrete: rounding up an exponential gives a geometric (Exercise 17 of Densities and cumulative distribution functions).
What passes through g. Medians pass through strictly monotone g (Exercise 19), means through linear g; for other g neither need pass (Examples 2 and 3).
Formulas for Q_X. Result 5 holds for every distribution, but Q_X has a closed form only when F_X can be inverted by formula; \Phi cannot, so normal Q is computed numerically.
Where this goes next
Joint distributions carries Result 2 to functions of two variables, with the absolute value of a Jacobian determinant in place of |h'|, and Sums of independent variables finds the distribution of X + Y for independent X and Y. Moment generating functions give a second route, through M_{aX+b}(t) = e^{bt} M_X(at). The The bivariate normal comes from linear changes of independent normals. Result 5 drives computer simulation (Designing a simulation).
Exercises
Discrete variables
- X is uniform on \{-2, -1, 0, 1, 2, 3\}. Find the pmf of X^2 and of |X - 1|.
- The number N of meteors Isaac sees in a minute is \operatorname{Poisson}(2). Find the probability that N is even, counting 0 as even.
- The first clear night N is \operatorname{Geometric}(0.25), but Amara stops after 5 nights, so she watches Y = \min(N, 5) nights. Find the pmf and the mean of Y.
Monotone functions
- X \sim \operatorname{Uniform}(0, 1) and Y = X^3. Find f_Y and P(Y \le \tfrac18), and find E(Y) both from f_Y and by Result 3.
- T \sim \operatorname{Exponential}(1) and \displaystyle Y = \sqrt{T}. Find F_Y, f_Y and P(Y > 1).
- X has density f_X(x) = 2x for 0 < x < 1, and 0 otherwise. Find the density of Y = 1/X, P(Y > 2) and E(Y).
- The brightness B of a variable star, as a multiple of a reference star, is \operatorname{Uniform}(1, 4) at a random moment, and its magnitude relative to the reference is M = -2.5 \log_{10} B. Find the density of M, P(M \le -1) and the median of M.
- Isaac’s laser pointer stands 1 meter from a long straight wall and is aimed at an angle \Theta from the perpendicular, with \Theta \sim \operatorname{Uniform}(-\tfrac{\pi}{2}, \tfrac{\pi}{2}). The beam hits the wall Y = \tan \Theta meters from the nearest point. Find f_Y, P(|Y| \le 1) and P(Y > 2).
- Z \sim N(0, 1) and Y = e^Z. Find f_Y, the median of Y, E(Y) and P(Y > 2).
Monotone pieces
- X \sim \operatorname{Uniform}(-1, 3) and Y = |X|. Find f_Y, and find E(Y) from f_Y and from f_X.
- X has density \displaystyle f_X(x) = \frac12 e^{-|x|} for all real x. Find the density of Y = X^2 and P(Y \le 1).
- A filter wheel of radius 1 stops at an angle \Theta \sim \operatorname{Uniform}(0, 2\pi), and a mark on its rim is then at height Y = \sin \Theta above the axle. Find f_Y and P(Y > \tfrac12).
Simulation
- X has F_X(x) = 1 - (1 + x)^{-2} for x \ge 0, and 0 for x < 0. Find f_X and Q_X, the values Q_X(0.75) and Q_X(0.96), and the median of X.
- The seeing on a night is rated S = 1, 2 or 3 with probabilities 0.2, 0.5 and 0.3. Find Q_S, its values at u = 0.15, 0.2, 0.69 and 0.71, and P(Q_S(U) = 2) for U \sim \operatorname{Uniform}(0, 1).
- Find an increasing g and a decreasing g such that g(U) has density \displaystyle \frac{x}{2} on (0, 2) when U \sim \operatorname{Uniform}(0, 1), and the value of each at u = 0.09.
Proofs
- Let X \sim N(\mu, \sigma^2) and a \ne 0. Prove that aX + b \sim N(a\mu + b, a^2 \sigma^2), and deduce that \displaystyle \frac{X - \mu}{\sigma} \sim N(0, 1).
- Let X have a density f, continuous except at finitely many points, with f(-x) = f(x) for all x. Prove that |X| has density 2f(y) and X^2 has density \displaystyle \frac{f(\sqrt{y})}{\sqrt{y}} for y > 0, both 0 for y < 0.
- Prove that if F_X has a jump, then F_X(X) is not \operatorname{Uniform}(0, 1).
- Call m a median of X when \displaystyle P(X \le m) \ge \frac12 and \displaystyle P(X \ge m) \ge \frac12. Prove that if g is strictly monotone on an open interval I with P(X \in I) = 1, then g(m) is a median of g(X).
- Let U \sim \operatorname{Uniform}(0, 1). Prove that 1 - U \sim \operatorname{Uniform}(0, 1), and deduce that \displaystyle -\frac{1}{\lambda} \ln U \sim \operatorname{Exponential}(\lambda) for \lambda > 0.
Answers
- X^2 is 0, 1, 4, 9 with probabilities \tfrac16, \tfrac13, \tfrac13, \tfrac16, since \pm 1 give 1 and \pm 2 give 4. |X - 1| takes 0, 1, 2, 3 with the same probabilities, by the same pairing.
- \displaystyle \frac{1 + e^{-4}}{2} \approx 0.5092. By Result 1 it is \displaystyle e^{-2} \sum_{k \text{ even}} \frac{2^k}{k!} = e^{-2} \cosh 2.
- P(Y = k) = 0.25 \, (0.75)^{k-1} for k \le 4, that is 0.25, 0.1875, 0.140625, 0.10546875, and P(Y = 5) = P(N \ge 5) = 0.75^4 = 0.31640625. \displaystyle E(Y) = \sum_k k \, P(Y = k) = \frac{781}{256} \approx 3.051.
- F_Y(y) = P(X \le y^{1/3}) = y^{1/3} on [0, 1], so \displaystyle f_Y(y) = \frac13 y^{-2/3} for 0 < y < 1; P(Y \le \tfrac18) = \tfrac12. \displaystyle E(Y) = \int_0^1 \frac13 y^{1/3} \, dy = \frac14 = \int_0^1 x^3 \, dx.
- F_Y(y) = P(T \le y^2) = 1 - e^{-y^2} for y \ge 0, so f_Y(y) = 2y e^{-y^2} for y > 0, the density of Exercise 8 of Densities and cumulative distribution functions; P(Y > 1) = e^{-1} \approx 0.3679.
- \displaystyle h(y) = \frac1y, \displaystyle |h'(y)| = \frac{1}{y^2}, so \displaystyle f_Y(y) = \frac{2}{y^3} for y > 1. P(Y > 2) = P(X < \tfrac12) = \tfrac14. \displaystyle E(Y) = \int_1^\infty \frac{2}{y^2} \, dy = 2 = \int_0^1 \frac1x \cdot 2x \, dx.
- \displaystyle f_M(m) = \frac{0.4 \ln 10}{3} \, 10^{-0.4m} for -2.5 \log_{10} 4 < m < 0, about (-1.5051, 0): M decreases in B, with h(m) = 10^{-0.4m} and |h'(m)| = 0.4 \ln 10 \cdot 10^{-0.4m}. P(M \le -1) = P(B \ge 10^{0.4}), which is \displaystyle \frac{4 - 10^{0.4}}{3} \approx 0.4960. B has median 2.5, so by Exercise 19 M has median -2.5 \log_{10} 2.5 \approx -0.9949.
- h(y) = \arctan y, \displaystyle h'(y) = \frac{1}{1 + y^2}, \displaystyle f_\Theta = \frac{1}{\pi}, so \displaystyle f_Y(y) = \frac{1}{\pi(1 + y^2)}, the density of Exercise 4 of Densities and cumulative distribution functions. P(|Y| \le 1) = P(|\Theta| \le \tfrac{\pi}{4}) = \tfrac12, and \displaystyle P(Y > 2) = \frac12 - \frac{\arctan 2}{\pi} \approx 0.1476.
- h(y) = \ln y, \displaystyle h'(y) = \frac1y, so \displaystyle f_Y(y) = \frac{1}{y\sqrt{2\pi}} e^{-(\ln y)^2/2} for y > 0. The median is e^0 = 1 by Exercise 19. Since \displaystyle z - \frac{z^2}{2} = \frac12 - \frac{(z - 1)^2}{2}, E(Y) = \int e^z \varphi(z) \, dz equals e^{1/2} \int \varphi(z - 1) \, dz, so E(Y) = e^{1/2} \approx 1.6487. P(Y > 2) = 1 - \Phi(0.6931) \approx 0.2441.
- \displaystyle f_Y = \frac12 on (0, 1) and \displaystyle \frac14 on (1, 3): the pieces (-1, 0) and (0, 3) have h_1(y) = -y and h_2(y) = y, with |h_j'| = 1 and \displaystyle f_X = \frac14. \displaystyle E(Y) = \int_0^1 \frac{y}{2} \, dy + \int_1^3 \frac{y}{4} \, dy = \frac14 + 1 = \frac54, and \displaystyle \int_{-1}^{3} \frac{|x|}{4} \, dx = \frac14 \left( \frac12 + \frac92 \right) agrees.
- \displaystyle f_Y(y) = \frac{f_X(-\sqrt{y}) + f_X(\sqrt{y})}{2\sqrt{y}} = \frac{e^{-\sqrt{y}}}{2\sqrt{y}} for y > 0. P(Y \le 1) = P(|X| \le 1) = 1 - e^{-1} \approx 0.6321.
- \displaystyle f_Y(y) = \frac{1}{\pi\sqrt{1 - y^2}} for -1 < y < 1. \sin is monotone on (0, \tfrac{\pi}{2}), (\tfrac{\pi}{2}, \tfrac{3\pi}{2}) and (\tfrac{3\pi}{2}, 2\pi); each y \ne 0 in (-1, 1) is reached from two of them, each giving \displaystyle \frac{1}{2\pi} \cdot \frac{1}{\sqrt{1 - y^2}}, as \displaystyle \left|\frac{d}{dy} \arcsin y\right| = \frac{1}{\sqrt{1 - y^2}}. P(Y > \tfrac12) = \tfrac13: \Theta must lie in (\tfrac{\pi}{6}, \tfrac{5\pi}{6}).
- f_X(x) = 2(1 + x)^{-3} for x > 0. Solving 1 - (1 + x)^{-2} = u gives Q_X(u) = (1 - u)^{-1/2} - 1, so Q_X(0.75) = 2 - 1 = 1 and Q_X(0.96) = 5 - 1 = 4. The median is \displaystyle Q_X(0.5) = \sqrt{2} - 1 \approx 0.4142.
- F_S is 0.2 on [1, 2), 0.7 on [2, 3) and 1 from 3 on, so Q_S(u) is 1 for 0 < u \le 0.2, 2 for 0.2 < u \le 0.7 and 3 for 0.7 < u < 1. The values are 1, 1, 2, 3, and P(Q_S(U) = 2) = P(0.2 < U \le 0.7) = 0.5.
- \displaystyle F(x) = \frac{x^2}{4} on [0, 2], so the increasing choice is \displaystyle g(u) = Q(u) = 2\sqrt{u}, with g(0.09) = 0.6. Since 1 - U is uniform (Exercise 20), \displaystyle g(u) = 2\sqrt{1 - u} is a decreasing choice, with \displaystyle g(0.09) = 2\sqrt{0.91} \approx 1.908.
- \displaystyle f_X(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-(x - \mu)^2/(2\sigma^2)} is continuous on I = \mathbb{R}, and g(x) = ax + b has \displaystyle h(y) = \frac{y - b}{a}, \displaystyle |h'| = \frac{1}{|a|}. Since \displaystyle \left(\frac{y - b}{a} - \mu\right)^2 = \frac{(y - (a\mu + b))^2}{a^2} and \displaystyle |a|\sigma = \sqrt{a^2\sigma^2}, Result 2 gives aX + b the density \displaystyle \frac{1}{\sqrt{a^2\sigma^2}\sqrt{2\pi}} e^{-(y - (a\mu + b))^2/(2a^2\sigma^2)}, which is the N(a\mu + b, a^2\sigma^2) density. With \displaystyle a = \frac1\sigma and \displaystyle b = -\frac{\mu}{\sigma} it is N(0, 1).
- P(X = 0) = 0, so take the pieces (-\infty, 0) and (0, \infty), both mapped onto (0, \infty) by |x| and by x^2. For |x|, h_j(y) = \mp y with |h_j'| = 1, and Result 3 gives f(-y) + f(y) = 2f(y). For x^2, \displaystyle h_j(y) = \mp\sqrt{y} with \displaystyle |h_j'| = \frac{1}{2\sqrt{y}}, giving \displaystyle \frac{f(-\sqrt{y}) + f(\sqrt{y})}{2\sqrt{y}} = \frac{f(\sqrt{y})}{\sqrt{y}}. Both variables are \ge 0, so the densities are 0 for y < 0.
- Suppose F_X jumps at x_0. By Result 2 of Discrete distributions: binomial, geometric, Poisson, P(X = x_0) = p > 0, and on \{X = x_0\}, F_X(X) = F_X(x_0), so P(F_X(X) = F_X(x_0)) \ge p > 0. A \operatorname{Uniform}(0, 1) variable has a density and so gives every single value probability 0 (Result 1 of Densities and cumulative distribution functions). Hence F_X(X) is not uniform.
- Let I = (a, b). If m \le a then P(X \le m) = 0, and if m \ge b then P(X \ge m) = 0; so m \in I. Say g increases on I. For x \in I, g(x) \le g(m) exactly when x \le m, and P(X \in I) = 1, so \displaystyle P(g(X) \le g(m)) = P(X \le m) \ge \frac12, and likewise \displaystyle P(g(X) \ge g(m)) = P(X \ge m) \ge \frac12. If g decreases, the two events swap.
- For 0 \le u \le 1, P(1 - U \le u) = P(U \ge 1 - u) = u, using P(U = 1 - u) = 0, and 1 - U lies in [0, 1]; so 1 - U has the \operatorname{Uniform}(0, 1) distribution function. The exponential quantile function is \displaystyle Q(v) = -\frac{1}{\lambda} \ln(1 - v), as in Example 5, and \displaystyle -\frac{1}{\lambda} \ln U = Q(1 - U), so Result 5 applied to the uniform variable 1 - U gives the claim.