in reply to Calculating the number of possible matches with N mismatches for DNA? [Solved!]
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calculating the number of possible matches with N mismatches for DNA? [Solved!]
by BrowserUk (Patriarch) on May 27, 2015 at 07:35 UTC |