“A paradox is an argument that produces an inconsistency, typically within logic or common sense.”-Wikipedia.

Computer scientists study paradoxes to learn about logical inconsistencies because computers (being as stupid as they are!) can not handle them. This is particularly important in the fields of Operating Systems, Artificial Intelligence, Machine Learning, etc. On top of that, paradoxes are extremely fun thought exercises! The unexpected hanging paradox is described as follows:

A judge tells a prisoner that he will be hanged at noon on one weekday in the following week, but the execution will be a surprise to the prisoner.

Now, the prisoner concludes that he will not be hanged on Friday, since after Thursday noon he know that there is only one day left in the week and therefore being hanged on Friday will no longer be a surprise for him after Thursday noon.

Given the fact that he will not be hanged on Friday, he again concludes that he will not be hanged on Thursday, since after Wednesday noon it will no longer be a surprise for him.

With similar reasoning he concludes that he will not be hanged on any of the week days. He joyfully returns thinking that he will not be hanged at all.

On a random day next week an executioner hang the prisoner, which is indeed a surprise to him.

[Inspired by an episode of Numb3rs]