You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use List::Util 'max'; # https://github.com/ReneNyffenegger/PerlModules/tree/master/List/Util
my $λ = 41;
my $tests = 100000;
my %result;
my $screen_width = 200;
for (1 .. $tests) {
my $x = Math::Random::random_poisson(undef, $λ); # When called in a scalar context, generates and returns only one such outcome as a scalar, regardless of the value of $n (first paramter
$result{$x}++;
}
my $max_number = max map { $result{$_} } keys %result;
# Output the graph
print("\n");
for my $key (sort { $a <=> $b } (keys(%result))) {
my $len = int($screen_width * $result{$key}/$max_number);