Sunday Times Teaser 3194 – A Proper Lesson
by Peter Good
Published Friday December 08 2023 (link)
A maths teacher wrote a sequential list of numbers 1, 2, 3, 4, … on the blackboard and asked her pupils to find a pair of positive fractions adding up to 1. The pair was to have the two numerators and two denominators consisting of four different numbers from her list. They found all possible pairs.
She then told them to group two of the pairs that used eight different numbers from her list, which was just long enough to enable them to do this. The class found all possible groups. One of the groups contained some fractions that were not used by any other group.
Which of the teacher’s numbers were not used by that group?
7 Comments
Leave one →
Distilled down to the essentials with more complete printout
The ‘exit()’ in line 35 can be replaced by ‘break’ and line 3 can be deleted as the ‘import’ is no longer required, further simplifying the code.
Hi John, I liked your use of a conditional within a print statement to prevent printing ( I adopted it when simplifying my reposted code above). The multiple replace statements are innovative but a bit too difficult to ‘decode’ for my liking!
With more staightforward print formatting inspired by your ‘fout’ function, Brian. Plus afew more tweaks
The definitive version after clean-up to avoid using indexing