►
Description
Taking on Genetically Evolving Cellular Automata with JavaScript - Irina Shestak, Small Media Foundation
"Genetically evolving cellular automata -- that’s a mouthful. Let’s break it down
1. We will be looking at cellular automata. A cellular automata is a set of units governed with very simple rules. These units make up a complex system, or model.
2. We can train cellular automata to genetically evolve, making themselves better overtime. We can make them adhere to a set of rules that would make the system reach a certain outcome at the end of N generations. We can even use these concepts in the wild.
3. We will be doing it all with JavaScript."
A
Hey
everyone.
So,
thanks
for
having
me
note
interactive,
this
is
going
to
be
awesome.
My
name
is
irina.
I
am
a
that
door.
Oh
my
god.
Okay,
I'm,
a
development
team
lead
at
small
media
foundation.
I'm
based
out
of
london.
I
used
to
be
out
in
vancouver,
which
is
why
the
canadian
accent
but
I
live
in
london.
A
So
the
title
is
a
little
bit
complicated
and
I
think
we
should
kind
of
break
it
down
a
little
bit
and
start
with
a
story
as
to
even
how
I
got
into
this
in
the
first
place
so
story.
Time,
like
I
said
I
am
from
vancouver
and
in
vancouver
it
rains
about
99
of
the
time
and
so
last
november
I
was
out
to
go
for
a
hike
and
our
library
which
is
like
this
coliseum-like
library,
not
as
cool
as
this
building,
but
still
pretty
cool.
A
Probably-
and
I
picked
up
this-
really
cool
edition
of
the
hitchhiker's
guide
to
the
galaxy-
and
it
was
awesome-
and
I
wanted
to
get
it,
but
my
partner
was
sitting
there
and
he
found
this
little
black
book
and
it
said
it
said,
complexity,
a
guided
tour
and
that's
all
it
said
it
didn't
have
like
a
one
of
those
fancy
covers
to
go
over
top
of
it
because
I
think
it
was
lost
so
there
I
was
with
this
book
called
complexity,
guided
tour,
and
I
thought
it
was
really
interesting
and
I
picked
it
out.
A
I
read
the
first
couple
of
pages
and
it
was
awesome
and
she
talks
about
a
bunch
of
different
things
that
make
up
complexity,
melanie
mitchell,
who
is
the
author,
but
she
also
talks
about
cellular
automata
in
about
10
pages
of
through
the
300
pages
of
the
book,
and
that
particular
concept
kind
of
struck
me-
and
I
thought,
okay,
how
about
I
explore
it?
I
know
I
know
javascript.
A
A
To
be
honest,
so
let's
talk
about
automata,
so
the
original
concept
kind
of
came
together
by
the
scientists,
john
von
neumann,
you
may
have
known
you
might
know
him
from
the
manhattan
projects
and
the
things
he
put
together
there,
but
he's
also
started
to
work
a
work
on
cellular
tamar
in
his
kind
of
series
of
lectures,
just
called
theory
of
self-evolving
cellular
automata
and
that's
kind
of
what
started
this
entire
concept
and
where
it
got
to
it,
and
so
he,
when
he
was
putting
these
lectures
together,
they
were
later
transcribed
by
his
co-worker.
A
He
described
two
kinds
of
automotive,
one
being
kind
of
the
artificial
and
the
other
one
being
the
natural
like
seashells
and
things
like
that,
where
certain
parts
of
automata
are
present
and
we're
obviously
going
to
be
talking
about
the
computer
ones.
Okay,
so
I
kind
of
want
to
know
more
a
little
bit.
What
is
it,
what
is
a
settler
automata,
so
I've
been,
as
I
was
reading
through
his
work.
A
I've
put
together
kind
of
the
four
I've
extracted
the
four
concepts
that
make
an
automata
the
way
he
would
would
envision
the
automata
to
be,
and
so
rule
number
one
or
like
the
trade
number.
One
is
the
fact
that
whatever
the
result
that
comes
out
of
the
automata
is
dependent,
how
these
elementary
parts
are
defined,
so
it's
dependent
on
how
the
rules
are
set
and
everything
that
functions
with
automata
is
based
on
the
rules.
A
A
Three
operations
are
not
directed
themselves,
so
whenever
something
happens,
it's
not
they're
not
changing
themselves.
I
guess
for
considerations.
Von
neumann
actually
did
or
like
he
had
like
this
interesting
relationship
when
he
wrote
about
it.
So
operations
are
not
directed
at
themselves,
they're
transfiguring,
something
else,
and
it's
a
decentralized
system
and
kind
of
these
four
different
traits
that
have
been
put
together.
A
We
can
say
that
what's
super
interesting
about
it
is
the
fact
that
they
produce
a
much
more
complicated
objects
than
themselves
and
that
could
be
easily
seen
in
something
like
the
turing
machine,
which
is
an
automata.
So
what
starts
off
with
is
that
you
have
an
automaton
that
performs
the
action.
A
The
puncher
itself
is
the
automaton,
and
the
tape
that
is
infinite
in
both
directions
is
the
one
that
either
has
a
punched
hole
through
it
or
an
unpunched
hole
through
it,
and
so
the
automaton
produces
the
action
of
actually
punching
the
hole,
and
the
tape
is
what
the
result
is
at.
So
basically,
the
action
that
it
produces
is
not
directed
at
themselves,
which
basically
means
that
entirely
the
automata
itself
and
the
tape,
and
what
comes
out
of
it.
A
It's
two
different
constructs
which
is
really
interesting
because,
if
you
think
about
it,
you're,
basically
producing
a
much
more
complicated
object
which
solved
enigmas
during
world
war
ii
by
simply
punching
the
tape-
and
that's
pretty
fascinating
to
me.
A
So
another
definition
that
melanie
mitchell
put
together
for
this
automaton
was
the
fact
that
simple
components
with
local
information
and
communication
give
rise
to
coordinated
global
information
processing.
So
what
happens
is
that
these
simple
rules
that
have
been
defined
to
the
cellular
automata
are
basically
directing
directing
the
way
the
information
gets
processed.
A
So,
let's
go
back
to
kind
of
the
trade
number
two
that
we've
mentioned
previously.
The
fact
that
automata
is
aware
there
have
been
kind
of
I've
boiled
it
down
to
three
different
kind
of
series
of
ways
that
awareness
could
be
structured
and
they're
based
on
kind
of
three
different
people
that
worked
on
automata.
So
one
was
john
von
neumann
who's.
We
who
we
talked
about
before
so
initially
when
he
was
writing
his
or
doing
his
lectures
on
self
for
producing
automata
he.
He
started
off
with
like
this.
A
This
grid,
this
lattice
of
light
bulbs
that
he
hooked
up
and
he
put
them
together.
So
I
made
a
replica
obviously-
and
I
think
it's
pretty
close
so
basically,
what
would
happen
is
that
light
bulbs
would
be
connected
between
one
another
and
they
would
be
turning
on
and
off,
based
on
what
their
neighbors
were
doing.
So
if
their
neighbors
were
on
per
se,
eventually
the
light
bulb
would
turn
off,
and
this
was
kind
of
his
initial
replica
actual
hard
light
bulbs
actual
wires,
trying
to
kind
of
put
this
together.
A
A
So,
if
you're,
a
cup
of
coffee,
you're
dependent
on
kind
of
your
neighborhood,
which
are
the
cake,
so
there's
only
two
states
in
automata,
it's
a
binary
states,
binary
state
kind
of
concept,
so
you
can
either
be
one
or
the
other
with
a
lot
of
computational
papers.
You
will
have
like
this
concept
of
dead
or
alive,
so
they
would
just
use
black
or
white
dots.
A
I
just
describe
it
with
cake
and
coffee,
so
you're,
dependent
on
your
neighbors
and
conway's
game
of
life
works
is
the
fact
that
you
have
this
giant
grid
that
you
will
then
turn
on
certain
states.
You
would
turn
them
into
that
and
then,
if
basically,
given
this
example,
if
you're
a
cup
of
coffee-
and
you
have
three
cakes-
you
become
a
cake.
A
If
there's
two
or
three
cakes
around
in
your
still
cup
of
coffee,
you
stay
a
cake,
and
if
there
are
less
than
two
of
you,
you
become
a
coffee
kind
of
like
that,
a
little
bit
confusing.
But
basically
what
happens
is
that
you
have
this
grid
that
changes
over
time
and
the
grid
stays
the
same
and
so
different.
A
different
concept
that
came
out
of
that
was
kind
of
these
interesting
patterns
that
you
would
end
up
getting
so
over
time.
A
You
would
have
this
glider
that
goes
on
and
on
and
on
and
on
and
on,
depending
on
how
big
your
universe,
I
suppose,
is,
or
similarly
you
will
have
something
like
the
blaster
which
looks
like
spaceships
fighting,
but
it's
similarly
on
this
universe
of
of
your
autonomous
automata
and
these
kind
of
cells
were
produced
based
on
their
starting
position.
A
So,
with
conway's
game
of
life,
it's
more
of
a
two-dimensional
binary
concept
that
is
relevant,
but
it's
two-dimensional
because
you're
looking
at
the
grid
itself
as
your
canvas
and
binary,
obviously,
because
there's
only
two
states
that
the
cells
could
take
on
so
another
person
came
in
and
he
said
okay.
This
is
a
little
bit
complicated.
I
want
to
simplify
it
and
I
want
to
be
able
to
derive
certain
solutions
from
that.
A
So
again,
as
a
cell
you're,
still
aware
of
your
surroundings
and
you
still,
your
actions
are
not
to
work
toward
towards
yourself
but
towards
others,
and
you
affect
everybody
around
you,
but
in
code
perspective,
this
is
how
it's
going
to
look
like.
So
you
start
off
with
a
one-dimensional
array
and
over
time,
you're
going
to
progress
and
you're
going
to
change
as
you
go
along.
A
A
So
I
think
when
I
started
off
with
this,
I
just
tried
to
code
out
parole,
110
and
see
where
I
get
to
it,
and
I
was
able
to
kind
of
replicate
something
that
looks
like
this,
and
it
was
pretty
awesome.
So
the
grid
would
be
just
like
this
giant
grid
that
progresses
over
time,
and
then
you
basically
explore
the
patterns
that
came
out
out
of
it.
A
A
I
wanted
to
look
at
what
exactly
is
like
this
pattern
that
goes
on,
and
then
I
looked
into
cellular
automata
in
this
particular
rule
110,
and
I
realized
that
in
fact,
because
the
pattern
that
comes
out
of
it
is
so
complicated
and
so
different,
they
actually
call
this
particular
rule
touring
complete,
and
what
that
means
is
that
a
computational
system
that
can
compute
every
turing
computable
function
is
called
touring
complete
or
turing
powerful.
Alternatively,
such
a
system
is
one
that
can
simulate
a
universal
turing
machine.
A
You
come
out
with
a
quite
complicated
pattern
that
takes
on
so
we've
noticed
that
certain
part
patterns
end
up
dominating
in
the
particular
environment
and
kind
of
looking
into
the
pattern
as
a
concept
itself.
It's
basically
a
set
of
configurations
sharing
a
common
spatial
structure
and
in
particularly
with
most
of
wolfram's
256
rules.
A
So
what
was
then
said
by
a
bunch
of
people
who
were
looking
into
this
is
the
fact
that
there
is
still
a
diversity
of
these
spatial
temporal
behaviors,
but
the
system
is
organizing
itself
into
patterns
based
on
the
rules
that
it
follows,
and
that
was
really
interesting
to
me
that
it
organizes
itself.
So
I
even
had
three
slides
to
point
out
the
fact
that
it
organizes
itself
into
patterns
which
is
incredibly
fascinating.
So
that
leads
me
to
kind
of
this
entire
concept.
A
That
okay
were
this
entire
concept
of
cellular
automata
is
based
on
the
fact
that
there
is
a
two
state,
a
two
two
binary,
two
state
kind
of
concept:
that
people
follow
or
is
the
automata
follow,
which
leads
to
kind
of
this
interesting
theory
of
it
from
bit,
which
was
popularized
by
john
archibald
wheeler,
and
what
that
theory
says.
A
Is
it
from
bit
symbolizes
the
idea
that
every
item
of
the
physical
world
has
at
bottom
and
a
material
source,
an
explanation
that
we
can,
which
we
call
reality
arises
in
the
last
analysis,
from
the
posing
of
yes
or
no
questions
and
the
registering
of
equipment
evoked
responses,
which
is
a
pretty
complicated
way
of
saying
that
that
a
lot
of
this
kind
of
stuff
emerges
from
this
binary
state
solutions
and
very
complicated
things
can
emerge
from
binary
state
solutions.
A
So
let's
go
back
to
kind
of
the
fact
that,
given
these
particular
patterns,
we
were
looking
into
this
incredibly
diverse
spatial
temporal
behaviors
and
the
fact
that
the
system
is
organizing
itself
into
patterns
which,
given
the
particularly
simple
examples
or
simple
rules,
that
automata
follows.
We
come
up
with
a
very
complex
systems
that
turn
out
in
the
very
end.
A
So
and
then
I
guess,
as
I
was
kind
of
researching
this
or
putting
this
together
in
a
sense,
I
was,
I
guess
fascinated
by
this
entire
con
concept
of
complex
systems
in
general
and
what
is
even
a
concept,
complexity
or
complex
system.
So
I
was
researching
this
and
I
went
on
the
internet,
and
google
straight
up
gives
me
that
it's
a
state
or
quality
of
being
intricate
or
complicated.
A
Whereas
also
the
internet,
wikipedia
has
put
it
together,
as
complexity
is
generally
used
to
characterize
something
with
many
parts
where
those
parts
interact
with
each
other
in
multiple
ways,
culminating
in
a
higher
order
of
emergency
of
emergence
greater
than
the
sum
of
its
parts,
which
sort
of
starts
to
make
sense
in
a
sense
of
or
in
a
position
of
automata,
as
a
lot
of
the
parts
are
interacting
and
we
do
come
up
with
something:
that's
a
lot
greater
or
a
lot
more
complex
than
the
sum
of
it
parts.
A
But
otherwise
I
I
think
that
still
doesn't
answer
the
question
of
complexity
of
what
it
is
in
this
sense
or
in
the
space
of
automata.
So
another
person
came
up
with
a
couple
of
questions
and
he
does
really
awesome
videos
about
complexity
and
kind
of
model.
Thinking
and
he's
put
together,
three
different
answers
or
three
different
questions
that
we
could
answer
to
try
to
define
whether
something
is
complex
and
three
of
them
are,
is
how
hard
is
it
to
describe
the
particular
system?
A
How
hard
is
it
to
create
and
what
is
the
degree
of
such
organization?
And
so
I
guess
that
still
kind
of
helps
us
out
with
identifying
what
it
is
complex
and
what's
not
complex,
but
also
not
a
very
standard
answer.
In
fact,
I
went
searching
for
quite
a
few
more
answers
and
it
seems
like
folks
that
study
this
can't
agree
on
the
definition
of
complexity,
much
like
javascript
developers
can
degree
and
what
framework
to
use.
A
So
I've
decided
to
go
back
to
like
the
initial
stage
of
this
and
look
into
melanie
mitchell's
definitions
for
complexity,
and
she
says
that
basically,
the
average
information
content
or
the
amount
of
surprise
that
you
can
come
up
with
based
on
your
particular
algorithm,
is
what
something
is
complex.
So
if
you're,
I
guess
surprised
by
your
result.
It's
a
much
more
complicated
system.
A
A
Okay,
so
this
has
been
as
I,
as
I
said
like.
This
has
fascinated
a
lot
of
people,
because
it's
a
very
simple
model
that
could
reproduce
something
or
help
people
work
with
much
more
lifelike
models.
And
so
the
next
thing
that
people
decided
to
do
is
that,
okay,
we
have
this
model
that
we
could
write.
A
What
happens
if
we
work
with
evolving
these
particular
cells
and
see
where
we
get
to
it,
and
so
why
this
kind
of
came
to
people's
minds
is
because
it's
a
lot,
if
you
look
at
it
or
if
you
think
about
it,
it's
very
organic
in
a
way
humans,
reproduce
or
things
that
are
alive
or
produce
and
kind
of
very
similar
to
genetics,
work,
and
so
people
started
looking
into
it.
But
the
first
was
a
kind
of
annoyment
and
when
he,
when
he
was
working
on
his
theory
of
self-reproducing
automata,
he
kind
of
envisioned
this
robot.
A
This
was
very
awesome
of
like
honestly.
For
me,
he
envisioned
this
robot
that
basically
would
be
kind
of
structured
in
the
middle
of
nowhere
and
or
it
would
have
structure
in
the
middle
of
nowhere.
And
what
would
happen
is
that
it
would
have
access
to
all
the
possible
different
parts
it
may
or
may
not
need
ever,
and
then
it
would
kind
of
build
itself
as
it
required
and
as
it
evolved.
A
It
would
require
more
and
more
parts,
and
if
it
were
to
reproduce
it
would
require
more
and
more
parts,
but
it
would
always
have
this
access
to
the
parts,
but
once
people
have
been
putting
it
together
they've
they
decided
to
simplify
the
task
and
see
what
they
could
do
with
like
this
one-dimensional
lattice.
So
there's
work,
kind
of
in
both
one-dimensional
and
two-dimensional
space
and
people
have
been
putting
together,
algorithms
and
genetic
evolutions
based
on
both
kind
of
both
models.
A
I
suppose-
and
so
I
kind
of
like
the
idea
of
having
a
one-dimensional
space
and
seeing
where
I
could
come
up
or
what
I
could
come
up
with
in
that
so
there's
kind
of
three
different
aspects
that
one-dimensional
things
are
good
at
in
the
beginning,
one
being
density,
classification,
synchronization
and
random
number
generations,
and
so
with
with
density
classification,
is
something
I
decided
to
look
at,
because
that
was
kind
of
interesting
for
me
and
not
simple,
but
it
was
straightforward
to
do
and
then
kind
of
get
to
something
else
at
the
at
the
end,
and
so
the
way
that
would
work
is
basically
it's.
A
It's
like
a
voting
system.
It's
kind
of
you
set
up
you
and
your
neighbors
are
about
to
vote
an
election.
You
have
to
candidates
to
work
to
vote
for,
and
you
want
to
make
sure
that
your
neighbors
start
voting
for
a
candidate,
even
though
you're
in
start
you're
starting
off
in
a
minority.
A
So
you
start
off
with
a
random
state
lattice
or
an
array
or
a
matrix,
random
state,
again
you're
stuck
to
the
binary
state
solution
and
you
perform
you
kind
of
run
the
generation
over
time.
So
you,
you
would
have
several
generations
to
kind
of
convince
your
neighbors
to
vote
for
the
opposite
member,
and
the
goal
of
this
is
to
make
sure
that,
if
you're
in
a
minority
at
the
beginning,
you
want
to
be
in
the
majority
at
the
end.
A
In
fact,
you
want
to
win
at
the
end
and
you
kind
of
evolve
and
evolve
and
evolve,
and
each
one
of
these
items
or
cells
in
the
lattice
start
off
with
a
different
set
of
rules.
So
normally
would
like
wolfram's
automata.
You
would
have
a
single
state,
a
set
of
rules
that
every
single
one
of
them
follows.
A
If
you
were
one
state,
you
want
to
be
the
other
state
at
the
end,
and
if
you
get
there
majority
of
the
time
in
150
years,
you're
good
and
then
you
can
kind
of
have
your
own
metrics
as
to
how
much
those
particular
variables
could
be.
So
you
start
off
kind
of
over
time.
You
pick
out
okay,
so
this
wasn't
very
successful
because
I'm
still
in
the
same
state
over
time,
but
I
want
to
be
in
a
different
state,
the
next
time
around,
but
basically
the
concept
over
with
this
density
classification
task
is
very
straightforward.
A
All
you
want
to
do
is
being
able
to
convince
your
neighbors
to
vote
otherwise,
and
so
this
kind
of
thing
was
interesting
to
see,
because
in
the
beginning
you
would
have
like
this
generation
zero,
which
for
the
most
part
you
would
start
off
with
majority
black
cells
and
clearly
doesn't
perform
very
well
because
you
just
end
up
with
a
majority
of
black
cells,
but
it
gets
a
little
bit
more
interesting
at
the
very
end,
because
then
you
are
able
to
see
okay,
I
start
off
with
more
black
cells,
I'm
still
I'm
getting
a
little
bit
better,
but
I'm
still
ending
up
with
more
black
cells
at
the
end
and
by
certain
number
of
generations,
you're
able
to
get
to
something
else,
and
this
is
like
a
very
kind
of
straightforward
task
for
automata
to
perform,
but
you
are
then
able
to
kind
of
take
this
down
and
say:
okay,
I
want
to
apply
this
to
maybe
image
processing,
because
I
got
this
whole
voting
thing
down
in
a
basic
state
and
then
I'm
able
to
do
something
else.
A
A
But
what
happened
actually
just
recently
is
that
my
friend
and
I
were
at
nordic
js
together
and
he
runs
a
show
called
fun,
fun
functions
on
youtube,
and
so
him
and
I
have
put
together
a
kind
of
an
episode
of
working
on
this,
and
what
was
super
interesting
is
that
people
started
like
people
keep
tweeting
at
me
with
all
the
different
things
they've
built
with
automata,
and
that
was
kind
of
the
most
awesome
thing
I
could
have
gotten
out
of
this
is
that
people
are
actually
becoming
more
interested
in
something,
as
I
guess,
in
a
sense
rudimentary
or
boring
for
a
lot
of
people,
in
fact,
but
it's
interesting
to
see
that
people
becoming
a
lot
more
interested
in
it
and
are
trying
these
different
things
out
and
trying
to
kind
of
break
some
of
the
rules
over
time.