Enigma 91: Hidden gifts
From New Scientist #1235, 8th January 1981 [link]
“Beauty? Courage? Generosity? Patience? Wisdom? Which do you wish for the new-born Princess?” asked the Good Fairy.
“Beauty and Wisdom will do nicely, thank you,” replied the King, not wanting to seem greedy.
“Wait! For each gift you name, I shall bestow on her two of the other gifts instead. Each name of a gift triggers a different pair. Each gift is triggered by two of the names. But if you mention both names, they cancel out and she will not get that gift at all.”
“Coo, shiver my sceptre!” exclaimed His Majesty.
“Quite simple! For instance if you ask for Beauty and Courage, she will receive Generosity and Patience. If you ask for Beauty, Generosity and Patience, she will receive those three and Wisdom too. You in fact wished for Beauty and Wisdom. She shall have them, provided you ask for them in the simplest way.”
What gift or gifts should His Majesty ask for?
If we take it that the result is to end up with only Beauty and Wisdom then there is a unique simplest way to ask for these (if by simplest we mean asking for the fewest number of gifts), and so this is probably what is intended.
This Python program finds these solutions in 62ms.
Solution: The King should ask for Beauty and Wisdom.
There are two possible mappings of “asked for” gifts to “bestowed” gifts:
In each of these cases asking for B+W gives (exactly) B+W:
However, by relaxing the constraint that the Beauty and Wisdom should be the only gifts received, there are several other answers, asking for an equally short number of gifts, whereby the Princess could receive Beauty, Wisdom and an additional two gifts. Although in this case there is no unique solution.
The possible mappings are the same, but we can receive B+W (along with extra gifts) by asking for the following:
However, in both cases asking for Courage and Wisdom will bestow Beauty and Wisdom along with Generosity and Patience, so this might be a better solution to the puzzle.