A subset sum of a finite set of numbers is the sum of the elements of a subset
of
. The set of
all attainable subset sums is
|
(1)
|
where the empty subset contributes 0.
For , the eight subsets
give the sums
|
(2)
| |||
|
(3)
| |||
|
(4)
| |||
|
(5)
| |||
|
(6)
| |||
|
(7)
| |||
|
(8)
| |||
|
(9)
|
so the sum appearing most often is 3, which occurs twice, and has seven elements. More generally,
for
, every integer from 0 through
is attainable, so
|
(10)
|
For , 2, ..., the numbers of distinct subset
sums are 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, ... (OEIS A000124).
When consists of nonnegative integers,
the coefficient of
in
counts the subsets with sum
. Thus,
is the set of exponents with
nonzero coefficients. The definition also applies
to subsets of finite abelian
groups, where bounds on
are studied in additive combinatorics (Griffiths 2009).
The term "subset sum" is also used as a short name for the subset sum problem, which asks questions about attainable sums.