Poker game probability question In a standard poker game (no wild cards), suppose you are dealt five cards and your hand contains exactly one pair. You trade in the three worthless cards for new ones. What is the probability that your hand improves? meaning that there is a substantive transformation from one "kind" of hand into another

You have a pair, so these are the (mutually exclusive) ways of improving your hand:


*

*Being dealt two worthless cards and a third of the number in the pair, giving you three of a kind

*Being dealt one extra card and the remaining two of the number in the pair, giving you four of a kind

*Being dealt one extra card and another pair, giving you two pair

*Being dealt three of a kind, giving you a full house


Note that you cannot get a flush or a straight.  Also observe that the three cards you discarded all had distinct numbers, otherwise you would have had two pair.
Let us assume that there are no other players, so that there are $47$ cards remaining.  (If there are other players, you need to do essentially the following for each possible hand they're dealt, then sum over all of their possible hands times the probability of those hands. Probably intractable by hand.)  Fix the hand you were dealt.  We count the number of ways of being dealt each of the preceding possibilities.


*

*Think about picking two worthless cards. You can't pick the number you've been dealt, so you have $45$ options for the first.  For the second, you can no longer pick the same number as the first, or you'd be dealt two pair, so you have $45 - 3 = 42$ options for the second. Now divide by $2$ (you double-counted each pair of cards). Now there are $2$ ways of picking a third card of the number of the pair you've been dealt, so there are 
$$\frac{45\cdot 42}{2}2=45\cdot 42$$
hands ways of getting three of a kind.

*There is exactly one way of being dealt the remaining two cards of the number in your pair. There are $45$ options for the worthless extra card. So there are 
$$45$$
ways of being dealt a four pair.

*There are $12$ numbers remaining for another pair.  However, $9$ of them have four suits for each number, while $3$ of them are the same number as the three you discarded, so there are $\binom{9}{1}\binom{4}{2} + \binom{3}{1}\binom{3}{2}$ ways of choosing another pair. Then the extra card can't be from the same number as that pair, nor the same number as your original pair, so there are $43$ cards to select it from if you picked your pair from the $9$ full sets of numbers and $44$ cards to select it from if you picked your pair from the $3$ sets of numbers from which you discarded.  Therefore, there are 
$$43\cdot \bigg( 9\binom{4}{2} + 3\binom{3}{2} \bigg)$$
ways of being dealt two pair.

*To be dealt a full house, you can either be dealt a pair with extra card same number as your original pair, or you can be dealt three of a kind.  For the former, replace $43$ by $2$ in the previous bullet point. For the latter, there are $9$ numbers to choose from with $4$ suits and $3$ numbers to choose from with $3$ suits, so $\binom{9}{1}\binom{4}{3} + \binom{3}{1}\binom{3}{3}$ ways of being dealt a three-of-a-kind.  Adding,
$$2\cdot \bigg( 9\binom{4}{2} + 3\binom{3}{2} \bigg) + \bigg(\binom{9}{1}\binom{4}{3} + \binom{3}{1}\binom{3}{3}\bigg)$$
ways of being dealt a full house.


Since there are $\binom{45}{3}$ ways of being dealt three replacement cards, we have the probability of improvement is:
$$\frac{45\cdot 42 + 45 + 43\cdot 9\binom{4}{2} + 45\cdot 3\binom{3}{2} + 2\cdot 9\binom{4}{2} + 3\binom{3}{2} + \bigg(\binom{9}{1}\binom{4}{3} + \binom{3}{1}\binom{3}{3}\bigg)}{\binom{45}{3}}$$
Google's calculator says that is about $34\%.$
I think I covered everything here without error, but these counting arguments can be tricky.
