Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weighted win percentage by number of games played

Im looking to create a ranking system for users on a gaming site.

The system should be based of a weighted win percentage with the weighted element being the number of games played.

For instance:

55 wins and 2 losses = 96% win percentage

1 win and 0 losses = 100% win percentage

The first record should rank higher because they have a higher number of wins. I'm sure the math is super simple, I just can't wrap my head around it. Can anyone help?

like image 490
Dave Chenell Avatar asked Sep 22 '11 03:09

Dave Chenell


2 Answers

ELO is more thorough because it considers opponent strength when scoring a win or loss, but if opponents are randomly matched a simple and very effect approach is:

(Wins + constant * Average Win % of all players) / (Wins + Losses + constant)

so with 0 games the formula is the average for all players, as you increase the number of games played the formula converges on the actual record. The constant determines how quickly it does this and you can probably get away with choosing something between 5 and 20.

like image 161
AronMiller Avatar answered Nov 02 '22 21:11

AronMiller


Yes, it is "super simple":

 Percentage = Wins * 100.0 / (Wins + Losses)

To round to an integer you usually use round or Math.round (but you didn't specify a programming language).

The value could be weighted on the number of wins, using the given ratio:

 Rank = Wins * Wins / (Wins + Losses)

But there are other systems that understand the problem better, like Elo (see my comment).

like image 27
Peter O. Avatar answered Nov 02 '22 21:11

Peter O.