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