Skip to content

Sunday Times Teaser 3069 – Fit for Purpose

by Brian Gladman on July 17, 2021

by Peter Good

Published Sunday July 18 2021 (link)

George and Martha bought a new toy for their son Clark. It consisted of a rectangular plastic tray with dimensions 15x16cm and eight plastic rectangles with dimensions 1x2cm, 2x3cm, 3x4cm, 4x5cm, 5x6cm, 6x7cm, 7x8cm and 8x9cm. The rectangles had to be placed inside the tray without any gaps or overlaps. Clark found every possible solution and he noticed that the number of different solutions which could not be rotated or reflected to look like any of the others was the same as his age in years.

How old was Clark?

From → Uncategorized

5 Comments Leave one →
  1. Brian Gladman permalink

    This solution makes use of jigsaw.py, a series of routines to assist in rectangle packing.

    • Frits permalink

      @Brian, is the link to jigsaw.py up-to-date?

      ImportError: cannot import name ‘create_rpiece’

      • Brian Gladman permalink

        Hi Frits, My apologies for the outdated version – updated now.

    • Frits permalink

      @Brian, I rewrote the Walrus operator code in jigsaw.py to confirm that PyPy is faster for this program than Python 3.9.4. I hope the next PyPy release will be based on Python 3.8.

      • Brian Gladman permalink

        jigsaw.py is really overkill for this teaser but it works well enough. As you say
        PyPy does a lot better than CPython, more than twice the speed for me. I hope
        I’m wrong but I don’t think we will see PyPy moving to 3.8 anytime soon.

Leave a Reply

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

Subscribe to this comment feed via RSS