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

$n$ choose $k$, $n!$, bars and stars method are all different methods you use to get the result your looking for when it comes to counting problems, my question is when do you know when to use what.

i.e. $n!$ is used when there are no replacements allowed $n(n-1)(n-2)\dots$

$n$ choose $k$ is used when you need to choose $k$ subsets out of set $n$

but when do you use the bars and stars method?


are there any context clues or something i need to look out for when reading a problem, that can help me determine when i need to use the bars and stars method or the other methods

share|cite|improve this question
Stars and Bars is used when your problem comes down to finding the number of solutions of $x_1+x_2+\cdots+x_k=n$ in non-negative (or positive) integers. Here $k$ is fixed. Unfortunately, this is not helpful enough, since it takes experience to recognize when a problem comes down to that. – André Nicolas Jan 31 '13 at 6:29
To extend André’s comment, this answer gives six different kinds of questions that turn out to have stars-and-bars solutions; the first two are straightforward, the last four rather less so. – Brian M. Scott Jan 31 '13 at 6:49
This might help distinguis the "ball in boxes" scenario… – Jean-Sébastien Jan 31 '13 at 6:54

Your Answer


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

Browse other questions tagged or ask your own question.