A counterexample involving medians

Here we demonstrate that, when random variables X and Y from two different distributions are compared, P(X > Y) and P(Y > X) need bear no particular relationship to the relative locations of the medians of the two distributions. This happens because the location of the median gives you only one reference point on the distribution. The behaviour of the tails will help determine the probabilities P(X > Y) and P(Y > X).

Here X and Y have identical medians, but P(X > Y) != P (Y > X).

ValueProb of XProb of Y
20.490.0
10.00.49
00.020.02
-10.490.0
-20.00.49

P(X > Y) = 0.49 + 0.02 * 0.49 + 0.49 * 0.49 = 0.7399
P(Y > X) = 0.49 * 0.51 + 0.02 * 0.49 = 0.2597

Here the median of X is 1 and the median of Y is -1. Despite this, p(X > Y) = P(Y > X).

ValueProb of XProb of Y
30.1750.225
20.2250.175
10.20.0
00.00.0
-10.00.2
-20.1750.225
-30.2250.175

P(X > Y) = 0.175 * 0.775 + 0.225 * 0.6 + 0.2 * 0.6 + 0.175 * 0.175 = 0.42125
P(Y > X) = 0.225 * 0.825 + 0.175 * 0.6 + 0.2 * 0.4 + 0.225 * 0.225 = 0.42125