The late-night comic had found his perfect straight man. In June 2014, John Oliver sat down with renowned theoretical physicist Stephen Hawking for an interview.

“You’ve stated that there could be an infinite number of parallel universes,” the host of HBO’s “Last Week Tonight,” asked Hawking. “Does that mean there’s a universe out there where I am smarter than you?”

“Yes,” Hawking replied from his wheelchair, his lips bending up into a slight smile. “And also a universe where you’re funny.”

Hawking died early Wednesday at his home in England at age 76. Throughout his career as one of the world’s most recognizable cosmic thinkers, he regularly threw himself into pop culture’s comedic ring with cameos on programs such as “The Simpsons” and “Late Night with Conan O’Brien.”

These appearances aligned with a plucky wit that defined Hawking’s personal life as much as his universe-shaking theoretical work. Humor, however, was not just one side of his personality, but a key to overcoming the degenerative motor neuron disease he struggled against since 1963.

“Keeping an active mind has been vital to my survival, as has maintaining a sense of humor,” Hawking said in a 2013 documentary. “I am probably better known for my appearances on ‘The Simpsons’ and on “The Big Bang Theory” than I am for my scientific discoveries.”

That humor was deployed against a terrible prognosis.

At 21, Hawking was diagnosed with a condition similar to amyotrophic lateral sclerosis, also known as Lou Gehrig’s disease. According to the ALS Association, “Half of all people affected with ALS live at least three or more years after diagnosis. Twenty percent live five years or more; up to ten percent will live more than ten years.”

The disease would eventually shut down Hawking’s motor functions, rendering him speechless and unable to move without a wheelchair. Doctors initially said he would be dead in two years. His condition, however, proved to be a rare slow-acting version.

But Hawking fought through his deteriorating physical state, rising to a position as a celebrated professor of mathematics at the University of Cambridge and altering the popular conception of physics with his 1988 bestseller, “A Brief History of Time.”

Yet, the fact Hawking survived into his 70s is remarkable in its own right. “He is known as one of the longest, if not the longest, surviving patients with ALS in history,” the International Business Times wrote in 2012. “What’s happened to him is just astounding,” Leo McCluskey, the medical director at the University of Pennsylvania’s ALS Center, told Scientific American in that same year. “He’s certainly an outlier.”

In a January 2016 question and answer session, Hawking credited “my work and a sense of humor” with keeping him alive.

“When I turned 21, my expectations were reduced to zero,” he said. “It was important that I came to appreciate what I did have … It’s also important not to become angry, no matter how difficult life is, because you can lose all hope if you can’t laugh at yourself and at life in general.”

Hawking’s appearances on television tapped that sense of self-deprecation and fun.

“Your theory of a doughnut shaped universe is intriguing, Homer,” Hawking told “The Simpsons” dad in a 1999 episode. “I may have to steal it.”

“Wow,” Homer replied. “I can’t believe someone I never heard of is hanging out with a guy like me.”

“Professor Hawking, it’s an honor and privilege to meet you, sir,” Sheldon, one of the geeky characters on “The Big Bang Theory,” told him on one of the seven episodes he appeared in.

“I know,” Hawking replied.

He displayed the same wit off-screen. On Twitter on Tuesday night, Robert A. McNees, an associate professor in the department of physics at Loyola University Chicago recalled spending a night of “dinner and drinks, then karaoke” with the renowned thinker. Toward the end of the evening, McNees said he asked how late Hawking was planning to stay out.

“Until the batteries on the chair get low,” the professor quipped, according to McNees.

In 2009, Hawking threw a champagne party in Cambridge. Bottles were poured out, balloons strung around the room. But there was a catch: Hawking did not send out the invitations until after the party. It was not for his contemporaries, as he explained in a YouTube video, but future time travelers.

“I am hoping copies of [the invitation] in one form or another will survive for many thousands of years,” Hawking explained in the video. “Maybe one day someone living in the future will find the information and use a wormhole time machine to come back to my party, proving that time travel will one day be possible.”

No one showed.

“What a shame,” he quipped. “I was hoping a future Miss Universe was going to step through the door.”

Follow the Bangor Daily News on Facebook for the latest Maine news.