In the puzzle known as The King's Wise Men, three wise men are given hats of either white or blue, with the guarantee that at least one of the hats is blue.
The men are not allowed to speak to each other - the first man to stand up and correctly announce the colour of his hat wins.
For the robot's self-awareness test, Selmer Bringsjord, from the Rensselaer Polytechnic Institute AI and Reasoning Lab in New York, used three of French robotics company Aldebaran's humanoid Nao robots.
The three robots were told that two of them had been given "dumbing pills" that rendered them unable to speak, and one a placebo.
More From This Section
In reality, they had a button pressed on their heads, which muted two of the robots. They were then asked if they had been given the dumbing pill or the placebo.
After a few moments of silence, one robot stood up and said "I don't know."
It immediately realised what had happened, raised its hand and said, "Sorry, I know now. I was able to prove that I was not given the dumbing pill."