How to find the possible combinations of 13 cards in poker?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












From a standard 52 cards deck, given 13 random cards, I'm trying to find the possible combinations to be put in 3 slots (the total number of combinations as well as the list of combinations itself)



First slot is 5 cards



Second slot is 5 cards



Third slot is 3 cards



No ordering in each slot. (A, B, C, D, E) is the same as (C, D, A, B, E)



How would I go about approaching this? Thank you







share|cite|improve this question





















  • Are the first and second slots distinguishable?
    – Tiwa Aina
    Jul 15 at 3:59










  • @TiwaAina yes they are.
    – Jack Smother
    Jul 15 at 4:10










  • In order to actually list the combinations, you need an algorithm to generate all the subsets of $13$ objects taken $3$ at a time. Computer scientists have developed several such algorithms. For example, see section 7.2.1.3 of "The Art of Computer Programming, Volume 4A, Combinatorial Algorithms, Part 1" by Donald Knuth. Alternatively, if you just want results and don't care where they come from, if you are a Python programmer you could use the itertools.combinations() function.
    – awkward
    Jul 15 at 12:16














up vote
0
down vote

favorite












From a standard 52 cards deck, given 13 random cards, I'm trying to find the possible combinations to be put in 3 slots (the total number of combinations as well as the list of combinations itself)



First slot is 5 cards



Second slot is 5 cards



Third slot is 3 cards



No ordering in each slot. (A, B, C, D, E) is the same as (C, D, A, B, E)



How would I go about approaching this? Thank you







share|cite|improve this question





















  • Are the first and second slots distinguishable?
    – Tiwa Aina
    Jul 15 at 3:59










  • @TiwaAina yes they are.
    – Jack Smother
    Jul 15 at 4:10










  • In order to actually list the combinations, you need an algorithm to generate all the subsets of $13$ objects taken $3$ at a time. Computer scientists have developed several such algorithms. For example, see section 7.2.1.3 of "The Art of Computer Programming, Volume 4A, Combinatorial Algorithms, Part 1" by Donald Knuth. Alternatively, if you just want results and don't care where they come from, if you are a Python programmer you could use the itertools.combinations() function.
    – awkward
    Jul 15 at 12:16












up vote
0
down vote

favorite









up vote
0
down vote

favorite











From a standard 52 cards deck, given 13 random cards, I'm trying to find the possible combinations to be put in 3 slots (the total number of combinations as well as the list of combinations itself)



First slot is 5 cards



Second slot is 5 cards



Third slot is 3 cards



No ordering in each slot. (A, B, C, D, E) is the same as (C, D, A, B, E)



How would I go about approaching this? Thank you







share|cite|improve this question













From a standard 52 cards deck, given 13 random cards, I'm trying to find the possible combinations to be put in 3 slots (the total number of combinations as well as the list of combinations itself)



First slot is 5 cards



Second slot is 5 cards



Third slot is 3 cards



No ordering in each slot. (A, B, C, D, E) is the same as (C, D, A, B, E)



How would I go about approaching this? Thank you









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 15 at 3:53
























asked Jul 15 at 3:46









Jack Smother

1033




1033











  • Are the first and second slots distinguishable?
    – Tiwa Aina
    Jul 15 at 3:59










  • @TiwaAina yes they are.
    – Jack Smother
    Jul 15 at 4:10










  • In order to actually list the combinations, you need an algorithm to generate all the subsets of $13$ objects taken $3$ at a time. Computer scientists have developed several such algorithms. For example, see section 7.2.1.3 of "The Art of Computer Programming, Volume 4A, Combinatorial Algorithms, Part 1" by Donald Knuth. Alternatively, if you just want results and don't care where they come from, if you are a Python programmer you could use the itertools.combinations() function.
    – awkward
    Jul 15 at 12:16
















  • Are the first and second slots distinguishable?
    – Tiwa Aina
    Jul 15 at 3:59










  • @TiwaAina yes they are.
    – Jack Smother
    Jul 15 at 4:10










  • In order to actually list the combinations, you need an algorithm to generate all the subsets of $13$ objects taken $3$ at a time. Computer scientists have developed several such algorithms. For example, see section 7.2.1.3 of "The Art of Computer Programming, Volume 4A, Combinatorial Algorithms, Part 1" by Donald Knuth. Alternatively, if you just want results and don't care where they come from, if you are a Python programmer you could use the itertools.combinations() function.
    – awkward
    Jul 15 at 12:16















