Exact Hold Analysis in Video Poker
Abstract. A five-card video poker hand can be held in 32 ways, and the best one depends on the paytable. This paper describes how DiceGem counts every possible draw for every hold, and how an inclusion-exclusion table turns the same counting into the exact return of a whole game over all 2,598,960 deals.
Summary
- Every hand has 32 holds, from keeping nothing to keeping all five cards.
- For one hand, counting every draw for every hold means checking 2,598,960 final hands in total on a 52-card deck. That runs in a fraction of a second in a browser.
- For a whole game, the same counting across every deal gives the exact return with optimal play. An inclusion-exclusion table keeps that to 243 table reads per deal.
1. One hand: 32 holds
After the deal you keep any subset of your five cards and draw replacements from the 47 cards left. If you keep h cards, the draw can bring C(47, 5 − h) different sets of new cards:
| Cards held | Ways to hold | Possible draws for each hold |
|---|---|---|
| 5 | 1 | 1 |
| 4 | 5 | 47 |
| 3 | 10 | 1,081 |
| 2 | 10 | 16,215 |
| 1 | 5 | 178,365 |
| 0 | 1 | 1,533,939 |
Multiplied out and added up, that is 2,598,960 final hands, exactly the number of five-card hands in a deck. A hold’s value is the average payout over its draws, and the best hold is the one with the highest average. Games with a 53-card deck (a joker or an extra ace) have 48 cards left after the deal, and the same counting applies.
Our video poker hand analyzer runs exactly this count for any hand you enter, for each of our paytables. In most of our video poker games the Hint button uses the same function.
2. Evaluating a final hand quickly
The counting above evaluates millions of hands, so the hand evaluator is built for speed: it works on bit masks of ranks, checks straights against ten five-rank windows and reads the payout from the paytable directly. Wild cards (deuces, jokers) are handled by the same evaluator. Tests compare it with the slower, general hand evaluator on thousands of random hands for every paytable.
3. A whole game: inclusion-exclusion
The exact return of a paytable needs the best hold for every one of the 2,598,960 deals. Repeating section 1 for each deal would mean trillions of evaluations, so the calculation reuses work:
-
Build a table once. Every final hand is evaluated once, and its payout is added to each of its 32 subsets. The table then holds, for any set of cards X, the total payout of all final hands that contain X.
-
Correct for discarded cards. A hold’s draws must not contain the cards you threw away, because they have left the deck. Inclusion-exclusion removes them: the value of holding H and discarding D is
Σ over every subset S of D of (−1)^|S| × T[H ∪ S], divided by C(n − 5, 5 − |H|),
where n is the deck size.
-
Count the reads. Across the 32 holds of one deal, each card is either held, discarded and included in S, or discarded and left out, so the sum touches 3⁵ = 243 table entries per deal.
The best hold of each deal is the one with the highest value, and the game’s return is the average of those best values over all deals.
4. Bet size and paytables
The royal flush usually pays a bonus only on a maximum bet of 5 credits. With a smaller bet the paytable is slightly different, so the best hold can be different too. Each game is therefore computed for each credit level, and levels whose paytable is identical per credit are grouped together. The fairness page lists two figures per game: 5 credits, and 1 to 4 credits.
Games that multiply the next hand’s payout (such as a multiplier awarded for the current hand) are not analysed by this tool, because the value of a hold then also depends on future hands.
5. Tests
The returns of each video poker game are recomputed by its tests with this method and compared with the six-digit figures the game publishes. The method itself is checked against the published 99.544% return of 9/6 Jacks or Better, and its hold values against a slower, direct evaluation of every draw. The general approach is described in the exact return-to-player paper.