Analyzing Video Poker HandsAnalyzing a video poker hand requires, at its core, the following steps for each of the 32 ways to play the hand:
Without any sort of optimization, it would take even today's computers a very long time to perform the above steps for all 32 ways to play all 2,598,960 (or more) possible starting hands. By using some creativity and shortcuts, the steps can be modified to run faster, but still arrive at the same result. Step 1 is the most critical and time-consuming step. Fortunately there are multiple ways to complete it, as I will explain below. Determining Possible Replacement HandsBrute ForceThe simplest but slowest method uses "brute force", which involves looping through the unused cards and combining them with the held cards to determine the possible outcomes. On my website, when you analyze an individual hand, this is the method I use because it's fast enough for the purpose of analyzing an individual hand. When analyzing an entire game, however, this method is unacceptably slow. Depending on the game and whether or not a simplified deck model is used, it could take anywhere from one day to three months to finish. Game-Specific FormulasAnother method is to use formulas that determine the number of ways a particular hand can be made on the draw based on the cards held and the cards that were discarded. I believe this is the method that the Wizard of Odds uses, and I also believe that the formulas change from game to game, meaning that it would not be possible to use the Jacks or Better formulas for Deuces Wild, for example. I have never tried to implement this method, so I can't offer much insight into it. Generic FormulasThe shortcut I use involves formulas also, but for the most part they do not change based on the game. Before I begin analyzing each unique hand, I prepare some data about the game using a few arrays:
The numbers on the top are the "input" numbers, and correspond to the total number of hands in the entire game that include the designated cards, including those hands which contain the discards. The numbers on the left are the "output" numbers, and correspond to the total number of hands that are possible on the draw after the discards have been taken into consideration. The plus and minus signs on each row indicate whether the corresponding "input" number is to be added or subtracted. You may notice that the visual representation of the formulas yields a Sierpinski Triangle : ![]() There are actually two ways to execute these formulas:
Hurry Up and WeightOf the four basic mathematical operations, division is the one that takes humans the longest to perform. With some exceptions, the same holds true for computers. Division is what programmers refer to as an "expensive operation", because it requires more time to process than addition, subtraction, or multiplication. Additionally, computers can handle integers faster than they can handle decimals (floating-point numbers). Instead of dividing the total payout for each way to play by the number of hands that can be achieved on the draw, it is faster to multiply the total by a weighting factor which will "equalize" the results for all 32 ways to play. Doing this saves time in two ways: multiplication is used instead of division, and floating-point numbers are avoided. The first step involved in finding the ideal weighting factor is figuring out the number of possible outcomes for each number of discards:
The next step is determining the least common multiple (LCM) of all six numbers for each deck size:
The final step is dividing the least common multiple by the number of possible outcomes. The result is the ideal weighting factor for the corresponding number of discards:
By multiplying the total payout for each way to play by the appropriate weighting factor, it is then possible to identify the best play as the one whose weighted payout is the highest, with no division necessary. For more information about weighting factors, I recommend The Wizard of Odds' Video Poker FAQ , which is where I learned about them.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright © 2007-2008 Video Poker Genius. All rights reserved. Free Video Poker | Mac Video Poker | Video Poker | Legal Notices | Websites | Contact | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||