Brain-Teaser 259: [Musical tastes]
From The Sunday Times, 17th April 1966 [link]
A survey of the musical tastes of 100 boys showed that the most popular group was one known as the Jonahs, three girls by the names of Jane, Jean and June.
58 were fans of Jane, 45 fans of Jean, and 42 fans of June. Jane and Jean had 27 fans in common; Jane and June, 28; Jean and June 19; and 18 were fans of all three.
How many of the boys were not fans of the group?
This puzzle was originally published with no title.
[teaser259]
Jim Randell 11:30 am on 2 March 2023 Permalink |
We can label the 8 areas of the corresponding Venn diagram according to who likes who:
and we have:
These equations are easily solved manually to give:
Solution: 11 of the boys were not fans of any member of the group.
Here is a program using the [[
Matrix()]] class from the enigma.py library.Run: [ @replit ]
from enigma import (Matrix, as_int, printf) # construct the equations eq = Matrix.equation("abcdefgx") eqs = [ eq("abcdefgx", 100), eq("adgf", 58), eq("bedg", 45), eq("cefg", 42), eq("dg", 27), eq("gf", 28), eq("eg", 19), eq("g", 18), ] # solve the equations (a, b, c, d, e, f, g, x) = Matrix.linear(eqs, valid=(lambda n: as_int(n, "0+"))) # output the solution printf("x={x} [a={a} b={b} c={c} d={d} e={e} f={f} g={g}]")LikeLike