This is a great one from the Julia Robinson Mathematics Festival.
Three pirates are all wearing hats. Some of them may have secretly had the skull and crossbones removed from their hats. The pirate captain says “Two of you are going to walk the plank – the first one of you scalawags to correctly determine whether your hat has the skull and crossbones gets to be my first mate. Now, raise your hand if you see at least one skull and crossbones!”
All three pirates raise their hands, but no pirate immediately knows whether their hat has the skull and crossbones. The smartest pirate then knows and becomes first mate. What did they know, and how did they know it?