The judge informs each prisoner that he has made the same offer to the other. They are not allowed to confer. We can assume that each prisoner is fully rational and knows the other is rational too. What should each prisoner do, confess or deny?
Let's look at it from the point of view of prisoner 1. There are two cases to consider: prisoner 2 denies or admits guilt.
Let's take the case where prisoner #2 denies guilt. If prisoner one admits it then he gets off free, whereas if he denies he gets 2 in the clink. So in this case prisoner one is better off admitting guilt.
The other possibility is that prisoner #2 admits guilt. If prisoner one admits it then he gets 4 years, whereas if he denies he gets 5. So in this case too prisoner one is better off admitting guilt.
Now prisoner #2 will use the same logic to reach the same conclusion and hence both prisoners will admit guilt and get four years each.
There's just one difficulty with this solution, namely that it is wrong. For if both prisoners denied their guilt they would each get 2 years instead of 4. What is the solution to the paradox?