Skip to content

Sunday Times Teaser 3161 – Going Through the Hoops

by BRG on April 22, 2023

Colin Vout

Published Sunday April 23 2023 (link)

I arrived very late to watch the croquet game. Someone had listed the times when the four balls (blue, black, red and yellow) had run through hoops 1 to 12; none had yet hit the central peg to finish. Blue had run each hoop earlier than black, and every hoop had been run by colours in a different order. The only change in running order from one hoop to the next-numbered hoop was that two colours swapped positions. These swapping pairs (to obtain the order for the next-numbered hoop) were in non-adjacent positions for hoops 5 and 10, but no others. For one particular colour, all the hoops where it passed through earlier than the yellow were before all those where it passed through later than the yellow.

In what order had the balls run the twelfth hoop?

From → Uncategorized

9 Comments Leave one →
  1. BRG permalink

    • Frits permalink

      @Brian, nice solution.

      Can you elaborate on the benefits of the new WordPress site?

      The only change I see is a new font for the Python code. I hoped with every comment we could see a creation timestamp.

      • BRG permalink

        HI Frits,

        It was intended to be a cost reduction but it was a disaster since the promised
        site migration didn’t work. So I am now back to my old host. I had to do some
        recovery work and this meant that my Python formatting plug-in has changed. I
        can set the font but I left it on default – is it better or worse? EDIT: I put
        it back to the old font.

  2. JohnZ permalink

    The teaser is ambiguous about which hoop to hoop transitions have non adjacent swaps. A single solution is reached for transitions from 5 to 6 and 10 to 11.

  3. John Z permalink

    Line 26 can be written more efficiently as:

  4. John Z permalink

    A more compact version of my first post

  5. John Z permalink

    My definitive version:
    Variables byt, ayt and cc could be made ‘global’ in hp (if cc is removed from the argument list and from the ‘yield’) which would result in improved run time but would this be considered good style?

  6. John Z permalink

    Never say never; tighter still

Leave a Reply

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

Subscribe to this comment feed via RSS