Saturday, 14 September 2013

Get only random 20% of consecutive inputs

Get only random 20% of consecutive inputs

I have a system that constantly gathers items from a rss feed.
I want to take only a certain percentage, say 20%, of those items, randomly.
My approach is that for each item I "throw a dice" using rand(0,100) and
accept the item only if the result of this statement is < 20.
Is it a good approach?

No comments:

Post a Comment