\begin{gather*} B = \sum_{k=0}^{n} {\binom{n}{k} a^k b^{n-k}} \end{gather*}
in-context