Brainteaser 1816: Polls apart
From The Sunday Times, 6th July 1997 [link]
A TV station has commissioned a survey of a small sample of its viewers. One quarter said they watched boxing, one third said they watched tennis, and one half said they watched football. All watched at least one sport. When analysed, the results showed that the number of those questioned who watched just one of the sports equalled the square of the number watching all three. The TV people were unconvinced and asked for a second poll with the number of people questioned increased by 50%. Surprisingly, all that was said above about the first poll was still true for the second.
How many people were questioned in the first poll?
[teaser1816]
Jim Randell 5:46 pm on 2 November 2021 Permalink |
See also: Brain-Teaser 25.
If the total number of participants is N, and the 7 regions of the Venn Diagram are: B, T, F, BT, BF, TF, BTF, then we have:
Summing the middle three, and then replacing (B + T + F) using the last equation:
And from the first equation:
equating these:
So for a given value of BTF we can calculate the corresponding value for N.
This Python program considers increasing (BTF, N) values, and looks for an example viable arrangement by calculating values for the remaining areas of the Venn diagram. When it finds an N value that is 50% more than a previously determined value it stops.
It runs in 54ms.
Run: [ @replit ]
from enigma import (irange, inf, div, decompose, sq, Matrix, as_int, printf) # generate viable configurations def solve(): # consider values for the number that watch all 3 sports for BTF in irange(2, inf): # calculate N N = div(12 * BTF * (BTF - 1), 11) if N is None: continue BTF2 = sq(BTF) if BTF + BTF2 > N: continue # choose values for BT, BF, TF for (BT, BF, TF) in decompose(N - BTF - BTF2, 3, increasing=0, sep=0, min_v=0): # determine the remaining variables eqs = [ # B T F BT BF TF BTF = k ((1, 1, 1, 1, 1, 1, 1), N), # B + T + F + BT + BF + TF + BTF = N ((4, 0, 0, 4, 4, 0, 4), N), # B + BT + BF + BTF = N/4 ((0, 3, 0, 3, 0, 3, 3), N), # T + BT + TF + BTF = N/3 ((0, 0, 2, 0, 2, 2, 2), N), # F + BF + TF + BFT = N/2 ((1, 1, 1, 0, 0, 0, 0), BTF2), # B + T + F = BTF^2 ((0, 0, 0, 0, 0, 0, 1), BTF), # BTF ((0, 0, 0, 1, 0, 0, 0), BT), # BT ((0, 0, 0, 0, 1, 0, 0), BF), # BF ((0, 0, 0, 0, 0, 1, 0), TF), # TF ] try: (B, T, F, BT, BF, TF, BTF) = Matrix.linear(eqs, valid=(lambda x: as_int(x, "0+"))) except ValueError: continue yield (N, B, T, F, BT, BF, TF, BTF) break # only need one example for any N # record results by N seen = set() for (N, B, T, F, BT, BF, TF, BTF) in solve(): N_ = 2 * N // 3 printf("N={N}; B={B} T={T} F={F} BT={BT} BF={BF} TF={TF} BTF={BTF} [(2/3)N={N_}]") if N_ in seen: break seen.add(N)Solution: The number of participants in the first poll was 2160.
And there were 3240 in the second poll.
Here are example arrangements:
(There are many possibilities for (BT, BF, TF), but for each (N, BTF) pair they sum to the same value).
There are many possible arrangements that satisfy the conditions, but there are fewer that have an N value that is 1.5× a smaller N value.
The program stops when it finds the first solution, but there are further solutions, although they don’t really qualify as “a small sample”:
LikeLike
Hugh Casement 6:30 pm on 2 November 2021 Permalink |
BTF must be a multiple of 11, or 1 more than that, for N to be an integer.
For any BTF, N pair there are many possible values for BT, BF, and TF.
But the sum of those three is determined, as shown in the third grey block of Jim’s analysis,
and it also equals N/12 – 2BTF.
It turns out to be negative is BTF is too small.
LikeLike
GeoffR 8:02 pm on 2 November 2021 Permalink |
It is easy just to use Jim’s five basic equations in a MiniZinc solution as constraints, although fixing the ranges of variables was not easy to pre-determine.
The programme took under 2 sec to find the answer, but nearly 2 minutes to exhaust all the subsequent searching with the Chuffed Solver.
LikeLike