Splitting requests into buckets

Hi,

I have a need to split requests into buckets based on assigned percentages.

For example 60% of the users fall into Bucket A and 20 % fall into bucket B and the remaining into Bucket C.

The there is no fixed limit on the requests.

Once the number of buckets have been decided the % could change in real time.

Is this possible at all?

thanks for any hints on how this can be done efficiently.

Really appreciate your help.

M

[480 byte] By [mhdevid9a] at [2007-10-2 7:23:57]
# 1
Sure. Pick a random number between 0 and 1. If it's less than 0.6 use the first bucket, if it's between 0.6 and 0.8 use the second bucket, else use the third. If the percentages change then change the cutoffs accordingly.
DrClapa at 2007-7-16 21:00:48 > top of Java-index,Other Topics,Algorithms...