Get the inverse of ratio, what is the mathematical term?

$\begingroup$

I need to create kind of the inversed ratio. What i mean:

Let's say there are the numbers 1,1,2 the ratio is 0.25,0.25,0.5. The sum of the ratio is of course 1. But i want the "inversed" ratio so the small numbers become great and great numbers become small. It still needs the sum of 1. so 1,1,2 becomes 0.375,0.375,0.25

I tried around a bit and came to this algorithm:picture of algorithm (mistake: should be 0.375,0.375,0.25)

Can i simlify the algorithm to a mathmatical expression somehow? And had this "inversed" ratio special name so i do a search for it?

$\endgroup$ 5

1 Answer

$\begingroup$

If you want to have it so that the ratio of any two numbers in the output is the inverse ratio of the same two numbers in the input, then it's pretty simple to do:

  1. Take the multiplicative inverse of your list (so $1, 1, 2$ becomes $1, 1, \frac{1}{2}$).

  2. Do your ratio calculations as before (so we get $1+1+\frac{1}{2} = \frac{5}{2}$, dividing the list elements by this value gives $\frac{2}{5}, \frac{2}{5}, \frac{1}{5} = 0.4, 0.4, 0.2$)

$\endgroup$ 1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like