X*(1/T) + 1*((T-1)/T) where T = (N choose 2), X = (M-N+2)(1/2)