Possibly related to the number of random numbers - first from the built in rand and then with rand from Math::Random::MT::Auto. I generated 2 ** 25 random numbers and the code and results are below.
#!/usr/bin/perl use strict; use warnings; use 5.014; my %rand; for (1 .. 2**25) { my $r = rand; $rand{ $r }++; } say scalar keys %rand; use Math::Random::MT::Auto qw(rand); %rand = (); for (1 .. 2**25) { my $r = rand; $rand{ $r }++; } say scalar keys %rand;
Results:
C:\Old_Data\perlp>perl t.pl 32768 33554432 C:\Old_Data\perlp>perl -E "say 2**25" 33554432 C:\Old_Data\perlp>perl -E "say 2**15" 32768 C:\Old_Data\perlp>
You can see that for 2**25 == 33_554_432 the built in rand only produced 2**15 == 32768 random numbers but the module produced an entire range of random numbers equal to 2**25.

Update: perl version -
C:\Old_Data\perlp>perl -v This is perl 5, version 14, subversion 1 (v5.14.1) built for MSWin32-x64-multi-thread

Windows version - 7


In reply to Re: Perl rand() generates larger numbers for small sample size, bug! by Cristoforo
in thread Perl rand() generates larger numbers for small sample size, bug! by ravipatel4

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.