Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Monte Carlo - Coin Toss

by roboticus (Chancellor)
on Mar 12, 2011 at 16:11 UTC ( #892833=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        printf "% 4u    % 10u   %5.2f\n",
                $i, $triangle[$i+1], 100*$triangle[$i+1]/$runs;
    }
    
  2. or download this
    $ time perl 892293.pl
    Name "main::a" used only once: possible typo at 892293.pl line 21.
    ...
    real    0m0.034s
    user    0m0.024s
    sys     0m0.012s
    
  3. or download this
    $ time perl 892293.pl
    Name "main::a" used only once: possible typo at 892293.pl line 21.
    ...
    real    0m0.034s
    user    0m0.028s
    sys     0m0.004s
    
  4. or download this
    use strict;
    use warnings;
    ...
    for (my $i = 0; $i < $numTosses+1; $i++) {
        print "$i\t$triangle[$i+1]\t",100*$triangle[$i+1]/$runs, "\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://892833]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2015-07-05 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls