there are 442170 ways of filling exactly 2 of 5 residues with letters from the alphabet {A,C,D}, and 3 of 5 residues with 17 other letters. And there are 3200000 ways to fill all 5 residues with any of the 3+17=20 letters of the amino acid alphabet.

Therefore, the probability that a given gene with 5 amino acid residues will have exactly 2 filled with A,C or D is

P = 442170 / 3200000 = 0.138.

It will happen 13.8% of the time, a little less than one chance in seven.

Click through this presentation to review.