I want to find all the different combinations of dividing 17 into 2 groups; the order does not matter; each group has to contain at least one item.

I know the formula is C(17,r)=17!/(r!*(17-r)!) and my r is one to eight so there's a lot! I hoping there is an easy way to do this. I have been trying to assign items into the two groups by using 1 and 0 - i.e. 01111111111111111, 10111111111111111, 11011111111111111, ... 00111111111111111, 01011111111111111, etc ...

  • 2
    $\begingroup$ Actually, there are $2^{16}=65536$ ways of diving a group of $17$ objects in $2$ groups, assuming that one accepts empty groups (otherwise, the answer is 65535). Is it practical to generate such a large number of groups in Excel? Does it suit some practical purpose? $\endgroup$ – digital-Ink Sep 16 '12 at 9:48
  • $\begingroup$ Also, note that in MS Excel 2003 and earlier there are a maximum of 65,536 rows and 256 columns per worksheet, so you could arrive to some limitations when generating all the groups (assuming you put one group in the first column and the other group in another column + a header, you arrive to the maximum number of rows). $\endgroup$ – digital-Ink Sep 16 '12 at 9:54
  • $\begingroup$ The tag is wrong. This question has nothing to do with group theory! $\endgroup$ – Derek Holt Sep 16 '12 at 10:52
  • $\begingroup$ I don't know about Excel, but LibreOffice Calc has "=DECINBIN($x$,17)". Let $x$ run from 0 to 65535. $\endgroup$ – Hagen von Eitzen Sep 16 '12 at 11:03
  • $\begingroup$ Excel has no direct function to present each partition. You may want to do this using another program and import the large result into Excel. $\endgroup$ – NoChance Sep 16 '12 at 11:15

Well firstly there are 2^{17} subsets of the 17 objects (either an object is in or not in a subset). However 1 of these subsets contains no elements and another one contains all 17 of them (which would leave the other group having none). So these are discounted. So we are left with 2^{17}-2 ways of partitioning it. However we have double-counted as every subset we make has a complement that we count with this method but shouldn't count as the order of the 2 groups doesn't matter. therefore [2^{17}-2]/{2}=2^{16}-1 different combinations.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.