The count of good "words"

37 Views Asked by At

How many good $words$ are there , which have length $n$ and consist of {0,1}

A $word$ is considered good if the number of occurrences of $0$ in the $word$ is $even$:

ex. $${ n = 3: [111],[100],[010],[001] }$$

I have no idea what to do. Any help would be appreciated

1

There are 1 best solutions below

0
On BEST ANSWER

You need all the possible combinations that have 0, 2, 4, ... up to n digits of zero. Number of possible numbers with 0 digits is $\binom{n}{0}$, number of possible numbers with 2 digits $\binom{n}{2}$, and so on. After you sum up all these numbers, you get all the possible numbers that have from 0 to n even digits of 0.

$$\sum_{i=0}^\frac{n}{2}\binom{n}{2i}$$