HenryRLee / PokerHandEvaluator

Poker-Hand-Evaluator: An efficient poker hand evaluation algorithm and its implementation, supporting 7-card poker and Omaha poker evaluation
Apache License 2.0
372 stars 80 forks source link

Max values of ranks for 5-cards, 6-card, and 7-card Hands, respectively ? #28

Closed 52nlp closed 1 year ago

52nlp commented 3 years ago

May I know the max values of ranks for 5-cards, 6-card, and 7-card Hands, respectively in the Python implementation? Thanks a lot!

HenryRLee commented 3 years ago

Hi @52nlp.

All these types of games, including 5-card, 6-card, 7-card, and even Omaha poker, use the same rank value system. The minimum value is 1, matching the strongest hand (the Royal Flush). The maximum value is 7642, matching the weakest hand in the 5-card poker (7-5-4-3-2 unsuited).

So, the maximum value in the 5-card poker is 7642. However, this hand does not exist in the 6-card poker. The reason is that any additional card to this hand (or any 7-High hand), must improve the hand. Indeed, the weakest possible hand in the 6-card poker is 8-7-5-4-3 unsuited, with a value of 7450. Due to the same reason, the weakest hand in the 7-card poker cannot be an 8-High hand. The actual weakest hand in the 7-card poker is 9-8-7-5-4 unsuited, with a value of 7414.

Cactus Kev made a very good summary of all possible 5-card hands on this page. If you scroll down to the bottom, you will find the weakest hand, and find its corresponding rank in the first column. The second, the third, and the fourth column represent the possible number of such hands in the 5-card poker, 6-card poker, and 7-card poker respectively. You will see that rank 7462 has zero hands in 6-card and 7-card poker. The nearest hand with a possible 6-card hand is value 7450, with 4020 possible 6-card hands. Similarly, the nearest hand with a possible 7-card hand is value 7414, with 15540 possible 7-card hands.