number of pairs of integers whose sum is even

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.

• The question in the post differs from what the title says ("pairs")!? – Hagen von Eitzen Oct 19 '14 at 19:53
• I think that every pair does sum to a positive number. – user2097 Oct 19 '14 at 19:54
• Wow, I've read through this question a couple of times, and some of the statements in it make very little sense whatsoever. For example, why can't you simply ask how many combinations are there? Given the set of integers from 1 to 9, every combination sums up to a positive number! Also, what does "non-null positive numbers" mean? And what on earth has that got to do with the set of integers from 1 to 9??? Finally, as already mentioned in the comments above, the title asks for pairs of integers, and the question asks for a combination of integers. The description here is severely flawed. – barak manos Oct 19 '14 at 20:03
• sorry for the confusion. i meant even numbers – animalcroc Oct 19 '14 at 21:36
• sorry for the confusion. i meant sums that are even. – animalcroc Oct 19 '14 at 21:39

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$.