canis [shmem] /home/shmem > time perl4 -e '$iters = 100_000; $runs = 6; for $sides (1,2,3,4,6,8,10,20,100) { printf "%-5s", "D$sides:"; for (1 .. $runs) { $tot = 0; for (1 .. $iters) { $tot += int(rand $sides)+1; } print " ", $tot/$iters; } print "\n"; }' D1: 1 1 1 1 1 1 D2: 1.4976199999999999513 1.4995000000000000551 1.5008399999999999519 1.5009200000000000319 1.4983500000000000707 1.4992000000000000881 D3: 1.9988500000000000156 2.0010099999999999554 1.9973600000000000243 1.9947699999999999321 2.0022500000000000853 1.9987600000000000922 D4: 2.4961099999999998289 2.5017000000000000348 2.5014599999999997948 2.4986999999999999211 2.4970900000000000318 2.5005099999999997884 D6: 3.50016000000000016 3.4905300000000001326 3.5027200000000000557 3.4986999999999999211 3.4940500000000001002 3.4981499999999998707 D8: 4.5008200000000000429 4.4963499999999996248 4.499399999999999622 4.505130000000000301 4.500880000000000436 4.4966600000000003234 D10: 5.5046299999999996899 5.4901400000000002422 5.4932299999999996132 5.4982899999999998997 5.4878000000000000114 5.481379999999999697 D20: 10.478590000000000515 10.511730000000000018 10.487120000000000886 10.511749999999999261 10.520690000000000097 10.513320000000000221 D100: 50.332399999999999807 50.534730000000003258 50.687139999999999418 50.558239999999997849 50.449489999999997281 50.479340000000000543 473.690u 154.350s 26:25.22 39.6% 0+4164k 0+7io 39159pf+0w canis [shmem] /home/shmem > perl4 -v This is perl, version 4.0 $RCSfile: perl.c,v $$Revision: 4.0.1.4 $$Date: 91/06/10 01:23:07 $ Patch level: 10 Copyright (c) 1989, 1990, 1991, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 4.0 source kit.