Bill H. kinda beat me to this, but the OP really mistated the problem somewhat, which is causing most of the confusion on this thread. The problem should go something like this:
The warden tells the prisoner that he will be executed one day next week (Monday through Friday, if you will). The warden says that the execution day will be chosen in advance and will not be changed. The warden then makes the prisoner the following deal: Each morning the warden will ask the prisoner if today is the chosen execution day.
If the prisoner says yes and he’s right, the warden will let him go free.
If the prisoner says yes and he’s wrong, then he’ll be executed on the spot.
If the prisoner says no and he’s right (i.e. today is not the chosen day) then the game continues.
If the prisoner says no and he’s wrong (i.e. today is the chosen day), then obviously he gets executed.
The salient points are 1) the day is stated to be chosen in advance and will not be changed; 2) the prisoner gets asked once per day if today is the day; 3) The prisoner may only answer “yes” once: if he ever says “yes” and he’s wrong, he’s dead.
So the reasoning of the prisoner should now be clearer: Obviously, if he makes it to Friday and he’s asked if today’s the day, he answers “yes” and goes free. So he rules out Friday as a possible execution day because it’s logically impossible for him to actually be executed on that day; given the constraints of the puzzle, he can’t be executed on Friday because if he were to make it to Friday, all he’d need to do is say “yes” to the question and he’d go free. And from that he reasons backwards that it can’t be Thursday, can’t be Wednesday, etc.
The way to resolve the apparent paradox and discover the flaw in the prisoner’s reasoning is to look at the puzzle from the warden’s point of view. If the warden is intelligent and has thought of the same reasoning that the prisoner has, he will conclude that the prisoner believes that he cannot be executed on any day. Therefore when the prisoner is asked on Monday if today is the day, he will say no. So if the warden chooses Monday as the day, the prisoner will die. The warden can make the same argument for any day except Friday.
So what is the flaw in the prisoner’s reasoning? It’s the “if” part: Friday gets ruled out as the execution day only if the prisoner lives to Friday. Ruling out the other days then follows from that premise. But, if one of the other days turns out to be the execution day, then that first premise is wrong so the whole chain of reasoning falls apart.
Finally (just to say it another way), note that there are two conditions necessary for the prisoner to live to Friday: 1) the prisoner must say “no” on all previous days, and 2) all previous days must not be the actual chosen day. If number 2 is false (i.e. one of the previous days is the chosen day), and the prisoner says “no”, he dies.