Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

Ordering@Ordering@CEs

, 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
add comment

1 Answer 1

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
(*{1,2,3}*)
share|improve this answer
add comment

Your Answer

 
discard

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.