You can simplify the calculation to
sub NwithM { my $f = 4-1; my( $L, $M ) = @_; my $T=1; my $tmp = 1; for my $m ( 1 .. $M ) { $tmp *= ($L-$m+1)/$m*$f; $T += $tmp; } return $T; }
In reply to Re: Calculating the number of possible matches with N mismatches for DNA? [Solved!]
by hdb
in thread Calculating the number of possible matches with N mismatches for DNA? [Solved!]
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |