Search code examples
phpalgorithmlamprankingvoting-system

How to prevent gaming a voting system where people can vote once per day?


I've implemented a voting system for videos online, wherein visitors can only cast a vote once in any given day. I use combination of their email address and timestamp to ensure that each vote is unique for that day.

As you might guess, this lead to people gaming the system by registering throwaway email addresses at mailinator.com and the like, so I'm wondering if anyone's tried implementing any other voting algorithms that allow for multiple votes by the same person. In addition, this setup means that if a video #1 has more people associated with it than video #2, video #1 is already at an unfair advantage.

I'm thinking about a ranked system, but I'm not totally sure how that could prevent anyone from gaming the system with fake email addresses. The problem I'm trying to solve is like this:

Given 3 videos, A, B and X. A has 5 people in it, B has 2, and X has 4.
Assuming that X is the best video of the three, and that people can vote every day, is there a voting system that will help "B" rise to the top?

Like I said, I my proposed ranked system, would posit that if the amount of #2's outnumber the #1's, it's safe to assume that should be the winner, but that seems incomplete.

Has anyone tackled anything like this before? Keep in mind, these are pretty low volume results (we average about 500 votes/7 days), so 2 people can really make a difference.

This is on a LAMP (PHP) stack in a shared hosting environment, if it helps.

Also, if you're wondering why we're allowing multiple votes by the same person, it's because the higher ups realize this helps drive traffic to the site, and they really enjoy seeing graphs go up (despite the fact the subsequent hits are pretty meaningless).

Thanks in advance, and if you need any other information please let me know.


Solution

  • You're actually asking about two separate things:

    First, how can you prevent people gaming the system? This is pretty intractable. You can raise the bar for placing a vote, by requiring registration, a minimum reputation like SO, or other restrictions, but ultimately all you can hope to do is reduce cheating, not eliminate it. Consider that people successfully register multiple times for physical political elections, then evaluate how likely it is that you can eliminate all cheating on your site.

    Second, how do you give a fair quality ranking to different items that may have different popularity and have been around for different times? One very good solution is described here by Randall Munroe. That article links to the actual algorithm, which is fairly straightforward to implement.