ds_diversity function

Compute Diversity