C:\test>perl -E"{++$t;$r=`perl -E\"say rand()\"`;$r<.5?++$a:++$b; printf qq[\r%.3f : %.3f], $a*100/$t, $b*100/$t; $t>$ARGV[0] and say and $t=$a=$b=0; redo}" 10 45.455 : 54.545 27.273 : 72.727 36.364 : 63.636 54.545 : 45.455 72.727 : 27.273 63.636 : 36.364 36.364 : 63.636 45.455 : 54.545 27.273 : 72.727 36.364 : 63.636 72.727 : 27.273 45.455 : 54.545 54.545 : 45.455 63.636 : 36.364 C:\test>perl -E"{++$t;$r=`perl -E\"say rand()\"`;$r<.5?++$a:++$b; printf qq[\r%.3f : %.3f], $a*100/$t, $b*100/$t; $t>$ARGV[0] and say and $t=$a=$b=0; redo}" 100 52.475 : 47.525 52.475 : 47.525 52.475 : 47.525 46.535 : 53.465 45.545 : 54.455 51.485 : 48.515 41.584 : 58.416 46.535 : 53.465 42.574 : 57.426 40.594 : 59.406 C:\test>perl -E"{++$t;$r=`perl -E\"say rand()\"`;$r<.5?++$a:++$b; printf qq[\r%.3f : %.3f], $a*100/$t, $b*100/$t; $t>$ARGV[0] and say and $t=$a=$b=0; redo}" 1000 49.750 : 50.250 51.349 : 48.651 48.651 : 51.349 53.047 : 46.953