Are the first and second slots distinguishable?
– Tiwa Aina
Jul 15 at 3:59




Are the first and second slots distinguishable?
– Tiwa Aina
Jul 15 at 3:59












@TiwaAina yes they are.
– Jack Smother
Jul 15 at 4:10




@TiwaAina yes they are.
– Jack Smother
Jul 15 at 4:10












In order to actually list the combinations, you need an algorithm to generate all the subsets of $13$ objects taken $3$ at a time. Computer scientists have developed several such algorithms. For example, see section 7.2.1.3 of "The Art of Computer Programming, Volume 4A, Combinatorial Algorithms, Part 1" by Donald Knuth. Alternatively, if you just want results and don't care where they come from, if you are a Python programmer you could use the itertools.combinations() function.
– awkward
Jul 15 at 12:16




In order to actually list the combinations, you need an algorithm to generate all the subsets of $13$ objects taken $3$ at a time. Computer scientists have developed several such algorithms. For example, see section 7.2.1.3 of "The Art of Computer Programming, Volume 4A, Combinatorial Algorithms, Part 1" by Donald Knuth. Alternatively, if you just want results and don't care where they come from, if you are a Python programmer you could use the itertools.combinations() function.
– awkward
Jul 15 at 12:16










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Since you say "first," "second," and "third," it seems to me that the slots are distinguishable.



We can put $5$ cards (out of the $13$ we start with) in the first slot in $binom135$ ways.



We can put $5$ cards (out of the $13-5=8$ we now have) in the second slot in $binom85$ ways.



We can put the remaining $3$ cards in the third slot in $binom33=1$ way.



Put this together for a total of $binom135binom85binom33=72072$ possible combinations.



This is given the fact that the 13 cards have already been chosen. If we have to choose the 13 from a deck and then distribute among the slots, we would multiply our result by $binom5213$ (and end up with $45,766,697,267,491,200$), since there are $binom5213$ ways to choose $13$ cards out of a set of $52$.



Addendum: Here's some context for that last number. If you wanted a file with every combination of cards in slots (using Ks to denote King of Spades, for instance), you would need over one exabyte of storage for that one file!






share|cite|improve this answer























  • lol 1 exabyte. Thank you for the information. :D
    – Jack Smother
    Jul 15 at 4:30










  • any idea how to print out the results for the 72072? i see there would be three for loops and a lot of lists
    – Jack Smother
    Jul 15 at 4:31










  • @JackSmother I'm not a very good programmer (I only know basic Python and Java). Using Python, I would make a set of lists containing every size-5 subset of your deck-of-thirteen (e.g. deck13 = ["Ah", "2h",...,"Ks"]). Then, for each of these lists, I would make a set of every possible slot2 based on the cards in the lists I'm iterating over. Then, I would make Cartesian product of the set of slot1 lists and their corresponding set of slot2 lists. Finally, in each of the lists, I would append a list of the 3 cards left over. I recommend going on StackOverflow for a better implementation.
    – Tiwa Aina
    Jul 15 at 4:55










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2852167%2fhow-to-find-the-possible-combinations-of-13-cards-in-poker%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Since you say "first," "second," and "third," it seems to me that the slots are distinguishable.



We can put $5$ cards (out of the $13$ we start with) in the first slot in $binom135$ ways.



We can put $5$ cards (out of the $13-5=8$ we now have) in the second slot in $binom85$ ways.



We can put the remaining $3$ cards in the third slot in $binom33=1$ way.



Put this together for a total of $binom135binom85binom33=72072$ possible combinations.



This is given the fact that the 13 cards have already been chosen. If we have to choose the 13 from a deck and then distribute among the slots, we would multiply our result by $binom5213$ (and end up with $45,766,697,267,491,200$), since there are $binom5213$ ways to choose $13$ cards out of a set of $52$.



Addendum: Here's some context for that last number. If you wanted a file with every combination of cards in slots (using Ks to denote King of Spades, for instance), you would need over one exabyte of storage for that one file!






