koooee
koooee
  • Threads: 3
  • Posts: 5
Joined: Apr 14, 2010
December 4th, 2011 at 9:26:04 PM permalink
So I made up the words in that title...but, I am unsure if such a function exists. Let me formulate the question (I also have this on Quora):

Is there such a function in combinatorics that given a single value 0 to totalCombinations-1 it can return a unique set of subsets in the total combinatoric space. For Example: say we have a set S=A,B,C,D and we want to choose 2, thus total combinations = 6 (nCr(4,2))
I would like a function something like f(0) = A,B; f(1) = A,C; f(2) = A,D....f(6) = C,D


Does this function exist and at scale for magnitudes of combinations? So for any n f(n) = Item1, Item2...ItemN
Forgive my ignorance.
JB
Administrator
JB
  • Threads: 334
  • Posts: 2089
Joined: Oct 14, 2009
December 4th, 2011 at 10:27:06 PM permalink
What you are referring to is called a combinadic. See my post here for how to apply it to a 7-card poker hand (52 choose 7). You can adjust the code to fit your needs.

Also, the original source where I found this information can be found here.
koooee
koooee
  • Threads: 3
  • Posts: 5
Joined: Apr 14, 2010
December 5th, 2011 at 1:14:43 AM permalink
You have made my month. 1000 Thanks.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 5th, 2011 at 2:13:06 PM permalink
For additional information:

http://en.wikipedia.org/wiki/Combinatorial_number_system
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
  • Jump to: