Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a three-element list which contains inverses of a function u, like so:

CEs = {(u^(-1))[0.448165 u[10]+0.551835 u[30]],(u^(-1))[0.296264 u[10]+0.703736 u[30]],30}

I would now like to obtain the ranking of the elements of this list under the assumption that u is strictly increasing but struggle even to understand the output of


, which gives

{2, 3, 1}

without Mathematica knowing anything about u. Could someone explain to me how this ranking comes about and how I might be able to teach Mathematica that u is strictly increasing and to order elements under this assumption? In the current case the ordering should be

{1, 2, 3}
share|improve this question
That explains the ordering Mathematica returns. Anyway I can teach it to sort assuming that u is strictly increasing? – RoyalTS Jul 30 '13 at 10:50
up vote 2 down vote accepted

If $ u $ is strictly increasing, then so is $ u^{-1}. $ You don't really care about their values so a representative of strictly increasing functions will preserve the ordering. $ y=x $ is such a function so I am replacing your u, u^(-1) with Identity and the ordering is the desired:

CEs = {(u^(-1))[0.448165 u[10] + 0.551835 u[30]], (u^(-1))[
   0.296264 u[10] + 0.703736 u[30]], 30};
CEs /. Thread[{u, u^(-1)} -> Identity] // Ordering
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.