Illustration: David Foldvari

When is it OK to start making light of terrible events? That's the comedian's perennial question. Some say there are things you should never joke about. Others that there's no "unfit subject for comedy", just lots of unfit jokes.

John Goddard, Bishop of Burnley, seems to take the former view: "There is a fear in my mind we can become immune to dreadful things that happen in history if we allow them to be treated too light-heartedly." He was talking about a proposed hillside artwork to commemorate the Pendle witch trials. The local council had commissioned the artist Philippe Handford to write the year of the trials, 1612, in massive numerals on Pendle Hill. It then backed out in the face of protests led by the bishop. Last week it emerged that the project will go ahead because a local brewery has agreed to fund it.

I'm sure the bishop is mightily pissed off but I don't understand why writing 1612 on a hill constitutes being light-hearted about something that happened then. It's just commemorating it, isn't it? But maybe Goddard doesn't like that either. "Do we want the area to be known for the injustice and oppression of perhaps elderly, perhaps deformed women?" he said.

His reasoning seems flawed. If there's one thing that makes people "immune to dreadful things that happen in history" more readily than treating them light-heartedly, it's forgetting about them altogether or trying to pretend they didn't happen. Antisemites tend to deny the existence of the Holocaust rather than make jokes about it.

Since the notion of witchcraft is involved in this case, the bishop probably thinks that any commemoration will lead to levity: to dressing up, wearing pointed hats and cackling, to groups of goths drinking cider. Witches are fun, like vampires and dragons. It's unfortunate that the same terminology applies both to an engaging sort of Halloween ghoul and a 400-year-old excuse for judicial murder.

If it's ever OK to be light-hearted about something tragic, surely it is about this. It happened 400 years ago. No one who knew any of the dead has been alive for centuries. The issues involved are no longer relevant: Britons don't get accused of being witches any more – they proudly declare that they're witches when their interest in reflexology or crystals wanes. That particular method for justifying some random killing to allay a sense of angry bewilderment has gone permanently out of fashion. The Bishop of Burnley is unusually sensitive in thinking it's an inappropriate subject for fairly unreflective Vincent Price-style jollity.

One answer to the comedian's question is that a joke is OK if you get away with it. If you say something in the hope of a laugh and it causes a stink instead, you tend to wish you hadn't even if you can defend it intellectually. Similarly, if you say something ethically indefensible but, instead of attacking it, people just guffaw and clap, you have to be a saint to feel completely sorry.

And you can never be sure. I doubt Philippe Handford expected to get any shit for some art inspired by a ghoulish anecdote – particularly as he'd cleared it with the landowner and Natural England and is using a water-based grass paint which will disappear within weeks – and yet he ended up on the wrong end of a bishop's crosier.

In the world of comedy even more than that of biodegradable art, there's an incentive to take risks with taste. That's because people tend to be most amused the millisecond after they would have been offended. That's the edge in an edgy joke. If you're the first to crack a gag about something after it has mysteriously become acceptable, you're in clover. If you're the last to do so before that, you're screwed. Things go straight from taboo to hilarious – and at different times for different people. In playgrounds some will already be making jokes about the Batman shootings. Others think you still can't touch the Somme. For the Bishop of Burnley, gags about early 17th-century miscarriages of justice are "too soon".

Can science help? It's increasingly getting involved in areas that were previously the preserve of artistic judgment. Just last week, in Europhysics Letters, two physicists published an analysis of Beowulf, The Iliad, the Harry Potter books and The Lord of the Rings. Maybe comedy will be the next art form to reach the point where scientific scrutiny trumps instinct – that moment when code-breaking ceased to be the domain of crossword fiends and passed over to the mathematicians.

Can they come up with an equation to find out whether a subject is suitable for risk-free levity? How many years ago the event occurred (x) must be a factor as well as the number of people who were killed (y). If there are survivors or relatives of the dead still living (z), that's got to massively increase the likelihood of umbrage. The issues at stake in the tragedy are also key: the Crusades remain a touchier subject than the Crimean war despite happening centuries earlier because inter-religious hatred is a hotter potato than the Victorian policy of bolstering Turkey at the expense of Russia. The slave trade is a more sensitive topic than the Titanic because the racism that is the premise of the former is more of a blight on contemporary civilisation than the flawed naval architecture that caused the latter's demise. So let's call the number of extant associated issues "n". Here's my attempt at an equation:

Offence Likely To Be Taken (OLTBT) = (y/x)z + n

In the case of the Pendle witch trials, it would work out as: 12 divided by 400, multiplied by 0 plus 0, which equals 0. That's assuming n is zero because persecution of alleged witches doesn't happen here any more. But trumping up charges against unpopular oddballs probably does, so maybe n is 1, which would make the OLTBT equal 1 – just enough to get a bishop's goat.

But handy though this could be as a sort of Duckworth-Lewis method for evading Ofcom, it doesn't answer the question properly: the real answer has little to do with subject matter and everything to do with intent. As Trevor Griffiths wrote in his play Comedians: "When you walk into that arena with a joke, you've got to know why you're there."