Click to See Complete Forum and Search --> : Algorithm for awarding prizes on a leaderboard


DodgerLD
December 20th, 2010, 01:14 PM
Hi,

If you have a prize pool (say 1,000 points), and a leaderboard like:

Rank / Name
1 / Dan
2 / Rachel
3 / Max
4 / Chloe
5 / Grant
etc.

Is there an algorithm where you can input prize pool, rank, and maybe the number of people, and it will give you the number of points (or a %) for each rank. The person ranked #1 would get like 25% of the prize pool, and each person below would get less and less until the full prize pool is paid out.

Possible? Ideas?

Thanks.

nuzzle
December 21st, 2010, 01:08 AM
less and less


You first need to define what "less and less" actually means. Say you express it in relation to what the first rank gets. As an example say the first rank gets 1, the second rank gets half of that namely 1/2 and the third 1/3 of what the first got and then 1/4 and finally 1/5.

You then translate this to "portions of the whole" by first calculating the whole which is the sum of the parts, like

S = 1 + 1/2 + 1/3 + 1/4 + 1/5

You then can easily calculate what portion of this whole each rank gets. The first gets 1/S, the second gets (1/2)/S, the third (1/3)/S, etcetera.

Finally if you multiply these portions with 100 you get the percentage each portion constitutes of the whole. Or you can multiply the portions with the prize pool to directly get the number of points each rank gets.

If you feel the lower ranks get too much you can use some other distribution scheme you consider fairer. Say for example each rank should only get half of what the next better rank got you end up with this distribution: 1, 1/2, 1/4, 1/8 and 1/16. But the principle of how to calculate portions of a whole remains the same.

DodgerLD
December 21st, 2010, 02:49 AM
Hi nuzzle,

I think this is the same idea that I got from someone on IRC. I converted his formula to Excel for testing:

((1 - p) / (1 - p ^ n) * p ^ (r - 1)) * l

p = a value between 0 and 1 which defines the distribution.
n = number of players
r = rank
l = prize pool

Thanks for your help! :)

MrViggy
December 21st, 2010, 09:38 AM
Or, you can do it like we do in one of the games I play. 1st = 100%; the rest = 0%. Really easy! :)

Viggy

DodgerLD
December 21st, 2010, 10:27 AM
I wish. :)

nuzzle
December 21st, 2010, 11:00 AM
((1 - p) / (1 - p ^ n) * p ^ (r - 1)) * l


This formula is based on that you express the portions as a geometric series. One of the example series I gave,

1, 1/2, 1/4, 1/8, 1/16, .......

is an example of a geometric series. It can alternatively be written as,

(1/2)^0, (1/2)^1, (1/2)^2, (1/2)^3, (1/2)^4, .......

which means p of your formula has been chosen to be 1/2.

Generally the sum of a geometric series can be written like,

S = (1 - p^n) / (1 - p)

which you recognize in your formula above. In my example series n is 5.

And the p^(r - 1) part of your formula just selects the proper term in the series for each rank number r.

So your formula calculates the rank portions (distributed according to a geometric series) indeed.

DodgerLD
December 27th, 2010, 07:33 AM
Sweet. Thanks again.