use strict; use warnings; use List::Util qw(reduce); use bignum; # Number of coins to toss my $coin_toss=1000; # We cumulative probability of side1 appearing anywhere between 1 and 60 times my $side1=60; # Compute the binomial coefficients for row 1000 of pascal's triangle my @triangle = robo_2(1000); print < $side1; print "$i\t$triangle[$i]\t",100*$prob, "\n"; } print "\n\nProbability of 0..60 tails is: ", $total_prob*100; sub robo_2 { my $row = shift; my @cols = (1); ++$row; $cols[$_] = $cols[$_-1] * ($row-$_)/$_ for 1 .. $row-1; return @cols; }