Theory
Capture-recapture estimates the size of a population that is difficult to count directly, such as fish in a pond. First capture a group, mark them safely and release them. Later capture a second group and count how many are marked.
If the first sample has M marked animals, the second has C animals and R of those are marked, assume the marked proportion in the second sample is similar to the marked proportion in the full population: R/C is approximately M/N.
Rearrange to estimate population N = M x C / R. For 40 marked, 50 in the second sample and 10 marked recaptures, N is about 40 x 50 / 10 = 200.
The estimate needs important assumptions: marks remain visible; marking does not change survival or chance of recapture; animals mix through the population; and the population stays approximately closed between samples.
If no marked animal is recaptured, R = 0 and this formula cannot give an estimate. A very small R makes the estimate unstable. Report the result as approximate, not exact.