share|cite|improve this answer























  • lol 1 exabyte. Thank you for the information. :D
    – Jack Smother
    Jul 15 at 4:30










  • any idea how to print out the results for the 72072? i see there would be three for loops and a lot of lists
    – Jack Smother
    Jul 15 at 4:31










  • @JackSmother I'm not a very good programmer (I only know basic Python and Java). Using Python, I would make a set of lists containing every size-5 subset of your deck-of-thirteen (e.g. deck13 = ["Ah", "2h",...,"Ks"]). Then, for each of these lists, I would make a set of every possible slot2 based on the cards in the lists I'm iterating over. Then, I would make Cartesian product of the set of slot1 lists and their corresponding set of slot2 lists. Finally, in each of the lists, I would append a list of the 3 cards left over. I recommend going on StackOverflow for a better implementation.
    – Tiwa Aina
    Jul 15 at 4:55














up vote
1
down vote



accepted










Since you say "first," "second," and "third," it seems to me that the slots are distinguishable.



We can put $5$ cards (out of the $13$ we start with) in the first slot in $binom135$ ways.



We can put $5$ cards (out of the $13-5=8$ we now have) in the second slot in $binom85$ ways.



We can put the remaining $3$ cards in the third slot in $binom33=1$ way.



Put this together for a total of $binom135binom85binom33=72072$ possible combinations.



This is given the fact that the 13 cards have already been chosen. If we have to choose the 13 from a deck and then distribute among the slots, we would multiply our result by $binom5213$ (and end up with $45,766,697,267,491,200$), since there are $binom5213$ ways to choose $13$ cards out of a set of $52$.



Addendum: Here's some context for that last number. If you wanted a file with every combination of cards in slots (using Ks to denote King of Spades, for instance), you would need over one exabyte of storage for that one file!






share|cite|improve this answer























  • lol 1 exabyte. Thank you for the information. :D
    – Jack Smother
    Jul 15 at 4:30










  • any idea how to print out the results for the 72072? i see there would be three for loops and a lot of lists
    – Jack Smother
    Jul 15 at 4:31










  • @JackSmother I'm not a very good programmer (I only know basic Python and Java). Using Python, I would make a set of lists containing every size-5 subset of your deck-of-thirteen (e.g. deck13 = ["Ah", "2h",...,"Ks"]). Then, for each of these lists, I would make a set of every possible slot2 based on the cards in the lists I'm iterating over. Then, I would make Cartesian product of the set of slot1 lists and their corresponding set of slot2 lists. Finally, in each of the lists, I would append a list of the 3 cards left over. I recommend going on StackOverflow for a better implementation.
    – Tiwa Aina
    Jul 15 at 4:55












up vote
1
down vote



accepted







up vote
1
down vote



accepted






Since you say "first," "second," and "third," it seems to me that the slots are distinguishable.



We can put $5$ cards (out of the $13$ we start with) in the first slot in $binom135$ ways.



We can put $5$ cards (out of the $13-5=8$ we now have) in the second slot in $binom85$ ways.



We can put the remaining $3$ cards in the third slot in $binom33=1$ way.



Put this together for a total of $binom135binom85binom33=72072$ possible combinations.



This is given the fact that the 13 cards have already been chosen. If we have to choose the 13 from a deck and then distribute among the slots, we would multiply our result by $binom5213$ (and end up with $45,766,697,267,491,200$), since there are $binom5213$ ways to choose $13$ cards out of a set of $52$.



Addendum: Here's some context for that last number. If you wanted a file with every combination of cards in slots (using Ks to denote King of Spades, for instance), you would need over one exabyte of storage for that one file!






share|cite|improve this answer















Since you say "first," "second," and "third," it seems to me that the slots are distinguishable.



We can put $5$ cards (out of the $13$ we start with) in the first slot in $binom135$ ways.



We can put $5$ cards (out of the $13-5=8$ we now have) in the second slot in $binom85$ ways.



We can put the remaining $3$ cards in the third slot in $binom33=1$ way.



Put this together for a total of $binom135binom85binom33=72072$ possible combinations.



