Skip to content

Sunday Times Teaser 3194 – A Proper Lesson

by BRG on December 8, 2023

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?

From → Uncategorized

7 Comments Leave one →
  1. BRG permalink

  2. John Z permalink

  3. John Z permalink

    Distilled down to the essentials with more complete printout

  4. John Z permalink

    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.

    • BRG permalink

      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!

  5. John Z permalink

    With more staightforward print formatting inspired by your ‘fout’ function, Brian. Plus afew more tweaks

  6. John Z permalink

    The definitive version after clean-up to avoid using indexing

Leave a Reply

Note: HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS