Comedian Tim Vine won the award for the funniest one-liner at this

year’s Edinburgh Fringe Festival with the joke: “I decided to sell my Hoover. Well, it was just collecting dust.”

It’s the second time he has won the trophy, presented by TV channel Dave, and he’s been runner-up on three other occasions. His previous winning gag was: “I’ve just been on a once-in-a-lifetime holiday. I’ll tell you what, never again.”

The human race has been laughing for at least two million years. Professor Robin Dunbar of Oxford University believes that a sense of humour could be one of the reasons why early man began to bond together in larger groups.

His research, three years ago, also found that laughter really is good for you.

A good guffaw from watching Mr Bean slapstick comedy released endorphins that act as a natural pain killer. It is also said that laughter releases physical tension, boosts the immune system and helps the heart.

The science of humour has been discussed since the time of Aristotle, who said: “The secret of humour is to surprise.” So a custard pie worked in Ancient Greece, too.

Researchers at Wolverhampton University traced the oldest joke in the world back to the Sumerians 4,000 years ago. They had a bawdy sense of fun: “Something which has never occurred since time immemorial; a young woman did not fart in her husband’s lap.”

The oldest British joke dates back to the 10th Century. They were bawdy, too: “What hangs at a man’s thigh and wants to poke the hole that it’s often poked before?

Answer: A key.”

Senior lecturer Dr Paul McDonald said: “Jokes have varied over the years, with some taking the question and answer format while others are witty proverbs or riddles.

“What they all share, however, is a willingness to deal with taboos and a degree of rebellion. Modern puns, Essex girl jokes and toilet humour can all be traced back to the very earliest jokes identified in this research.”

Humour is now being taken seriously. Brunel University in London has a Centre for Comedy Studies Research and there are regular conferences and symposiums discussing the science of laughter.

Professor Rod Martin of the University of Western Ontario, in his book The Psychology of Humour, suggested that on average people laugh 17.5 times per day. A half laugh? Could that be from a small joke? Like, what’s brown and sticky? A stick.

A good sense of humour, he said, tended to be one of the most highly rated traits when people choose their friends, lovers or spouses. My spouse and I have been married 47 years so a sense of humour has been compulsory.

Research at Colorado University said humour stemmed from “a benign violation of the way the world ought to be”. Mmm. That needs mulling over.

People find an incident funny, they said, when it goes against the norm. No, not that Norm. He retired from Cheers years ago. In one experiment, a sausage manufacturer hired a rabbi to promote his pork sausages. The audience thought it funny because it was a moral violation.

Liverpool comedian John Bishop commented: “Benign violation is the perfect way of describing it. Humour should be like looking through a cracked window. You see something but you see it in a slightly different way. If you take it too far it becomes offensive and not funny.”

Jim Holt, in his book Stop Me If You’ve Heard This: A History and Philosophy of Jokes, said there were broadly three theories about gags.

The superiority theory: when we see someone hit by a custard pie.

The incongruity theory: when the natural order of things is turned on its head.

The relief theory (supported by Freud, of all people): when we laugh because we are briefly liberated from our inhibitions.

I wonder how Freud would have gone down at the Glasgow Empire on a Saturday night?