123xyz
123xyz
  • Threads: 4
  • Posts: 11
Joined: May 7, 2019
July 1st, 2019 at 11:57:22 PM permalink
Hello everyone,

I would like to generate all the possible combinations of 7 cards I can make within a deck of 52 cards. I made a function on python but after 10min it's still not finished, do you have any ideas ?

Thank you to always be so helpfull
DogHand
DogHand
  • Threads: 2
  • Posts: 1525
Joined: Sep 24, 2011
July 2nd, 2019 at 5:23:05 AM permalink
123xyz,

Well, the number of combinations of 7 cards selected from 52 is 133,784,560, so you have to be patient.

"52 choose 7" is equal to 52!/((52-7)!*7!), or (52*51*50*49*48*47*46)/(7*6*5*4*3*2*1).

Hope this helps!

Dog Hand
beachbumbabs
beachbumbabs
  • Threads: 100
  • Posts: 14265
Joined: May 21, 2013
Thanked by
MrCasinoGames
July 2nd, 2019 at 5:29:27 AM permalink
Quote: 123xyz

Hello everyone,

I would like to generate all the possible combinations of 7 cards I can make within a deck of 52 cards. I made a function on python but after 10min it's still not finished, do you have any ideas ?

Thank you to always be so helpfull



Do you want just the number of possibilities, or the number of 7 card hands that contain a particular poker hand or each type of hands?

I think the raw number is just COMBIN(52,7) in excel. which is 133,784,560 hands.

If you go to

this page,
and look at the two 7 card stud tables, the Wizard breaks the hands down into values that fit a poker hand of various strengths.

These tables show the BEST possible hand. For example, hands with a straight include those with a straight flush. But since a straight flush is a distinct, more valuable hand, they are listed separately, and subtracted from those that contain just a straight.

If neither of these address your question, please be more specific.
Last edited by: beachbumbabs on Jul 2, 2019
If the House lost every hand, they wouldn't deal the game.
7craps
7craps
  • Threads: 18
  • Posts: 1977
Joined: Jan 23, 2010
July 2nd, 2019 at 6:58:15 AM permalink
Quote: beachbumbabs

I think the raw number is just COMBIN(7,52) in excel. which is 133,784,560 hands.

my Excel returns for COMBIN(7,52)#NUM!
in pari/gp calculator: binomial (7,52) returns 0
133,784,560 is the number of combinations of 52 choose 7.

OP"I would like to generate all the possible combinations of 7 cards I can make within a deck of 52 cards."
52 choose 5 = 2,598,960

52C7 is about 51.5 times LARGER than 52C5
a program I have takes 7 minutes to create a delimited text file for 52C5 at 68 MB in size.

good luck on the 52C7 created file!
imo,such a waste of effort and time.

what IS the OP actually after?
Oh, I see, could be more specific
winsome johnny (not Win some johnny)
GBAM
GBAM
  • Threads: 10
  • Posts: 84
Joined: Feb 26, 2019
July 2nd, 2019 at 7:53:11 AM permalink
Quote: 7craps

my Excel returns for COMBIN(7,52)#NUM!



Swap the 7 and 52

Also a semi-related question. In Wizard of Odds pay out tables there is usually a “total combinations” that is not simply the total 5 card combos.

For example in crazy 4 poker, the payout tables use a total combination number of 3,986,646,103,440 but this is much larger than the total number of 5 card combos.

Is this larger number the total number of 2 hand faceoffs?
beachbumbabs
beachbumbabs
  • Threads: 100
  • Posts: 14265
Joined: May 21, 2013
July 2nd, 2019 at 6:43:30 PM permalink
Quote: GBAM

Swap the 7 and 52

Also a semi-related question. In Wizard of Odds pay out tables there is usually a “total combinations” that is not simply the total 5 card combos.

For example in crazy 4 poker, the payout tables use a total combination number of 3,986,646,103,440 but this is much larger than the total number of 5 card combos.

Is this larger number the total number of 2 hand faceoffs?



Yes. Every player hand has to be compared to every possible dealer hand in turn, to calculate results for the table.

Thanks for catching the transposition error, both you and 7craps.
If the House lost every hand, they wouldn't deal the game.
GBAM
GBAM
  • Threads: 10
  • Posts: 84
Joined: Feb 26, 2019
July 3rd, 2019 at 3:23:21 AM permalink
Quote: beachbumbabs

Yes. Every player hand has to be compared to every possible dealer hand in turn, to calculate results for the table.



Why/how is this number different than combin(52,10)?
CrystalMath
CrystalMath
  • Threads: 8
  • Posts: 1911
Joined: May 10, 2011
Thanked by
GBAM
July 3rd, 2019 at 4:54:27 AM permalink
Quote: GBAM

Why/how is this number different than combin(52,10)?



Combin(52,10) is the total number of 10 card hands, where the order dealt doesn’t matter. But, there are combin(10,5) ways to pick which of those 10 are the player’s cards.

I would calculate the total hands as combin(52,5)*combin(47,5), which is equivalent to combin(52,10)*combin(10,5).
I heart Crystal Math.
GBAM
GBAM
  • Threads: 10
  • Posts: 84
Joined: Feb 26, 2019
July 3rd, 2019 at 6:01:59 PM permalink
So to make those tables on WoO where the use simulations to learn the EV of each hand do those simulations just tally up the wins like:

Player: A2346 vs dealer: A2345, A2346...... etc and count the wins vs losses?
Last edited by: GBAM on Jul 3, 2019
CrystalMath
CrystalMath
  • Threads: 8
  • Posts: 1911
Joined: May 10, 2011
July 3rd, 2019 at 6:54:45 PM permalink
Quote: GBAM

So to make those tables on WoO where the use simulations to learn the EV of each hand do those simulations just tally up the wins like:

Player: A2346 vs dealer: A2345, A2346...... etc and count the wins vs losses?



Yes, although I wouldn't call it a simulation. If you cover every possibility, then it is a full combinatorial analysis, even if you don't use "math" to determine the results.
I heart Crystal Math.
GBAM
GBAM
  • Threads: 10
  • Posts: 84
Joined: Feb 26, 2019
July 3rd, 2019 at 7:17:03 PM permalink
In a simulation do they just run a loop comparing thousands and thousands of random pairings to estimate a house edge?
CrystalMath
CrystalMath
  • Threads: 8
  • Posts: 1911
Joined: May 10, 2011
Thanked by
GBAM
July 3rd, 2019 at 7:47:05 PM permalink
Quote: GBAM

In a simulation do they just run a loop comparing thousands and thousands of random pairings to estimate a house edge?



Yes, random selections is a simulation. In the Wizards analysis of Crazy4, it covers all combinations.
I heart Crystal Math.
GBAM
GBAM
  • Threads: 10
  • Posts: 84
Joined: Feb 26, 2019
July 4th, 2019 at 11:02:55 AM permalink
What sort of software or programming language is best for something like this? Python? Java? C++?
Last edited by: GBAM on Jul 4, 2019
  • Jump to: