quantify diversity of a sample