R Elbow Method Mathematics