# How to calculate all combinations of string without repeat the same value

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?

-
Possible duplicate: math.stackexchange.com/questions/141302/… –  Julian Kuelshammer Nov 7 '12 at 16:14

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$$

-