Arte SheetsLearn. Try. Understand.

Statistical

Simpson's Diversity Index (1 - D) & Lincoln-Petersen Mark-Recapture formulas

Calculate finite-sample diversity and a Chapman capture–recapture estimate under explicit sampling assumptions.

Diversity of a recorded sample and a separate population estimate

The finite-sample diversity formula gives the probability that two distinct individuals selected uniformly from the recorded sample belong to different categories. Counts must be nonnegative integers with total at least2. It is not the with-replacement expression1-SUM(p_i^2): for S equally represented categories the finite-sample value is N/(N-1)*(1-1/S), and can reach1 when every individual has its own category.

The Chapman adjustment reduces small-sample bias under capture–recapture assumptions; it is not universally unbiased. The population must be closed between samples, marks retained and correctly identified, and capture/mixing assumptions appropriate. Marking must not alter subsequent capture probability. Heterogeneity or dependence can seriously distort the result.

This exercise refuses a population estimate when overlap R is zero. The adjusted arithmetic is finite then, but that alone does not justify a useful estimate. The output is an estimated abundance, not a census or a confidence interval. Applying capture–recapture to software defects needs its own justified detection model.

Species / Survey InputCount / ValueFormula TermEcological Output
4 Species Counts (B2:B5)40, 30, 20, 10 (N = 100)n*(n-1): 1560 + 870 + 380 + 90 = 2,900N*(N-1) = 9,900 pairs
Simpson Diversity 1 - D1 - 2,900 / 9,9007,000 / 9,900 = 70 / 990.7071 (70.71% diversity)
Mark-Recapture (M, C, R)E2=49, E3=39, E4=9((49+1) * (39+1)) / (9+1) - 1N_hat = 199 total population!
Monoculture Edge CaseCounts [100, 0, 0, 0]1 - 9,900 / 9,9000.0000 diversity

Finite-sample Simpson's Index of Diversity 1 - D

With C2:C5 storing =B2 * (B2 - 1) and N = SUM(B2:B5), evaluates exact probability two random individuals differ.

=IF(COUNT(B2:B5)<>4,"Invalid inputs",IF(OR(MIN(B2:B5)<0,SUM(B2:B5)<2,B2<>INT(B2),B3<>INT(B3),B4<>INT(B4),B5<>INT(B5)),"Invalid inputs",LET(totN, SUM(B2:B5), ROUND(1 - SUM(C2:C5) / (totN * (totN - 1)), 4))))

Chapman-adjusted capture–recapture estimate

M and C are positive integer sample sizes, and overlap R cannot exceed either sample. Require R>0 for a displayed estimate in this exercise. Fractional estimated populations are retained to two decimals; do not interpret the decimal as a count of observed individuals.

=IF(COUNT(E2:E4)<>3,"Invalid inputs",IF(OR(E2<1,E3<1,E4<0,E4>MIN(E2:E3),E2<>INT(E2),E3<>INT(E3),E4<>INT(E4)),"Invalid inputs",IF(E4=0,"No recaptures",ROUND((E2+1)*(E3+1)/(E4+1)-1,2))))

Try the example

Use the original values or change them to test your understanding.

Further reading