When it comes to the future of humanity, Tesla CEO Elon Musk and Alibaba founder Jack Ma disagree on whether people should be scared by the potential of artificial intelligence. Ma is optimistic about AI, while Musk is more apocalyptic. But the two billionaire businessmen do agree on the biggest problem the world will face in the future: not enough people.

"Most people think we have too many people on the planet, but actually, this is an outdated view," Musk said while on stage with Ma at at the World Artificial Intelligence Conference in Shanghai on Wednesday. "Assuming there is a benevolent future with AI, I think the biggest problem the world will face in 20 years is population collapse."

"The biggest issue in 20 years will be population collapse. Not explosion. Collapse."

"I absolutely agree with that," Ma said. "The population problem is going to be facing huge challenge. 1.4 billion people in China sounds a lot, but I think next 20 years, we will see this thing will bring big trouble to China. And … the speed of population decrease is going to speed up. You called it a 'collapse,'" he said to Musk. "I agree with you."

"Yeah, accelerating collapse," Musk said.

Fears of overpopulation due to immigration are short-sighted, according to Musk. "The common rebuttal is like, 'Well what about immigration?' I'm like, 'From where?'"

TWEET: For the first time in modern history, the world's population is expected to virtually stop growing by the end of this century, due in large part to falling global fertility rates.

Musk and Ma may be aggressive with their time frame, but by 2070, the global fertility rate is expected to fall below the global replacement fertility rate — that's the average number of children each woman needs to give birth to for the population to replace itself from one generation to the next — according to a recent analysis of United Nations global population data from the Pew Research Center. The current global replacement rate is 2.1 births. The current global fertility rate is 2.5, but is expected to fall to 1.9 by 2100.

Fertility rates vary widely, but Africa is the only global region expected to have "strong population growth" through 2100. Populations in Europe and Latin America are projected to be declining by 2100. Asia's population is projected to increase though 2055 and then begin to decline, according to Pew.

For some regions, especially in poor countries, rising fertility rates cause a burden on the already stressed social infrastructure systems. But in countries like China, a slowing population is cause for concern.

For example, due to decades of birth restrictions in China (from the '70s until 2015 Chinese couples were required to have only one child), ever increasing economic opportunities for women and increasing longevity, China now has a lopsided population — there are not enough young workers to support the growing population of older people.

In January, a group of local academics, the Chinese Academy of Social Sciences, issued a warning to government leaders about the potential threat of population decline, the New York Times reported.

"What are the socio-economic consequences of long-term sustained negative population growth? From a theoretical point of view, the long-term population decline, especially with the aging of the aging, is bound to bring very unfavorable social and economic consequences," the report, translated into English, says.

See also:

Elon Musk, Bill Gates and Warren Buffett agree: Now is the best time to be alive

Jeff Bezos' job listing for Amazon's first hire: You have to exceed what 'most competent people think possible'

Elon Musk backs presidential candidate Andrew Yang, who advocates giving Americans $1,000 a month