1
$\begingroup$

I have small problem that could be solved with a mathematical calc, but I don't know how.

I have six variables String , and I must find all the combination between them.

Obvisually , in every combination, the same string can't appear!

Example:

In these example, I tried to find the combinations for the first column. i don't know if it's right.

white, yellow , red, black, blue

 white, yellow  white, yellow , red  white, yellow , red,black,  white, yellow , red,black, blue,   white, red, black, blue  white, black , blue  white, blue   white black,  

... and so on...

How can i have a algorithm to calc this stuff?

  • 0
    Possible duplicate: http://math.stackexchange.com/questions/141302/how-to-find-all-possible-combinations-of-a-set-of-options2012-11-07

1 Answers 1

1

If you don't care in which order the colors appear, then each color can either be part of a subset, or not.

This gives $2^6$ subsets, but it includes the empty set, which may not be interesting for you.

Take it out to get

$ 2^6-1=63 $