Compute Expectation of a Binomial Sum (Algebraic Evaluation)

The question presents a summation involving binomial coefficients and asks to evaluate it, recognizing it as the expectation or another moment of a binomial distribution.

grandes-ecoles 2018 QIII.2 View
We introduce a uniformly distributed random variable $Z : \Omega \rightarrow \{-1,1\}^{n}$. For $\omega \in \Omega$, we denote by $Z_{i}(\omega)$ the coordinates of $Z(\omega)$. Show that for all $A = (a_{i,j})_{1 \leqslant i,j \leqslant n} \in \mathcal{M}_{n}(\{-1,1\})$, we have $$\forall i \in \{1, \ldots, n\}, \quad \mathbb{E}\left[\left|\sum_{j=1}^{n} a_{i,j} Z_{j}\right|\right] = \frac{1}{2^{n}} \sum_{k=0}^{n} \binom{n}{k} |n - 2k|,$$ where $\binom{n}{k}$ denotes the binomial coefficient. Deduce $$\mathbb{E}\left[g_{A}(Z)\right] = \frac{n}{2^{n}} \sum_{k=0}^{n} \binom{n}{k} |n - 2k|.$$
isi-entrance 2020 Q29 View
Let $n$ be a positive integer and $t \in ( 0,1 )$. Then $\sum _ { r = 0 } ^ { n } r \binom { n } { r } t ^ { r } ( 1 - t ) ^ { n - r }$ equals
(A) $n t$
(B) $( n - 1 ) ( 1 - t )$
(C) $n t + ( n - 1 ) ( 1 - t )$
(D) $\left( n ^ { 2 } - 2 n + 2 \right) t$.