Let $p \in ]0,1[$. Let $X_1, \ldots, X_n$ be mutually independent random variables following the same Bernoulli distribution with parameter $p$. Let $U(\omega) = (X_1(\omega), \ldots, X_n(\omega))^T$ and $M(\omega) = U(\omega)\,{}^t(U(\omega))$.
Give the distribution, expectation and variance of the random variables $\operatorname{tr}(M)$ and $\operatorname{rg}(M)$.
Let $p \in ]0,1[$. Let $X_1, \ldots, X_n$ be mutually independent random variables following the same Bernoulli distribution with parameter $p$. Let $U(\omega) = (X_1(\omega), \ldots, X_n(\omega))^T$ and $M(\omega) = U(\omega)\,{}^t(U(\omega))$.

Give the distribution, expectation and variance of the random variables $\operatorname{tr}(M)$ and $\operatorname{rg}(M)$.