Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

A (one dimensional) cellular automaton is a function1 F : Σ → Σ with the property that there is a K > 0 such that F (x)i depends only on the 2K + 1 coordinates xi−K , xi−K+1, . . . , xi−1, xi, xi+1, . . . , xi+K . A periodic point of σ is any x such that σ^p (x) = x for some p ∈ N, and a periodic point of F is any x such that F^q (x) = x for some q ∈ N. Given a cellular automaton F, a point x ∈ Σ is jointly periodic if there are p, q ∈ N such that σ^p (x) = F^q (x) = x, that is, it is a periodic point under both functions.

This project aims to explore the nature of one-dimensional Cellular Automata, in the hope of finding the structure of cellular automata through its periodic points.

2034 views
License: MIT
ubuntu2004
1
import math
2
import random
3
4
class InitialCondition:
5
def __init__(self, size = 64):
6
self.size = size
7
8
class FarRightIsOne(InitialCondition):
9
def __init__(self, size):
10
self.state = self._build_state(size)
11
InitialCondition.__init__(self, size)
12
13
def _build_state(self, size):
14
state = [0] * size
15
state[-1] = 1
16
return state
17
18
class MiddleStateIsOne(InitialCondition):
19
def __init__(self, size):
20
self.state = self._build_state(size)
21
InitialCondition.__init__(self, size)
22
23
def _build_state(self, size):
24
state = [0] * size
25
middle_index = math.floor(len(state) / 2) - 1
26
state[middle_index] = 1
27
return state
28
29
class RandomState(InitialCondition):
30
def __init__(self, size):
31
self.state = [random.randint(0,1) for i in range(size)]
32
33
InitialCondition.__init__(self, size)
34
35
36