Ever heard the one about c equalling (m nO)/p?

The mathematical equation for the perfect joke was revealed by scientists in London yesterday. The calculation is c=(m+nO)/p.
In the formula, c is the funniness of the joke; m is the “comic moment” (arrived at by multiplying the punchline’s funniness rating by the length of the joke’s buildup); nO is the number of times the subject undergoes a pratfall, multiplied by the “ouch factor” - the social and physical pain of the indignity involved. The total is divided by the number of puns, p.

The formula was worked out by Helen Pilcher and Timandra Harkness - both scientists and stand-up comedians - who make up the Comedy Research Project, which they run in collaboration with the Science Museum’s Dana Centre in London.

According to the equation, if a joke consists of a long “shaggy dog story”, it does not require such a funny punchline as a shorter wisecrack.

Puns are seen as dissipating the power of a joke because they tend to encourage groans rather than laughter.