Skip to main content
1 of 5
Ilmari Karonen
  • 2.1k
  • 14
  • 15

By definition, $x$ is a median of the random variable $X$ if and only if $\mathrm{Pr}[X < x] = \mathrm{Pr}[x < X]$.

(Note that, in general, $X$ may have multiple medians if there is an interval of values satisfying the definition, and conversely $\mathrm{Pr}[X < x]$ may be less than $\frac12$ if $\mathrm{Pr}[X = x] > 0$.)

Now, also by definition $g: \mathbb R \to \mathbb R$ is strictly monotone increasing if and only if $a < b \iff g(a) < g(b)$ for all $a, b \in \mathbb R$. (In other words, a strictly increasing function preserves the ordering of numbers.)

Let $Y = g(X)$, where $g$ is strictly monotone increasing. Then $y = g(x)$ is a median of $Y$ if and only if $$\begin{aligned} \mathrm{Pr}[Y < y] &= \mathrm{Pr}[y < Y] & \iff \\ \mathrm{Pr}[g(X) < g(x)] &= \mathrm{Pr}[g(x) < g(X)] & \iff \\ \mathrm{Pr}[X < x] &= \mathrm{Pr}[x < X], \end{aligned}$$ where the first equivalence is obtained simply by substituting the definitions of $Y$ and $y$, and the second by applying the fact that $g$ is strictly monotone increasing.

In other words, $y = g(x)$ is a median of $Y = g(X)$ if and only if $x$ is a median of $X$.


Ps. Note that the result above holds for any real-value random variable $X$, even if the median of $X$ (and/or $Y$) is not uniquely defined. However, it only guarantees that $y = g(x)$ is some median of $Y$, but not that any particular rule for picking a "canonical" median $x$ of $X$ will necessarily yield the same median $y = g(x)$ when applied to $Y$. Of course, if both $X$ and $Y$ have unique medians $x$ and $y$, then $y = g(x)$ always holds with no ambiguity.

In particular, if the function $g$ is discontinuous, $Y$ may have multiple medians even if $X$ does not. For a simple example, let $X \sim \mathcal N(0, 1)$ (or any other continuous distribution with a unique median at $x = 0$) and let $$g(z) = \begin{cases} z-1 & \text{if } z < 0 \\ \alpha & \text{if } z = 0 \\ z+1 & \text{if } z > 0, \end{cases}$$ where $-1 ≤ \alpha ≤ 1$ is an arbitrary constant. Then $g(x) = g(0) = \alpha$ is indeed a median of $Y = g(X)$, but so is any other $y \in [-1, 1]$ as well. In effect, the function $g$ "cuts" the distribution of $X$ at exactly its median $x = 0$ and pulls the pieces on either side apart, leaving the distribution of $Y = g(X)$ with a gap containing multiple medians. And, just to add insult to injury, $g$ can map the actual median of $X$ to any number within that gap.

Ilmari Karonen
  • 2.1k
  • 14
  • 15