Calculate the combinations of 4 items in different number of sets

216 Views Asked by At

Let's say I have four colors. Red, Green, Blue, Black

I want to find all different combinations that those can be put to, being able to use sets of 4 colors, down to 1 color. Order will always be the same for the same colors. No duplicate sets are allowed.

So, I'm manually writing some of those combinations I can think of:

  • Red, Green, Blue, Black
  • Red, Green, Blue
  • Red, Green, Black
  • Red, Blue, Black
  • Red, Blue
  • Red, Black
  • Red
  • Green, Blue, Black
  • Green, Black
  • Green, Blue
  • Green
  • Red, Green
  • Blue
  • Black

I think I'm missing some. So, how is this called? Is it permutations? Combinations? What formula do all combinations come from? And finally, is there any online "calculator" to find all possible combinations of such a case?

1

There are 1 best solutions below

1
On BEST ANSWER

What you have is a set with four elements, which we can represent with numbers: $S=\{1,2,3,4\}$. You are looking for the set of all subsets of $S$, i.e. $$\{\{\},\{1\},\{2\},\{3\},\{4\},\{1,2\},...,\{1,2,3,4\}\}$$ called the "powerset of $S$" (note that the powerset includes the empty set!). One can prove that the number of elements in the powerset of $S$, where $S$ has $n$ elements, is simply $2^n$ (try proving this!). Excluding the empty set gives the number $2^n-1$.