From The Sunday Times, 25th December 1949 [link]
Many readers will recall the problem of constructing the integers each by means of four fours, with the usual mathematical signs. For example:
17 = (4×4) + 4/4
71 = (4! + 4.4)/.4
Competitors are invited to submit a continuous series of integers so constructed, beginning with 1 and proceeding, without gaps, as far as possible.
A follow-up was posted on 1st January 1950, to elaborate on the allowed constructions (although it is not as explicit as it could have been): [link]
The problem set was that of constructing a continuous series of integers each by means of four fours, “with the usual mathematical signs”. Several readers have asked for a closer definition of the phrase quoted.
It covers all signs (not themselves letters or numbers other than 4) which “every schoolboy knows”. It therefore includes: addition, subtraction, multiplication and division signs, square roots (and fourth roots), fourth powers, factorial signs, decimal points and recurring points, and combinations of these. It does not include gamma functions, logs or anti-logs, permutations or combinations, or trigonometrical functions. Nor does it include (as some hopeful readers have permitted themselves to believe) the use of square brackets to indicate “the integral part of”.
This one of the occasional Holiday Brain Teasers published in The Sunday Times prior to the start of numbered Teasers in 1961. A prize of 5 guineas was offered for the longest list.
[teaser-1949-12-25] [teaser-unnumbered]
Jim Randell 8:57 am on 17 February 2022 Permalink |
We assume that each of the students speaks at least one language (otherwise we can find many solutions), then we can represent the 7 internal areas of the Venn diagram: F, G, R, FG, FR, GR, FGR.
So we have:
And the additional conditions give 5 more equations.
But together these only give 6 equations in the 7 variables, so we need to choose a value for one of the regions to make a complete set of equations. The value for FGR region needs to be divisible by 2, so we can use that.
The following Python program runs in 54ms.
Run: [ @replit ]
from enigma import (Matrix, as_int, irange, printf) # the given equations (incomplete) eqs = [ # F G R FG FR GR FGR = k (( 1, 1, 1, 1, 1, 1, 1), 64), # 64 students in total ((-1, 0, 3, -1, 2, 3, 2), 0), # total F = 3(total R) (( 0, -1, 2, -1, 2, 1, 1), 0), # total G = 2(total R) (( 0, 0, 0, -1, -1, 0, 4), 0), # FGR = (1/5)(FG + FR + FGR) (( 0, 0, 0, -2, 0, -2, 7), 0), # FGR = (2/9)(FG + GR + FGR) (( 0, 0, 0, 0, -2, -2, 3), 0), # FGR = (2/5)(FR + GR + FGR) ] # choose a value for FGR for FGR in irange(0, 64, step=2): # make an additional equation for FGR # F G R FG FR GR FGR = k eq = ((0, 0, 0, 0, 0, 0, 1), FGR) # solve the equations for non-negative integers try: vs = tuple(as_int(x, "0+") for x in Matrix.linear(eqs + [eq])) except ValueError: continue (F, G, R, FG, FR, GR, FGR) = vs # there must be at least 1 speaker of each language if R + FR + GR + FGR == 0: continue # output solution printf("F={F} G={G} R={R} FG={FG} FR={FR} GR={GR} FGR={FGR}")Solution: 25 of the students speak only French.
There is only one possible arrangement (subject to the assumption above):
We can manually simplify the equations:
So given an even value for FGR = 2k, we can calculate the values for the other regions:
Run: [ @replit ]
from enigma import (irange, div, printf) # total number of students N = 64 # choose a value for FGR = 2k for k in irange(0, N // 2): n = N - 17 * k if n < 0: break R = div(n, 6) if R is None: continue # determine the other values FR = FGR = 2 * k GR = k FG = 3 * FGR F = 3 * R + 5 * k G = 2 * R + k # output solution printf("F={F} G={G} R={R} FG={FG} FR={FR} GR={GR} FGR={FGR}")If we do the steps manually we find we only need to check k = 0, 1, 2, 3, and only k = 2 gives viable values.
LikeLike
GeoffR 11:45 am on 17 February 2022 Permalink |
LikeLike
Jim Randell 4:24 pm on 17 February 2022 Permalink |
Although we are not told that each of the 7 subsets is non-empty (but we do know that there must be at least one student that speaks each of the languages).
LikeLike
GeoffR 3:56 pm on 18 February 2022 Permalink |
Although the Solve Function is often used in Mathematica for solving sets of simultaneous equations, it did not work in this instance. It turns out that the FindInstance Function (ref Brian) was suitable. and can sometimes be used as an alternative solver in Mathematica.
FindInstance[{ F + G + R + FG + FR + GR + FGR == 64, F + FG + FR + FGR == 3 (R + FR + GR + FGR), G + FG + GR + FGR == 2 (R + FR + GR + FGR), 5 FGR == FG + FR + FGR, 9 FGR == 2 (FG + GR + FGR), 5 FGR == 2 (FR + GR + FGR), F + FG + FR + FGR > 0, G + FG + GR + FGR > 0, R + FR + GR + FGR > 0}, {F, R, G, FG, FR, GR, FGR}, Integers ] {{F -> 25, R -> 5, G -> 12, FG -> 12, FR -> 4, GR -> 2, FGR -> 4}}LikeLike