# Counterexamples where Median is outside [Mode-Mean]

It is widely believed that the median of a unimodal distribution is "usually" between the mean and the mode. However, this is not always true...

My question: can someone provide examples of continuous unimodal (ideally simple) distributions where the median is outside the [mode, mean] interval? For example a distribution such as mode < mean < median.

=== EDIT =======

There are already good answers by Glen_b and Francis, but I realized that what I am really interested in is an example where mode < mean < median or median < mean < mode (that is both median is outside [mode, mean] AND median is "on the same side" as mean of mode (i.e. both above or below mode)). I can accept the answers here are open a new question or maybe someone can suggest a solution here directly?

• It's no trouble to extend the answer to cover the more restricted case. Commented Dec 15, 2016 at 9:32
• Check out figure 6 here: ww2.amstat.org/publications/jse/v13n2/vonhippel.html which gives a (continuous unimodal) Weibull example where the median is not between the mode and mean. Commented Dec 15, 2016 at 12:08

Sure, it's not hard to find examples - even continuous unimodal ones - where the median is not between the mean and the mode.

1. Consider $T_1,T_2$ i.i.d from a triangular distribution of the form $f_T(t) = 2(1-t) \mathbb{1}_{0<t<1}$

Now let $X$ be a 60-40 mixture of $T_1$ and $-4T_2$.

The density of $X$ looks like this:

The mean is below 0, the mode is at 0, but the median is above 0. A minor modification of this would yield an example where even the density (rather than just the cdf) was continuous, but the relationship between location-measures was the same (edit: see 3. below).

2. Generalizing, let's put a proportion $p$ (with $0<p<1$) of the total probability into the right-hand-side triangle and a proportion $(1-p)$ into the left-hand side triangle (in place of the 0.6 and 0.4 we had before). Further, make the scaling factor on the left half $-\beta$ rather than $-4$ (with $\beta>0$):

Now assuming $p>\frac12$, the median will always be in the interval covered by the right-triangle, so the median will exceed the mode (which will always remain at $0$). In particular, when $p>\frac12$, the median will be at $1-1/\sqrt{2p}$.

The mean will be at $(p - \beta(1-p))/3$.

If $\beta>p/(1-p)$ then the mean will be below the mode, and if $\beta< p/(1-p)$ the mean will be above the mode.

On the other hand, we want $(p - \beta(1-p))/3 < 1-1/\sqrt{2p}$ to keep the mean below the median.

Consider $p=0.7$; this puts the median above the mode.

Then $\beta=2$ would satisfy $\beta<p/(1-p)$ so the mean is above the mode.

The median is actually at $1-1/\sqrt{1.4}\approx 0.1548$ while the mean is at $\frac{0.7-2(0.3)}{3}\approx 0.0333$. Hence for $p=0.7$ and $\beta=2$, we have mode < mean < median.

(NB For consistency with my notation, the variable on the x-axis for both plots should be $x$ rather than $t$ but I am not going to go back and fix it.)

3. This is an example where the density itself is continuous. It is based on the approach in 1. and 2. above, but with the "jump" replaced with a steep slope (and then the entire density flipped about 0 because I want an example that looks right-skew).

[Using the "mixture of triangular densities" approach, it can be generated as a mixture of 3 independent scaled variates of the triangular form described in section 1. We now have 15% $T_1$, 60% $-3T_2$ and 25% $5T_3$.]

As we see in the diagram above, the mean is in the middle, as requested.

1. Note that m_t_ mentions the Weibull in comments (for which the median is outside the $[\text{mode},\text{mean}]$ interval for a small range of the shape parameter $k$). This is potentially satisfying because it's a well-known unimodal continuous (and smooth) distribution with simple functional form.

In particular, for small values of the Weibull shape parameter, the distribution is right-skew, and we have the usual situation of median between the mode and the mean, while for large values of the Weibull shape parameter, the distribution is left-skew, and we again have that "median in the middle" situation (but now with the mode at the right rather than the mean). In between those cases is a small region where the median is outside the mean-mode interval, and in the middle of that the mean and mode cross over:

      k                 order
(0,3.2589)      mode < median < mean
≈ 3.2589       mode = median < mean
(3.2589,3.3125)  median < mode < mean    (1)
≈ 3.3215       median < mode = mean
(3.3215,3.4395)  median < mean < mode    (2)
≈ 3.4395       median = mean < mode
3.4395+        mean < median < mode
(≈3.60235      moment-skewness = 0)


Choosing convenient values for the shape parameter in the intervals marked (1) and (2) above -- ones where the gaps between the location-statistics are about equal -- we get:

While these fulfill the requirements, unfortunately the three location-parameters are so close together that we can't visually distinguish them (they all fall in the same pixel), which is a little disappointing -- the cases for my earlier examples are much more separated. (Nevertheless it does suggest situations to examine with other distributions, some of which might give outcomes which are more visually distinct.)

