Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm going to provide a fictitious setup that aligns with my mathematical needs. I am a company that is measuring the bounciness of balls and providing two 1-10 rating to each ball based on how it compares to all other balls. The first rating is based on more bounces being good. The second rating is based on less bounces being good.

Is there a way I can take all data points (number of ball bounces) and find an accurate 1-10 rating (for each ball) for both scenarios?

Thank you for your time and help! (If I used incorrect tags, I apologize)

share|cite|improve this question
up vote 0 down vote accepted

Here is one way.

Let $M$ be the maximum and $m$ be the minimum number of bounces among all the balls. Then the rating is just a matter of rescaling $m \le x \le M$ to $1 \le y \le 10$. The following function does this: $$ f(x) = 1+\left \lfloor 10 \frac{x-m}{M+1-m} \right \rfloor. $$ Then $f$ will map a ball's number of bounces, $x$, to an integer between 1 and 10, inclusive, with the property that if $x_1>x_2$, then $f(x_1) \ge f(x_2)$. More bounces results in a higher rating.

To get a lower rating with more bounces, just subtract $f(x)$ from 11: $$ g(x) = 10-\left \lfloor 10 \frac{x-m}{M+1-m} \right \rfloor. $$

share|cite|improve this answer
First, thank you for your answer. When I use the above function f(x), it seems I receive values I was not expecting. With the ball bounces being 3, 5, 6, 9, 10, 15, I receive a 1 for 3 (expected result) and a 10.2 for 15 (not expected result). The middle value of 9 gets a 5.6, which I'd expect to be a 5. Am I performing the calculations correctly? Are my expectations wrong? I'm no math wizard. ;) Thanks again for your time! – Akaishen Jun 21 '12 at 21:32
I found another solution online that is providing the values I had expected. y = 1 + (x-A)*(10-1)/(B-A). A is the minimum value of the range and B is the maximum value. Thus far it is working, which is why I am posting it just in case someone else has the same problem. If you see a problem with this new equation, let me know. Thanks! – Akaishen Jun 21 '12 at 23:36
You are not using the functions I gave correctly. The symbol $\lfloor z \rfloor$ means the greatest integer less than or equal to z. For example, $\lfloor 5.2 \rfloor=5$. The function $f(x)$ I gave, with $m=3$ and $M=15$, gives $f(3)=1, f(9)=5,$ and $f(15)=10$. – Matthew Conroy Jun 22 '12 at 1:11
Thank you for the correction and teaching me what the bracket symbols are used for. I'll rebuild my test code and I'm sure it'll work this time. Thanks! – Akaishen Jun 22 '12 at 4:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.