Welcome to the Monastery | |
PerlMonks |
Re^3: Monte Carlo - Coin Tossby Eliya (Vicar) |
on Mar 12, 2011 at 10:40 UTC ( [id://892814]=note: print w/replies, xml ) | Need Help?? |
You have an off-by-one error, it should be: ... No, 0 .. NUM_TOSSES is correct here, because adding up NUM_TOSSES (with a single result being 0 or 1) can potentially produce values ranging from zero to NUM_TOSSES.
Tossing a coin once can produce 0 or 1 tails;
In Section
Cool Uses for Perl
|
|