Brain-Teaser 485: Delphic oracle
From The Sunday Times, 13th September 1970 [link]
Delphi has three computers, in order to confuse the faithful. The 1969 one always gives a true answer; the 1960 one always gives an untrue answer; the 1965 is quite unpredictable.
Professor Binary, who is visiting the shrine, fed to each computer in turn the question: “What is the date of the largest computer?”
The first computer replied “1969”; the second replied “Not 1960”; and Binary, who could see the size, though not the date, of the computers as they replied, had no need to study the third computer’s reply, since he now knew the answer to his question.
What is the date of the largest computer?
This puzzle is included in the book Sunday Times Brain Teasers (1974).
[teaser485]
Jim Randell 8:28 am on 9 July 2019 Permalink |
This Python program runs in 81ms.
Run: [ @replit ]
from enigma import (subsets, printf) # the behaviours of the computers def F(s): return (not s) def U(s): return True def T(s): return bool(s) # the professor asks two of the computers (identified by size) for (a, b) in subsets((0, 1, 2), size=2): # record largest computers in scenarios that work rs = set() # consider all possible size orders (L, M, S) for size in subsets((F, U, T), size=3, select='P'): (L, A, B) = (size[0], size[a], size[b]) # first computer states "1969 (T) is largest" if not A(L == T): continue # second computer states "1960 (F) is not largest" if not B(L != F): continue rs.add(L) # look for unique solutions if len(rs) == 1: L = rs.pop() printf("L={L.__name__} [a={a} b={b}]")Solution: The largest computer is from 1965.
So the largest computer, from 1965, is unreliable.
The medium sized computer is from 1960, and always makes false statements.
The smallest computer is from 1969, and always makes true statements.
The Professor asks his first question to the medium sized computer, and his second question to the smallest computer.
We can verify manually that this does indeed give a solution.
First we refer to the computers by their behaviour, instead of their year. So:
The Professor asks the firsts question (“which computer is largest”) to M (the medium sized computer), and gets an answer of “T”, and he then asks the same question to S (the smallest computer), and gets an answer of “not F”.
There are six possible orders of computer (Largest, Medium, Smallest):
So there is only one possible situation, and so the Professor can determine that: L=U=1965 (and also: M=F=1960, S=T=1969).
Asking the question to M and S is the only situation where a single largest computer is identified, so this is the only solution.
LikeLike