Original Post
Hi guys, I usually do something like this: probs[0]=0.25; probs[1]=0.5; probs[2]=1.0; ran=RanDeviate(); for(i=0;i<3;i++){ if(ran < probs) // it's that one } Well, that's fine for me but other people have a problem setting the values, they think the probs[1] will have a 50% chance of occuring. So what is a nice method ? It would be nice if I didn't have to sort anything. It would be nice if the actual values were the probabilities that would add up to 1.0 Any ideas would be appreciated.