Tuesday 23 April 2019

Automata, Chaos and Emergent Behaviour

We were lucky to have Peter Marks visiting Cornwall to lead this meetup on Automata, Chaos and Emergent Behaviour.


Working examples, including code, are online: https://codepen.io/spluko/.


A similar session was already run in London previously, and was written up, so I won't repeat the content but focus on just the key points and differences to that session.


Automata

Mathematicians, scientists and indeed philosophers, often consider whether the natural world and its behaviour can be modelled as a collection of abstract objects following simple rules. Indeed, the justification of modelling real world behaviour isn't even necessary, we can be interested in objects following simple rules just because it is interesting.

Although there are very precise and formal definitions of automata, an informal definition is more understandable. Automata are abstract things - which take input, and follow simple rules to decide their next state, from where they can continue to take more input and continue to evolve.


The word state is just a technical term for the configuration of, and information in, an automaton.

It might be difficult to picture an "abstract" thing. It just means that many kinds of things can be automata - from small robot ants to pixels moving around a screen.

The reason they can be interesting is that from the simple rules can emerge interesting, and sometimes surprisingly sophisticated, behaviour.


Key Principles

Peter structured his talk by progressively exploring the key principles at play when modelling automata - iteration, multiplicity and interaction:

  • Iteration - the repeated application of rules, often mathematical rules.



  • Multiplicity - Creating and evolving many automata.



  • Interaction - Allowing the evolution of automata to depend on other automata, encoded again as the simple rules that define their next state.


Peter illustrated the principle of iteration with an object that just happened to be a circle. The rules that are applied to it increase its size. The state of the object changes over time - the circle grows. Although this example sounds a little laboured, it illustrates the concepts.


Peter proceeded to demonstrate the principle of multiplicity, creating many objects and allowing them to evolve according to the same simple rules.



These particles appear to move along different paths. The rules that apply to them are still the same, the different paths are due to their different initial starting states - they all have different initial speeds and directions (velocity).

Peter the proceeded to the interesting idea of chaos  - the apparent breakdown of a system into randomness. He explained that actually the chaotic systems we were looking at were not random, just so varied in their behaviour that it was had to predict their future state. Chaotic systems are very sensitive to their initial conditions, which contributes ti their difficult predictability.

A good example of a chaotic system is an ink drop falling into a glass of water. The ink molecules are start off in a relatively well defined small space, but then move around the glass in a very unpredictable way, and also along paths very different to molecules they started off as neighbours with.


The following curves are drawn according to positions which evolve in a chaotic manner.


Peter then proceeded to demonstrate the opposite effect - order out of chaos. Particles are created and moved according to the following fairly simple mathematical rules:
xt+1 = sin(a * yt) - cos(b * xt)
yt+1 = sin(c * xt) - cos(d * yt)
The initial impression is that the particles seem to follow a chaotic path with no order or pattern. However, creating many particles and following theirs allows a pattern to emerge.


You can find many more example of these beautiful forms online, here for example: http://paulbourke.net/fractals/peterdejong/, which includes:


Finally, Peter demonstrated automata whose behaviour depended on the state of other automata - interaction. Simple examples include balls that bounce off each other, transferring momentum to each other.

Peter showed how even simple rules can lead to emergent behaviour, for example the self-organising of objects according to their colour.

Before:


After:


More sophisticated example is of boids, where bird-like automata follow rules that encourage them to follow each other by matching velocities, but also not allowing them to get too close, whilst aiming to cohere towards a group or cluster. The resulting behaviour is very similar to birds flocking.



Here is another example showing the boids more clearly, from the processing website.



Conclusion

Peter took us through a well structured tour of automata, starting with very simple and easy to understand examples, and working through the principles of iteration, multiplicity and interaction.

For many, including myself, there is still the sense of excitement, surprise and wonder at how simple rules can lead to both chaos, and also emergent behaviour.

Peter's talk inspired some of the conversation after the session, which broadened out to how nature itself works and the role of simple laws of physics, chemistry and biology governing the emergence of the world we observe!


No comments:

Post a Comment