Teaser 3100: Crate Expectations
From The Sunday Times, 20th February 2022 [link] [link]
Pip and Estella know each other to be honest and clever. At the reading of Miss Havisham’s will they see a large crate on which are placed two envelopes addressed V+S+E and V, and a lipstick. The solicitor gives Estella the V+S+E envelope and Pip the V envelope and says, “Inside this crate Miss Havisham has left a cuboidal gold bar whose dimensions in mm are different whole numbers greater than 1, and whose volume, surface area and total edge length are V mm³, S mm² and E mm respectively. Inside your envelope, which you should now open, is the secret value of your address. Every fifteen minutes a bell will ring, and if at that point you know the other’s value, write both values on the crate with lipstick and the gold is yours”. At the first bell Pip and Estella sat still, but when the bell rang again Estella lipsticked 3177 and Pip’s value on the crate.
What was Pip’s value?
[teaser3100]
Jim Randell 4:49 pm on 18 February 2022 Permalink |
For a cuboid with dimensions x, y, z we have:
Estella knows that V+S+E = 3177, so we can find possible cuboids by looking at the decomposition of (3177 + 8) into three factors.
But Pip did not respond at the first bell, so we can discard any cuboids that give a unique V+S+E value for the corresponding V value.
I’ve added the [[
divisors_tuples()]] function from Enigma 1062 to the enigma.py library.This Python program runs in 48ms.
Run: [ @replit ]
from enigma import (Record, divisors_tuples, printf) # determine cuboid values from (x, y, z) dimensions def cuboid(x, y, z): V = x * y * z S = 2 * (x * y + x * z + y * z) E = 4 * (x + y + z) return Record(x=x, y=y, z=z, V=V, S=S, E=E, VSE=V + S + E) # determine cuboid values from volume V def from_V(V): for (x, y, z) in divisors_tuples(V, 3): if 1 < x < y < z: yield cuboid(x, y, z) # determine cuboid values from V+S+E value def from_VSE(VSE): for (x, y, z) in divisors_tuples(VSE + 8, 3): if 3 < x < y < z: yield cuboid(x - 2, y - 2, z - 2) # Estella knows V+S+E = 3177 for e in from_VSE(3177): # eliminate cuboids with volume V that have unique V+S+E values ps = set(p.VSE for p in from_V(e.V)) if len(ps) < 2: continue # output solution printf("V={e.V} [x={e.x} y={e.y} z={e.z}] ps={ps}")Solution: Pip’s value was 1815.
Given a V+S+E value of 3177, Estella knows the decomposition is one of:
Which means Pip has been given a value for V that is one of 1335, 1551, 1815.
If Pip had been given 1335, he could work out:
If he had been given 1551, he could work out:
In either of these two cases Pip would have been able to declare both values at the first bell.
He didn’t, so he must have been given 1815, which has the following decompositions:
There are multiple options, so Pip cannot declare at the first bell.
Hence, of the three options, Estella knows Pip must have been given 1815 and can declare this at the next bell.
LikeLike