Points Calculator

62 Views Asked by At

I'm trying to formulate an equation for a online ranking system, I would like to award points to users based on there rank and the total number of users. I would like something similar to below, where rank 1 would get 50% of available points with <300 users, rank2 30%, rank3, 20% etc..

The available points a multiple of the users so rank 1 should always get the most points.

RANK/USERS <300     400     500      600    700     800      900   etc....
    1       50%     45%     40%      38%    35%     33.5%    32%
    2       30%     25%     23%      22%    21%     20%      19%
    3       20%     18%     16%      15%    15%     14.5%    14%
    4               12%     12%      11%    11%     11%      11%
    5                       9%        8%    8%      8%       8%
    6                                 6%    6%      6%       6%
    7                                        4%     4%       4%
    8                                               3%       3% 

Would anyone know the best way to do this..

1

There are 1 best solutions below

0
On

I'm not sure how you calculated the numbers in the table above, but if you don't mind amending those values slightly, you can use this formula which gives a decent approximation.

Given $r$ rank and $u$ users, $$ f(r,u) = \left\{ \begin{array}{ll} \frac{u/100-r+1}{(1+u/100)(u/200)} & \quad r \leq \frac{u}{100} \\ 0 & \quad \mbox{otherwise} \end{array} \right. $$

Here are the first few values (rounded to the nearest whole percent):

RANK/USERS   <300    400    500    600    700
    1         50%    40%    33%    29%    25%
    2         33%    30%    27%    24%    21%
    3         17%    20%    20%    19%    18%
    4                10%    13%    14%    14%
    5                        7%    10%    11%
    6                               5%     7%
    7                                      4%