Dénombrement de matrices binaires

  \begin{flushright} \textit{Ces petits vers seront mon propos liminaire\\ avant que nous comptions des matrices binaires.} \end{flushright}  \textbf{Énoncé:}~~~~~~(temps conseillé : 10 min)\hfill\textit{D'après HEC 2017 ECE}\\  Pour tout $n \in \mathbb{N}^*$, on note $\mathcal{M}_n(\mathbb{R})$ l'ensemble des matrices carrées à $n$ lignes et $n$ colonnes à coefficients réels. On note $\mathcal{B}_n(\mathbb{R})$ l'ensemble des matrices de $\mathcal{M}_n(\mathbb{R})$ dont tous les coefficients sont égaux à $0$ ou $1$.  1) Combien existe-t-il de matrices appartenant à $\mathcal{B}_n(\mathbb{R})$ ?  2) Combien existe-t-il de matrices de $\mathcal{B}_n(\mathbb{R})$ dont chaque ligne et chaque colonne comporte exactement $n-1$ coefficients égaux à $1$ ?

Correction :