From The Sunday Times, 14th July 1991 [link]

The “tangram” is an ancient Chinese puzzle. It consists of seven pieces which can be formed into a square (as shown) and into many other artistic shapes.
The middle-sized triangle, the square and the parallelogram are all twice the area of the smaller triangles, and half the area of the larger ones. All the angles are 45, 90 or 135 degrees. And in my version the lengths of the shorter sides of the largest triangles are 7 cm.
I have a thin rectangular sheet of card 70 cm by 91 cm from which I wish to cut as many such sets of tangrams as possible with the minimum amount of wastage.
How many complete sets can I make?
The text of this puzzle is taken from the book Brainteasers (2002), so may differ from the puzzle originally published in the newspaper.
[teaser1505]
Jim Randell 8:56 am on 20 May 2021 Permalink |
We can get a solution using the [[
SubstitutedExpression]] solver from the enigma.py library.This run file executes in 421ms.
Solution: SUNDAY = 816270.
For a faster solution we can use the (experimental) [[
SubstitutedExpression.split_sum()]] solver.The following Python program runs in 58ms.
Run: [ @replit ]
from enigma import SubstitutedExpression, printf # solve the sum <expr> def check(expr, *extra): p = SubstitutedExpression.split_sum(expr, extra=extra, answer="SUNDAY").solver() for (s, ans) in p.solve(verbose=0): printf("SUNDAY = {ans} [{expr} / {s}]", s=p.substitute(s, expr)) # check the two possibilities check('EASTER + SUNDAY = TEASER', 'E < S') check('EASTER + TEASER = SUNDAY', 'E < T')There is only one possible solution even without the information that EASTER is the lowest number. So the [[
E < S]] and [[E < T]] clauses could be removed.LikeLike
GeoffR 9:58 am on 31 May 2021 Permalink |
LikeLike