Number of ways to choose N integers that sum up to X

  • Thread starter Thread starter mnb96
  • Start date Start date
  • Tags Tags
    Integers Sum
mnb96
Messages
711
Reaction score
5
Hello,
is there a straightforward way, or some well-known expression to count how many ways there are of choosing N positive integers a_1,\ldots,a_N such that a_1+\ldots+a_N = X (where X is some fixed positive integer).

Note that if N=2, and X=10 (for example), I consider the pairs 1+9 and 9+1 (for instance), as being two different ways of obtaining X=10, as well as 2+8 and 8+2, or 3+7 and 7+3, and so on...

For N=1 there is obviously only 1 choice.
For N=2 the result should be: X-1 ways.
For N=3 it is (X-1)(X-2)/2

...For N>3 things get more complicated...
 
Physics news on Phys.org
You could use a "generating functions" to find the number of combinations of integers that sum to a given number. Then you might be able to infer the number of permutations from that answer. A search for "generating functions ways of making change" turns up many expositions, for example this PDF explains it: http://ocw.mit.edu/courses/mathematics/18-310c-principles-of-applied-mathematics-fall-2007/lecture-notes/22_2_ln.pdf

If anyone knows a way to use generating functions to get the answer for the number of permutations directly, I'd like to hear about it.
 
Last edited by a moderator:
The answer is: {X-1 \choose N-1}

This problem is related to the following:
The number of ways to place r indistinguishable balls into n distinguishable boxes such that no box is empty is given by

{r-1 \choose n-1}

See:
http://msor.victoria.ac.nz/twiki/pub/Courses/MATH261_2011T1/WebHome/notes_2.pdf"

To understand the formula we consider 10 balls:
o o o o o o o o o o

Suppose we are interested in how many ways we can represent 10 as a sum of 3 variables:
a1 + a2 + a3 = 10

We can model this by dividing the 10 balls into 3 blocks, for example:
o o o | o o | o o o o o

Obviously, we need 2 dividers to form 3 blocks. All we need to do is count the number of ways we can place
the dividers between the balls. For 10 balls there are 9 spaces between the balls. Thus, there are 9 positions for the 2 dividers yielding

{9 \choose 2} possibilities.


Summary:
r=10 balls, n=3 blocks
=> r-1 positions for n-1 dividers

possibilities: {r-1 \choose n-1} = {9 \choose 2}
 
Last edited by a moderator:
##\textbf{Exercise 10}:## I came across the following solution online: Questions: 1. When the author states in "that ring (not sure if he is referring to ##R## or ##R/\mathfrak{p}##, but I am guessing the later) ##x_n x_{n+1}=0## for all odd $n$ and ##x_{n+1}## is invertible, so that ##x_n=0##" 2. How does ##x_nx_{n+1}=0## implies that ##x_{n+1}## is invertible and ##x_n=0##. I mean if the quotient ring ##R/\mathfrak{p}## is an integral domain, and ##x_{n+1}## is invertible then...
The following are taken from the two sources, 1) from this online page and the book An Introduction to Module Theory by: Ibrahim Assem, Flavio U. Coelho. In the Abelian Categories chapter in the module theory text on page 157, right after presenting IV.2.21 Definition, the authors states "Image and coimage may or may not exist, but if they do, then they are unique up to isomorphism (because so are kernels and cokernels). Also in the reference url page above, the authors present two...
When decomposing a representation ##\rho## of a finite group ##G## into irreducible representations, we can find the number of times the representation contains a particular irrep ##\rho_0## through the character inner product $$ \langle \chi, \chi_0\rangle = \frac{1}{|G|} \sum_{g\in G} \chi(g) \chi_0(g)^*$$ where ##\chi## and ##\chi_0## are the characters of ##\rho## and ##\rho_0##, respectively. Since all group elements in the same conjugacy class have the same characters, this may be...
Back
Top