in reply to Weighted random selection

To my shame I must confess I used the same algorithm with my mp3 player. And I didn't give a thought about efficiency.

If you do mind, you could just sum up the all the weights and do the looking up on a second walkthrough. Definitely more memory efficient and if your weights are above 2 on average it would be faster too.

You could also keep a running weight total that would be updated on every addition or deletion in the group.