Take it from a 91-year-old mathematician: Living a long, healthy life is like a game of probability.

You want to “minimize the chance of really bad outcomes of one sort or another,” Edward Thorp, a mathematics professor, hedge fund manager, and blackjack player, told Bloomberg.

That means trying to lower the likelihood of things that could kill you, like heart disease or other “main killers,” he said. So his advice is to schedule regular checkups and vaccinations and manage overall risks. 

You also want to develop habits that can add years to your lifespan. Thorp called these “magic bullets,” which include regular exercise and a healthy diet.

Thorp’s exercise routine includes aerobic exercises like walking or a short jog and core strength-building activities. At 91, he can do two chinups and 15 pushups. He told Bloomberg he stays away from the “typical American diet” because it can lead to weight gain and cause several diseases. Thorp, who’s 155 pounds, said he’s only gained 2 pounds in 70 years.

Additionally, Thorp said he regularly takes four of five supplements. He also takes the medication Finasteride for his enlarged prostate, which has the added benefit of preventing his hair from thinning. 

Thorp said that people who beat the odds in blackjack, the financial markets, or life do one thing better than others: They anticipate risks and figure out how to overcome them.

“If I have an edge, it’s that I try to think things through for myself, look at the empirical evidence, manage risks, and work hard at making the necessary changes,” he said. 

Those who want to implement a few of Thorp’s lifestyle habits into their life but need a little motivation should try habit stacking.

“It’s easier to create a habit when you add it onto something you’re already doing,” Dr. Kien Vuu, a physician who specializes in antiaging and regenerative medicine, previously told Business Insider.