#!/usr/bin/perl -w

$Q = 1;		# probability of no common birthday
$N=50;		# population size

for ($K=0; $K < $N; $K++) {
	$Q =$Q*(1 - $K/365);
	$k = $K+1;
	$P = 1 - $Q;	# probability of a common birthday
#print "$k people, probability  $P of a common birthday.\n";
	if (($k % 5) == 0) {print "  $k   $P\n";}
}
