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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://892833]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found