• That works, thanks. Out of curiosity, what would be a similar "triangular distribution" where mode < mean < median? (here median < mode < mean) Commented Dec 15, 2016 at 7:07
• Actually in my original example mean<mode<median ; you had the inequalities backward there. I have now added a similar example where the mean is above the mode but below the median (indeed, you could simply have replaced the original $-4T_2$ with say $-1.25T_2$ and kept the mixture proportions at $0.6$ for the right part and $0.4$ for the left part). Commented Dec 15, 2016 at 9:20

The following example is taken from Jordan Stoyanov's Counterexamples in Probability.

Given positive constant $c$ and $\lambda$, consider a random variable $X$ with density $$f(x)=\begin{cases}ce^{-\lambda(x-c)}, & x\in(c, \infty) \\ x, & x\in(0, c] \\ 0, & x\in(-\infty,0].\end{cases}$$ The mean $\mu$, median $m$ and mode $M$ of $X$ can be found as $$\mu=\frac{c^3}{3}+\frac{c^2}{\lambda}+\frac{c}{\lambda^2},\qquad m=1,\qquad M=c.$$ Note $f(x)$ is a density only if $$\frac{c^2}{2}+\frac{c}{\lambda}=1.$$ So if we let $c\to1$ then $\lambda\to2$. As a result, if we choose a $c>1$ that's close to $1$ (say $1.0001$), we can find that $\mu>c$ and $M=c$, so median $m$ does not fall between $\mu$ and $M$.

Take the exponential distribution with rate parameter a and density a exp(-ax) for 0<=x< infinity. The mode is at zero. Of course the mean and the median are greater than 0. The cdf is 1-exp(-ax). So for the median solve for exp(-ax)=0.5 for x. Then -ax=ln(0.5) or x = -ln(0.5)/a. For the mean integrate ax exp(-ax) from 0 to infinity. Take a=1 and we have a median = -ln(0.5)=ln(2) and mean = 1.

So mode < median < mean.

• Sorry, but aren't we looking for distributions where mode < mean < median (or more generally where median is outside [mode, average])? Commented Dec 15, 2016 at 6:58
• Sorry for the confusion, I did add to the original question, but what I was asking originally is for examples where median is outside [mode, mean] while I think median is inside [mode, median] in your example. Commented Dec 15, 2016 at 8:56
• Michael, the question doesnt ask for a case where the median is between the mode and the mean. You misquote the original in your comment just above this one; the question does not say "mode<median<mean" where you state that it does (and has never done so at any point in the edit history). As a result, your answer supplies a case which is not asked for; indeed that's the usual situation (median in the middle of the other two) that the question seeks exceptions from. Almost any well-known skewed unimodal distribution has the median in the middle - the trick is finding ones that don't do that. Commented Dec 15, 2016 at 22:13
• The edit history is available by clicking on the red link at the bottom of the question where it currently says "edited 18 hours ago" (it changed to 19 while I was typing these comments). You can see the history of edits by clicking there. The question was posted 22 hours ago (as I type this now), and when you click through to the edit history that original question can be seen at the bottom labelled "1". Your answer appeared about 2 hours later (20 hours ago), when that was what the question still said. About 1-2 hours after your post, the OP edited their question once, which can be seen ... Commented Dec 16, 2016 at 2:55
• ctd ... at the top of the edit history.. There's a two-minute window after each edit to make changes that count as part of that edit (i.e. at 22 hours ago and at 18-19 hours ago there was a two-minute window each time where say a typo might have been fixed) but ~20 hours ago when you posted, the question had been unchanged for about 2 hours, and it remained unchanged for more than an hour after you posted, when a major edit (shown in the edit history) was performed. Any edits outside those brief two-minute post-edit windows would be in the edit history. Commented Dec 16, 2016 at 2:55

As the above answers suggest, any order is possible.

However, the violation of the mean-median-mode inequality should generally only happen in a nearly symmetric distribution.

