It would not be wise to bet someone that they cannot do something.

Either thay can or they are unlikely to honour the bet.

Clearly you do not need to be certain there there is only one solution.

You might or might not want to.

being only one solution? Yes. Would I bet £1,000,000? Not without producing

an analytical solution.

But do I need to be confident that there is only one solution?

Teasers are designed to have only one solution and this means that the only

risk I take in delivering the first solution is that I will have failed to

solve a flawed teaser. And I can live with that! (I did, of course, check

for other solutions).

How can you be sure there is only one solution?

]]>
1 2 3 4 5 6 7 8 |
from itertools import combinations # children are adults at age 18 for A, B, C, D in combinations(range(1, 18), 4): T = A**2 + B**2 + C**2 + D**2 if all((100 * (2 * k - 1) % T == 0) for k in (A, B, C, D)): print(f"Grandchildren's ages: {A}, {B}, {C}, {D}") |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from itertools import combinations, count # A grandchild of age N receives 2.N - 1 shares on their # birthday and hence a lifetime total of N^2 shares # consider the age of the eldest grandchild for a_max in count(4): # consider the ages of the other three grandchildre for a3 in combinations(range(1, a_max), 3): a4 = a3 + (a_max,) # the lifetime total for all four grandchildren ls_sum = sum(x * x for x in a4) # the amounts given to each grandchild on their birthday as a # percentage of the total shares given to all grandchildren # are all integers if all((200 * n - 100) % ls_sum == 0 for n in a4): f, s, l = ', '.join(f"{x}" for x in a4).rpartition(', ') print(f"Their ages are {' and '.join((f, l))}.") exit() |

In the light of the discussion below, I have added this analysis.

If the age of the oldest grandchild is \(m\), their percentage \(p_{max}\) of the total number of shares given to the grandchildren must satisfy:\[p_{max}<=\frac{100(2m-1)}{m^2+14}\] Since the percentages for the four grandchildren are all different, this percentage must be at least 4% which leads to the equations \[4m^2+56<=100(2m-1)\] \[(m-25)^2<=586\]which show that \(m<=25\pm\sqrt{586}\). Hence we find that \(m<50\).

]]>