Tuesday, April 8, 2014

rough notes on finding near misses to cycles in juggler sequence

this is about feeding a number back into a function over and over again, and seeing what kind of patterns we get.

see the entry for the collatz conjecture in the complexity lab manual, it is a similar game

def jug(n) = {int(sqrt(n^3))  if n is odd else  int(sqrt(n))}

int(r) is the greatest integer less than r, i.e. int(4.773)=4

so that jug(6)=2, and jug(2)=1 and jug(1)=1 and we stop there.  that's a fixed point.

jug(3)=int(sqrt(27))=5, and jug(5)=11, etc..

the sequence of numbers we get is called the orbit of the first number under the dynamical system for our function jug(x)

here are the orbits for the first 9 integers
[1]
[2, 1]
[3, 5, 11, 36, 6, 2, 1]
[4, 2, 1]
[5, 11, 36, 6, 2, 1]
[6, 2, 1]
[7, 18, 4, 2, 1]
[8, 2, 1]
[9, 27, 140, 11, 36, 6, 2, 1]
>>>

here is orbit for 37:

 [37, 225, 3375, 196069, 86818724, 9317, 899319, 852846071, 24906114455136, 4990602, 2233, 105519, 34276462, 5854, 76, 8, 2, 1]

it seems that no matter what n we start off with we reach 1 (i think this has been tested up to a million)

no one knows how to prove that this is so.  There are many systems like this and they puzzle us.
wiki on the juggler sequence

the question is: are there numbers for which the orbit reaches a fixed point?  or are there numbers for which the orbit cycles?  for instance, look at the orbit for 3:
[3, 5, 11, 36, 6, 2, 1]
if the square root of 36 had happened to be 5 this orbit would have been:
3, 5, 11, 36, 5, 11, 36, 5...

and 5,11,36 would be a cycle.  no one has found any cycles yet, but lets look for almost cycles like 3, 5, 11, 36, 6... 6 is CLOSE to 5.


so,

i generate an orbit under this dynamical system.  [(x0,0), (x1,1)....(xn,n)]
then i sort this by x, so that xi that are near each other in size are near each other in the sequence

then i create a sequence of the differences between consecutive xi's  and sort that.  here is what i get for 37:

(diff, (xi, i), (xj, j))
(1L, (1L, 17), (2L, 16))
(6L, (2L, 16), (8L, 15))
(9L, (8L, 15), (17, 18))
(20, (17, 18), (37, 0))
(39L, (37, 0), (76L, 14))
(149L, (76L, 14), (225, 1))
(1142L, (2233L, 10), (3375, 2))
(2008L, (225, 1), (2233L, 10))
(2479L, (3375, 2), (5854L, 13))
(3463L, (5854L, 13), (9317, 5))
(90550L, (105519L, 11), (196069, 3))
(96202L, (9317, 5), (105519L, 11))
(703250, (196069, 3), (899319, 6))
(4091283L, (899319, 6), (4990602L, 9))
(29285860L, (4990602L, 9), (34276462L, 12))
(52542262L, (34276462L, 12), (86818724, 4))
(766027347, (86818724, 4), (852846071, 7))
(24905261609065L, (852846071, 7), (24906114455136L, 8))


now if i want to search for orbits with near misses... what do i search for?  obviously the first few entries do not count

the 4th and 5th entries are close to what i'm looking for.  how do i write an algorithm to pick them out?  the diff must be small but the indexes must be far apart.

the 3rd entry has indices 3 apart but i'm not going to count that as a good candidate!

hmm... a programming puzzle!

Sunday, April 6, 2014

If I Were Able To Focus I'd Describe This Complexity Lab Manual

The Complexity Lab Manual

What is the complexity lab manual?  It is hard to explain in a few words. It is the science and craft that we've discovered in the last 150 years that begin to bridge the gap between machines and  life, that most people never even get a glimpse of in grade school or college.  it is about discovies and techniques that are so surprisingly different than our thousand years old ways of thought and language.  but the world today is so complex, moving so fast, has become so overpopulated by people who have at their disposal immense powers to transform the earth that it is the duty of everyone to learn these new skills of how to see the world, understand it, and build with it in a sane way.

