1
$\begingroup$

I am trying to compute certain score, which is the sum of all variables (e.g., $a$, $b$, $c$). The higher the value of a variable, the score will be higher. However, I have one variable, say $a$, which is in the unit of seconds (time), representing the speed. I expect the score to be higher if it is in higher speed, which means I will need to inverse/reverse the value of $a$.

There are two ways which I can think of:

(1) $ \frac{1}{x} $

(2) $ 1 - (\frac{1}{1 + x}) $

Any comments if these are the right ways?

$\endgroup$

closed as unclear what you're asking by JMoravitz, Namaste, Paul Frost, Xander Henderson, HK Lee Sep 1 '18 at 2:38

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ The first function is decreasing on $\Bbb R^+$ while the second is increasing. They will give opposite sort orders. $\endgroup$ – dxiv Aug 31 '18 at 19:31
  • 3
    $\begingroup$ How about more simply multiplying everything in the list by $-1$... $\endgroup$ – JMoravitz Aug 31 '18 at 19:41
  • $\begingroup$ Just checking: this is not about sorting the list of numbers? $\endgroup$ – Robert Soupe Sep 1 '18 at 0:22
  • $\begingroup$ no, it is not about sorting. $\endgroup$ – Stuart Peterson Sep 1 '18 at 7:29
0
$\begingroup$

(2) will not work. It will leave the numbers in the same order as before. (1) works fine. So will $-x$, or if you want positive numbers $a-x$ where $a$ is larger than the largest of your values, or $-x^3$ or many other things. You just need some decreasing function of $x$ and you are there. Without another criterion nobody can say which is the right way.

$\endgroup$
  • $\begingroup$ another criterion? such as? $\endgroup$ – Stuart Peterson Aug 31 '18 at 21:00
  • $\begingroup$ What else you want. I gave a few examples. All will reverse the ordering of the input. How would you choose between them? $\endgroup$ – Ross Millikan Sep 1 '18 at 0:19

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