1

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 Answers1

1

$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$.

J. W. Tanner
  • 60,406
  • Thank you. 3 guys in the office here have been trying to figure this out for 30 minutes - none of us being math majors. – Keith Becker Oct 07 '19 at 21:06