You will construct machines made of a billion parts all interacting with each other in complicated ways.   you will learn what molecules are and how a trillion of them can make fluid subtle bodies.  you will learn how light, streaming from the hot sun to the cold dark voids of outerspace, sets into motion the weather, makes our hearts beat, our muscles move, our very thoughts themselves to flow.  let's begin.

>>>MELD THESE PARAGRAPHS TOGETHER, ENDING WITH MENTIONING THE POTTER'S CLAY
most people would say that we are not machines, that love is not just a chemical reaction. throughout history most cultures have thought that our very being, our minds, our souls are separate from our bodies of flesh and bone, even that they are immortal and immune from death and decay.  that an eternal supermind and supercraftsman, God, alien to earth, death and decay, outside of the very physical universe,  created bodies out of dumb clay and breathed a little bit of himself into these clay pots to make us alive and and able to feel.


over the past few thousands of years, from the time of the cavemen, the time of the hebrew prophets and the ancient greek philosophers, human culture has built up this notion of an uncrossible divide.  On the one side we put: animated life and human thought and feeling and on the other side mud and machinery.
Most of us would think that there is an unbridgeable gap between the mechanical and the living, between  inanimate rocks chemicals and machines on the one side and  on the other side; living, fluid, subtle, creative, beautifull, beings like trees and animals and people; dancers, artists, writers, you and i who can think and feel.
>>>

complexity lab is about that clay, and what it can do without a supermind creator from the outside.  I know, these are bold thoughts, even heretical thoughts.  but the fact is that we are watching what this clay can do in our microscopes, in our laboratories, in our computers and soon in our nanotechnology factories.  We will learn that life is not made of featureless smooth gobs of stuff like the clay that the potter uses, but that life is made, not from the outside by a potter, but from the inside by a seething swarm of microscopic factories, all interacting with each other a trillion times a second.

But in this modern age most of us do have a vague notion that our bodies have something to do with chemistry, that scientists are saying that we are simply complicated machines or bags of molecules, that our human love and morality are simply chemical reactions.  But what could they mean by this?  How could chemistry or machinery do what you and i can, or even fly like a honeybee who can find flowers, build beehives..?  How can complicated machines be anything like people?  how could complex swarms of molecules, atoms, make life?  Scientists say that 99% of a tree with its finely grained wood, veined leaves, and flowers is made simply of air and water.   just how complicated are these supposed machines, and molecular interactions anyway?

It is the goal of this complexity lab manual to guide you through a series of experiments, projects, diagrams, and stories, to help you get a gut intuition of the kinds of machinery that modern science has discovered and what they are capable of.  To show you that these machines are gazillions of times more subtle, fluid, and creative than cars and robots and computers, and factories.  You will even learn to build some of these machines yourself.  We are learning to build machines that are approaching the suppleness, beauty and creativity of life.

 But our new discoveries of how lifelike machines and chemistry can be is only a hundred and fifty years old,  a mere blink of the eye in the span of human history.  And the schools are not teaching this new view of the world.

In this complexity lab, we will see that our flesh is a swarm of so many more parts than in an automobile or even in a computer.  you will see that their mechanisms of interactions are so much more  fluid and subtle than the machine parts that we are familiar with.

How do the parts of these new machines interact? Most human notions of creativity and government are that a central mind or hierarchy controlling all the parts of the body.  And in the same manner we have tried to build governments on these same models of centralized control.  Even a democracy is based on notions of hierarchical organization.  10,000 people elect one councilperson and 10 counsilpersons work with one mayor, and a million people elect an elector and 100 electors elect one president, and then in daily practice these few people deal with the lives of the many.  This is a clunky system, and not very responsive to the complex times we live in.  In fact, throughout history,  these governments have mostly been ugly and inhumane, and they rarely last more than a few centuries. They exhibit none of the stability and beauty of forests and coral reefs that last for 1000s of years  and are so refreshingly peaceful and beautiful that we flock to them for a break from our clunky ratrace cities. 

the traditional notion of craftsmanship, of building a machine or of creating a work of art, is of a single mind crafting a machine or painting from the outside, or crafting a machine by building a huge factory outside of it which can only touch the parts with a few hands or tools at a time.  We could not imagine how to craft a working kidney with its millions of densly packed, carefully interlocked tubes all in a space of a few inches.

