[step:Compute the point Gram matrix from incidence counts]Let $\mathcal P=\{p_1,\dots,p_v\}$ denote the point set of $\mathcal D$, and let $\mathcal B=\{B_1,\dots,B_b\}$ denote the block set of $\mathcal D$, where $b=|\mathcal B|$. With respect to these enumerations, the [incidence matrix](/page/Incidence%20Matrix) $N \in \mathbb{R}^{v \times b}$ satisfies $N_{i\ell}=1$ if $p_i \in B_\ell$ and $N_{i\ell}=0$ otherwise. Let $I_v \in \mathbb{R}^{v \times v}$ denote the identity matrix, let $J \in \mathbb{R}^{v \times v}$ denote the all-one matrix, so $J_{ij}=1$ for all $1 \le i,j \le v$, and let $\mathbb{1}:=(1,\dots,1)^\top\in\mathbb{R}^v$ denote the all-one vector. For $1 \le i,j \le v$, the $(i,j)$ entry of the product $NN^\top$ is
\begin{align*}
(NN^\top)_{ij}
= \sum_{\ell=1}^{b} N_{i\ell}N_{j\ell}.
\end{align*}
If $i=j$, this sum counts the blocks containing $p_i$, hence equals the [replication number](/page/Replication%20Number) $r$. If $i \ne j$, this sum counts the blocks containing both distinct points $p_i$ and $p_j$, hence equals $\lambda$ by the definition of a [$2$-$(v,k,\lambda)$ design](/page/Block%20Design). Therefore $(NN^\top)_{ij}=r$ when $i=j$, and $(NN^\top)_{ij}=\lambda$ when $i\ne j$. The matrix $(r-\lambda)I_v+\lambda J$ has the same entries, so
\begin{align*}
NN^\top = (r-\lambda)I_v+\lambda J.
\end{align*}[/step]