# Elbow criteria to determine number of cluster

It is mentioned here that one of the methods to determine the optimal number of clusters in a data-set is the "elbow method". Here the percentage of variance is calculated as the ratio of the between-group variance to the total variance.

I felt difficult in understanding this calculation. Can any one explain how to calculate the percentage of variance for a data-set represented as feature matrix $F \in \mathbf{R}^{m \times n}$, where $m$ is the feature dimension and $n$ is the number of data points. I use the k-means algorithm for clustering.