# What formula would you use to cast an average of several numbers into a smaller range?

Say I have four numbers ranging in value from 15-95. If I want to, for a simple example, say that if the average of the four numbers is 15 (lowest possible value), that would relate to 2 on a scale of 2-10. Then instead if the average of the four numbers is 95 (highest possible value), that would relate to 10 on that same scale. What, then, is the formula to figure out where an average of say 57 falls on that scale of 2-10. Does that make sense, and is there a name for what this kind of 'transposition' is called?

• If the numbers range from $15$ to $95$ and the average is $15$, we know they all are $15$. Frankly, it doesn't make sense. The simplest transposition is a linear one as @user127.0.0.1 has described. I suspect you need to think more clearly about what you want. The math is the easy part-the hard part is defining what you want. Jan 25, 2014 at 5:05

If you want "simple", then just do a linear transformation; that is, write down the equation of the line through the points $(15,2)$ and $(95,10)$ and there you go.

Easiest way is to shift the range first to the orign $$\left[15,95\right] \mapsto [0,80]$$ After that scale it to the length you need, here: $$[0,80]\mapsto[0,8]$$

Last but not least shift it back to the position you need

$$\left[0,8\right]\mapsto [2,10]$$

So a funktion to map an $x$ from the frist range to an $y$ of the second range would be given by

$$y = f(x) = (x-15)\cdot\frac{1}{10}+2$$

Take a look at your testcase $x=15, x=95$ and $x=57$. For those values you will get:

• $f(15) = (15-15)\cdot\frac{1}{10}+2 = 2$
• $f(95) = (95-15)\cdot\frac{1}{10}+2 = 10$
• $f(57) = (57-15)\cdot\frac{1}{10}+2 = 6.2$
• Using tabstops answer you could also use the formula x = (y + 5) / 2. Do you see any preference to one or the other? Jan 25, 2014 at 5:09
• @Drew No, using his/her approach will leed you to exactly the same formula that I showed you. Jan 25, 2014 at 5:17