Ranking 5 Deck Poker Hands

154 Views Asked by At

I'm trying to create a poker game that uses 5 decks, and have run into a problem calculating how many possible combinations of suited 4 of a kinds there are.

Suited 5 of a kind seems easy enough. To make a suited 5K of any given rank and suit, there are only 5 cards in the deck and you need all of them, so one combo per rank, per suit = 1 * 13 * 4 = 52 total suited 5Ks.

With suited 4K I tried the same approach, first calculating combinations of any given rank and suit (lets say Ace of Spades), then multiplying by 52.

My problem is with the first part. There are two ways I've thought of it that both seem correct, but can't be as they give different results.

The deck has 5 Aces of Spades total, so there are 5 ways to make a suited 4K with 4 cards. The problem comes with calculating how many 5 card combos that makes. (Note there are 260 total cards in the deck to begin with).

Option A: I have 5 combos of 4K and multiply by the remaining 255 cards in the deck, excluding the last Ace of Spades as it would make a suited 5 of a kind. 5 * 255 = 1275

Option B: I have 5 combos of 4K and multiply by the remaining 256 cards in the deck, to get all combos of suited 4 of a kind, including the suited 5 of a kind for now. 5 * 256 = 1280. Then remove the one combo of suited 5K to get 1279.

The difference is small enough to be negligible, but it's driving me insane not being able to understand this.

1

There are 1 best solutions below

0
On BEST ANSWER

As has already been discussed in the comments, in option $B$ you're counting suited $5$ of a kind $5$ times and thus need to subtract it $5$ times.

Since your comments indicate that you intend to pursue further, more complicated calculations of this kind, you might want to learn about the inclusion–exclusion principle.