Cass Sunstein, David Schkade, and Daniel Kahneman, in a 1999 paper named Do People Want Optimal Deterrence, write:
Previous research suggests that people’s judgments about punitive damage awards are a reflection of outrage at the defendant’s actions rather than of deterrence. This is not to say that people do not care about deterrence; of course they do. Our hypothesis here is that they do not attempt to promote optimal deterrence; for this reason they do not make the kinds of distinctions that are obvious, even secondnature, for those who study deterrence questions. Above all, they may not believe that in order to ensure optimal deterrence, the amount that a given defendant is required to pay should be increased or decreased depending on the probability of detection, a central claim in the economic analysis of law.
If we're after optimal deterrence, we should punish potentially harmful actions more if they're hard to detect, or else the expected disutility of the punishment is too small. But apparently this does not accord with people's sense of justice.
Does this mean we should change our sense of justice? And should we apply optimal deterrence theory to informal social rewards and punishments, such as by getting angrier at antisocial behaviors that we learned of by (what the wrongdoer thought was) a freak coincidence?