canis [shmem] /home/shmem > time perl -e 'my $iters = 100_000; my $runs = 6; for my $sides (qw{1 2 3 4 6 8 10 20 100}) { printf "%-5s", "D$sides:"; for (1 .. $runs) { my $tot = 0; for (1 .. $iters) { $tot += int(rand $sides)+1; } print " ", $tot/$iters; } print "\n"; } ' D1: 1 1 1 1 1 1 D2: 1.5017 1.50273 1.49927 1.50004 1.50069 1.50234 D3: 2.00005 2.0013 1.99667 2.00228 2.00141 2.0018 D4: 2.49651 2.49254 2.50251 2.5008 2.49389 2.50032 D6: 3.4947 3.49803 3.4938 3.50231 3.50249 3.49613 D8: 4.50561 4.51195 4.51012 4.50395 4.4961 4.50096 D10: 5.52471 5.50722 5.50845 5.4933 5.4983 5.49319 D20: 10.51722 10.48846 10.52023 10.50762 10.48594 10.52206 D100: 50.43492 50.46292 50.4675 50.66063 50.35462 50.46591 293.510u 0.450s 4:54.97 99.6% 0+1599k 4+7io 1pf+0w canis [shmem] /home/shmem > uname -a SunOS canis 4.1.4 5 sun4m canis [shmem] /home/shmem > perl -v This is perl, version 5.004 Copyright 1987-1997, 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 5.0 source kit.