I was once told the following riddle: 100 dwarfs stand in a straight line, each wears a hat of the colour red, yellow or green and they can see only the hats of the dwarfs in front of them. A dwarf will be released, if he can guess the colour of it's hat correctly and he is only allowed to speak once. If he cannot guess the colour correctly, he dies. And of course each dwarf can hear all the other dwarfs clearly. The question is: Which strategy should the dwarfs use so that as many as possible can be saved.
This riddle is not too difficult, so the riddle was generalized so that, there are infinite many dwarfs. And the question now is, how many dwarfs can be saved and how? I was also told that you can save all apart from a finite amount of dwarfs and that using ultrafilters leads to success. I don't know, whether this is true or not, (but I strongly think it is). I would really like to see and then understand the answer to that riddle. I would be really happy, if someone can help me.