#!/usr/bin/perl -w

use 5.034;

die "No poblation. Usage: $0 <num>\nwhere num is the size of the population." unless $ARGV[0];

my $P = $ARGV[0];
my $p = 0.5;
my $e = 0.03; # total error
my $Z = 2;  # sighly more than 95%

say "Size of the sample = ", 1+int ($P*$Z*$Z*$p*(1-$p) / ($e*$e*($P-1)+$Z*$Z*$p*(1-$p))), "";

exit 2;


