[Math] Number of strings of length 10 consisting of the digits 0,1,2,3 with even sum of digits

combinatorics

A weight for string is simply the sum of digits. Now if the digits are 0, 1, 2 and 3, how many possible strings are there of even weight if the string is 10 digits?

My reasoning: there must be an even number of odd digits, so select $2i$ positions out of ten and the remaining $10-2i$ digits are either zero or two. Summing over all possibilities we get

$$\sum_{i=1}^{5}2^{10-2i}\binom{10}{2i}$$

But the answer is:

$$2^{10}\sum_{i=1}^{5}\binom{10}{2i}$$

What do I do?

Best Answer

To count even weight strings, you can choose the first $9$ digits arbitrarily ($4^9$ ways to do this); and then you will have two choices for the last digit so as to make the sum even.

So half the strings have even weight.

Related Question