Density Calculations (untested)

density calculations (O(n^2) time)