A paradox also known as the surprise examination paradox or prediction paradox.
A prisoner is told that he will be hanged on some day between Monday and Friday, but that he will not know on which day the hanging will occur before it happens. He cannot be hanged on Friday, because if he were still alive on Thursday, he would know that the hanging will occur on Friday, but he has been told he will not know the day of his hanging in advance. He cannot be hanged Thursday for the same reason, and the same argument shows that he cannot be hanged on any other day. Nevertheless, the executioner unexpectedly arrives on some day other than Friday, surprising the prisoner.
This paradox is similar to that in Robert Louis Stevenson's "bottle imp paradox," in which you are offered the opportunity to buy, for whatever price you wish, a bottle containing a genie who will fulfill your every desire. The only catch is that the bottle must thereafter be resold for a price smaller than what you paid for it, or you will be condemned to live out the rest of your days in excruciating torment. Obviously, no one would buy the bottle for 1¢ since he would have to give the bottle away, but no one would accept the bottle knowing he would be unable to get rid of it. Similarly, no one would buy it for 2¢, and so on. However, for some reasonably large amount, it will always be possible to find a next buyer, so the bottle will be bought (Paulos 1995).