Given a number (17) between a range of numbers (14-21) or (minRange-maxRange) what is the formula to achieve an output of 0 - 1?

30 Views Asked by At

Given a number (17) between a range of numbers (14-21) or (minRange-maxRange) what is the formula to achieve an output of 0 - 1?

So given a range of (14-21) with a number of 17.5 would achieve an output of .5.

So given a range of (14-21) with a number of 14 would achieve an output of 0.

So given a range of (14-21) with a number of 21 would achieve an output of 1.

1

There are 1 best solutions below

1
On BEST ANSWER

$x\mapsto(x-14)/7$ meets your needs. That map would take $17$ to $3/7\approx43\%$.

More generally, $x\mapsto(x-\text{minRange})/(\text{maxRange}-\text{minRange})$ maps $\text{minRange}$ to $0,$

$\text{maxRange}$ to $1$, and $\dfrac{\text{minRange}+\text{maxRange}}2$ to $0.5$.