Hello All,

I'm organizing a large charity "poker run" where I'll have hundreds of mountain bikers turning in 5 card hands to be ranked for handing out prizes. Instead of sorting them by hand, I need to punch in, for example, "participant 129" and their hand of, say, "KH, 5D, 5D, KH, KS" for a couple of kings of hearts, a couple of fives of diamonds and a king of spades. The trick, as you see, is that I have to rank hands considering the multiple decks. A five of a kind with all kings of hearts ought to be better than a five of a kind with various suits for the kings.

I know this is a long shot, especially since I'm no programmer/code writer myself. I'm hoping to find someone looking for a challenge and/or wanting to do something for the greater good of man (i.e. me and my charity).

Todd

Recommended Answers

All 10 Replies

You have to find out the exact probability of each possible hand, given the actual number of decks you used. There is no "blanket rule" for a hand.

The probability of a hand is the total number of different ways to make that hand (counting substituting an identical card as a different way), divided by the total number of possible hands.

In standard poker, the probability is figured using the combination formula, where the number of ways to draw something is:

C(n,r) = n! / r! / (n-r)!

Where n is the number of objects drawn from, and r is the number of objects drawn.

The probability of drawing 4 of a kind in a standard 5-card poker hand is:

C(4,4) * C(48,1) / C(52,5)

CAUTION:

If you take those cards out of the deck and give them to the player, then the next player does not have the same probability of winning. You have to do the calculations all over again with those cards removed.

The probabilities normally given for poker hands are calculated by assuming that that hand is the only one drawn from the deck.

