# Scoring a grid​

As a professor of Awesomeness at the prestigious Ad Hoc University, I decided to assign my students this puzzle. Unfortunately, they were all unable to get it! I want to post it here to see if any puzzlers can get it.

Here we go:

Suppose I've defined an operation that takes in a 5x5 grid of booleans (or 1s and 0s) and outputs a number which represents its score. Here are some examples:

= 5 + 7 = 12

= 3 + 6 = 9

= 3 + 0 = 3

= $$\infty$$

= 6 + 4 = 10

= $$\infty$$

Your job is to tell me how I score my grids!

Note: all the information of the puzzle is in the blockquote; nothing outside the blockquote is relevant!

• cab the infinity be written as sum of 2 of which one is apporaching infinity ,?? – Aakash Mathur Aug 17 at 13:54
• @AakashMathur -- Assume that the $\infty$ is the first number and the second number that is added to it is... uncertain. That is, the second number can be one of multiple things, so I decided not to list it and just call it $\infty$. – Voldemort's Wrath Aug 17 at 13:56
• Can we expect the puzzle to be solvable ignoring the actual images in the blockquote, and using JUST the 25 bits of information that are encoded into them in the most obvious way? (I'm assuming so, because no steganography) – Steve Aug 17 at 14:13
• (: what is that you are saying obvious – Aakash Mathur Aug 17 at 14:20
• @Steve -- Yeah, and you know that already 'cuz you posted your answer. :):) – Voldemort's Wrath Aug 17 at 16:42

Running them on a 5x5 Game of Life!

The score is calculated from two pieces:

The time until the pattern becomes stable, plus the number of cells alive at the end

• This is a really nice observation and may very well be strongly connected to the answer :) However, how do you define 'time' here? When I use the link you provided, the fourth grid in particular takes a LOT of iterations to do what you say... – Stiv Aug 17 at 14:40
• Time = iterations. Are you testing on a 5x5 grid, or just putting the patterns on a larger one? – StephenTG Aug 17 at 14:43
• Ah, that might well be what's making the difference! In which case I withdraw my doubt and commend you again on spotting this connection! – Stiv Aug 17 at 14:45
• Yeah, the second example gave me the idea, but my first test on a larger grid didn't match up. But I realized that thing might pan out differently if things couldn't expand past the borders – StephenTG Aug 17 at 14:46
• OMG! I thought it was related to the game of life and even figured it might be related to number of iterations to reach stability. So I ran it on a game of life simulator on a large grid and couldn't see any answers emerging. DAMN I was so close!!! I even spent 2 hours looking at cool game of life videos after this question... – Dmitry Kamenetsky Aug 18 at 7:44

As the answer from @StephenTG states, the secret is to

interpret the grids as cells in Conway's Game of Life (a thought I'd had, and intended to investigate further this evening)

Specifically,

it is run on a finite 5x5 grid where all cells outside the 5x5 area are considered to be permanently 'dead' (one common alternative is to run it on a toroidally-connected grid, but this is ruled out because several of the patterns shown would have different behaviour on such a grid).

Implementing the necessary calculations in Excel:

We can see that, as also stated in @StephenTG's answer,

Taking $$N$$ as the generation where a stable configuration is reached, and $$K$$ as the number of live cells in that stable configuration, the final answer adds $$N + K$$. For starting grids that reach no stable configuration, $$N = \infty$$

Higher finite scores are possible. For example,

I was able to quickly construct grids which score $$13 + 4 = 17$$ and $$3 + 16 = 19$$

... and revisiting it a little later, some minor tweaks improve this:

$$27 + 6 = 33$$

Later, I finally got round to doing an exhaustive computer search for better solutions. The most relevant part of the output

shows both the longest-lived starting state, and also the highest-scoring (subsequent generations are left as an exercise for the reader):

 State 257296 : 39 + 0 = 39
[]
[]
[][]  [][]
[][][]

New best score: 39 + 0 = 39

State 12366675 : 34 + 6 = 40
[][]    []
[]  [][]
[][]
[]    [][]
[][]  []
New best score: 34 + 6 = 40

Search Time: 35.3581088 seconds
Showing 48 states with best score (40):


• Also correct and I like your work on Excel! Great job! – Voldemort's Wrath Aug 17 at 16:41