Skip to Content

Set and Run Probability without Mathematics

4 replies [Last post]
MatthewF's picture
Joined: 07/22/2008

I'm working on a game that uses numbered cards that the players lay down as sets and runs. Though my best guess as to rough probabilities seems to work out in playtesting, I've decided to try to figure out more accurate probabilities since it would likely take thousands of playtests and lots of good observation to be as precise as I'd like.

I know that the part of math called combinatorics can accurately calculate what I need, but I'm not good with it and after a bunch of research, have concluded that it will take me way, way longer to figure out the odds that way than by simply writing a 20-minute computer program to simulate a few million hands and go with what it figures out for the odds.

However, I'm wanting to make sure I'm figuring out the right thing, so here's a simple example:

A Set is two or more cards of the same rank (number) of any suit. I'm creating a deck of cards and then drawing randomized sets of 7-card hands from them. Let's say that I draw the following (numbers are rank, letters are suits):

1c 3a 3b 3c 3d 5b 7d

Looking at it, I see a set of four (the 3s). What I'm trying to figure out is what else I have. I'm pretty sure that I have another set of three and two sets of two. That is, that I don't need to count every combination because I can't actually play all of those combinations.

By "combinations" I mean that I don't in fact have a whole bunch of sets of three like this:

3a 3b 3c
3a 3b 3d
3a 3c 3d
3b 3c 3d

There aren't actually four sets of three in my hand, just one, right?

Here's what I'm working towards, if it helps: what are the odds of a Set of 2, of 3, 4, 5, 6, and 7, and what are the odds of a Run (two or more cards with the same suit and ranks in numerical order, like 2a 3a 4a 5a) of 2, of 3, 4, 5, 6, and 7.

I'm almost positive I don't have to count all the possible combinations in a given hand since there really is only one play of a three-card set in the above example, but I want to make certain. Any help is appreciated.

seo's picture
Joined: 07/21/2008
Your deck?

I noticed you didn't mention how many cards there are in your deck, what are the values, how many suits, etc. Maybe if you do, some generous person, versed in probability, might give you the answer to your questions. Sadly, I am not the right person, but if there is one around, it would help to know your deck better.

Zzzzz's picture
Joined: 06/20/2008
What is the total number of

What is the total number of cards in the deck?

What is the breakdown of cards per suite?

Are there duplicate cards (same suite/value)?

fecundity's picture
Joined: 07/28/2008
The natural way to estimate

The natural way to estimate the probabilities with a computer program is to initialize an empty array with N elements, where N is the number of ranks. Then generate a random hand of cards. Go through the hand one card at a time, and increment the Jth element of the array when you reach a card of rank J. When you are done, look to see if any of the elements are greater than one. In your example, the 3rd element of the array will be 4 when you've gone through the hand. This avoids counting the four-of-a-kind as any smaller combo.

Record whatever sets were in the hand. Reinitialize the array and generate a new hand. Repeat for many, many hands.

If you want help with the mathematical, analytic solution, rather than the computational, brute force solution, you'll need to tell us more about the structure of the deck. But the computational approach should give you enough precision.

MatthewF's picture
Joined: 07/22/2008

Thanks for all comments.

I'll pass along the deck info, but I'm hoping mostly to understand what I should and should not count. Mind you, I do want to count the three-of-a-kind if there's a four-of-a-kind: some things in the game can be done with three and others with four, so a player may well want to only play the three. I just want to make sure that if I have one four-of-a-kind then I should count it as a four, a three, and 2 twos rather than as a four, 4 threes, and 6 twos.

The deck has five suits and seven ranks (1-7) twice. That's 70 cards. There are also five wild cards that can be anything, for a total of 75 of these types of cards. Sets are same-numbered cards, any suit, two or more. Runs are all the same suit in consecutive order, two or more, with wraparounds allowed (6, 7, 1, 2, 3, all of the same suit, is a valid 5-card run).

The wild cards, the duplication of cards (two of everything except wilds), and the wraparound of the runs makes the math pretty hard, but my computer program already takes all of that into account. I just don't know how to count the hand, though I'm now about 90% certain that a four of a kind is one 4, one 3, and two 2s.

Syndicate content

forum | by Dr. Radut