Skip to content

Sunday Times Teaser 3192 – In Formation Technology

by BRG on November 24, 2023

Football formations are generally described by three or four nonzero whole numbers summing to 10 (the goalkeeper isn’t counted), representing, from defence to attack, the number of players in approximate lines across the pitch.

Last season we played a different formation every week, always using four lines, each with at most four players; the difference between one week and the next was that from one line two players moved, one to an adjacent line and the other to the line beyond that (eg, 3-4-1-2 could only be followed by 3-2-2-3). Our number of fixtures was the largest it could have been, given these conditions. The first number in our formations was more often 3 than any other number; 3-1-3-3 gave us our worst result.

How many games did we play, and what were our first three formations?

From → Uncategorized

7 Comments Leave one →
  1. BRG permalink

  2. JohnZ permalink

    Somewhat short on comments, primitive printout, but it works.

  3. John Z permalink

    The recursive functon, ‘chain’, above generates a lot of ‘chaff’. The ‘seasons’ list has 1752 entries. As an analogy, let’s say it yielded (1, 2, 3, 4, 5). It would follow that up with:
    (1, 2, 3, 4)
    (1, 2, 3)
    (1, 2)
    (1)

    By adding a few additional lines the function is more efficient, generating a ‘seasons’ list with only 843 entries. But it’s much less elegant:

  4. John Z permalink

    Definitive version

  5. John Z permalink

    lines 39, 40, 41 which count what “The first number in our formations was” can be replaced by:

    squeezing the code down a bit further.

    • John Z permalink

      or similarly:

      • John Z permalink

        Yes, it reduces the line count and looks elegant but is computationally inefficient as the ‘zip’ is executed in every iteration of the ‘for’ loop, in this case five times.
        A more efficient alternative is:

Leave a Reply

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

Subscribe to this comment feed via RSS