# Where does the number “12” comes from in Kruskal Wallis formula?

I just want to know.. Where does the "12" in the Kruskal Wallis formula comes from? I hope someone can give me a very good explanation.

• $12$ comes from the fact that $\sum_{i=1}^N (i - \frac{N+1}{2})^2 = \frac{(N-1) N (N + 1)}{12}$, so it occurs naturally in the expression for the sample variance of the ranks of the outcomes which is (deterministically) equal to $\frac{N (N + 1)}{12}$. – guy Jun 10 '16 at 14:40