Problem 1970. Kaggle: Reverse Game of Life - Periods of Oscillators

Kaggle's Conway's Reverse Game of Life contest inspires this Period of Life challenge. The kaggle contest runs from Oct-14-2013 thru Mar-02-2014. References: Game of Life at Wolfram. Wiki Life.

1. Any live cell with fewer than two live neighbors dies, as if caused by under-population.
2. Any live cell with two or three live neighbors lives on to the next generation.
3. Any live cell with more than three live neighbors dies, as if by overcrowding.
4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
5. No wrap around. Beyond edge is zero. Eight Neighbors.

Determine the period of life for a given binary matrix. A stable configuration, Still Life, has a cycle of 1.

Input: M , an [m,n] array

Output: N, Period of Life cycle (Period <11)

Examples: A few matrices of varying periods

N=1   N=2    N=3 Caterer
0000  00000  0000000000
0110  00000  0001000000
0110  01110  0100011110
0000  00000  0100010000
      00000  0100000000
             0000100000
             0011000000
             0000000000

Additional References: Oscillators, Still Life

Solution Stats

84.0% Correct | 16.0% Incorrect
Last Solution submitted on Apr 18, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers19

Suggested Problems

More from this Author296

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!