I assume you are saying asymmetric unimodal distribution, since the mode can be many for multimodel distributions and then a meaningful comparison is useless. In most cases, for an asymmetric unimodal distribution, the mean-median-mode inequality will be valid, this is because the definition of skewness, according to van Zwet’s trailblazing work Convex transformations of random variables, is depending on a non-decreasing convex function, we call it ϕ. Then, if adding an additional constraint that ϕ′ (x) ≥ 0. Consider a near-symmetric distribution S, such that the mean-median-mode inequality is not valid, then, s be the pdf of S. Applying the transformation ϕ (x) to S decreases s(Q(ϵ)), and the decrease rate, due to the order, is much smaller for s(Q(1 − ϵ)). As a consequence, as ϕ^(2)(x) increases, eventually, after a point, for all 0 ≤ ϵ ≤ 1/2, s(Q(ϵ)) becomes greater than s(Q(1 − ϵ)) even if it was not previously. Thus, the SQA(ϵ) function (symmetric quantile average) becomes monotonically decreasing. When the SQA(ϵ) function (symmetric quantile average) becomes monotonically decreasing, that means for a right-skewed distribution, ∀0 ≤ ϵ1 ≤ ϵ2 ≤ 1/2, SQA(ϵ1) ≥ SQA(ϵ2). Then, we can show that its pdf satisfies the inequality f(Q(ϵ)) ≥ f(Q(1−ϵ)) for all 0 ≤ ϵ ≤ 1/2 or f (Q(ϵ)) ≤ f (Q(1 − ϵ)) for all 0 ≤ ϵ ≤ 1/2. Proof. Without loss of generality, consider the case of right-skewed distribution. From the above definition, it is deduced that (Q(ϵ−δ)+Q(1−ϵ+δ))/2≥(Q(γϵ)+Q(1−ϵ))/2 ⇔ Q(ϵ−δ)−Q(ϵ)≥Q(1−ϵ)−Q(1−ϵ+δ)⇔Q′(1−ϵ)≥Q′(γϵ), where δ is an infinitesimal positive quantity. Observing that the quantile function is the inverse function of the cumulative distribution function (cdf), Q′(1 − ϵ) ≥ Q′(ϵ) ⇔ F′(Q(ϵ)) ≥F ′(Q(1−ϵ)), thereby completing the proof, since the derivative of cdf is pdf. For a right-skewed unimodal distribution, if Q(ϵ) >M , then the inequality f(Q(ϵ)) ≥ f(Q(1 − ϵ)) holds. The principle is extendable to unimodal-like distributions. Suppose there is a right-skewed unimodal-like distribution with the first mode, denoted as M, having the greatest probability density, while there are several smaller modes located towards the higher values of the distribution. Furthermore, assume that this distribution follows the mean-median-first mode inequality, and the median, Q(1/2), falling within the first dominant mode (i.e., if x > Q(1/2), f (Q(1/2)) ≥ f (x)). Then, if Q(ϵ) > M, the inequality f(Q(ϵ)) ≥ f (Q(1−ϵ)) also holds. In other words, even though for a distribution following the mean-median-mode inequality, the SQA function might not be strictly monotonic, the inequality remains valid for most symmetric quantile averages.

A more complete result, extended to quantile average is proven in my paper Tuobang Li. (2023). Robust estimations from distribution structures (https://doi.org/10.5281/zenodo.10615583) ( https://www.researchgate.net/publication/377973944_Robust_estimations_from_distribution_structures_I_Mean).

An elegent special case is that, when the distribution is monotonic decreasing, right skewed, the mean-median-mode inequality is always valid.

A right-skewed distribution with a monotonic decreasing pdf is second $$\gamma$$-ordered.

Given that a monotonic decreasing pdf implies $$f'(x)=F^{\left(2\right)}\left(x\right)\le0$$, let $$x=Q\left(F\left(x\right)\right)$$, then by differentiating both sides of the equation twice, one can obtain $$0=Q^{\left(2\right)}\left(F\left(x\right)\right)\left(F^\prime\left(x\right)\right)^2+Q^\prime\left(F\left(x\right)\right)F^{(2)}\left(x\right)\Rightarrow Q^{\left(2\right)}\left(F\left(x\right)\right)=-\frac{Q^\prime\left(F\left(x\right)\right)F^{\left(2\right)}\left(x\right)}{\left(F^\prime\left(x\right)\right)^2}\geq0$$, since $$Q^\prime\left(p\right)\geq0$$. Theorem 1 already established the $$\gamma$$-orderliness for all $$\gamma\geq0$$, which means $$\forall 0\leq\epsilon\leq\frac{1}{1+\gamma}, \frac{\partial\text{QA}}{\partial\epsilon}\leq0.$$ The desired result is then derived from the proof of Theorem 5, since $$(-1)^{2}\frac{\partial^{2}\text{QA}}{\partial\epsilon^{2}}\geq0$$ for all $$\gamma\geq0$$.

Theorem 1 and 5 can be found in my paper. For an ordered distribution, the mean-median inequality is always valid, and since the distribution is monotonic, the mean-median-mode inequality is always valid.

Furthermore, this relation also provides valuable insights into the relation between modality and the monotonicity and convexity of symmetric quantile averages function. The conventional definition states that a distribution with a monotonic pdf is still considered unimodal. However, within its supported interval, the mode number is zero. Theorem .1 implies that the number of modes and their magnitudes within a distribution are closely related to the likelihood of the monotonicity of the SQA function being valid. This is because, for a distribution satisfying the necessary and sufficient condition the inequality f(Q(ϵ)) ≥ f(Q(1−ϵ)) for all 0 ≤ ϵ ≤ 1/2 or f (Q(ϵ)) ≤ f (Q(1 − ϵ)) for all 0 ≤ ϵ ≤ 1/2. It is already implied that the probability density of the left-hand side of the median is always greater than the corresponding probability density of the right-hand side of the median. So although counterexamples can always be constructed for non-monotonic distributions, the general shape of a distribution with a monotonic SQA function should have a single dominant mode.

von Zwet, W. R. (2012). Convex transformations: A new approach to skewness and kurtosis (pp. 3-11). Springer New York

• Hi. Welcome to CV. This is a MathJax-enabled site. Please use this facility to typeset your mathematical expressions for better legibility. For a quick guide, check this Meta CV post: Instructions on how to use LaTeX on CrossValidated. Commented Feb 9 at 20:38
• Hi, thank you for your suggestions, I already correct my answer in Latex. Commented Feb 10 at 4:30