Slot Machine biased

EDIT: The "problem" is solved. Thank you for your help
 
Last edited on
I generated a sample of 100 rand calls with rand() % 17 + 1 and got this distribution. Some numbers definitely appear more often than others, but a second set of 100 calls had different numbers appearing more often. It's a pseudo-random function - there's really no guarantee that you'd get an equal distribution of all possible numbers.


Random # 1 appeared 8 times.
Random # 2 appeared 5 times.
Random # 3 appeared 5 times.
Random # 4 appeared 7 times.
Random # 5 appeared 7 times.
Random # 6 appeared 4 times.
Random # 7 appeared 6 times.
Random # 8 appeared 7 times.
Random # 9 appeared 2 times.
Random # 10 appeared 6 times.
Random # 11 appeared 7 times.
Random # 12 appeared 4 times.
Random # 13 appeared 13 times.
Random # 14 appeared 4 times.
Random # 15 appeared 7 times.
Random # 16 appeared 4 times.
Random # 17 appeared 4 times.


The newer random library might be something to check into?
http://www.cplusplus.com/reference/random/?kw=random
Last edited on
Thanks I guess I didn't realized how it worked. I'll just tell him to keep trying it and eventually it will show up.
Last edited on
Please put your original question back in please. Might help other people in the future.
Topic archived. No new replies allowed.