When Judge Elgan Edwards, the recorder of Chester, handed his four-year exemplary sentences to two men for using Facebook to incite riots that never happened, he said he hoped it would be a deterrent to would-be rioters.

The judge justified the sentences for the two men, who had pleaded guilty and who had no previous convictions, by saying the pair had caused "a very real panic" in their Cheshire towns "at a time when collective insanity gripped the nation".

The four-year sentences are the longest passed so far relating to the riots, and the fact that no one turned up to the riots in those locations, apart from the police, has sparked fierce controversy.

But are such "exemplary sentences" ever effective as a deterrent to other potential offenders?

The shock at the sentences may stem partly from the fact that the two men, Jordan Blackshaw, 20 and Perry Sutcliffe-Keenan, 22, were imprisoned for an offence that some do not even realise is a crime. And while the communities secretary, Eric Pickles, complains that people would be alarmed if incitement to riot had led to "just a slap on the wrist", a four-year sentence goes far beyond that consideration.

The annual criminal justice statistics now publish the average sentences passed each year for every offence in the criminal calendar, and they contain some interesting comparisons.

If the two Cheshire men had left home and actually taken part in a riot, it is likely they would have been charged with violent disorder. The average sentence passed on the 372 people convicted of violent disorder in 2010 was just over 18 months. The 1,434 people convicted of public order offences last year got, on average, two months inside.

Normally, to qualify for a four-year sentence, a convict would have to kidnap somebody (average sentence 47 months in 2010), kill someone while drink driving (45 months), or carry out a sexual assault (48 months).

The sentence is also out of line with the experience of previous riots. In a Bradford riots case in 2001, a sentence of three years for violent disorder was upheld on appeal against a 19-year-old with no previous convictions. The court of appeal, dealing with cases involving violent disorder in Croydon in 2005, ruled that a starting point of three years was justified. Indeed, the maximum sentence for violent disorder is five years, with a reduction of up to a third for those who plead guilty at the earliest opportunity.

But what about Edwards's hopes that such a long sentence would prove a deterrent? When Cambridge University criminologist professors Andrew von Hirsch and Sir Anthony Bottoms were asked by the Home Office to review evidence concerning the link between prison sentences and criminal deterrence, they concluded that deterrence did work. They said ordinary people could be deterred by formal and informal sanctions. Indeed, the entire criminal justice system exercises a deterrent effect in that there would be a lot more crime if people thought they could offend with impunity.

But they also looked at whether it was the certainty of being caught and punished, or the prospect of a really severe punishment, that had the most potent deterrent effect. On this point they concluded the evidence showed that passing ever harsher sentences did not "enhance the deterrent effect".

For potential offenders the increased likelihood of being caught and convicted, the research evidence shows, does have an impact on crime rates.

Even in the home of "Judge Dredd" sentencing – the US – the research studies have shown a very weak correlation between the severity of punishments and crime rates.Von Hirsch and Bottoms say one deterrent factor does have a strong impact – the social ties of the potential offender. Those with strong family and community links are much more likely to be deterred by the prospect of being caught than the lone, persistent burglar, who often acts impulsively.

There is one other factor that can further blunt the impact of an exemplary sentence. While the Facebook sentences have been widely publicised, the criminologists say there is real doubt about whether many potential criminals actually know the "going rate" for any particular crime – let alone whether they are deterred by it.