Please comment your solutions, questions and remarks..
We are going to have several prisoner problems! Better solve them before you end up in jail.
There are 2010 prisoners in the prison. One day the chair of the prison gathers the prisoners and tells them the following. Tomorrow all of you will come to the yard in a queue, all of you gazing forward. I will put a hat on each of your heads. A black or a white hat. No one of you will know which one is on their own head but everyone will see those hats that are in front of them. Then I will ask each of you, starting from the last in the queue, which is the colour of his or her hat. If he or she gives the wrong answer, I shoot him/her with a bazooka.
The prisoners have some time to agree on a strategy before they have to come to the yard. Once they are there, they cannot communicate except for that they can hear what the previous prisoners in the queue answer and whether or not they are killed with a bazooka.
What is the best strategy they can agree on?
(Thanks to Yilong Li for this problem)