Wise Man
A sultan has captured 50 wise men. He has a glass currently standing bottom down. Every minute he calls one of the wise men who can choose either to turn it over (set it upside down or bottom down) or to do nothing. The wise men will be called randomly, possibly for an infinite number of times. When someone called to the sultan correctly states that all wise men have already been called to the sultan at least once, everyone goes free. But if his statement is wrong, the sultan puts everyone to death. The wise men are allowed to communicate only once before they get imprisoned into separate rooms (one per room). Design a strategy that lets the wise men go free.
Answer
Designate One Wise Man as the Counter: He will keep track of how many “wise man” have been to the sultan already.
Other 49 Wise Men "Regulars": On every visit, a Regular checks:
If the glass is bottom down and he has not done his one flip yet, he flips it upside down. (He never does this flip again.)
Otherwise, he does nothing.
Counter’s Role:
Each time the Counter sees the glass upside down, he flips it to bottom down and increases his count by 1.
Once the Counter’s count reaches 49, he declares that everyone has visited.