# Is the value of probability invariant of function of a random variable

Consider two random variables following a common distribution F. Is $$P(X_{1} > X_{2}) = P(f(X_{1})>f(X_{2}))$$ for any function f?

• If $f$ was a constant function then the right hand side would be zero. Oct 31, 2019 at 14:59
• Take f(x) = -x for an obvious counterexample. Oct 31, 2019 at 16:40
• You need to make assumptions about f in order for this to be true. Assuming that f is strictly monotonic and increasing should do it Oct 31, 2019 at 21:45

Let $$X_1, X_2$$ be two independent random variables each with pmf

$$P_{X}(x)= \begin{cases} \frac{1}{2} & x =1 \\ \frac{1}{2} & x =-1 \\ \end{cases}$$

Then $$\mathsf P(X_1>X_2)=0.25$$ but $$\mathsf P\big(X_1^2>X_2^2\big)=0$$

No. That equation does not hold in general. Although that equation does not hold in general, it does hold for monotonically increasing functions. If $$f$$ is monotone increasing (e.g., exponential or logarithmic functions) then you have the event equivalence:

$$\{ X > Y \} \quad \quad \iff \quad \quad \{ f(X) > f(Y) \}.$$

In this case the underlying events are equivalent and so the probability equation you give holds regardless of the distribution of $$X_1$$ and $$X_2$$. Note also that there are some special combinations of a distribution $$F$$ and a function $$f$$ for which your probability equation holds, but it will not hold as a general property unless $$f$$ is a monotonically increasing function.

• Might want to add the qualifier "strictly" to "monotonic". "monotonic" is often used to refer to functions with $x > y \rightarrow f(x) \ge f(y)$ rather than $x > y \rightarrow f(x) > f(y)$ Oct 31, 2019 at 20:56
• Maybe. But for non-strict version I would usually say "monotone non-decreasing" rather than "monotone increasing". I would generally take "increasing" to imply strictness, unless the contrary is stipulated. Rather than change it, I think I'll just leave these comments here for the OP to see.
– Ben
Oct 31, 2019 at 21:02
• Oct 31, 2019 at 21:05
• That's all very well, but I've seen the alternative terminology elsewhere, and it makes more sense. By the terminology you have linked to, the constant function $f(x)=c$ is an "increasing" function, yet it never increases. It is also a "decreasing" function, yet it never decreases. Curious terminology, no?
– Ben
Oct 31, 2019 at 21:12

A simple counterexample for any $$X_i$$ with $$P(X_i > 0) = 1$$ is the function $$f(x) = x^{-1}$$. It reverses inequalities, hence $$P(f(X_1) > f(X_2)) = P(X_1 < X_2)$$, which is in general different from $$P(X_1 > X_2)$$.