This is a very well known puzzle and there are many variations of this puzzle. I picked this one up from “Mathematical Circles” by Dmitri Fomin, Sergey Genkin and Ilia Itenberg, Chapter #8, Problem #8.
Three people – A, B and C – are sitting in a row in such a way that A sees B and C, B sees only C, and C sees nobody. They were shown 5 caps – 3 red and 2 white. They were blindfolded, and three caps were put on their heads. Then the blind folds were taken away and each of the people was asked if they could determine the color of their caps. After A, and then B, answered negatively, C replied affirmatively. How was that possible?
Happy thinking!
Sir !! There are possible 7 scenarios caps can be distributed between A,B & C and they are RRR,RRW,RWR,RWW,WWR,WRR & WRW. In the last 3 scenarios when A is wearing a white cap either B or C will know the colour of their cap; only when A sitting in the front wears a red cap they cannot predict their colours.
Hence when C gives the answer in affirmative based on A & B nodding negative it can only be any of the 4 scenarios when C is wearing a red cap.
Rgds
Vivek