#!usr/bin/perl use warnings; for ($sample=0; $sample<5000; $sample ++) { $k = 25; $N = 10000; @cls=(); $total=0; while ($k>=2) { if ($k==1) {last;} $mean = (4*$N)/($k*($k-1)); $time = (-log(rand)*$mean); push (@cls, $time); $k=$k-1; } $ntotal+=$_ for @first; $nmean = $ntotal/5000; print "$nmean\n"; foreach $first(@first) { if ($first<=$nmean) {push(@low, $first)}} $low= scalar @low; $hig= scalar (5000-@low); print "$low\n"; print "$hig\n"; }