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

Question: In how many ways can you sort 8 of 12 flags (4 flags for each country) so there will be at least one flag from each country? Final answer: 4620

I'm not sure whether it's possible, but I'd like to solve this question by reducing the impossible ways from the total options. I think that there are ${3 \choose 1}\dfrac{8!}{4! 4! 0! }$ impossible ways of sorting. How can the total options be calculated? I assume that the flags of the same country are indistinguishable.


share|cite|improve this question
My bad, I'm in a bit of delay. Apologies and thanks for helping! – Shahar Aug 8 '12 at 7:53
up vote 1 down vote accepted

I don't see how to get the total options without adding up contributions from individual partitions of $8$. I'd do it like this:

$$ 3!\frac{8!}{4!3!1!}+3\frac{8!}{4!2!2!}+3\frac{8!}{3!3!2!}=4620\;. $$

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.