I would approach the problem of programming this as follows: (I understand you have your random number generator already written from previous posting?)
  1. Start by using warning and strict
  2. Look up the perl data stucture called a 'array of arrays' (LoL) perldsc
  3. Crate your LoL  my @lori (lori acronym for lists of random integer)
  4. Populate the array items in each array in the LoL using your random integer generator

    (probably use something like

    for $i ( 1 .. 1000) { $AoA[$i] = [ somefunc($i) ]; }
    taken from ARRAYS OF ARRAYS

  5. Create a scalar to hold the results of your analysis(where you apply your gcd(x, y) = 1) my $result=0;
  6. Examine each pair of random integers in the LoL for meeting the gcd(x, y) = 1 criteria and increment $result when true
    foreach my @pair (@lori) { if( my_gcd_func(@pair) = 2) { $result++; }; }
  7. Check that value in $result against the 6/(Pi^2) .
    if( $result = 6/(3.1415926 * 3.141596) ) { do whatever you need to do to meet assignment requirements }

The code shown here is not tested, and there are parts which are obviously missing, but those will become obvious as you work your way through the above sequence I think. Perldocs are your friend in this endeavor I think. The basic foreach loop and if statement covered in perldoc along with the other noted perl docs above should give you a place to start.

It seems to me that your main issue is that you're new to programming and sitting fine in your understanding of the theory. I have zero understanding of the theory which is probably reflected in the way I approached it above, but that is not really important to you right now. So I hope that the basic breakdown above gets you started in the direction that you want to go on the programming end. Best of luck to you on that assignment.

...the majority is always wrong, and always the last to know about it...

A solution is nothing more than a clearly stated problem...


In reply to Re: PRNG/TRNG Cesaro's theorem by wjw
in thread PRNG/TRNG Cesaro's theorem by CDCozy

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.