>>232 ゴリ押しで。

use strict ;
use warnings ;
use List::Util qw/shuffle/ ;

my $trials = 99999 ;
my $throws = makeThrows($trials) ;

my $balls = scalar( () = $throws =~ /bbbb/g ) ; # フォアボールの回数
$balls *= 4 ; # ボールになった投球の数

print "trials: $trials\n" ;
print "balls' balls: $balls\n" ;
printf ("balls/trials = %2.3f %s\n" , 100*$balls/$trials , "[%]" ) ;

sub makeThrows {
my $n = shift ;
my @throws ;
my $d = $n * 2/3 ; # max strikes number

for ( my $i=0; $i<=$d; $i++ ) {
$throws[$i] = "s" ; # strikes
}
for ( my $i=$d+1; $i<$n; $i++ ) {
$throws[$i] = "b" ; # balls
}

return join "" , shuffle(@throws) ;
}