WolframAlpha.com
WolframCloud.com
All Sites & Public Resources...
Products & Services
Wolfram|One
Mathematica
Wolfram|Alpha Notebook Edition
Finance Platform
System Modeler
Wolfram Player
Wolfram Engine
WolframScript
Enterprise Private Cloud
Application Server
Enterprise Mathematica
Wolfram|Alpha Appliance
Enterprise Solutions
Corporate Consulting
Technical Consulting
Wolfram|Alpha Business Solutions
Resource System
Data Repository
Neural Net Repository
Function Repository
Wolfram|Alpha
Wolfram|Alpha Pro
Problem Generator
API
Data Drop
Products for Education
Mobile Apps
Wolfram Player
Wolfram Cloud App
Wolfram|Alpha for Mobile
Wolfram|Alpha-Powered Apps
Services
Paid Project Support
Wolfram U
Summer Programs
All Products & Services »
Technologies
Wolfram Language
Revolutionary knowledge-based programming language.
Wolfram Cloud
Central infrastructure for Wolfram's cloud products & services.
Wolfram Science
Technology-enabling science of the computational universe.
Wolfram Notebooks
The preeminent environment for any technical workflows.
Wolfram Engine
Software engine implementing the Wolfram Language.
Wolfram Natural Language Understanding System
Knowledge-based broadly deployed natural language.
Wolfram Data Framework
Semantic framework for real-world data.
Wolfram Universal Deployment System
Instant deployment across cloud, desktop, mobile, and more.
Wolfram Knowledgebase
Curated computable knowledge powering Wolfram|Alpha.
All Technologies »
Solutions
Engineering, R&D
Aerospace & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Mechanical Engineering
Operations Research
More...
Finance, Statistics & Business Analysis
Actuarial Sciences
Bioinformatics
Data Science
Econometrics
Financial Risk Management
Statistics
More...
Education
All Solutions for Education
Trends
Machine Learning
Multiparadigm Data Science
Internet of Things
High-Performance Computing
Hackathons
Software & Web
Software Development
Authoring & Publishing
Interface Development
Web Development
Sciences
Astronomy
Biology
Chemistry
More...
All Solutions »
Learning & Support
Learning
Wolfram Language Documentation
Fast Introduction for Programmers
Wolfram U
Videos & Screencasts
Wolfram Language Introductory Book
Webinars & Training
Summer Programs
Books
Need Help?
Support FAQ
Wolfram Community
Contact Support
Premium Support
Paid Project Support
Technical Consulting
All Learning & Support »
Company
About
Company Background
Wolfram Blog
Events
Contact Us
Work with Us
Careers at Wolfram
Internships
Other Wolfram Language Jobs
Initiatives
Wolfram Foundation
MathWorld
Computer-Based Math
A New Kind of Science
Wolfram Technology for Hackathons
Student Ambassador Program
Wolfram for Startups
Demonstrations Project
Wolfram Innovator Awards
Wolfram + Raspberry Pi
Summer Programs
More...
All Company »
Search
WOLFRAM COMMUNITY
Connect with users of Wolfram technologies to learn, solve problems and share ideas
Join
Sign In
Dashboard
Groups
People
Message Boards
Answer
(
Unmark
)
Mark as an Answer
GROUPS:
Staff Picks
Wolfram Science
Physics
Wolfram Language
Wolfram Summer School
Wolfram Fundamental Physics Project
3
Ryan Lau
[WSS21] The 3-colored distributed consensus problem
Ryan Lau
Posted
11 months ago
1354 Views
|
1 Reply
|
3 Total Likes
Follow this post
|
The 3-colored distributed consensus problem
by
Ryan Lau
BSc Natural Sciences (Physics & Physical Chemistry), University College London (UCL)
Abstract: Consider a collection of cells with a certain fraction of 3 distinct colours. There is some rule, of which when applied to the system, will turn all the cells to the majority colour when that fraction of the colours exceeds a certain threshold, reaching global consensus. The system will also exhibit indeterminate states when there are equal weights of colors. A general majority rule has been hypothesised and studied using grid cellular automata in cases of 2 and 3 colors. Some other rules are suggested, but their analysis is left for future studies. This report concludes with some criticism and possible future works.
Introduction
The Idea
The problem of distributed consensus has been well studied in the 2 colored case [1]. However, the existing literature is insufficient in solving for the problem of the 3-colored case. In this report, we will study this problem specifically on grid cellular automata. It is expected that the studies which will be conducted on the 3-colored case will provide some insight on how cellular automata links to certain properties in physical systems.
The problem
In this report, we will discuss some of the rules which perform on 3 colors, red, yellow and blue in 1-dimension (1D). The rules will be analogous to the majority function, similar to the GKL rule which will be discussed in future sections. The cells cannot decide which cell color is the majority, hence there will be indeterminate states of red yellow and blue. It is expected that the rule will provide us a “triple point” behaviour, where the cells cannot determine which color is the majority. The idea is studied via hypothesizing a general majority rule, and applying it to 2-colored and 3-colored system, with comparisons of their behaviours being made. Some other rules will also be suggested, but will be analysed in future works.
The Majority Function
The main idea of the majority function or rule is that it returns the majority color of some neighbouring cells. The sections below will have some more concrete examples.
The GKL rule
The Gacs-Kurdyumov-Levin (GKL) rule, or the “radius 3” rule operating on size-7 neighborhoods [1] provides us with a 1D deterministic cellular automaton rule that would lead to global consensus. Consider an initial system, Sys1, with a random arrangement of red cells with fraction
p
=
0.6. The rest will be yellow cells. The GKL rule as described by the following in the Wolfram Language is given as:
{l3_, _, l1_, c_, r1_, _, r3_} :> If[If[c == 0, r1 + r3, l1 + l3] + c >= 2, 1, 0]
We then apply it to the initial system Sys1:
I
n
[
]
:
=
L
a
b
e
l
e
d
[
B
l
o
c
k
R
a
n
d
o
m
[
S
e
e
d
R
a
n
d
o
m
[
5
6
7
]
;
A
r
r
a
y
P
l
o
t
[
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
o
n
[
{
F
r
o
m
D
i
g
i
t
s
[
T
u
p
l
e
s
[
{
1
,
0
}
,
7
]
/
.
{
l
3
_
,
_
,
l
1
_
,
c
_
,
r
1
_
,
_
,
r
3
_
}
:
>
I
f
[
I
f
[
c
=
=
0
,
r
1
+
r
3
,
l
1
+
l
3
]
+
c
>
=
2
,
1
,
0
]
,
2
]
,
2
,
3
}
,
R
a
n
d
o
m
C
h
o
i
c
e
[
{
.
6
,
.
4
}
-
>
{
1
,
0
}
,
3
0
0
]
,
6
0
]
,
C
o
l
o
r
R
u
l
e
s
-
>
{
0
-
>
H
u
e
[
0
.
1
5
,
0
.
7
2
,
1
]
,
1
-
>
H
u
e
[
0
.
9
8
,
1
,
0
.
8
2
0
0
0
0
0
0
0
0
0
0
0
0
0
1
]
}
,
F
r
a
m
e
-
>
F
a
l
s
e
,
I
m
a
g
e
S
i
z
e
-
>
L
a
r
g
e
]
]
,
"
F
i
g
1
:
G
K
L
r
u
l
e
w
h
e
n
p
=
0
.
6
"
]
O
u
t
[
]
=
F
i
g
1
:
G
K
L
r
u
l
e
w
h
e
n
p
=
0
.
6
We can also consider another initial system, Sys2, with
p
= 0.4, and applying the same rule on it:
I
n
[
]
:
=
L
a
b
e
l
e
d
[
B
l
o
c
k
R
a
n
d
o
m
[
S
e
e
d
R
a
n
d
o
m
[
5
6
9
]
;
A
r
r
a
y
P
l
o
t
[
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
o
n
[
{
F
r
o
m
D
i
g
i
t
s
[
T
u
p
l
e
s
[
{
1
,
0
}
,
7
]
/
.
{
l
3
_
,
_
,
l
1
_
,
c
_
,
r
1
_
,
_
,
r
3
_
}
:
>
I
f
[
I
f
[
c
=
=
0
,
r
1
+
r
3
,
l
1
+
l
3
]
+
c
>
=
2
,
1
,
0
]
,
2
]
,
2
,
3
}
,
R
a
n
d
o
m
C
h
o
i
c
e
[
{
.
4
,
.
6
}
-
>
{
1
,
0
}
,
3
0
0
]
,
6
0
]
,
C
o
l
o
r
R
u
l
e
s
-
>
{
0
-
>
H
u
e
[
0
.
1
5
,
0
.
7
2
,
1
]
,
1
-
>
H
u
e
[
0
.
9
8
,
1
,
0
.
8
2
0
0
0
0
0
0
0
0
0
0
0
0
0
1
]
}
,
F
r
a
m
e
-
>
F
a
l
s
e
,
I
m
a
g
e
S
i
z
e
-
>
L
a
r
g
e
]
]
,
"
F
i
g
2
:
G
K
L
r
u
l
e
w
h
e
n
p
=
0
.
4
"
]
O
u
t
[
]
=
F
i
g
2
:
G
K
L
r
u
l
e
w
h
e
n
p
=
0
.
4
Both cases successfully reaches to a “global consensus”. The plot below shows how the colors of the grids change with time for different initial systems, or different values of
p
:
I
n
[
]
:
=
d
a
t
a
=
P
a
r
a
l
l
e
l
T
a
b
l
e
[
I
f
[
p
=
=
.
5
,
N
o
t
h
i
n
g
,
M
e
a
n
A
r
o
u
n
d
/
@
T
r
a
n
s
p
o
s
e
[
T
a
b
l
e
[
M
e
a
n
/
@
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
o
n
[
{
F
r
o
m
D
i
g
i
t
s
[
T
u
p
l
e
s
[
{
1
,
0
}
,
7
]
/
.
{
l
3
_
,
_
,
l
1
_
,
c
_
,
r
1
_
,
_
,
r
3
_
}
:
>
I
f
[
I
f
[
c
=
=
0
,
r
1
+
r
3
,
l
1
+
l
3
]
+
c
>
=
2
,
1
,
0
]
,
2
]
,
2
,
3
}
,
R
a
n
d
o
m
C
h
o
i
c
e
[
{
p
,
1
-
p
}
-
>
{
1
,
0
}
,
5
0
0
0
]
,
2
0
0
]
,
2
0
0
]
]
]
,
{
p
,
.
3
,
.
7
,
.
0
5
}
]
;
L
a
b
e
l
e
d
[
L
i
s
t
L
i
n
e
P
l
o
t
[
M
a
p
T
h
r
e
a
d
[
C
a
l
l
o
u
t
[
#
1
,
R
o
w
[
{
S
t
y
l
e
[
"
p
"
,
I
t
a
l
i
c
]
,
"
=
"
,
#
2
}
,
I
m
a
g
e
S
i
z
e
-
>
L
a
r
g
e
]
]
&
,
{
d
a
t
a
,
C
a
s
e
s
[
R
a
n
g
e
[
.
3
,
.
7
,
.
0
5
]
,
E
x
c
e
p
t
[
0
.
5
]
]
}
]
]
,
"
F
i
g
3
:
P
l
o
t
o
f
c
o
l
o
r
t
e
n
d
e
n
c
i
e
s
a
g
a
i
n
s
t
t
h
e
n
u
m
b
e
r
o
f
s
t
e
p
s
f
o
r
d
i
f
f
e
r
e
n
t
v
a
l
u
e
s
o
f
p
"
]
O
u
t
[
]
=
F
i
g
1
:
G
K
L
r
u
l
e
w
h
e
n
p
=
0
.
6
The y-axis shows the color tendencies (0 for yellow, 1 for red), and the x-axis shows the number of steps performed. The plot above shows properties which are similar to a phase transition [2]. For
p
< 0.5, the cells will be all yellow; for
p
> 0.5, the cells will be all red. However at
p
= 0.5, the cellular automaton is “indecisive”, hence generating the following nested pattern:
I
n
[
]
:
=
L
a
b
e
l
e
d
[
B
l
o
c
k
R
a
n
d
o
m
[
S
e
e
d
R
a
n
d
o
m
[
2
4
4
2
5
]
;
A
r
r
a
y
P
l
o
t
[
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
o
n
[
{
F
r
o
m
D
i
g
i
t
s
[
T
u
p
l
e
s
[
{
1
,
0
}
,
7
]
/
.
{
l
3
_
,
_
,
l
1
_
,
c
_
,
r
1
_
,
_
,
r
3
_
}
:
>
I
f
[
I
f
[
c
=
=
0
,
r
1
+
r
3
,
l
1
+
l
3
]
+
c
>
=
2
,
1
,
0
]
,
2
]
,
2
,
3
}
,
R
a
n
d
o
m
C
h
o
i
c
e
[
{
.
5
,
.
5
}
-
>
{
1
,
0
}
,
1
0
0
0
]
,
5
0
0
]
,
C
o
l
o
r
R
u
l
e
s
-
>
{
0
-
>
H
u
e
[
0
.
1
5
,
0
.
7
2
,
1
]
,
1
-
>
H
u
e
[
0
.
9
8
,
1
,
0
.
8
2
0
0
0
0
0
0
0
0
0
0
0
0
0
1
]
}
,
F
r
a
m
e
-
>
F
a
l
s
e
,
I
m
a
g
e
S
i
z
e
L
a
r
g
e
]
]
,
"
F
i
g
4
:
G
K
L
r
u
l
e
w
h
e
n
p
=
0
.
5
"
]
O
u
t
[
]
=
F
i
g
4
:
G
K
L
r
u
l
e
w
h
e
n
p
=
0
.
5
The image above shows us a “critical phenomenon” [3], much like the critical point we see in properties of matter, where the matter itself is indistinguishably in a gas and liquid state at some definite temperature and pressure.
Rule 184
There are certain rules which gives us similar behaviour as discussed. For example, the rule 184 [4] when
p
= 0.5, with nested patterns of red and yellow stripes moving left and right :
I
n
[
]
:
=
L
a
b
e
l
e
d
[
B
l
o
c
k
R
a
n
d
o
m
[
S
e
e
d
R
a
n
d
o
m
[
5
6
7
]
;
A
r
r
a
y
P
l
o
t
[
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
o
n
[
1
8
4
,
R
a
n
d
o
m
C
h
o
i
c
e
[
{
1
,
0
}
,
4
0
0
]
,
1
8
0
]
,
C
o
l
o
r
R
u
l
e
s
-
>
{
0
-
>
H
u
e
[
0
.
1
5
,
0
.
7
2
,
1
]
,
1
-
>
H
u
e
[
0
.
9
8
,
1
,
0
.
8
2
0
0
0
0
0
0
0
0
0
0
0
0
0
1
]
}
,
F
r
a
m
e
-
>
F
a
l
s
e
,
I
m
a
g
e
S
i
z
e
L
a
r
g
e
]
]
,
"
F
i
g
5
:
R
u
l
e
1
8
4
w
h
e
n
p
=
0
.
5
"
]
O
u
t
[
]
=
F
i
g
5
:
R
u
l
e
1
8
4
w
h
e
n
p
=
0
.
5
The Rules for the 3-Colored Problem
Method
For this particular problem, there are too many rules which one might investigate. Conducting an exhaustive search will be practically unfeasible as it is computationally too expensive. Better heuristics should be developed to perform such searches. Therefore, we will first construct an analog of the GKL via trial and error, together with some random searches within a rules, using the
CellularAutomaton
function. We will expect the system to have some phase transition properties for different weights of the 3 colors.
Translation from 2-colored to 3-colored rules
One cannot apply a 2-colored rule to a 3-colored rule in cellular automata. As given in the documentation [5], the 1D general RuleNumber,
n
, is specified by the following:
n
=
2
r
+
1
k
k
(
1
)
w
h
e
r
e
k
i
s
t
h
e
n
u
m
b
e
r
o
f
c
o
l
o
r
s
,
a
n
d
r
t
h
e
n
u
m
b
e
r
o
f
n
e
a
r
e
s
t
n
e
i
g
h
b
o
u
r
s
.
I
n
o
u
r
c
a
s
e
t
h
e
r
e
w
i
l
l
b
e
2
r
+
1
3
3
r
u
l
e
s
t
h
a
t
a
r
e
a
p
p
l
i
c
a
b
l
e
t
o
3
c
o
l
o
r
s
,
w
i
t
h
v
a
r
y
i
n
g
r
.
Analog of the Majority Rule
The main goal of the majority rule is to let it decide on which color has the highest fraction after a certain number of steps. Here we can hypothesise a general majority rule as the following:
neighbors:{l3_,b3_,l1_,c_,r1_,b1_,r3_}:>First @ Commonest[neighbors]
Let us name the rule above Maj7. It operates on size-7 neighborhoods, and has a similar form as the GKL rule above. The overall rule number is given by the following:
FromDigits[Tuples[{1,0},7]/. neighbors:{l3_,b3_,l1_,c_,r1_,b1_,r3_}:>First @ Commonest[neighbors],k]
The
k
here indicates the number of colors in the system again. Let us see what it does on a two colored system, and have a pl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w
i
t
h
d
i
f
f
e
r
e
n
t
v
a
l
u
e
s
o
f
p
"
]
O
u
t
[
]
=
F
i
g
6
:
P
l
o
t
o
f
c
o
l
o
r
t
e
n
d
e
n
c
i
e
s
a
g
a
i
n
s
t
s
t
e
p
s
o
f
t
h
e
M
a
j
7
r
u
l
e
w
i
t
h
d
i
f
f
e
r
e
n
t
v
a
l
u
e
s
o
f
p
As we can see from Fig 6, there is a change of behaviour at
p
= 0.5, which are very similar to Fig 3. The difference is that the Maj7 rule does not help the system reach global consensus, only local consensus, unlike the GKL rule. We can then conclude the hypothesised rule does give some “phase transition” property when crossing
p =
0.5 .
From now onwards, let us label 0 as Yellow, 1 as Red and 2 as Blue for consistency throughout the code and notebook. Let us then look at what the Maj7 rule does with 3 colors:
I
n
[
]
:
=
M
a
n
i
p
u
l
a
t
e
[
{
r
,
y
,
b
}
=
{
r
V
a
l
,
y
V
a
l
,
b
V
a
l
}
/
/
I
f
[
T
o
t
a
l
[
#
]
>
1
,
#
/
T
o
t
a
l
@
#
,
#
]
&
;
{
r
V
a
l
,
y
V
a
l
,
b
V
a
l
}
=
{
r
,
y
,
b
}
;
A
r
r
a
y
P
l
o
t
[
C
e
l
l
u
l
a
r
A
u
t
o
m
a
t
o
n
[
{
F
r
o
m
D
i
g
i
t
s
[
T
u
p
l
e
s
[
{
2
,
1
,
0
}
,
7
]
/
.
n
e
i
g
h
b
o
r
s
:
{
l
3
_
,
b
3
_
,
l
1
_
,
c
_
,
r
1
_
,
b
1
_
,
r
3
_
}
:
>
F
i
r
s
t
@
C
o
m
m
o
n
e
s
t
[
n
e
i
g
h
b
o
r
s
]
,
3
]
,
3
,
3
}
,
S
e
e
d
R
a
n
d
o
m
[
s
e
e
d
]
;
R
a
n
d
o
m
C
h
o
i
c
e
[
{
b
V
a
l
,
r
V
a
l
,
y
V
a
l
}
-
>
{
2
,
1
,
0
}
,
5
0
0
]
,
t
]
,
I
m
a
g
e
S
i
z
e
-
>
{
5
0
0
,
3
6
9
}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t
i
o
n
s
t
e
p
s
"
}
,
0
,
6
0
0
,
1
,
A
p
p
e
a
r
a
n
c
e
-
>
"
L
a
b
e
l
e
d
"
}
,
D
e
l
i
m
i
t
e
r
,
{
{
w
,
1
5
0
,
"
z
o
o
m
"
}
,
1
0
0
,
4
0
0
,
1
}
]
O
u
t
[
]
=
I
n
i
t
i
a
l
s
e
e
d
s
F
r
a
c
t
i
o
n
o
f
r
e
d
0
.
5
3
0
5
2
F
r
a
c
t
i
o
n
o
f
y
e
l
l
o
w
0
.
1
7
8
9
0
9
F
r
a
c
t
i
o
n
o
f
b
l
u
e
0
.
2
9
0
5
7
1
e
v
o
l
u
t
i
o
n
s
t
e
p
s
6
0
z
o
o
m
I
n
[
]
:
=
Plotting a line graph like Fig 6 is not so easy for the 3-colored case. As there are 3 colors, which the weights have to add up to one, and the three colors have to be plot against the number of steps, one would need to plot a 4D graph to fully describe the system. To simplify the problem, the blue color is chosen to be fixed to have fractions of 0.3 and 0.5, and we then vary colors yellow and red, and use ListLinePlot3D to plot a 3D analog of Fig 6 to see whether the rule also gives us some phase transition properties:
I
n
[
]
:
=
y
e
l
l
d
a
t
a
3
D
b
l
u
e
f
i
x
[
b
_
:
0
.
5
]
:
=
T
a
b
l
e
[
W
i
t
h
[
{
m
a
x
S
t
e
p
s
=
L
e
n
g
t
h
[
r
o
w
[
[
2
]
]
]
,
c
o
l
o
r
P
r
o
p
=
r
o
w
[
[
1
]
]
}
,
T
r
a
n
s
p
o
s
e
[
{
R
a
n
g
e
[
m
a
x
S
t
e
p
s
]
,
C
o
n
s
t
a
n
t
A
r
r
a
y
[
c
o
l
o
r
P
r
o
p
,
m
a
x
S
t
e
p
s
]
,
r
o
w
[
[
2
]
]
}
]
]
,
{
r
o
w
,
P
a
r
a
l
l
e
l
T
a
b
l
e
[
W
i
t
h
[
{
r
=
1
-
b
-
y
}
,
I
f
[
r
=
=
(
1
-
b
)
/
2
&
&
y
=
=
(
1
-
b
)
/
2
&
&
r
+
b
+
y
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h
e
n
f
r
a
c
t
i
o
n
o
f
b
l
u
e
c
e
l
l
s
=
0
.
5
"
]
O
u
t
[
]
=
F
i
g
8
a
:
P
l
o
t
o
f
c
o
l
o
r
t
e
n
d
e
n
c
y
a
g
a
i
n
s
t
s
t
e
p
s
f
o
r
d
i
f
f
e
r
e
n
t
c
o
l
o
r
p
r
o
p
o
r
t
i
o
n
s
w
h
e
n
f
r
a
c
t
i
o
n
o
f
b
l
u
e
c
e
l
l
s
=
0
.
3
O
u
t
[
]
=
F
i
g
8
b
:
P
l
o
t
o
f
c
o
l
o
r
t
e
n
d
e
n
c
y
a
g
a
i
n
s
t
s
t
e
p
s
f
o
r
d
i
f
f
e
r
e
n
t
c
o
l
o
r
p
r
o
p
o
r
t
i
o
n
s
w
h
e
n
f
r
a
c
t
i
o
n
o
f
b
l
u
e
c
e
l
l
s
=
0
.
5
Conveniently, the red and yellow surfaces represents the colors red and yellow. The color tendency label is same as the color rules discussed before. Let us take Fig 8a for example. In the regime of low proportion of red colored cells or high proportion of yellow colored cells, the red colored cells will gradually turn into yellow colored cells, indicated by the decreasing color tendency towards the color yellow; The yellow colored cells will remain yellow, indicated by the unchanging gradient. The same applies to the opposite regime discussed. There exists a special point when two surfaces cross over each other (Color Proportion = 0.3 for Fig 8a ; Color Proportion = 0.5 for Fig 8b), which is when red and yellow have the same fraction. The crossing over in Fig 8a shows that the system cannot determine its majority color, shown by the unchanging gradient of the surface, as the 3 colors all are in equal weights. The crossing over in Fig 8b is different. While red and yellow have the same fraction, the majority color is blue, thus both red and yellow tends towards 0.5 after some steps. The rule therefore can determine the majority color successfully, but cannot reach global consensus. Although we can see the behaviours of the states, it is quite hard to interpret whether there are phase transition properties from above. To solve this problem future works, a plot can be made with fixing a step, but with varying weights of the 3 colors to get a bigger picture of the system and the majority rule itself.
I would also like to share some trial rules which gave some other interesting results:
I
n
[
]
:
=
M
a
n
i
p
u
l
a
t
e
[
{
r
,
y
,
b
}
=
{
r
V
a
l
,
y
V
a
l
,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