The earliest occurrence of the puzzle that I am aware of is from 1958.
Chapter 1 of the book contains several mathematical puzzle stories on
the great Sultan Ibn-al-Kuz of Quasiababia. The third of these stories is
called "FORTY UNFAITHFUL WIVES". and deals with the blue eyes puzzle.
The great Sultan Ibn-al-Kuz was very much worried about the large number
of unfaithful wives among the population of his capital city. There were
forty women who were openly deceiving their husbands, but, as often
happens although all these cases were a matter of common knowledge, the
husbands in question were ignorant of their wives’ behavior. In order to
punish the wretched women, the sultan issued a proclamation which permitted
the husbands of unfaithful wives to kill them, provided, however, that
they were quite sure of the infidelity. The proclamation did not mention
either the number or the names of the wives known to be unfaithful; it
merely stated that such cases were known in the city and suggested that
the husbands do something about it. However, to the great surprise of the
entire legislative body and the city police, no wife killings were reported
on the day of the proclamation, or on the days that followed. In fact, an
entire month passed without any result, and it seemed the deceived husbands
just did not care to save their honor.
“O Great Sultan,” said the vizier to Ibn-al-Kuz, “shouldn’t we announce the
names of the forty unfaithful wives, if the husbands are too lazy to pursue
the cases themselves?”
“No,” said the sultan. “Let us wait. My people may be lazy, but they are
certainly very intelligent and wise. I am sure action will be taken very
soon.”
And, indeed, on the fortieth day after the proclamation, action suddenly
broke out. That single night forty women were killed, and a quick check
revealed that they were the forty who were known to have been deceiving
their hus-bands.
“I do not understand it,” exclaimed the vizier. “Why did these forty
wronged husbands wait such a long time to take action, and why did they
all finally take it on the same day?”
“Very simple, my dear Watson.” The sultan chuckled. “As a matter of fact
I expected this good news exactly on that day. My people, as I suggested
before, may be too lazy to organize the shadowing of their wives for the
purpose of establishing their faithfulness or unfaithfulness, but they
have certainly shown themselves intelligent enough to resolve the case by
purely logical analysis.”
“I do not understand you, Great Sultan,” said the vizier.
“Well, assume that there were not forty unfaithful wives, but only one.
In this case, everybody with the exception of her husband knew the fact.
Her husband, however, believing in the faithfulness of his wife, and
knowing no other case of unfaithfulness (about which he would undoubtedly
have heard) was under the impression that all wives in the city, including
his own, were faithful. If he read the proclamation which stated that
there are unfaithful wives in the city, he would realize it could mean
only his own wife. Thus he would kill her the very first night.
Do you follow me?”
“I do,” said the vizier.
“Now let us assume,” continued the sultan, “that there were two deceived
husbands, let us call them Abdula and Hadjibaba. Abdula knew all the time
that Hadjibaba’s wife was deceiving himt and Hadjibaba knew the same about
Abdula’s wife. But each thought his own wife was faithful.
“On the day that the proclamation was published, Abdula said to himself,
‘Aha, tonight Hadjibaba will kill his wife.’ On the other hand, Hadjibaba
thought the same about Abdula. However, the fact that next morning both
wives were still alive proved to both Abdula and Hadjibaba that they were
wrong in believing in the faithfulness of their wives. Thus during the
second night two daggers would have found their target, and two women
would have been dead.”
“I follow you so far” said the vizier, “but how about the case of three
or more unfaithful wives?”
“Well, from now on we have what is called mathematical induction. I have
just proved to you that, if there were only two unfaithful wives in the
city, the husbands would have killed them on the second night, by force
of purely logical deduction. Now suppose that there were three wives,
Abdula’s Hadjibaba’s, and Faruk’s, who were unfaithful. Faruk knows, of
course, that Abdula’s and Hadjibaba’s wives are deceiving them, and so he
expects that these two characters will murder their wives on the second
night. But they don’t. Why? Of course because his, Faruk’s, wife is
unfaithful, tool and so in goes the dagger, or the three daggers, as a
matter of fact.”
“O Great Sultan,” exclaimed the vizier, “you have certainly opened my
eyes on that problem. Of course, if there were four unfaithful wives,
each of the four wronged husbands would reduce the case to that of three
and not kill his wife until the fourth day. And so on, and so on, up to
forty wives.”
“I am glad,” said the sultan, “that you finally understand the situation.
It is nice to have a vizier whose intelligence is so much inferior to
that of the average citizen. But what if I tell you that the reported
number of unfaithful wives was actually forty-one?”
Gamow and Stern state in a footnote that this puzzle was communicated
to them by Dr. Victor Ambarzuminian.