[metapost] Drawing a urn
technik at roomandspace.com
Thu Nov 29 14:21:08 CET 2007
Am Donnerstag, den 29.11.2007, 07:01 -0600 schrieb Troy Henderson:
> Try replacing
> > if (i <= 5 ):
> if (normaldeviate <= 0.176374 ):
> If I understand your problem correctly, this should solve both of your
> questions. The reason for choosing 0.176374 is because normaldeviate
> is a normally distributed (pseudo) random number whose mean is 0 and
> whose standard deviation is 1, and the probability that such a number
> is <= 0.176374 is 0.57. Obviously, you would want to change that
> value if you decide to change your probability.
I tried that 3 times and I got .40, .41 and .45, so this does not
exactly give me what I want. I have 100 balls, and on .57 I have 57
dark and 43 light balls (maybe normaldeviate <= 0.17... gives me some
value arround the light balls, where I could deal with, but the value is
not exact). That cannot change between runs, random should only be the
position of the balls where they are.
Do you have any further Ideas?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://tug.org/pipermail/metapost/attachments/20071129/1c81d75b/attachment.bin
More information about the metapost