#!/usr/bin/perl -l ($n,$N) = @ARGV; for (1 .. $N) { my %h; $h{int rand 10}++ for 1 .. $n; $g++ if keys %h > 9; } print $g/$N;