Brain-Teaser 496: [Operatics]
From The Sunday Times, 29th November 1970 [link]
The soprano, the tenor, and the manager are all well aware that the five operas in the repertoire will be sung on the first five evenings of next week.
The tenor is expecting Ernani to be two nights after Don Giovanni and one night before Carmen, and he is expecting Bohème later in the week than Aida. The soprano is expecting Aida to be two nights before Ernani.
The manager, who knows all their expectations and knows the true state of affairs, tells me that for every night next week the soprano and tenor had different operas on their lists — and neither is right; he adds that the true list shows Don Giovanni two nights before Bohème.
I asked him what the tenor expected to sing on the evening booked for Aida; he told me, but I could still not be sure about next week’s true programme till he also told me what the soprano expected to sing on the evening booked for Aida. Then I knew the true programme.
What do the soprano and tenor expect on the evening of Aida?
This puzzle was originally published with no title.
[teaser496]
Jim Randell 2:29 pm on 29 August 2019 Permalink |
This Python program selects possible sets of orderings for the manager, soprano and tenor, and then uses the [[
filter_unique()]] function from the enigma.py library to reduce these to sets where knowledge of the tenor’s selection for the actual night of A is ambiguous, but the addition of the soprano’s selection gives a unique answer.This Python program runs in 90ms.
from itertools import product from enigma import (subsets, irange, filter_unique, unpack, join, printf) # the five operas operas = list("ABCDE") # record possibilities for the manager, soprano, tenor (ms, ss, ts) = (list(), list(), list()) # consider possible orders for s in subsets(irange(1, 5), size=len, select="P"): (A, B, C, D, E) = s # tenor is expecting... # E then C then D, A before B if D + 2 == E and E + 1 == C and A < B: ts.append(s) # soprano is expecting... # A two nights before E if A + 2 == E: ss.append(s) # manager knows... # D two nights before B if D + 2 == B: ms.append(s) # collect viable (m, s, t) orders rs = list() # choose a pair of orders for the soprano and tenor for (s, t) in product(ss, ts): # they must differ in every position if any(a == b for (a, b) in zip(s, t)): continue # choose an order for the manager for m in ms: # it must differ from s and t in every position if any(a == b or a == c for (a, b, c) in zip(m, s, t)): continue rs.append((m, s, t)) # indices into the orders for A, B, C, D, E (A, B, C, D, E) = (0, 1, 2, 3, 4) # knowing what the tenor expects on the day of A is not enough to determine the correct order (_, rs) = filter_unique(rs, unpack(lambda m, s, t: t.index(m[A])), unpack(lambda m, s, t: m)) # ... but knowing what the soprano expects as well is enough (rs, _) = filter_unique(rs, unpack(lambda m, s, t: (t.index(m[A]), s.index(m[A]))), unpack(lambda m, s, t: m)) # output solutions fmt = lambda x: join((n for (i, n) in sorted(zip(x, "ABCDE"))), sep=" ") for (m, s, t) in rs: printf("m = {m}; s = {s}; t = {t}", m=fmt(m), s=fmt(s), t=fmt(t))Solution: On the night of Aida, the soprano is expecting Bohème, and the tenor is expecting Ernani.
The complete orders are:
Before the setter has asked any questions there is enough information that he can narrow the correct order down to one of four options.
The setter asks the manager what the tenor expects to sing on the night booked for A. This is the 4th night, and so will get the answer E.
This allows the setter to narrow the correct order down to one of two options.
On also being told that the soprano expects to sing B on that night, only one of those options remains, giving the solution.
LikeLike
Pete Good 9:43 am on 13 August 2023 Permalink |
Jim,
I think that this teaser has two solutions. I found 10 sets of three schedules that appear to meet the constraints and not just 4 sets:-
C E D A B , A D B E C, B C A D E
E A D C B, A D B E C, C B A D E
C E D A B, A D B E C, D B A C E
C E D A B, A D B E C, D C A B E
E D C B A, D A E C B, B C A D E
E A D C B, A D B E C, B C A D E
E C D A B, A D B E C, C B A D E
E C D A B, A D B E C, D B A C E
E A D C B, A D B E C, D C A B E
E D C B A, D A E C B, C B A D E
On the evening of Aida, the tenor and soprano are expecting ED, DB, EC, EB, BE, DC, ED, EC, DC or BE. There are two sets of schedules containing ED, EC, BE and DC so these can be discounted but DB and EB are both unique so it appears that there are solutions.
Have I overlooked something?
LikeLike
Jim Randell 11:31 am on 13 August 2023 Permalink |
@Pete: You have found the right list of 10 possibilities.
We are told that if we knew what the tenor was expecting on the day that A is actually to be performed, then that would not be enough to determine the correct order.
Looking at the list, the tenor is expecting one of B, D, E to be performed on the day of A.
Looking at the corresponding correct orders:
The first 2 lead to a unique correct ordering, so we eliminate those cases and we are left with the 5 possibilities (where the tenor expects E to be performed on the day of A).
From those 5 possibilities we look at what the soprano is expecting on the day of A.
It is one of: B, C, D.
Looking at the corresponding correct orders:
So only B will allow us to determine the correct ordering.
Hence the soprano expects B, and the tenor expects E. And the correct ordering is (C E D A B).
LikeLike
Pete Good 11:55 am on 13 August 2023 Permalink |
Thank you for explaining this.
LikeLike