VOOZH about

URL: https://www.geeksforgeeks.org/dsa/cellular-automaton-discrete-model/

⇱ Cellular Automaton Discrete Model - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Cellular Automaton Discrete Model

Last Updated : 23 Jul, 2025

A Cellular Automaton is a discrete model similar to any other automaton which has its own start state(s) and a set of rules. 

A cellular automaton is a model of a system of "cell" objects with the following characteristics :

  • The cells live on a grid which can be either 1D or even multi-dimensional
  • Each cell has a state. The number of state possibilities is typically finite. The simplest example has the two possibilities of 1 and 0
  • Each cell has a neighbourhood and it is typically a list of adjacent cells
👁 Image

The working principle of the cellular automata is shown below:

  1. An initial state is selected by assigning a state for each cell.
  2. A new generation is created, according to some fixed rule that determines the new state of each cell in terms of:
    • The current state of the cell.
    • The states of the cells in its neighbourhood.
  3. Hence, a new state is calculated by looking at all previous neighbouring states.
👁 Image

1. Conway’s Game Of Life

2. Rule 90:

Rule 90 is an elementary cellular automaton that consists of a one-dimensional array of cells, each of which can hold either a 0 or a 1 value. Each cell is the exclusive or(XOR) of its two neighbours. 

Current State111011101100011010001000
Next State  0  1  0  1  1  0  1  0

If we concatenate the Next State into a single binary number and convert it to decimal (01011010)2, it becomes 90, hence we get the name Rule 90. 

3. When the initial state has a single nonzero cell, this diagram has the appearance of the Sierpiński triangle

👁 Sierpinski_triangle1

Implementation of Sierpiński triangle:


Output
The rules of Rule 90 Cellular Automata are as follows: 
 Rule 1: 0 0 0 -> sets cell to: 0
 Rule 2: 0 0 1 -> sets cell to: 1
 Rule 3: 0 1 0 -> sets cell to: 0
 Rule 4: 0 1 1 -> sets cell to: 1
 Rule 5: 1 0 0 -> sets cell to: 1
 Rule 6: 1 0 1 -> sets cell to: 0
 Rule 7: 1 1 0 -> sets cell to: 1
 Rule 8: 1 1 1 -> sets cell to: 0

 SIERPINSKI TRIANGLE

 ■ 
 ■ ■ 
 ■ ■ 
 ■ ■ ■ ■ 
 ■ ■ 
 ■ ■ ■ ■ 
 ■ ■ ■ ■ 
 ■ ■ ■ ■ ■ ■ ■ ■ 
 ■ ■ 
 ■ ■ ■ ■ 
 ■ ■ ■ ■ 
 ■ ■ ■ ■ ■ ■ ■ ■ 
 ■ ■ ■ ■ 
 ■ ■ ■ ■ ■ ■ ■ ■ 
 ■ ■ ■ ■ ■ ■ ■ ■ 
 ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ 


Comment