We've yet to figure out how to build a government that can govern a million people in a humane and stable way.  and only recently are we learning how to build a real kidney, or eye.

In the complexity lab we will learn a new form of craftsmanship.  We will learn what happens when large numbers of simple parts interact with each other, instead of being controlled by a central mechanism. We will see that when  those interactions include both stabiliziing and disruptive elements, creativity results.  we will learn that when we build a machine of 10 parts, then 100 parts, then a 1000 parts... that at each stage totally new capabilities appear, they don't just become 10 times faster or smarter, but capabilities that we could never predict appear at each stage. And not just a thousand parts (maybe a car has a thousand parts if we count all the nuts and bolts) We will learn about machines with trillions of parts.

One of the main tasks and most difficult tasks of this complexity lab is to teach you how to think about very large numbers, to feel them in your gut.  you will even learn how to comprehend how big a trillion is!  You will start with understanding 2, then you will understand 3, then you will understand 10 and then 100 and thousand and so on.

In the past, in simpler times, in slower times, in times when there were only hundreds of people scattered across rural landscapes,  when there were only a few scattered cities with more than ten thousand people in them, and only a few cities interacted with each other at a time, there was no need for most of us to think about numbers. numbers weren't important.  But now, that there are six BILLION of us crowding the planet.  (most people don't even know the difference between 10,000 people in a city, 300 million people in the united states, or 6 billion people in the world) when dozens of cities with over 10million people in them span the earth in a tightly interacting global network of commerce and warfare that responds to random events in a split second, when the global economy can calapse in a day, it is our duty to learn to think about numbers.  to think about billions, to think about what happens when networks of billions of people make thousands of decisions every second of the hour, every hour of the day, every day of the year.  we've got to learn how big that number is. and we've got to learn what that number of parts can do.

yes, in the past machines were only made out of a few dozens of clunky metal parts.  but in the past two generations, we've learned to make computers out of nimble switches, switches that communicate with each other.  We've learned to connect thousands of these switches together and have them flipping on and off thousands of times each second.  not the clicking and  clacking of clunky metal parts, the movement is of microscopic bundles of static electricity.  but this was only the start.  An astounding thing happened: every year or so we learned how to weave together ten times as many switches into the same chip the size of a finger nail.  every year or so we learned to make them them make their tiny decisions ten times faster.

we can now connect together billions of switches, all changing each other a billion times a second.  these are the computers we use today.  computers that can animate movies with swarms of 1000s of lifelike people.  programs that can coordinate 100s of activities on our computer desktops.  computer chips in Aibo dogs that can get together and play a passable game of soccer.

And then there is the newest technologies: genetic engineering and nanotechnology.  we ARE learning to build with life and chemistry from the very molecules on up.  It's coming.  It's time that every highschool kid embarking on adulthood in this complicated fast moving world, learns this new worldview.






Old Intro With Links To Labs

Saturday, December 28, 2013

Is It Strange That Langton's Ant Produces Asymetrical Pattern?

So Langton's ant is a two dimensional Turing machine of utter simplicity.

It starts out on an infinite square grid.  Each square starts off white and can be either white or black.   The ant starts on one square facing south and repeats this simple rule:

If on a blank square turn 90degrees clockwise otherwise turn 90degrees counterclockwise, then flip the color of the square from white to black or black to white, then move forward one square.

What it does is quite surprising, taking a long time to create a complex pattern:

http://www.youtube.com/watch?v=1X-gtr4pEBU

It wanders around higgledy piggledy for  9978 steps and then executes a repeating pattern of length 104 which shifts over diagonally each time to produce an endless highway.

We can certainly build a simple mechanical device to do this.  I bet we can even build a protein to do it on a regular face of a crystal, or we can maybe even find a medium sized molecule out there that already does this?

At any rate at first i thought it was odd that this seemingly symmetrical rule produces such an asymmetrical pattern.  But then i realized that the initial conditions are not symmetrical!  They start off all white.

So I decided to try the ant on some different initial conditions.  If i start it on a grid that is alternating black and white stripes or checkerboard pattern of black and white (which i suppose we could think of as more symmetrical initial conditions) the ant surprises me.  It simply executes a boring straight line!  horizontal for horizontal stripes and diagonal for checkerboard.  HUH






