From: Daniel S. <pop...@gm...> - 2013-10-14 21:56:20
|
I have a progam that simulates a certain population animals that I wrote for some friends of mine, and they said that something was wrong with it because there would always be way more of one gender than the other. As far as I can tell, this is due to a biased random number generator, and I was wondering if anyone had a workaround for this, as I don't understand the results I got when I googled this. -- Daniel Swanson |
From: Pascal J. B. <pj...@in...> - 2013-10-14 22:36:11
|
Daniel Swanson <pop...@gm...> writes: > I have a progam that simulates a certain population animals that I > wrote for some friends of mine, and they said that something was wrong > with it because there would always be way more of one gender than the > other. As far as I can tell, this is due to a biased random number > generator, and I was wondering if anyone had a workaround for this, as > I don't understand the results I got when I googled this. CL-USER> (loop repeat 10000000 if (zerop (random 2)) sum 1 into male else sum 1 into female finally (return (list male female (/ male (+ male female))))) (4999985 5000015 999997/2000000) CL-USER> (mapcar 'float *) (4999985.0 5000015.0 0.4999985) Doesn't seem to be biased to me. This is on Linux. -- __Pascal Bourguignon__ http://www.informatimago.com/ |
From: Sam S. <sd...@gn...> - 2013-10-14 23:30:17
|
> * Daniel Swanson <cbcpbea.gbzngb.qhqr@tznvy.pbz> [2013-10-14 16:56:12 -0500]: > > I have a progam that simulates a certain population animals that I > wrote for some friends of mine, and they said that something was wrong > with it because there would always be way more of one gender than the > other. As far as I can tell, this is due to a biased random number > generator, and I was wondering if anyone had a workaround for this, as > I don't understand the results I got when I googled this. This can be caused by your population evolution rather than the RNG bias. This could also be a statistical fluke. I suggest that you try reproducing the problem with a different seed (see MAKE-RANDOM-STATE). -- Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 http://www.childpsy.net/ http://openvotingconsortium.org http://www.memritv.org http://mideasttruth.com http://jihadwatch.org http://palestinefacts.org Complete tolerance is impossible: it is insulting to bigots. |
From: Daniel S. <pop...@gm...> - 2013-10-14 23:57:23
|
We have repeated the same simulation with about the same numbers several times, and no matter which numbers we use, one gender ends up having a lot more individuals than the other, usually by a factor of about 10. The genders start out equal every time. We also tend to end up with more grass than there are atoms in the universe, but that is a statistical fluke. I will check for statistical flukage in our numbers and try more tests. On Mon, Oct 14, 2013 at 6:30 PM, Sam Steingold <sd...@gn...> wrote: >> * Daniel Swanson <cbcpbea.gbzngb.qhqr@tznvy.pbz> [2013-10-14 16:56:12 -0500]: >> >> I have a progam that simulates a certain population animals that I >> wrote for some friends of mine, and they said that something was wrong >> with it because there would always be way more of one gender than the >> other. As far as I can tell, this is due to a biased random number >> generator, and I was wondering if anyone had a workaround for this, as >> I don't understand the results I got when I googled this. > > This can be caused by your population evolution rather than the RNG > bias. > This could also be a statistical fluke. > I suggest that you try reproducing the problem with a different seed > (see MAKE-RANDOM-STATE). > > -- > Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000 > http://www.childpsy.net/ http://openvotingconsortium.org http://www.memritv.org > http://mideasttruth.com http://jihadwatch.org http://palestinefacts.org > Complete tolerance is impossible: it is insulting to bigots. -- Daniel Swanson, Certified Geek http://www.proofthatgodexists.org |