0
$\begingroup$

Can anyone give me an idea of how to be able to browse through a set of combinations?

Lets say that I have 3 objects that can hold 3 different values and I want to browse through these. How do I know which is the next combination? I will always know how many values every object can hold and they can always hold the same number of values and therefore I also know total number of combinations. So if I am on combination (3, 2, 1), how do I know that the next combination is (3, 2, 2)?

Object O1 O2 O3

Comb. 1. 1 1 1 Comb. 2. 2 1 1 Comb. 3. 2 2 1 . . . . Comb. 27. 3 3 3

  • 2
    Can you clarify your question a little bit? You seem to be asking how to browse through a set of combinations, the easiest of which (in my mind) would be to express the integers 0 to 26 in base 3. But then you give an example at the bottom which I can't quite follow. For example, what is Combination 5? And what combination numbers would "0 0 0" and "1 1 2" be?2012-01-31
  • 0
    This reference may help: Generating the mth Lexicographical Element of a Mathematical Combination:http://msdn.microsoft.com/en-us/library/aa289166(v=vs.71).aspx2012-01-31
  • 0
    crossposted to MO: http://mathoverflow.net/questions/87116/formula-to-browse-through-combinations2012-01-31
  • 0
    See whether what you want isn't already at http://math.stackexchange.com/questions/97813/a-positional-number-system-for-enumerating-fixed-size-subsets2012-01-31
  • 0
    What you _seem_ to be asking for is multi-combinations: choosing a fixed number of $k$ elements from a given set with $n$ elements, where an element can be chosen more than once but order of choice is not taken into account. There are $\tbinom{n+k-1}k$ of those and they are in bijection with the corresponding ordinary (non-repeating) combinations of the $n+k-1$-element set. In any case your examples involve repetitions of the same element. You need to formulate your question precisely if you want to get a useful answer.2012-01-31

1 Answers 1