Without loss of generality, assume that the original hand was AAKQJ, and we traded in the KQJ.
The possible outcomes are as follows:
- Draw two aces and another rank to obtain four of a kind (AAAAx).
- Draw three of another rank to obtain a full house (AAxxx).
- Draw an ace and another pair to obtain a full house (AAAxx).
- Draw an ace and two other ranks to obtain three of a kind (AAAxy).
- Draw a pair and another rank to obtain two pairs (AAxxy).
- Draw three other ranks to retain one pair (AAxyz).
There are only two aces left in the remainder of the deck. These can be combined with any of the other $45$ cards to obtain a four of a kind, so there are $45$ such draws.
There is only one way each of drawing KKK, QQQ, or JJJ, plus four ways each of drawing TTT, 999, down to 222, so there are $4 \times 9 + 3 = 39$ such draws to obtain a full house AAxxx.
There are three ways each of drawing KK, QQ, or JJ, plus six ways each of drawing TT, 99, down to 22, so there are $6 \times 9 + 3 \times 3 = 63$ such pairs; each of these can be combined with either of the two remaining aces in the $2 \times 63 = 126$ draws to obtain a full house AAAxx.
There are $36 \times 32 \div 2 = 576$ non-matching pairs containing no K, Q, or J; there are $36 \times 9 = 324$ non-matching pairs containing exactly one K, Q, or J; and there are $9 \times 6 \div 2 = 27$ non-matching pairs containing only K, Q, and J. There are thus $576+324+27 = 927$ such pairs, each of which can be combined with either of the two remaining aces in the $2 \times 927 = 1854$ draws to obtain three of a kind AAAxy.
There are three ways each of drawing KK, QQ, or JJ; each of these can be combined with any of $42$ non-matching, non-ace cards for $9 \times 42 = 378$ draws. To this must be added the six ways each of drawing TT, 99, down to 22; each of these can be combined with any of $41$ non-matching, non-ace cards for $54 \times 41 = 2214$ draws. Thus, there are $378+2214 = 2592$ draws to obtain two pairs AAxxy.
Finally, there are $36 \times 32 \times 28 \div 6 = 5376$ non-matching triples xyz not containing K, Q, or J; there are $9 \times 36 \times 32 \div 2 = 5184$ non-matching triples xyz containing exactly one K, Q, or J; there are $9 \times 6 \times 36 \div 2 = 972$ non-matching triples containing exactly two K, Q, or J; and there are $9 \times 6 \times 3 \div 6 = 27$ non-matching triples KQJ. This totals $5376+4032+864+27 = 11559$ non-matching triples to retain one pair AAxyz.
As a double check, we have accounted for $11559+2592+1854+126+39+45 = 16215$ hands, and $\binom{47}{3} = 16215$.