Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Voting algorithm: how to calculate rank?

I am trying to figure our a way to calculate rank. Right now it simply takes ratio of wins / losses of each individual entry, so e.g. one won 99 times out of a 100, it has 99% winning rank. BUT if an entry won 1 out of total 1 votes, it will have a 100% winning rank, but definitely it can't be higher that of the one that won 99 times. What would be a better way to do this?

like image 423
mvbl fst Avatar asked Jan 22 '10 17:01

mvbl fst


People also ask

How do you rank votes in choice?

How does Ranked Choice Voting work? You can rank up to five candidates in order of preference, instead of choosing just one. If a candidate receives more than 50% of first-choice votes, they are the winner. If no candidate earns more than 50% of first-choice votes, then counting will continue in rounds.

How does a ranked ballot work?

The term ranked voting (also known as preferential voting or ranked choice voting) refers to any voting system in which voters rank their candidates (or options) in a sequence of first or second (or third, etc.) on their respective ballots.


2 Answers

Try something like this:

votes = wins + losses
score = votes * ( wins / votes )

That way, something with 50% wins, but a million votes would still be ahead of something with 100% wins but only one vote.

You can add in an extra weight based on age (in days in this example), too, something like

if age < 5:
    score = score + ((highest real score on site) * ((5 - age) / 5)

This will put brand new entries right at the top of the first page, and then they will move slowly down the list over the course of the next 5 days (I'm assuming age is a fractional number, not just an integer). After the 5 days are up, they will be put in the list based solely on the score from the previous bit of pseudo-code.

like image 93
pib Avatar answered Nov 26 '22 17:11

pib


Depending on how complicated you want to make it, the Elo system chess uses (or something similar) may be what you want: http://en.wikipedia.org/wiki/Elo_rating_system

Even if a person has won 1/1 matches, his rating would be far below someone who has won/lost hundreds of matches against tough opponents, for instance.

like image 44
z - Avatar answered Nov 26 '22 16:11

z -