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