Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Monte Carlo - Coin Toss

by roboticus (Canon)
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 romping around the Monastery: (8)
As of 2014-12-21 20:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (107 votes), past polls