Is there a 'simple' function that flips the order of positive numbers without making them negative?

59 Views Asked by At

If I want to flip the order of some numbers, I can just multiply them with -1. But is there a not too complicated way to do it such that the numbers remain positive?

Here's my attempt to word the question a bit more formally if you prefer that:

Is there a simple* function that maps from $\mathbb{R} \to S$ where $S \subseteq \mathbb{R} \ $ s.t.: $$ \ \forall x \colon \forall y \colon (x \in \mathbb{R}) \wedge (y \in \mathbb{R}) \wedge (x < y) \rightarrow (f(x) > f(y)) \wedge (f(x) > 0) \wedge (f(y) > 0)$$

Its fine even its from $\mathbb{N} \to S$ or something.

*I know this is vague, but I just mean like obviously I know there is some function but I want one I can use.

Thank you!

2

There are 2 best solutions below

2
On BEST ANSWER

Try $f:\mathbb{R}\to\mathbb{R}_{>0}$ given by $f(x)=e^{-x}.$

This is a positive strictly decreasing function.

4
On

$f(x) = 1/x \text{ if } x\gt0$,

otherwise $f(x)=x$.