Teaser 1973: Straw store
From The Sunday Times, 9th July 2000 [link]
Farmer Fermat has more straw than he can safely stack on his usual rectangular storage area. So he extends the shorter sides of the area to equal the longer sides, thereby forming a square. Alongside he adds another square area, whose side is equal to the shorter side of the original rectangle. The total area of the two squares together is 243 square feet larger than the original rectangle.
He can now stack straw on each square, up to a height equal to the length of the side of each square, effectively forming two cubes, and the total volume in cubic feet is a perfect cube.
What was the perimeter of the original rectangle?
[teaser1973]
Jim Randell 7:50 am on 17 September 2019 Permalink |
As presented this puzzle has multiple solutions. However if the perimeter of the original rectangle is required to be a whole number of feet, then only one of the solutions remains.
This Python program finds all the solutions to the puzzle numerically using the [[
find_zero()]] function from the enigma.py library. It runs in 63ms.Run: [ @replit ]
from enigma import (irange, cb, cbrt, sq, find_zero, catch, printf) # consider values for t, where T = t^3 is the total volume for t in irange(1, 100): T = cb(t) # calculate y (for x in [0, t]) def Y(x): return cbrt(T - cb(x)) # how close is x^2 + y^2 - xy to 243? def f(x): y = Y(x) return abs((sq(x) + sq(y) - x * y) - 243) # find a zero for f r = catch(find_zero, f, 0, cbrt(0.5 * T)) if r is None: continue x = r.v y = Y(x) p = 2 * (x + y) # output solution printf("t={t}: x={x:.3f}, y={y:.3f}, p={p:.3f}")Solution: The (integer) perimeter of the original rectangle was 48 feet.
Allowing non-integer solutions for the perimeter we get four solutions:
Graphically we get a solution when the ellipse x² + y² − xy = 243 intersects the curve x³ + y³ = t³ for integer values of t.
For positive x and y we get solutions for t = 16, 17, 18, 19, as shown in the graph below:
The original rectangle has sides of length x and y, so the perimeter of the original rectangle is 2(x + y). Only t=18 gives an integer value for the perimeter (although the values for x and y are not integers). In this case the exact values are: x, y = 12 ± √33.
LikeLike
Jim Randell 8:39 am on 19 September 2019 Permalink |
Here is an analytical solution.
Given the equations:
If we consider the product (x + y)(x² + y² − xy) we have:
We also have:
So for a given value of t we can determine values for x + y and xy, say:
These have positive real solutions for x and y when a² ≥ 4b and b ≥ 0
So t is in the range 16 to 19. And the required perimeter is given by p = 2(x + y) = 2t³ / 243.
We can consider the 4 candidate values manually and look for an integer solution, or use a short program:
Run: [ @replit ]
from enigma import (irange, cb, div, printf) for t in irange(16, 19): p = div(2 * cb(t), 243) if p is None: continue printf("t={t}: p={p}")LikeLike