[Math] number of pairs of integers whose sum is even

combinatorics

Given the set of integers from 1 to 9, how many combinations sum to an even number?

I got 511. Here's my approach:
I first consider 3 sets:

  • $X$: the non empty set of all even numbers: $2^{4}-1=31$
  • $Y$: combinations of two odd integers $ \binom 52 $.
  • $Z$: combinations of four odd integers $ \binom 54 $.

I got my answer (511) by the following expression: $X+Y+Z+ X(Y+Z)$.

Apparently the answer is 512, so I'm off by 1.

Best Answer

Your answer is correct (though I don't understand parts of your reasoning; for $X$ we have $2^4-1\ne 31$ and neither of the two numbers makes sense) as can be seen by a different reasoning: Each subset of the nine-element set of given numbers gives rise to a sum. Since all summnds are positive, the sum is positive as soon as the set is not empty. There are $2^9$ subsets, minus the empty set we obtain $2^9-1=511$.