The other patterns are for other initial conditions.  if i start the ant with initial random black and white squares of equal probability it wanders aimlessly faster than on all white and hits the wall rather quickly (at this point my program halts).  If I start the ant with a space scattered sparsely with random black squares it tries to do the usual ant thing but keeps getting side tracked!

This is interesting.  So the endless highway is not stable to perturbation.  It seems it will eventually form from any initial state of a small area of randomness but any non white region larger than that small initial area can perturb it.  and of course my stripe, checkerboard and total randomness initial conditions totally negate it.

I think my next step is to watch this ant on toroidal surfaces of various numbers of squares.


Thursday, October 31, 2013

Testing Javascript

Can i put javascript into my blogposts? lets see:


well, lets see what that was

Thursday, October 17, 2013

Finally, Back To Work. will describe it when it's daylight!

phase transition as conway life cellular automata becomes more and more asynchronous.

import grph2
import random as r

def async_conway(N,M,pat,gens,px,alpha,delay):
  """async_conway(pat,lim,px,tx,ty,alpha) --
     run async conway on pat,up to lim gens, tx,ty is torus dims
     alpha is percent of cells to update each gen
     compile averate density =len(live_cells)/tx*ty and
     activity which is numcells to change in a gen/tx*ty"""
  canv=grph2.Grph(tx,ty,px,'conway torus '+str(tx)+'X'+str(ty)+
                            'alpha= '+str(alpha))
  tot=N*M
  live_cells=center(pat,N)
  canv.gens=grph2.k.Label(canv.win)
  canv.gens.pack()
  canv.density=grph2.k.Label(canv.win)
  canv.density.pack()
  canv.activity=grph2.k.Label(canv.win)
  canv.activity.pack()
  adjacent_empties=calc_adjacent_empties(live_cells,tor=True,N,M)
  display(live_cells,canv)
  pop=len(live_cells); active=0
  for n in xrange(gens):
    for m in xrange(delay): pass
    canv.gens.config(text=str(n))
    canv.density.config(text=str(float(pop)/tot))
    canv.activity.config(text=str(float(active)/tot))
    pop,active=async_conway_gen(live_cells, adjacent_empties, canv,
                                tx,ty,alpha,pop,active)


def async_conway_gen(live_cells, adjacent_empties, canv, tx,ty,alpha,
                     pop, active):
  """update the conway world one generation
     alpha is the percent of cells at random to update syncronously
     update pop =len(live), active=numcells chg"""
  die=[]; born=[]; erase=[]
  for cell in live_cells:
    if r.random()      if not conway_calc(live_cells,tor,tx,ty, *cell) & 2:
        #so num nbs is 0,1,4 or more
        die.append(cell); canv.unput(*cell);
        pop-=1; active+=1
  for cell in adjacent_empties:
    if r.random()      c=conway_calc(live_cells, tor,tx,ty,*cell)
      if c==3:
        born.append(cell); canv.put(*cell);
        pop+=1; active+=1
      elif c==0:
        #the cell is no longer adjacent to a live cell
        #take it out of the adjacent_empties set
        erase.append(cell)
        #THIS IS A LITTLE FUNNY ASYNC. WE MIGHT WANT TO UPDATE ***ALL***
        #THE EMPTIES.  THINK IT OUT.
  canv.upd()
  adjacent_empties-=set(erase)
  live_cells.update(born)
  adjacent_empties-=set(born)
  for cell in born:
    adjacent_empties.update(set(nbs(tor,tx,ty, *cell))-live_cells)
  adjacent_empties.update(die)
  live_cells-=set(die)
  return pop,activity




def nbs(tor,tx,ty, x,y):
  """nbs(tor,tx,ty,x,y) --  lazily return one neighbor at a time
     if tor=True then calculate mod tx, ty
     can be extended to cylinder or klein bottl"""
  if tor:
    yield((x-1)%ty,(y-1)%ty); yield(x,(y-1)%ty);
    yield((x+1)%tx,(y-1)%ty)
    yield((x-1)%ty,y); yield((x+1)%tx,y)
    yield((x-1)%ty,(y+1)%ty); yield(x,(y+1)%ty)
    yield((x+1)%tx,(y+1)%ty)
  else: 
    yield(x-1,y-1); yield(x,y-1); yield(x+1,y-1)
    yield(x-1,y); yield(x+1,y)
    yield(x-1,y+1); yield(x,y+1); yield(x+1,y+1)


