Number Of Cards Dealt In Gin Rummy Rating: 9,8/10 8176 reviews

Recently I picked up the game of Gin Rummy, which is a card game for two players using a standard deck of 52 cards (Gin_Rummy). Players always have hands of 10 cards, and the strongest kind of hand in the game is called a Gin, where all cards can be used to create melds. I was curious, what is the probability of a player being dealt Gin right away?

  1. Number Of Cards Dealt In Gin Rummy Games
  2. How Many Cards Dealt In Gin Rummy
  3. Number Of Cards Dealt In Gin Rummy

A single deal of the cards. That is, from time the cards are dealt until they are dealt again. Also called a hand (in poker anyway). It also refers to a set of cards assembled for scoring in a round of a card game, as in 2 sets of 3 of a kind in trick 1.

Gin has two kinds of melds: Sets of 3 or 4 cards sharing the same rank, e.g.888; and runs of 3 or more cards in sequence, of the same suit. e.g. 345 or more. In order to make Gin (melds with all 10 cards), it’s clear that you either need two runs of 5 cards, or a combination of melds of sizes 4-3-3. Here are some examples:

HowNumber Of Cards Dealt In Gin Rummy
  1. In Progressive Rummy, each player is dealt six cards in deal #1, seven cards in deal #2, and so on - one more card per hand in each successive deal. In Progressive Rummy, the contracts must be met exactly: 3 cards for a set, and 4 cards for a sequence. There are no extra cards. To be perfectly clear, here are the number of cards dealt, and the.
  2. Number of Cards Gin rummy uses a standard deck of cards, which contains of 52 cards. The jokers are not used. The cards rank from king to ace, with the king being the highest and ace being the lowest.

(5-5 split)
A2345910JQK

(4-3-3 split)
4444678222

In order to find the probability we simply need to count the number of possible Gin hands, and divide by the number of hands of size 10, given mathematically by 52 Choose 10. While it’s probably possible to count the Gin hands “by hand” with combinatorics, that task was too annoying for me to do at the time, and so I chose to devise an algorithm to count them instead.

CardsNumber Of Cards Dealt In Gin Rummy

When I started thinking about this problem, I found a web forum where one user had devised a brute force algorithm, iterating over all possible hands, to count the number of Gin hands, which took several hours to compute. Rather than iterate through every possible hand of 10 cards, my approach was to first compute all the possible melds that can be made, and then combine those melds (in the combinations 5-5 and 4-3-3), to see if they were valid hands. A combination of melds could be invalid if the melds have the same cards, for example, the following three melds all contain a 4:

4444345456

In the case above, the hand is not a valid hand of 10 cards, so this combination of melds is not counted as a Gin hand.

Number Of Cards Dealt In Gin Rummy Games

The algorithm also had to be careful not to count hands twice. This is possible because some hands of 10 cards can actually make Gin in multiple ways. For example, the following meld combinations are actually made from the same hand:

A2345678910
A2345678910
A2345678910
A2345678910

For this reason, when building hands from melds, the algorithm needs to check if the resulting hand has been made before. I achieve this in my algorithm by inserting Gin hands into a hash table the first time they are made, and check this table for every meld combination, so that hands are not double counted.

How Many Cards Dealt In Gin Rummy

I wrote the algorithm in C++, and the resulting code runs in about 500 milliseconds on my machine. I have made the source code available.

Number Of Cards Dealt In Gin Rummy

The result is that there are 51200 possible hands that make Gin. This means the probability of being dealt Gin is 1 in 308,984