Operation to Find the Ratio Between Two Numbers $x,y$

263 Views Asked by At

Background: I'd like to find the fraction between two positive numbers $x,y$. By definition the fraction must be lower than or equal to one. So if $x>y$, I find $R(x,y)=\frac{y}{x}$, ad if $y>x$, $R(x,y)=\frac{x}{y}$.

Motivation: It can be seen as the absolute value for ratios (in contrast to the absolute value for addition). It can also be seen as a metric or a distance defined by ratio.

Question: What operation is this $R$? Does it covered in any literature?

Guess: It is topologically equivalent to logarithm difference: $|\ln(x)-\ln(y)|$. This is a metric while $R$ is only a semimetric.

Does it have a name in literature so I can look it up?

2

There are 2 best solutions below

2
On BEST ANSWER

You have indeed defined the equivalent for multiplication of absolute value for addition.

I know of no particular name for this function.

It defines the same topology as the absolute value of the difference of the logarithms. That might be a sensible way to measure "distance defined by ratio". Whether it's useful for you depends on the application.

0
On

If your numbers are rational, $(x + y) / 2$ is rational and in between.

If they are irrational, you can try the following (here $\lceil z \rceil$ is the integer just larger than $z$, $\lfloor z \rfloor$ is the integer just smaller than $z$):

$\begin{align*} a &= \frac{1}{\lceil y - x \rceil} + 1 \\ m &= \frac{\lceil a x \rceil + \lfloor a y \rfloor}{2 a} \end{align*}$