
This was figured out about 20 years ago as a consideration for space travel.
The minimum population of humans needed to maintain genetic diversity and survive a multi-generational space flight, with the goal of setting up a colony at the other end, is about 160 people. Now, you have to make sure you carefully select those people so that they come from a diverse genetic background – and you have to be really picky about screening for diseases and genetic risk factors.
Theoretically, with some very restrictive social engineering and strong rules governing who can and cannot have children together, then you could start off with as little as 80 humans — 60 females and 20 males.
But, let’s think about this. First, 20 years ago, the whole field of epigenetics didn’t exist. Thus, the question of gene expression or suppression under a given set of environmental stresses wouldn’t have been considered. Likewise, people are much more than their genes. You can make all the restrictive rules you want, but culture, genetics, and sheer personal cussedness are going to ensure that the gene distribution you expect is not the distribution you will get. As with any engineered solution, designing at the edge of the envelope is a guarantee of failure.
Another very significant question is death rate before reaching the desired number of matings. This is going to be highly dependent on the environment. If the rate is high enough that nobody gets a chance to reproduce more than once, your minimal population is way too small, and the death rate depends on the total population.
Now, about repopulating “the earth”. This requires not only enough people to create a genetically viable population, but the right conditions to be able to innovate and do things like survive in a wide variety of harsh climates, navigate vast oceans, etc. This greatly increases the genetic diversity you need from your population. There are no hard lines between “races”, but within the gradual transition from one geographically distant group to another lies a necessary wealth of genes that allow survival from the Arctic to the Sahara, from Polynesia to the Himalayas.
Repopulating Earth also requires access to many resources. Owing to the success of the currently prevalent society, in all it’s many parts, many of the things a world-spanning population would want are not longer easy to get to, certainly not in the quantities that would make it easy to find and with the concentrations that would make it easy for a buddying civilization to refine.
