http://www.perlmonks.org?node_id=892814


in reply to Re^2: Monte Carlo - Coin Toss
in thread Monte Carlo - Coin Toss

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;
tossing a coin twice can produce 0, 1 or 2 tails;
etc.