Slot Machine biased

Apr 23, 2014 at 11:27pm
EDIT: The "problem" is solved. Thank you for your help
 
Last edited on Apr 24, 2014 at 7:00pm
Apr 24, 2014 at 1:02am
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 Apr 24, 2014 at 1:02am
Apr 24, 2014 at 6:59pm
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 Apr 24, 2014 at 6:59pm
Apr 24, 2014 at 7:23pm
Please put your original question back in please. Might help other people in the future.
Topic archived. No new replies allowed.