The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Math Topics » alt.math.recreational

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: need algorithm for weighted random choice
Replies: 1   Last Post: Nov 23, 2008 1:01 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 2
From: Rhode Island, USA
Registered: 11/22/08
need algorithm for weighted random choice
Posted: Nov 22, 2008 3:16 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

The subject 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.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.