I'm trying to list all of the unique combinations of five playing cards from a standard deck of cards, and it's taking up more space and computing power than I could ever imagine. But let's just start with a three card combination. There are not enough rows, so I'm getting a huge matrix. So I'm trying to find ways to eliminate the combinations I don't need.
The data for the first three cards looks something like this (somewhat simplified):
There are 52 unique cards in a deck, hence all data points are coded as integrals 1-52, but can obviously be transformed to something more intuitive later. I have removed all combinations including the same number more than once, such as 50,52,52 , because the same card can't be drawn twice. I basically just used IF functions for this.
But I still have many redundant combinations that are equal to some other equivalent combination. For example, the combination 5,2,1 is equivalent to the combination 1,2,5. After all, it doesn't matter in which order the cards are picked, so only one of the combinations need to stay. So my question is how to remove all the duplicate combinations in my data set?
I'm using Gnumeric or LibreOffice Calc on a Linux OS at home so I'd prefer if the task can be done without VBA coding and add-ins. I have access to the real deal (Excel) at my university, but then I'd have to wear pants and expose myself to dangerous daylight. Besides, the easily implemented formulas in an intuitive spreadsheet interface is what I love about Excel.
Any bright ideas?
The data for the first three cards looks something like this (somewhat simplified):
Code:
A B C
3 2 1
4 2 1
5 2 1
...
51 1 5
52 1 5
1 2 5
3 2 5
...
48 51 52
49 51 52
50 51 52
There are 52 unique cards in a deck, hence all data points are coded as integrals 1-52, but can obviously be transformed to something more intuitive later. I have removed all combinations including the same number more than once, such as 50,52,52 , because the same card can't be drawn twice. I basically just used IF functions for this.
But I still have many redundant combinations that are equal to some other equivalent combination. For example, the combination 5,2,1 is equivalent to the combination 1,2,5. After all, it doesn't matter in which order the cards are picked, so only one of the combinations need to stay. So my question is how to remove all the duplicate combinations in my data set?
I'm using Gnumeric or LibreOffice Calc on a Linux OS at home so I'd prefer if the task can be done without VBA coding and add-ins. I have access to the real deal (Excel) at my university, but then I'd have to wear pants and expose myself to dangerous daylight. Besides, the easily implemented formulas in an intuitive spreadsheet interface is what I love about Excel.
Any bright ideas?