Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!


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?

share|cite|improve this question
Possible duplicate:… – 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 $$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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