View Single Post
  #1  
Old November 22nd, 2008, 01:40 PM
m3p m3p is offline
Newbie
 
Join Date: Nov 2008
Location: Cumberland, Rhode Island USA
Posts: 2
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
m3p is on a distinguished road
Default looking for algorithm for weighted random choice

The subject line probably doesn't quite call it what it's supposed to be called but, anyway, here's the problem:

Just for the sake of argument, say there are 5 possibilities (each "possibility" represents someone's blog feed for instance.) Over the course of time, each feed receives votes on how interesting it is to the audience reading the feeds.

So, feed1 has received 41 votes, feed2 - 25, feed3 - 14, feed4 - 10, feed5 -8.

What would be the formula for randomly choosing one of the five feeds, while at the same time giving the feeds with a higher number of votes, a better chance at getting selected? In other words, how to randomly choose one of the feeds while factoring in their popularity (or unpopularity, as the case may be.)

Thanks in advance for any replies.
Reply With Quote