put back the commented away 63 71 and 75 and it looks as we expect(?) - a file of random numbers from the physics wizards is referenced too - put in 27 remove 28
use strict; use warnings; use List::Util qw(max sample); #use lib '/usr/local/share/perl/5.30.0'; #use Statistics::Basic::Stddev; #installs somewhere?? #use Statistics::Basic::StdDev; use Statistics::Basic qw(:all); use File::Slurp; #for large list of real randoms my @rands = read_file('../stats/bytes37Mb.txt'); my ($fertilewomen) = @ARGV; my @maxxes; my $cyclelength = 32; #my $duration = int(rand(1) + 0.5) == 1 ? 4 : 5; #my $duration = sample 1, (4, 5); $fertilewomen ||= 48; #print "duration is $duration\n"; #my @women; #for (1..100) { my @women; # for (1..48) { for (1..$fertilewomen) { # my $start = int(rand(31) + 0.5); # my $start = int(rand($cyclelength-1) + 0.5); # my $start = int(rand($cyclelength)); my $start = getrandom($_); # print "$start\n"; # my $range; # my $turnover = $cyclelength - $duration; # if ($start > 28) { # if ($start > $turnover) { # if ($start == 29) { # if ($start == $turnover+1) { # $range = [$start, $start+1, $start+2, 0]; # } elsif ($start == 30) { # } elsif ($start == $turnover+2) { # $range = [$start, $start+1, 0, 1]; # } else { # $range = [$start, 0, 1, 2]; # } # } else { # $range = [$start..$start+3]; # } # push @women, $range; # my $duration = sample 1, (4, 5); my $duration = 4; push @women, $start..($start+$duration-1); } my %count; my %mcount; for my $woman (@women) { # my @range = @{$woman}; # for (@range) { # my $moduluscyclelength = $_ % $cyclelength; my $moduluscyclelength = ($woman % $cyclelength); #print $moduluscyclelength, ' ', $woman, ' ', $cyclelength, "\n"; # $count{$_}++; $mcount{$moduluscyclelength}++; # $count{$woman}++; # } } my %occupancy; # for (0..31) { for (0..$cyclelength-1) { # my $value = exists $count{$_} ? $count{$_} : 0; my $mvalue = exists $mcount{$_} ? $mcount{$_} : 0; # $occupancy{$_} = $value; print "$_ $mvalue\n"; # print "$_ $value $mvalue\n"; } # print 'mean is ', mean(values %count), "\n"; # print 'sd is ', stddev(values %count), "\n"; # my %ostats; # for (values %occupancy) { # $ostats{$_}++; # } # for (sort { $a <=> $b } keys %ostats) { ## print $_, ' ', $ostats{$_}, "\n"; # } # push @maxxes, max(keys %ostats); #} #print join ' ', sort { $a <=> $b } @maxxes; sub getrandom { my $index = shift; my $byte = $rands[$index]; chomp $byte; return int($byte/8); }

In reply to the distribution is barmy by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.