The cards dealt to other players actually change the probabilities in the middle of the game. In stud poker, the cards you see facing up actually change the probabilities of you completing a certain hand (so do the down cards, but you can't see them).

A way you can do it so that you can know the probabilities is to have each player draw from a full standard deck. Then record what he drew on an entry slip, and replace those cards back into the deck before the next guy plays. Then the standard poker tables apply.

I have seen a website with altered hand values for poker played with a pinochle deck.

Thanks - that all makes sense. From the numbers likely at the event, we'll likely have 20 decks. The good thing is that with the five card hands, we somewhat limit the possibilities. Thanks for your input here. I'm going to take all the information I gather and bug a buddy to start writing something for me.

As long as your participants aren't allowed to see each others' cards, you can deal all the cards out to everyone and not skew the probabilities. Calculating the probability of a poker hand only changes when you know additional information, like which cards are unavailable to draw. The chances of drawing the ace of spades from a normal deck are 1 in 52, even if someone else has already drawn 3 cards, because you don't know what those cards are. If you *did* know, the chances wouldn't be 1 in 52 (they'd either be 0 or 1 in 49). From a poker standpoint, you're just as likely to draw a royal flush on the first 5 cards of the deck as on the last, so you don't need to deal, shuffle, and redeal to every participant. You can save the time and hand out the cards if you want.

This site lists poker hand probabilities for multiple decks, and includes perl source for generating the same. For 20 decks, here's what you're looking at:

** 20 decks

      0.000008%  5 of a kind flush     Traditional hands
      0.000602%  4 of a kind flush 
      0.001275%  straight flush          0.001275%  straight flush
      0.001346%  full house flush        0.003112%  5 of a kind
      0.003104%  5 of a kind plain       0.196563%  4 of a kind
      0.015585%  3 of a kind flush       0.325047%  straight
      0.024676%  2 pairs flush           0.376207%  flush
      0.162779%  nothing flush           0.403338%  full house
      0.173167%  pair flush              4.477288%  3 of a kind
      0.195961%  4 of a kind plain       6.801035%  2 pairs
      0.325047%  straight plain         41.508548%  nothing
      0.401992%  full house plain       45.907586%  pair
      4.477288%  3 of a kind plain
      6.801035%  2 pairs plain
     41.508548%  nothing plain
     45.907586%  pair plain

The alternative, of course, is to simply use one shuffled deck at a time, deal out 10 hands, and then move on to the next deck. You won't have to worry about any multiple deck probabilities or funky hands, and those get weird -- look how a straight is less likely than a full house with 20 decks, or how a three-of-a-kind flush is ranked higher than a four-of-a-kind. Even dealing out of multiple separated decks, it's unlikely that any two hands will be the same so you can just use standard poker ranking rules to rank them. And then everyone will already know the rules.

Good luck,

Stacy

As long as your participants aren't allowed to see each others' cards, you can deal all the cards out to everyone and not skew the probabilities. Calculating the probability of a poker hand only changes when you know additional information, like which cards are unavailable to draw. The chances of drawing the ace of spades from a normal deck are 1 in 52, even if someone else has already drawn 3 cards, because you don't know what those cards are. If you *did* know, the chances wouldn't be 1 in 52 (they'd either be 0 or 1 in 49). From a poker standpoint, you're just as likely to draw a royal flush on the first 5 cards of the deck as on the last, so you don't need to deal, shuffle, and redeal to every participant. You can save the time and hand out the cards if you want.

This site lists poker hand probabilities for multiple decks, and includes perl source for generating the same. For 20 decks, here's what you're looking at:

** 20 decks

      0.000008%  5 of a kind flush     Traditional hands
      0.000602%  4 of a kind flush 
      0.001275%  straight flush          0.001275%  straight flush
      0.001346%  full house flush        0.003112%  5 of a kind
      0.003104%  5 of a kind plain       0.196563%  4 of a kind
      0.015585%  3 of a kind flush       0.325047%  straight
      0.024676%  2 pairs flush           0.376207%  flush
      0.162779%  nothing flush           0.403338%  full house
      0.173167%  pair flush              4.477288%  3 of a kind
      0.195961%  4 of a kind plain       6.801035%  2 pairs
      0.325047%  straight plain         41.508548%  nothing
      0.401992%  full house plain       45.907586%  pair
      4.477288%  3 of a kind plain
      6.801035%  2 pairs plain
     41.508548%  nothing plain
     45.907586%  pair plain

The alternative, of course, is to simply use one shuffled deck at a time, deal out 10 hands, and then move on to the next deck. You won't have to worry about any multiple deck probabilities or funky hands, and those get weird -- look how a straight is less likely than a full house with 20 decks, or how a three-of-a-kind flush is ranked higher than a four-of-a-kind. Even dealing out of multiple separated decks, it's unlikely that any two hands will be the same so you can just use standard poker ranking rules to rank them. And then everyone will already know the rules.

Good luck,

Stacy

Thanks Stacy - much appreciated. Even if I don't get my program done to the level I'd like it, I can group things in Excel and do the results semi-manually at my event.

Quick question (I've finally got around to doing my program):

I'm mixed up with what "nothing flush" is at .162779% and a "flush" at .376207%. Aren't those the same - just all one suit, but nothing in a row and no pairs or the like?

Thanks,

Todd

The column on the right is what happens if you restrict it to traditional poker hands. In a standard deck, there is only the nothing flush and the straight flush.

In the column on the left, the "nothing flush" has the pair, three, four, and five of a kind and full house flushes removed. Those hands are impossible with a standard deck.

The best way to do this is to deal each person a hand from a standard deck, record it, and then put the cards back in the deck before dealing to the next person. Then there are no biases.

The following scenario introduces a bias:

Seating 6 people at each table, and dealing 6 hands from a standard deck at each table.

This biases the result, because it is unlikely that two top prize winners will be at the same table.

Seating more people at some tables and less people at other tables favors people sitting at the less crowded tables.

This scenario has no bias:

Having one deck at each table, dealing only one hand at a time, and returning the cards and shuffling before dealing another player a hand.

Cool - and thanks again. I appreciate it. There's probably no getting around the pile of decks for my needs here. We're sending a bunch of mountain bikers around a course and stocking 5 stations with cards. The hundreds of bikers will each pick up a card at a station, then show off their hands at the end.

Thanks again!

Todd

As far as ranking 5 aces of hearts against 5 aces of spades - announce at the beginning that you will be using bridge rankings for suits:
the hierarchy of suits: clubs, diamonds, hearts, spades. If I remember my wildcard poker, 5 of a kind beats a royal flush. Just start with the highest poker hands that come in just like regular poker and use the hierarchy of suits (5 aces with 3 spades and 2 hearts beats 5 aces with 3 spades and 2 clubs) to judge the best of similar hands; you could do this by eye long before a team of programmers could write, test, debug such a program. Post the poker hand rankings http://www.poker.com/poker-hands/. As soon as a really good hand comes in, you don't even have to look at the lessor hands. You do not have to compare every hand to every other hand, you only have to compare each hand to the best so far - replacing the best so far with the better hand (this is sort of a modified bubble sort so it could be programmed but why bother - your eyes and brain are the match for any computer program.) don't be intimidate by the number of poker hands that are possible, 5 aces of spades is the best possible hand and you are almost guaranteed that someone will have have that.

Have you decided how each person will get his hand? Will you have all the decks in one huge pile or each deck shuffled individually? Rent or borrow a card shuffler; make a show of the actual shuffling. I know this is a charity but think it through. Will someone deal the cards to people or will they choose their own cards? Will everyone be seated and servers come by and deal cards? will they get their cards as they arrive? If you live near a casino, see if you can get some of the 'used' decks (after a certain number of uses a deck is usally retired and a hole is punched through it to prevent someone from, er, using it again in the club) - the decks usually have the casino logo on them so they might even give them to a charity for free if not really cheap.

Here is a kool idea! get a huge cork board (or its equivalent) and when a hand comes in, fan it out such that a staple will hold all the cards in place (and the person's name) so it looks like a 'hand' then pin them to the board and adjust so that the best hands are on top and you will end up with a fantastic collage at the end of the evening. take into account that it is possible with 20 decks that more than one person could have 5 aces of clubs so you will have to work out a tie-breaker.

I once won a game of 'doctor pepper' (deuces, tens, jokers, one-eyed jacks, and the king with an axe are wild - that is 13 wild cards in one game) with 1 ace and 6 wild cards but that is another story (gawd, we played some awful poker games when we were stoned).

Will you be allowing people to trade cards? Will they trade anyway?

Er, does this help?

The collecting of cards from different decks in different places is going to make an even larger statistical mess.

It would be better for each rider to carry a deck. Then, each checkpoint shuffles the deck, and removes a card from the deck, puts it in an envelope with the rider's number on it, and gives the remainder of the deck back to the rider.

The envelopes are then collected and the poker hands are evaluated using standard poker rules.

I am doing something similar to what Todd Cowles did about 9 years ago (see above) . I would like to have a program that will help me determine the best 5 hands at the end of our event. We would probably enter the data similar to what Todd suggested. Has anyone created something like this in the past that may still be available now?

Thanks,

Larry
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.