Consistency of a ratio between positive and negative numbers

8.1k Views Asked by At

I want to model the inverse relationship between two sets of numbers $A, B$ both in the domain $[-5, 5]$. That is, for the same value $A$ I need a number that decreases linearly as $B$ increases, including (and this is the critical point) when $B$ goes from negative to positive. A simple division (ratio) won't work: for example if $A = 5$ and $B=-3$ the ratio is -1.67. But for $B=1$ (higher $B$) the ratio increases to 5.

A simple square transformation won't work either, because both -2 and 2 will assume the same value 4. The ratio should be lower when $B=-2$.

1

There are 1 best solutions below

5
On BEST ANSWER

I agree with the commenters that your question is unclear; it seems that you don't know quite what it is you want. However, I'm going to take a shot at telling you what I think you want. Reading between the lines, I think you want some formula that takes as input two numbers $A, B$ and produces as output some number $r$ with the properties that:

  1. $r$ is always positive
  2. For fixed $A$, you want $r$ to grow linearly as $B$ grows from $-5$ to $5$
  3. For fixed $B$, you want $r$ to decrease as $A$ grows from $-5$ to $5$

I think what you basically are trying to say is that you want to "shift" the values of $B$ and $A$ so that instead of using the "true" values (which range from -5 to 5), the "ratio" compares how far $A$ and $B$ are from their minimum values. If that is what you want, then the formula you need is

$$\frac{B+5}{A+5}$$

Hope this helps.

Edit: This formula will still give you trouble if $A=-5$. If you want to avoid that problem, you could use any formula of the form $\frac{B+n}{A+n}$ where $n>5$.