Given an $[n,M,d]$ code, find an upper and lower bound for the sum
$$\sum_{u,v \in C \\ u \neq v} d_{H} ( u,v)$$
From my understanding, the lower bound of any hamming distance is 1, so the lower bound of the summation should be the elements in an $M\times n$ matrix - 1? Honestly, I don't even know where to begin beyond that.
Since $d\leq d_H(u,v)\leq n,$ for all $u\neq v,$ you get the lower bound $$ d\binom{M}{2} $$ and the upper bound $$ n\left[\binom{M}{2}-1\right]+d $$ since at least one codeword pair must be at distance $d$.