We introduce a uniformly distributed random variable $Z : \Omega \rightarrow \{-1,1\}^{n}$.
(a) Show that for $m \in \{0, \ldots, n-1\}$, we have
$$\sum_{k=0}^{m} (n - 2k) \binom{n}{k} = n \binom{n-1}{m}.$$
(b) Deduce that for all $A \in \mathcal{M}_{n}(\{-1,1\})$,
$$\mathbb{E}\left[g_{A}(Z)\right] = \frac{n^{2}}{2^{n-1}} \binom{n-1}{\left\lfloor \frac{n}{2} \right\rfloor}$$
where $\left\lfloor \frac{n}{2} \right\rfloor$ denotes the floor of $\frac{n}{2}$.