Clapham Digital · Case study
Exact math, fast enough to feel instant
Video Poker Edge works out the exact expected value of all 32 possible holds on every hand, and answers in under a millisecond.
What it is
A strategy trainer for video poker. Instead of rules of thumb, it calculates the exact expected value of every one of the 32 ways to hold five cards. It’s on the App Store and Google Play; the app page has more.
The hard part
- Exact is slow.Working out one hold by brute force means simulating every possible draw, up to 1,533,939 combinations per hold. Correct, and far too slow for a trainer that has to answer the instant you tap.
- So do the slow part once.I solved every one of the 2,598,960 possible five-card deals ahead of time and folded them into 134,459 strategically distinct hands. At runtime the app looks the answer up instead of computing it, in under a millisecond.
- Checked against the outside world.A table that agrees with itself proves nothing. So the returns get compared with figures published elsewhere, Wizard of Odds among them. For 9/6 Jacks or Better the published return is 99.543904%, and the calculation agrees with it to six decimal places.
What it means for your project
Slow software is usually doing work on every request that could have been done once. I get the answer right first, then make it fast, and check both against something independent. The same approach works on a slow report, a slow search or a slow checkout.
Related: audits and speed and custom software.
Have something that needs building, fixing or checking? Email [email protected] or call or text (614) 835-7163.
All case studies → Blog →