Of course, this arrangement doesn't even require the ability to predict the future (or travel into the past), as long as you pick people to punish who are deterred from crime solely by the threat of punishment. After all, once they've been punished for a future crime, they might as well commit it.
Here's an edited version of a puzzle from the book "Chuck Klosterman four" by Chuck Klosterman.
When should you punish someone for a crime they will commit in the future? Discuss.