Brain-Teaser 914: Advancing numeracy
From The Sunday Times, 27th January 1980 [link]
My mathematics class is much more reliable than formerly. I can now be certain that each pupil will always follow a completely true statement by a false one, and vice versa.
It is clear that some difficulties still arise, but when I asked three of them to select one five-figure number between them, and to make two statements each about it, it was possible to deduce the number they had in mind.
They used a, b, c, d and e to indicate the positions of the successive digits, which were not necessarily all different.
Anne said:
1. The sum of the number and 969 Is divisible by 714.
2. The sum of c and e is one third of the sum of the five
digits.Bill said:
1. The sum of the number and 798 is divisible by 693.
2. The sum of the number and 987 is divisible by 658.Carol said:
1. The sum of b and d equals three times the first digit.
2. The sum of the number and 988 is divisible by 741.What was the number?
This puzzle is included in the book The Sunday Times Book of Brainteasers (1994). The puzzle text above is taken from the book.
[teaser914]
Jim Randell 9:02 am on 2 November 2021 Permalink |
This Python program runs in 60ms.
Run: [ @replit ]
from enigma import irange, nsplit, printf # consider the 5-digit number for n in irange(10000, 99999): # consider Bill's statements (can't both have the same truth value) if ((n + 798) % 693 == 0) == ((n + 987) % 658 == 0): continue # and Anne's (a, b, c, d, e) = nsplit(n) if ((n + 969) % 714 == 0) == (3 * (c + e) == a + b + c + d + e): continue # and Carol's if (b + d == 3 * a) == ((n + 988) % 741 == 0): continue printf("{n}")Solution: The number was: 32571.
Anne’s statements are: False, True.
Bill’s statements are: False, True.
Carol’s statements are: True, False.
LikeLiked by 1 person
Jim Randell 10:27 am on 3 November 2021 Permalink |
Or, checking fewer candidates:
from enigma import irange, nsplit, printf # exactly one of Bill's statements must be true b1 = set(irange(10290, 99999, step=693)) b2 = set(irange(10199, 99999, step=658)) for n in b1.symmetric_difference(b2): (a, b, c, d, e) = nsplit(n) if ( # Anne ((n + 969) % 714 == 0) != (3 * (c + e) == a + b + c + d + e) and # Carol (b + d == 3 * a) != ((n + 988) % 741 == 0) ): printf("{n}")LikeLike
GeoffR 8:52 am on 13 January 2022 Permalink |
LikeLike
Jim Randell 12:51 pm on 13 January 2022 Permalink |
@GeoffR: This model checks that at least one of the two statements for A, B, C is true. Rather than exactly one.
But changing
\/toxor(or!=) will do the job.LikeLike
GeoffR 2:31 pm on 13 January 2022 Permalink |
@ Jim: Ok, I see what you mean. This programme confirms it gets the same answer.
LikeLike