This is given the fact that the 13 cards have already been chosen. If we have to choose the 13 from a deck and then distribute among the slots, we would multiply our result by $binom5213$ (and end up with $45,766,697,267,491,200$), since there are $binom5213$ ways to choose $13$ cards out of a set of $52$.



Addendum: Here's some context for that last number. If you wanted a file with every combination of cards in slots (using Ks to denote King of Spades, for instance), you would need over one exabyte of storage for that one file!







share|cite|improve this answer















share|cite|improve this answer



share|cite|improve this answer








edited Jul 15 at 4:28


























answered Jul 15 at 4:16









Tiwa Aina

2,576319




2,576319











  • lol 1 exabyte. Thank you for the information. :D
    – Jack Smother
    Jul 15 at 4:30










  • any idea how to print out the results for the 72072? i see there would be three for loops and a lot of lists
    – Jack Smother
    Jul 15 at 4:31










  • @JackSmother I'm not a very good programmer (I only know basic Python and Java). Using Python, I would make a set of lists containing every size-5 subset of your deck-of-thirteen (e.g. deck13 = ["Ah", "2h",...,"Ks"]). Then, for each of these lists, I would make a set of every possible slot2 based on the cards in the lists I'm iterating over. Then, I would make Cartesian product of the set of slot1 lists and their corresponding set of slot2 lists. Finally, in each of the lists, I would append a list of the 3 cards left over. I recommend going on StackOverflow for a better implementation.
    – Tiwa Aina
    Jul 15 at 4:55
















  • lol 1 exabyte. Thank you for the information. :D
    – Jack Smother
    Jul 15 at 4:30










  • any idea how to print out the results for the 72072? i see there would be three for loops and a lot of lists
    – Jack Smother
    Jul 15 at 4:31










  • @JackSmother I'm not a very good programmer (I only know basic Python and Java). Using Python, I would make a set of lists containing every size-5 subset of your deck-of-thirteen (e.g. deck13 = ["Ah", "2h",...,"Ks"]). Then, for each of these lists, I would make a set of every possible slot2 based on the cards in the lists I'm iterating over. Then, I would make Cartesian product of the set of slot1 lists and their corresponding set of slot2 lists. Finally, in each of the lists, I would append a list of the 3 cards left over. I recommend going on StackOverflow for a better implementation.
    – Tiwa Aina
    Jul 15 at 4:55















lol 1 exabyte. Thank you for the information. :D
– Jack Smother
Jul 15 at 4:30




lol 1 exabyte. Thank you for the information. :D
– Jack Smother
Jul 15 at 4:30












any idea how to print out the results for the 72072? i see there would be three for loops and a lot of lists
– Jack Smother
Jul 15 at 4:31




any idea how to print out the results for the 72072? i see there would be three for loops and a lot of lists
– Jack Smother
Jul 15 at 4:31












@JackSmother I'm not a very good programmer (I only know basic Python and Java). Using Python, I would make a set of lists containing every size-5 subset of your deck-of-thirteen (e.g. deck13 = ["Ah", "2h",...,"Ks"]). Then, for each of these lists, I would make a set of every possible slot2 based on the cards in the lists I'm iterating over. Then, I would make Cartesian product of the set of slot1 lists and their corresponding set of slot2 lists. Finally, in each of the lists, I would append a list of the 3 cards left over. I recommend going on StackOverflow for a better implementation.
– Tiwa Aina
Jul 15 at 4:55




@JackSmother I'm not a very good programmer (I only know basic Python and Java). Using Python, I would make a set of lists containing every size-5 subset of your deck-of-thirteen (e.g. deck13 = ["Ah", "2h",...,"Ks"]). Then, for each of these lists, I would make a set of every possible slot2 based on the cards in the lists I'm iterating over. Then, I would make Cartesian product of the set of slot1 lists and their corresponding set of slot2 lists. Finally, in each of the lists, I would append a list of the 3 cards left over. I recommend going on StackOverflow for a better implementation.
– Tiwa Aina
Jul 15 at 4:55












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2852167%2fhow-to-find-the-possible-combinations-of-13-cards-in-poker%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

Color the edges and diagonals of a regular polygon

Relationship between determinant of matrix and determinant of adjoint?

What is the equation of a 3D cone with generalised tilt?