Cardinal of a set of functions between two finite sets of integers 
Let $ A= \{a_1, a_2, a_3,\cdots, a_{10}\}$, $B=\{ 1,2 \}$. Find the number of functions $ f: A \to B $ such that $ f(a_1) +f(a_2)+\cdots+f(a_{10})$ is an even number.

I have tried to find the number of functions $ 2^{10} $ But not getting any clue to find the functions under such conditions.
 A: Hint
Intuitively, the number of such maps is $2^{10}/2$: there is the same number of maps such that the sum is even, vs. the maps for which the sum is odd.
To prove it, prove that there is a one to one correspondence between the maps such that $f(a_1)=1$, vs the ones for which $f(a_1)=2$.
A: To see it as an arrangement problem. Let our mapping be permutations of $\{1, 1, 1, 1, 1, 1, 1, 1, 1, 1\}, \{2, 1, 1, 1, 1, 1, 1, 1, 1, 1\}, \{2, 2, 1, 1, 1, 1, 1, 1, 1, 1\}$ and so on...  
To get an even number as the output you need to select permutations of sets that have even number of one's. Let $P_{10}$ be permutations of $\{1, 1, 1, 1, 1, 1, 1, 1, 1, 1\}$, $P_{9}$ be permutations of $\{2, 1, 1, 1, 1, 1, 1, 1, 1, 1\}$ and so on..
$$\
\text{Required Permutations}=P_0+P_2+P_4+P_6+P_8+P_{10}
$$
You can compute each term and find the answer or you can use symmetry and argue that this will be equal to $\frac{2^{10}}{2}$ as pointed out by mathcounterexamples.net
A: So you have to take even members from $A$ which are maped to $1$.
So you need to find out the number of subsets of $A$ with even cardinality, and that is: $${10\choose 0}+{10\choose 2}+...+{10\choose 10} = {2^{10}\over 2} $$

More interesting question would be if we take $B=\{1,2,3\}$
