Logo
Back to Blog

Dice Poker in SQL Server

Written by:
4/17/2025 12:32 PM

Today we look at 2 different ways of calculating the probabilities.

Dice Poker is more or less what you think it is; you roll 5 dice and then have the option of re-rolling some or all of the dice to improve your hand. Apparently, there could be gambling involved and the person with the better hand wins the stakes for a given hand. I guess if you have enough dice, you could have more than 2 players. Dice Poker, I have been informed, is one aspect of the Witcher action role-paying game.

Here’s how to calculate the probabilities in Dice Poker, in order of pay-off. In other words, even though the probability of a High Straight and a Low Straight are the same the High Straight beats the Low Straight the probability of a bust or losing hand is much lower than getting one pair, the pair beats the bust.

  • Five of a kind: there are 6 combinations one for each face on the dice.

  • High Straight: all the possible arrangements of 23456.

  • Low Straight: all possible arrangements of 12345.

  • Four of a kind: 6 face for the 4 of a kind; 5 possible singletons; 5 possible positions for the singleton.

  • Full House: 6 faces for the 3 of-a-kind; 5 left for the pair; 5c2 = 10 possible positions for the pair.

  • Three of a kind: 6 faces for the 3 of a kind; 5c2 singletons; 5c3 positions for the 3 of a kind.

  • Two pair: 6c2 ways to combine faces; 4 possible faces for the singleton; 5c2 positions for the first pair; 3c2 positions for the second pair.

  • One Pair: 6 faces for the pair; 5!/2! possible combinations for the singletons, 5c2 arrangements for the pair

  • Loser: The total permutations (65) minus all the preceding values; all the possible combinations of singletons (6!) minus the High Straight and Low Straight combinations

Related Content

By Vijay Patel on 4/17/2025 10:53 AM
Cellular Automata in SQL Server

Based on Stephen Wolfram’s elementary cellular automata we demonstrate.

Read more
Try for 15 Days!

Install XLeratorDB in minutes and instantly add advanced capability to your database analytics. Start your 15-day trial today and see the difference.