4

I'm curious about the following idea:

suppose we have two values $P$ and $Q$, and the magnitude of the ratio $\frac{P}{Q}$ is between $0$ and $\infty$. If $P$ is smaller, then it's between $0$ and $1$. If $Q$ is smaller, it's between $1$ and $\infty$ (but the ratio $\frac{P}{Q}$ is between $0$ and $1$).

Is there a way to denote the "absolute ratio" (my term) that is always the ratio that is between $0$ and $1$ (either $\frac{P}{Q}$ or $\frac{Q}{P}$)?

As an example, the $\operatorname{absratio}(10,1) = \operatorname{absratio}(1,10) = 0.1.$

gnometorule
  • 4,640

3 Answers3

7

Because we're not supposed to start sentences with mathematical symbols, I'm presenting the answer this way: $$\displaystyle \min \biggl(\left\{\frac{P}{Q} ,\frac{Q}{P}\right\}\biggr).$$

Git Gud
  • 31,356
  • haha! just like (abs n: -n if n < 0 else n)...i prefer |n| – user62213 Feb 13 '13 at 21:23
  • @user62213 Exactly, nice point. And by the way, you can introduce the notation you suggested in your question if you wish, you just need to explain what it is. – Git Gud Feb 13 '13 at 21:24
4

I frequently find myself using this function. The prettiest statement, to my taste, is: $$absratio(A,B) = exp\{{|log(A)-log(B)|\}}$$

3

Here are a couple of candidates: $$ \frac12\left(\frac PQ+\frac QP-\left|\frac PQ-\frac QP\right|\right) $$ and $$ \frac{|P+Q|-|P-Q|}{|P+Q|+|P-Q|} $$

robjohn
  • 345,667