Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my( @sample ) = @entity{ 8, 8, 3, 1, 5, 0, 0 };
    
    my $prob = probability( \@entity, \@sample );
    
  2. or download this
    sub probability {
        my $entity_count = @{$_[0]};
        my $sample_count = @{$_[1]};
        return( ( 1 / $entity_count ) ^^ $sample_count );
    }