def conway_calc(live_cells,tor,tx,ty,x,y):
  """add up the number of neighbors of (x,y) that are live
     stop when you get to 4 cause 5,6,7,8 is the same"""
  sm=0
  for nb in nbs(tor,tx,ty, x,y):
    sm+=nb in live_cells
    if sm==4:
      break
  return sm






def calc_adjacent_empties(cells,tor,tx,ty):
  adjacent_empties=set([])
  for cell in cells:
    adjacent_empties.update(set(nbs(tor,tx,ty, *cell))-cells)
  return adjacent_empties

def display(live_cells,canv):
  for cell in live_cells:
    canv.plot(*cell)



def center(pat,N,M=None):
  if M==None: M=N
  cx=N//2; cy=M//2
  xmin, xmax, ymin, ymax=lims(pat)
  xmid=(xmax+xmin)//2
  ymid=(ymax+ymin)//2
  return set([(x-xmid+cx,y-ymid+cy) for x,y in pat])


def lims(pat):
  """return xmin,xmax,ymin,ymax of points in pat"""
  xmax=xmin=pat[0][0]
  ymax=ymin=pat[0][1]
  for x,y in pat[1:]:
    xmax=max(xmax,x); xmin=min(xmin,x)
    ymax=max(ymax,y); ymin=min(ymin,y)
  return xmin, xmax, ymin, ymax


Tuesday, April 23, 2013

Wednesday, February 27, 2013

The Complexity Lab Manual View Of What is Life and How Can It Develop Spontaneously From Chemistry


CHAPTER 1
Diversity and Complexity of Life

1.1) you can go outside in almost any noncity street and collect 100 different kinds of plants.  Along the way you will get some experience with diversity (almost continuous variation on a theme), disparity (discontinuity between forms), and the incredible morphological details that allow us to notice these differences

1.2) not only morphological details, but behavioral.  You can watch a beehive and eventually learn that a 2cm long honeybee can execute over 270 different skills, one of which is to reproduce new elaborate honeybees out of the food they search for and collect.  How do they do this?  Can we build robots to do this?


CHAPTER 2
Computer Science

To get a handle on the levels of complexity involved in life we can get hands on experience building complexity from the ground up.

2.1) from transistors to logic gates, from logic gates to flip flops and multiplexers, from these elements to memories and arithmetic processing units, from these structures to computers with instruction sets of on the order of dozens of instructions.

2.2) once we have computers we can create wild complexity by combining these instructions again hierarchically into subroutines of subroutines ... building up programs a billion instructions long.

2.3) we can even use these programmed computers to hook up to sensors and actuators of robots.

So, can we build 2cm autonomous self feeding reproducing Honeybee robots?  No! not yet. and the reproducing part we still haven't a clue about!  But we've learned alot along the way.


CHAPTER 3
Animal and Plant Development

So, how do animals build their children out of food?

We can watch an animal develop from its egg.  we learn that an animal is actually a growing colony of self reproducing single celled organisms.  a Honey bee starts off it's life as a single celled egg/amoeba that splits in half to 2 then 4 then 8 then...to 500million swarming self organizing amoebas that remain connected and make a honeybee happen. (actually teh first 10 divisions to 1024 cells are slightly different than this)

3.1) Pretty much everything that most organisms can do, this basic unit of life: the cell, can do.  dozens of behaviors, food seeking, reproducing itself out of food.  We can watch single celled Paramecium, Stentor, Euglena go about their ways in a drop of pond water under the microscope.  With months of observation and experiments we can catch them at many of these behaviors.


CHAPTER 4
So What Is This Basic Unit Of Life, The Cell?

4.1) a 150 years of at first confusing but slowly clarifying chemistry experiments has shown us that we can grind up cells and separate them out to 100s of distinct kinds of small components and 1000s of distinct kinds of large components built of these small components.  eventually we learn that the simplest of cells, an E. coli bacteria, are swirling underwater cities of  3000 protein building machines building 2million protein worker robots swimming around and being taken apart and rebuilt out of a soup of a billion parts in a sea of 10s of billions of water molecules.

