Is there a way to compute diversity in a population? Say we have the following 5 cities, each with the same population 


*

*CityA with 20% each of 5 ethnicities

*CityB with 99% of one ethnicity, but 100 different ethnicities in the remaining 1%

*CityC with 40% of one ethnicity and the remaining 60% distributed evenly over 10 different ethnicities


How can one measure their relative diversities?
 A: How about the Shannon index?
A: This paper by Massey and Denton 1988 is a fairly prolific overview of commonly used indices in Sociology/Demography. It would also be useful for some other key terms used for searching articles. Frequently in Sociology the indices are labelled with names such as "heterogeneity" and "segregation" as well as "diversity".
Part of the reason no absolute right answer exists to your question is that people frequently only use epistemic logic to reason why one index is a preferred measurement. Infrequently are those arguments so strong that one should entirely discount other suggested measures. The work of Massey and Denton is useful to highlight what many of these indices theoretically measure and when they differ to a substantively noticeable extent (in large cities in the US).
A: Tree diversity analysis book will get you up to speed with common diversity indices, along with some useful packages in R and their usage. While the book talks about trees, it can be used with marine fauna (which I did for my thesis) or even people.
A: A diversity index such as Simpson's Diversity Index may be helpful:
$$ S = \sum_{k=1}^{K} \left(\frac{n_k}{N}\right)^2 $$
where there are $N$ units and $K$ types in your population with $n_k$ units of each type ($k=1,2,\dots,K$).
It is essentially the probability that two randomly selected samples (with replacement) will be of the same type.
From your examples, the values for Simpson's Diversity Index will be as follows:
City A: $S_A = (\frac{20}{100})^2+(\frac{20}{100})^2+(\frac{20}{100})^2+(\frac{20}{100})^2+(\frac{20}{100})^2 = 1/5 = 0.200.$
City B: $S_B = (\frac{99}{100})^2+\sum_{i=1}^{100}(\frac{0.01}{100})^2 \approx 0.980.$
City C: $S_C = (\frac{40}{100})^2+\sum_{i=1}^{10}(\frac{6}{100})^2 = 0.196.$
You may have noticed that the more diverse the population, the lower Simpson's index is. Therefore, to create a positive relationship, sometimes it is presented as $1-S$ or $\frac{1}{S}$.
A: You may be interested in this paper: "A new axiomatic approach to diversity" from Chris Dowden.
