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 want to count the number of permutations of $4$ numbers, each in $\{1, 2, \ldots, 10\}$, that sum up to $10$. Can someone please show how to approach this problem? I want to know what is the best way to think about problems like this. Thank you.

share|cite|improve this question
Do you mean four distinct numbers? Because in that case they have to be $1,2,3$, and $4$, and there are $4!=24$ permutations of that set of four. – Brian M. Scott Mar 13 '13 at 15:23
They dont need to be distinct, e.g. (1 1 1 7), as long as they sum up to 10. – cody Mar 13 '13 at 15:25
up vote 4 down vote accepted

This is a straightforward stars-and-bars problem: you want to count the solutions in positive integers to the equation $x_1+x_2+x_3+x_4=10$. There are


such solutions. The reasoning behind the formula is explained pretty clearly in the linked article.

share|cite|improve this answer

If you're looking to eliminate the number of sums that differ only in their order of summands (e.g. $1+2+3+4=10$ and $4+1+2+3=10$) then this question is one on partitions, specifically the partition of $10$ into $4$ (non-zero) parts.

This input into Wolfram Alpha gives a nice visualization of the solution via Ferrers diagrams.

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.