They say tragedy + time = comedy.

But even if you adore the morbid jokes that make light of misfortune, you likely can’t share your twisted wit with many people. Common sense tells you that dark humor is frowned upon in public, because many poor souls are sensitive, and your crass jokes hurt their fragile feelings.

But recent research indicates that sick jokes are a sign of sharp wit and intellect. According to a new study conducted at the Medical University of Vienna,  there is a significant correlation between intelligence and dark humor.

In the study, researchers asked 156 participants — a mixture of men and women from a spectrum of educational backgrounds — to rate their comprehension and enjoyment of 12 dark humor cartoons.

One example of a dark cartoon used in the study features a pregnant woman being spoken to by a doctor. The doctor tells her “To begin with, here is the good news: your child will always find a parking space.”

Those who understood and appreciated the dark jokes the most not only had the highest IQ test results and were better educated, but they also scored lower for bad moods and aggression.

However, this doesn’t mean that dark humor is necessarily exclusive to the brainy. In fact, some researchers have even argued that a joke will fall flat among geniuses and dummies alike without something awful to make it funny.

Peter McGraw, psychologist and professor at the University of Colorado at Boulder, has traveled around the world researching comedy trends for his book, The Humor Code. In it, McGraw contends that the foundation of humor comes from dark places, from things that seem wrong and threatening. He posits the “benign violation” theory of humor — that something can only be funny when it strikes the delicate balance between hurtful and harmless.

“Humor is something people inherently enjoy,” McGraw tells me. “But there also needs to be something wrong, unsettling, and threatening in some way. We call those violations.”

Violations are anything that threatens the way you think the world ought to be. And those violations can be benign only if you’re somehow distanced from their damage. The harm may have occurred to someone else, happened a long time ago, or generally doesn’t seem real.

Go too edgy and you’ll make everyone uncomfortable. But go too light-hearted and you’ll never get a laugh. McGraw believes that hilarious harmony falls right in the center, and that equilibrium is easier to achieve when you’re intelligent.

“It does tend to be the case that smarter people are better at comprehending and producing comedy. You need to be clever to see the things that are wrong in the world and to make them okay,” he says. “Smart people are better-read and they know more about the world. They can connect these dots.”

Yet McGraw approaches the aforementioned study — the one that correlates dark humor and IQ — with skepticism. He says he can’t know for sure if the participants were randomly selected, if the cartoons were chosen by unbiased people, or even if the cartoons were purely benign or purely violations. He illustrates this with an example of an experiment.

“For example, if a drop a rubber snake at your feet, it’s funny when you’re realize you’re not in danger,” he says, because the violation (the snake) is benign (not going to kill you).

“But if I drop a real rattlesnake at your feet, that’s not benign, and you’re never going to laugh while the lethal threat is still there. It doesn’t matter how smart you are,” he explains.

“Imagine if I did that study, and the only variable I change is participants’ intelligence. I’d call it, ‘Smart People are Just as Likely as Dumb People to Laugh at Rubber Snakes,’” McGraw giggles.

So, I guess that saying — that you can tell how smart someone is by what they laugh at — rings pretty true. As psychologists like McGraw tell us, understanding jokes requires mental agility. You need to recognize a sudden shift in meaning, or appreciate the blending of odd contexts that don't normally go together.

“When it comes to dark humor, being smarter is advantageous because it gives you the ability to see that these things are benign,” McGraw says. Gruesome subjects like disease or disability may disgust many people, but having a positive state of mind and being able to quickly see through the gloom and laugh at the playful fiction takes a greater level of mental exercise.

So go ahead and take pride in your dead infant jokes. You’ve gotta be pretty intelligent to execute those babies.