in reply to Math all gone wrong...

If you're only expecting 100 errors, the variance will be about 10. Your results are indeed low for the expected rates in the low-rate calculations. How good is your random number generator?.

I got:

Error rate = 1 every 10, errors = 100046 99765 100442 99969 99433 
Error rate = 1 every 100, errors = 10134 9873 10067 10072 9842 
Error rate = 1 every 1000, errors = 1012 1056 1015 986 1055 
Error rate = 1 every 10000, errors = 103 101 105 93 96 
Error rate = 1 every 100000, errors = 8 14 10 14 11
without any modification of your code.

Update: Athlon/Linux 2.4.17/Perl 5.6.1 for this run. /dev/random is available.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Math all gone wrong...
by dbp (Pilgrim) on Dec 01, 2002 at 02:25 UTC
    My results:
    Error rate = 1 every 10, errors = 100098 100545 99931 99905 99434 
    Error rate = 1 every 100, errors = 10037 10075 9872 9924 10133 
    Error rate = 1 every 1000, errors = 959 978 1012 1032 1041 
    Error rate = 1 every 10000, errors = 97 100 109 92 86 
    Error rate = 1 every 100000, errors = 11 11 9 12 7
    

    What are you running this on (Machine/OS/Perl Version)? Also, rule of thumb is 30 trials for reliable statistical results. 100 is a safer bet.

    Update:(PIII/2.4.18/5.6.1 w/ dev/random) Thanks Zaxo, although to clarify, I was most interested in what the original poster was running on.

Re: Re: Math all gone wrong...
by CountZero (Bishop) on Dec 01, 2002 at 10:58 UTC
    On an entirely different track, if you need real random numbers (as opposed to calculated pseudo-random numbers) have a look at

    http://www.random.org/essay.html
    or
    http://www.fourmilab.ch/hotbits/

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law