Let \(C\) be a binary code of length \(n\) with minimum distance \(d>n/2\) and \(M\) codewords, enumerated as \(C=\{c_1,\ldots,c_M\}\).
Prove that \[ M(M-1)d\le \sum_{i=1}^M\sum_{j=1}^M d(c_i,c_j)\le \frac{nM^2}{2}. \]
Deduce that \(C\) has at most \[ \frac{2d}{2d-n} \] codewords. This is the Plotkin bound.