View Single Post
Old Sep 28th, 2007, 11:35 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Frankly, that sounds a tad flakey. If it's really dealing with basic probability, then it would be a random function.

You can think of it this way, though: Suppose I put 94 white and 6 black beans in a bag and 100 people have to each draw a bean. The guys that draw the black beans get shot. That's exactly 6 out of 100 if you don't put the beans back. Work it that way. Think array. Pick an element at random. Mark it so if it's chosen again, a new number is picked.

Same thing as dealing cards.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote