BOSTON – Next time you crush your thumb with a hammer and you’re in extreme pain, go ahead, let fly with every filthy obscenity you know.

It really does help.

At least according to Richard Stephens and his students, who earned a 2010 Ig Nobel prize, the award handed out by the Annals of Improbable Research magazine for silly sounding scientific discoveries that often have surprisingly practical applications.

This year’s winners include scientists who developed a way to collect whale snot using a remote-control helicopter; doctors from New Zealand who found that wearing socks on the outside of your shoes reduces the chances of slipping on ice; and researchers from China and the U.K. who examined the sex life of fruit bats.

The 20th anniversary edition of the Ig Nobel awards ceremony was held Thursday night at Harvard University.

The theme this year was bacteria. There was the world premiere of “The Bacterial Opera,” about bacteria that live on a woman’s front tooth, and door prizes for all 1,200 attendees: bacteria (it was on the tickets).

As usual, real Nobel laureates were on hand to give out the prizes.

Stephens, a lecturer in psychology at Keele University in the United Kingdom, was inspired by his own painful experience. A few years ago, after smacking his hand with a hammer and blurting out a choice expletive, he felt much better.

However, Stephens didn’t whack his subjects with a hammer. “We had to find a stimulus that was painful but not harmful,” he said.

The test subjects dunked their hands in a bucket of ice cold water to see how long they could hold it there. People with potty mouth were able to hold their hands in the water longer.

“What we think is when you swear you produce an emotional reaction in yourself, you arouse your nervous system and you set off the fight or flight response,” Stephens said. “It gets the heart rate up, gets the adrenaline flowing.”

Karina Acevedo-Whitehouse, Agnes Rocha-Gosselin and Diane Gendron won the engineering Ig Nobel for their novel way of gathering “exhaled breath condensate” — that stuff that sprays out of a marine mammal’s blow hole.

The bacteria found in the blow can give clues about the whale’s health.