Brain-Teaser 506: [The sword of Nyarlathotep]
From The Sunday Times, 21st February 1971 [link]
Students of the “Necronomicon” will be pleased to learn that sheet 73-74, missing from the copy at Miskatonic University, has come to light in the manuscript recently bought by the British Museum. On it the mad Arab, Abdul al Hazrad, has written:
“Cthulhu na fa’t’agn!
To fashion the sword of Nyarlathotep, take of fair metals for the hilt and the guard and the blade, enough.
The hilt shall be copper, unless the guard be silver in which case the blade shall be copper unless the hilt is gold.
The guard shall be copper unless the blade be gold in which case the guard shall be silver unless the hilt is silver.
The blade shall be gold unless the guard be gold in which case the blade shall be silver unless the hilt is copper.
Fashion then the sword of Nyarlathotep.”
Thus: Hilt = ?, Guard = ?, Blade = ?
This puzzle was originally published with no title.
[teaser506]
Jim Randell 3:24 pm on 24 October 2019 Permalink |
The conditions are expressed in a similar manner, so once the pattern of the text is determined it is easy to express the constraints.
This Python program examines all the possibilities for the construction. It runs in 81ms.
from enigma import (subsets, printf) # test: "A unless X (in which case B)" test = lambda X, A, B=True: (B if X else A) # available metals metals = (Cu, Ag, Au) = ("Cu", "Ag", "Au") # choose metals for the Blade, Hilt, Guard for (B, H, G) in subsets(metals, size=3, select="M"): # "the hilt shall be copper, unless the guard be silver in which # case the blade shall be copper unless the hilt is gold" if not test(G == Ag, H == Cu, test(H == Au, B == Cu)): continue # "the guard shall be copper unless the blade be gold in which # case the guard shall be silver unless the hilt is silver" if not test(B == Au, G == Cu, test(H == Ag, G == Ag)): continue # "the blade shall be gold unless the guard be gold in which case # the blade shall be silver unless the hilt is copper" if not test(G == Au, B == Au, test(H == Cu, B == Ag)): continue # output solution printf("B={B} H={H} G={G}")Solution: The blade is gold. The hilt is gold. The guard is silver.
LikeLike
John Crabtree 4:28 am on 27 October 2019 Permalink |
“unless” means that one condition or the other is true, but not both.
Statements 2 and 3 give that the blade must be gold.
Statement 2 simplifies to the the guard shall be silver unless the hilt is silver.
The statements 1 and 2 give that the guard must be silver and the blade must be gold
LikeLike
John Crabtree 4:04 pm on 6 November 2019 Permalink |
An expanded and slightly corrected solution:
“Unless” means one or the other, but not both.
Putting statements 2 and 3 into Boolean form, where “.” means “AND”, “~” means “NOT”, and “+” means “OR”
Statement 2. ~Bg.Gc + Bg.Gs.~Hs + Bg.~Gc.~Gs.Hs = 1
Statement 3. Bg.~Gg + ~Bg.Bs.Gg.~Hc + ~Bg.~Bs.Gg.Hc = 1
Multiplying the two and removing terms which are impossible gives
Bg.Gs.~Hs = 1
And so the blade is gold and the guard is silver.
Statement 1. ~Gs.Hc + Gs.Bc.~Hc.~Hg + Gs.~Bc.Hg = Gs.~Bc.Hg = Hg = 1
And so the hilt is gold.
LikeLike