4.2) I compare this to a city because i can approximate how many bricks there are in New York City:

bricks:
100bricks per window *100windows per wall
or 100^3 bricks per building * 5x10 buildings per city block,  *10*200 city blocks in Manhattan *5 boroughs in all of new york city
=10^6x10x10x100x5
=10^10x5=50billion, yeah more atoms in an E. coli bacteria than there are bricks in new york city.


4.3) remember in our computer chapter we learned what kind of advanced behaviors we could program out of a billion parts!  but there is a profound difference between molecular biology of the cell and programmable computers:  a computer program might consist of a million subroutines and state variables, but the computer processing unit processes these ONE AT A TIME or at most with some parallelism a dozen at a time.  In a living cell, those 2million proteins equivelent to simple subroutines are ALL OPERATING IN PARALLEL, It's like having a million different computer chips interacting at once.  and they dont have to execute the billion instructions of the program, because the billion parts are also bouncing around and interacting in parallel on their own.

so a single cell is a whole qualitatively different level of complexity than a single computer running a program.


4.4) Notice I haven't discussed DNA.  at this level of discussion it doesn't add much important difference.  The 10,000 genes in a cell are simply another 10,000 subroutines running in parallel with and interacting with the 1000s of different kinds of protein robot/subroutines. [if you are into object oriented programming, you can think of them as the classes and the proteins as the objects generated by them, which of course can use the classes to generate even more objects]


CHAPTER 5
What On Earth Are These Molecular Parts?

5.05) they are constructed out of a finite set of only 2dozen distinct kinds of atoms.  The major players: Carbon, Hydrogen, Nitrogen, Oxygen, Phosphorus, Sulfur, Sodium, Potassium, Magnesium, Calcium, Chlorine.  The trace elements (but essential nonetheless) Iron, Chromium, Manganese, Cobalt, Nickel, Copper, Zinc, Molybdenum, Iodine.  (a few other elements are used by various organisms that aren't people)


5.1) these parts are always in 3 dimensional motion (swimming around in a sea if you will) the smaller peices vibrating and bumping into each other a trillion times a second and the larger ones a billion times a second.  this motion we get for free simply because the universe is a warm place.  this is what heat is, the motion of atoms and molecules.  this is also why the higher temperature we raise a system, the faster (usually) chemical reactions will take place.

we can see hints of this motion in the microscope, this is called brownian motion.  Einstein and Perrin showed us how to use these observations to calculate that there are those 100billion molecules in a cell.

5.2) they are sensitive to each other and their environment (pH, hydrophobic/hydrophilic phase etc..) so that each molecule has functional parts that can react to each other with 100s of specific rules.  One learns this in an organic chemistry class.

5.3) they spontaneously join with each other and split apart in different ways depending on these rules.  This is mediated by energy flow which is the topic of chapter 6.  No outside mechanic is required.

5.4) even without energy flow, at thermodynamic equilibrium due to their incessant motion, these parts can self assemble into larger complex structures because of the way they attract each other (like magnets) and simple mathematics.

5.5) one example of this is the formation of clathrin coated pits which cells use to engulf molecular packets around them and bring them inside the cell.

5.6) You can see things like this happen by watching various feathery patterns of ice form in winter.

5.7) or by looking at an exhibit of 100s of different mineral formations.

5.8) so we have these billions of parts randomly exploring each other and then reacting with specific rules.


CHAPTER 6
Energy Flow

living cells are systems of molecules which have energy flowing through them.

Ultimately from the 5000 degree photosphere of the sun spewing out to the 2degrees coldness of outer space.  In between plants create high energy bonds in food molecules and these release energy to the next high energy bonds etc.. till the final fermentation processes of decay release heat to the cold night sky.  This flow of energy in a system of interacting parts can:

6.1) Energy flow causes cyclic iterations in systems of interacting parts. We can build a simple steam engine that cycles off of the flow of energy of burning fuel to CO2 and heat.

It will be important to notice that it is not JUST the heat that makes a steam engine work.  if we put the whole engine INSIDE a hot oven, it will stop.  The heat source and the Cold sink are both required.  Energy must flow from high potential to low.

