Ali-Baba is attempting to enter a cave. At the entrance, there is a square table with a vessel at each corner. Each vessel contains a herring, which can be oriented either head-up or tail-up. The orientations of the herrings are not visible from the outside.
Ali-Baba is permitted to reach into any two vessels, feel the positions of the herrings, and adjust them as he wishes (he may leave them unchanged or flip one or both). This operation can be repeated multiple times. However, after each move, the table is spun rapidly, making it impossible to determine which vessels were previously touched.
The cave door will open if all the herrings are in the same orientation. Assist Ali-Baba in devising a strategy to gain entry to the cave.
Sign in or create an account to reveal answers, view the solution, and save your progress. Create a free account to unlock practice and keep track of your work.
One puzzle per day. Cryptarithm, Magic Square, Summit. No sign-up required to play.
Play daily puzzle →Interactive problems and curated lessons—water pouring, magic squares, knight's tour, and more.
Browse library →See how you rank. Top solvers by problems solved correctly. Sign in to climb the ranks.
View leaderboard →