1. Sum of 10 numbers

I have 10 numbers (a to j), the sum of them will be equal to a fixed amount X and each number can be used once only. For example:

a+b = X
a+c+e+f = X
c+d+f = X
d+e+f = X
a+d+e+h+j = X
........

There are many combinations and is there a fast way to find all the combinations that is equal to X?

Thank you

2. Originally Posted by math_idiot
I have 10 numbers (a to j), the sum of them will be equal to a fixed amount X and each number can be used once only. For example:

a+b = X
a+c+e+f = X
c+d+f = X
d+e+f = X
a+d+e+h+j = X
........

There are many combinations and is there a fast way to find all the combinations that is equal to X?

Thank you
The is no fast way. The numbers are not defined in terms of each other. That means that there is no equation that can be used to express the relationships.

However, there are only 10 numbers, the solution can be calculated very quickly.

You need to make sure that all numbers are pair with all other sets of numbers. If the sum of a subset equals x, then it is kept. Otherwise the values less than x and greater than x are discarded.

Combinations/Permutatons:
A computer program could be used to take all of then numbers 1 at a time, 2 at at time, 3 at at time, etc. Summing the group to determine if it is equal to X.

Do you have specific values with which to work or is the question general purpose?

3. Thanks aidan.
It is a question asked by my little brother. I try to figure it out but cannot find a fast way to do so.

4. Originally Posted by math_idiot
I have 10 numbers (a to j), the sum of them will be equal to a fixed amount X and each number can be used once only. ...
There are many combinations and is there a fast way to find all the combinations that is equal to X?
Could not find any, but I found this:

Combination Generator

Zen Archery
In his book Wonders of Numbers (Oxford: Oxford University Press, 2001), pp. 275-276, Clifford Pickover posed a "Zen Archery" problem. In its simplest form, there is a target with 24 numbers on it. The archer must shoot 5 arrows at the target and hit numbers adding up to 200.
...
Pickover posed a similar problem at Archery by the Numbers. This is really a combinatorial problem -- given the 24 numbers taken 5 at a time, which unique combinations add up to 200?
Using 10 numbers:

$\displaystyle \sum_{n=1}^{10} \sum_{k=1}^{n} \, \binom{N}{K}$ = Total_Number_of_Combinations

$\displaystyle \binom{N}{K} = \frac{N!}{(K!)(N-K)!}$

There is a total of 1023 groups that need to be checked to see it that group of numbers sums to the value of X.

There is JAVA code at the URL given above, but it is not difficult to write your own to do the combinations and then sum the numbers in the combination.

Hope that helps.