6.2) Energy flow creates stable dynamic patterns in systems of many many interacting parts (fluids).  We can see this in simple heat flow creating stable patterns of convection cells in fluids and the flow of chemical energy creating stable patterns of spiral waves from a homogeneous mixture of just 5 simple chemicals in the Belusov Zhabotinsky reaction.  We can combine heat and energy flow and play with a candle flame.

6.3) the patterns are stable and can damp out certain classes of perturbation

6.4) but can also preferentially amplify other classes of random fluctuations.  for instance the spiral waves in the BZ reaction are just such amplifications of random fluctuations in the otherwise homogeneous solution.

6.5) interesting unpredictable dynamics can even be created.  We can see this by building a simple chaotic water wheel.  The BZ reaction also can run in a chaotic oscillating mode.

6.6) It is important to note that the ability of life to grow in complexity does not contradict the second law of thermodynamics.  This is true both at the level of a single organism growing from an egg/seed or at the level of whole ecosystems on earth evolving more elaborate different species and interactions between species.

[Explanation coming soon]


CHAPTER 7
Emergent Complexity In Mathematical Systems

7) systems of billions of simple connected agents with simple rules of interaction, under iteration can create VERY ELABORATE patterns that keep growing.

We are just beginning to explore the world at the atomic scale of pattern with scanning tunneling atomic force microscopes.  but we can go back to our computers and play some mathematical games to see what happens when we let 1000s or millions of interacting simple components iterate their simple rules of interaction over and over again.

This is the newest area of study in this exploration!  Only 40 years old!

7.1) the first hint of this kind of behavior was John Horton Conway's game of life, which he introduced in the early 1970s.   Begin with a grid of squares each of which can either be on or off.  each square only interacts with the 8 squares around itself.  every iteration we update all the squares in parallel with these two simple rules:

1) if an on square has less than 2 or more than 3 on neighbors it turns off, else it stays on

2) if an off square has exactly 3 on neighbors, it turns on, else it stays off.

O is off, X is on

you can work out for yourself what these four patterns do:

X
XX,

XXX,

OX
OOX
XXX,

OX
XXX
OOX

be prepared to be amazed.

we can write a computer program to mechanize this (and can imagine one day being able to use nanotechnology to build a grid of molecules to execute these patterns!)

and with that power learn that we can find patterns that continue to grow forever, and we can even make a pattern that forever spits out a sequence of prime numbers so that it grows for.ever and gets more and more different.

But Conway life is not a very satisfying example.  mess around with it and you see that if you change ONE little square in an elaborate pattern the whole dynamic pattern can crash, it is not very robust, the way chemistry is.

7.2) an even simpler rule generates more stable complexity.  Langton's ant: again start with an empty square grid.  Langton's ant is a simple machine (again we can imagine building a simple nanomolecular machine to do this in the not too distant future)  (The more exciting prospect is that perhaps with advanced tools of observation we can discover conditions under which an already existing molecule can do something like this) with a simple rule: the machine sits on a square and faces one of the 4 cardinal directions (N,E,S,W).  The rule is: if the machine is on an off square, turn it on, and rotate 90degrees clockwise, or if it is on an on square, turn it off and rotate 90degrees counterclockwise.  then move forward one square and repeat.

Operating with this simple rule, Langton's ant generates an increasingly complex weird shape that slowly grows to about 100x100 squares over a period of about 10,300 steps and then switches to a periodic behavior whereby it travels back and forth diagonally with one move forward each time in a period of about 100 steps each back and forth and builds an infinite repeated patterned highway shooting off in one direction.  It is very stable, no matter how much you mess up its pattern, it will eventually build its highway.

There are many variations of Langton's ant to explore.  even multiple ants interacting.  What might happen if we had 10billion Langton's ants of a dozen different varieties interacting?  hmmm???


CONCLUSION
go over these laboratory exercises carefully and take time to mull them over.  While none of these chemical or mathematical games comes even REMOTELY close to the molecular complexity of the simplest living cell, they give at least me, a hunch that we are on our way  inventing such games or even finding them under natural chemical conditions, and thus elucidating how chemistry might be able to elaborate all on its own into life.