We start with a standard poker deck (52 cards, 4 suits, 13 ranks). In our first hand (5 cards) all the 5 cards are different (different rank). Now our first hand have 5 cards with 5 differents ranks. We must calculate the probability to get a pair (One Pair) replacing one, two, three, four or all five first hand’s cards. Example:
First Hand: ♥1 ♦2 ♥3 ♠4 ♠5.
We replace one card (random, A1) and we get: ♦6 ♦2 ♥3 ♠4 ♠5. How many possibilities do we have to get one pair? And how many possibilities do we have if we replace two cards (A1 and B2)? And replacing 3, 4 or 5 cards?
I'll start you off.
I'll assume that you need at least one pair (as opposed to exactly one pair), and that the cards you discard don't go back into the deck (so that you're guaranteed to get different cards than you discarded).
Drawing one card, there are $12$ out of $48$ that will give you a pair: three of each of the cards left in your hand.
Drawing two cards, it seems easier to calculate the complementary probability (those that don't give you at least a pair) and subtract from $1$.
So we need to count the number of ways to draw two cards that are different from the three we still have. But remember that the ranks that were discarded only have three cards out there! To count accurately, we need to break all possibilities into disjoint cases. We can draw two different cards such that (a) they're both different than the ones we discarded; (b) one is different than the ones we discarded, or (c) they're both the same rank (but different suit) than the ones we discarded.
For case (a), we have eight ranks, from which we pick two. Then we choose the suit for each. This has $_8C_2 \cdot 16$ possibilities.
For case (b), we choose the card that matches one we discarded $_2C_1$ and its suit $3$, then the "fresh rank" and its suit ($_8C_1 \cdot 4$).
For case (c), we know the ranks of the cards we need to choose, but we need to choose the suit of each ($9$).
Of all these, there are $_{47}C_2$ possible ways to draw two cards from what remains.
Thus, the probability if we draw two is
$$P(2) = 1 - \frac{(27 \cdot 16) + (2 \cdot 3 \cdot 8 \cdot 4) + 9}{1081}.$$
Not a trivial problem! But can you take it from here for the other cases?