You Can Turn Your Computer into a Universe, Here’s How.

Timucin Erbas
11 min readMay 28, 2021

One of the most interesting questions humans have ever wondered about has to be the existence of life. How did we get living things out of pure material, and no magic? This question boils down to one concept — called emergence. The subject of how simple and stupid things organize together to become complex and smart.

Before we get into emergence, I want to talk about how weird we are.

Yes, we are weird.

I mean, think of it. We are thinking, living, wondering, but we are made of tiny atoms which do nothing other than follow the laws of the universe, but make up complex structures which seem to make their own decisions.

This fascinating concept is called emergence. Stupid things becoming smart, simple things become complicated. In this case, emergence can give us valuable insight into how life exists at all, since we are fundamentally the same as a pile of rocks.

The main reason these topics are so difficult to explain to ourselves is because we haven’t seen them happen. No human has seen the first cell emerge from its surroundings, so we don’t have something to imagine, something to reference. However, it is (somewhat primitively) possible to recreate this moment.

For this reason, I have created a project using primordial particle systems where we can observe the emergence of life-like structures. I was originally inspired by this article that I came across on Nature.

Creating A Universe

The best way to understand emergence is by watching a simulation, since we can literally recreate and observe it. So why not create a simulated universe inside of your computer? This is what I was working on for the past week.

Specifically, these simulated universes inside of your computer are called “primordial particle systems”

The Idea is that we have a universe with boundaries. In this case, a 200 by 200 piece of territory with 5000 particles randomly placed in our “universe”. Each particle has 3 parameters.

  • Angular direction
  • x-coordinate
  • y-coordinate

At first I initialize all of the particles with a random spot and a random angle.

The Laws of Physics & Math

In order to have interacting particles, they should move. This is the reason we need a motion law. In each step, every particle will adjust its angle according to the particles surrounding it, and move forward a certain distance.

The way we adjust the angle of a particle is dependent on two parameters. One being the number of particles to the left of the particle, the second being the number of particles to the right of the particle (with respect to its direction). Now, each time step we count how many particles are to the left/right of the particle we are on, but are also with the condition that they are within a certain radius. Once we have those numbers, we determine which side we want to turn to. If there are more particles to the right, then we turn some amount to the right. If there are more particles to the left, then we turn towards the left. We will go deeper into how this works in just a moment.

This is represented by the sign(R-L) function. If left is greater than right, the input to the sign function will be negative, so the sign function will give us -1, which means we will be subtracting a negative angle from the current angle, which means we actually increase the angle we are looking towards, making the particle turn left.

If the right is greater than the left, the input to the sign function will be positive. This will result in an output of 1, so we would subtract a positive angle from the current angular trajectory, making the particle turn right.

If right is equal to left, the sign function will take zero as an input, and therefore give zero. This means the particle will turn zero degrees in total, just making it continue its current path.

This is great since it tells us which way to turn, but how do we know how much to turn in the direction given to us? This is where the rest of the equation comes in. We multiply the output of the sign with the total number of particles and beta (an independent variable which we choose.) The sign’s negative/positive value determines general rotation path, but the total number of particles multiplied by beta tells us how much we need to turn in that direction. As a cherry on top, we can pick a number (alpha) to add to the total rotational displacement.

Everything related with rotation might seem complete, but let’s dive deeper into how we will tell if a particle is to the left or the right of an image to make the above functions possible.

All of the angles we talk about in this simulation will be relative to the east direction, or the zero degree axis in the polar coordinate system. So to understand if a particle is to the left or the right relative to another, we need to find its relative angle to the zero degree axis assumed to go through the particle we are on. This way we can get mathematical numbers, and compare them that way.

Now that we have a reference point for each angle, we can mathematically compare the angles to determine whether a particle is to the left or right of the particle we are computing in the moment. Now we have to find the numerical values of the angles, which is just a few mathematical operations. All we need is the angle of the “current focus particle” and the coordinates of the current particles.

With the method above, we can find the relative angle (orange r) by finding the distance (green D) between the focus particle (red dot) and the one we are trying to determine whether it is to the left or right of the red dot (orange dot), and taking the sin function of the height difference (green h) and eventually finding the angle of deflection from the x-axis (blue i). Although i is close to what we want to get to, it isn’t quite there yet. We need to find the angular distance from the particle to the zero degree axis (orange r). To do this, we either add/subtract 0/180/360 from i depending on the relative quadrant to find the orange r (list boxed in green at bottom right).

Therefore: (a1 is red a in the image),

If r > a1 and r < a1 + 180:
orange particle is to the left of the red particle
If r < a1 or r > a1 + 180:
orange particle is to the right of the red particle

Using this method we can count the “local neighbors” to the left or the right of any particle, which lets us determine the adjusted angle. Once we determine the new angle, we have to move the particle forwards v steps.

We can’t just increase/decrease the x and y values of a particle by v since that would result in a total direction travel of v * sqrt(2). Also, we would always move in a 45 degree angle which is obviously incorrect. For this reason, we have to take the sine and the cosine of the updated angle to figure out the appropriate distance which has to be travelled to guarantee a correct angle of travel, and a correct distance of travel.

So we first iterate through every particle in the simulation, and while doing so count the number of particles to the left and right of each particle which are also within a certain radius. Using these numbers we determine the new angle which the particle will be facing. After updating the angular measure of the particle, we move it forwards an exact distance of v. We do this for every single particle. Once we are done updating the parameters and positions of every particle, we display the current state of the simulation as a new “tick”. Every “tick” we assume that a time unit has passed, and this way can observe the events happening within the primordial particle system through time. You can access the code I wrote in my Github repository.

Concept of Emergence

Using this simulation, we can actually observe the emergence of certain patterns. Turns out that the patterns which emerge within the primordial particle systems highly depend on the motion law. In this case, alpha and beta since those are the two independent variables within the motion law.

alpha = 180, beta = -15

This is what emerges from chaos once we set alpha to 180, and beta to -15. The researchers call this a “clear cow pattern” as the particles loosely group together to form these shapes under the condition of these parameters.

alpha=45, beta=-4

This is what the simulation gave me when I set alpha to 45 degrees and beta to -4. It is similar to the previous example, however the patterns are more densely clumped together and are somewhat parallel.

However, things start getting interesting when we set alpha to 180, and beta to -17. With these parameters we see multiple patterns which could be considered life, although some people claim that to be sensationalist. In portions of the environment with low density of particles, we see all of the particles distance themselves such that all of the particles become relatively equidistant, forming a pattern where all particles are arranged in this sort of “triangular grid”

Doesn’t actually look this nice, I enhanced the photo so you won’t be looking at anything blurry

When there is a denser environment, the particles can never find a pattern to all arrange themselves in since the space is too small to actually fit into by still carrying an equidistant pattern. Therefore, all of the particles keep shifting around like soup which is being stirred. When a certain area has a high enough density, some sort of collaborative “gravity” emerges, and we get a clump of particles which the researchers call a “spore”. This emergent gravity leads to this “spore” to become bigger and bigger.

After the spore becomes big enough, it acts against its own “collaborative gravity” and expands in to a circle-like structure. This is called a cell. You can see where I am going with this name. Cells are structures which can literally multiply and grow in population over time, just like cells in the real world.

A Spore
A Cell
Example of mitosis
Growth of population over a long period of time. This looks like art.
Even a life cycle! (Credits)
The output of my simulation

So we have some structures which emerge from a mathematical motion law and a handful of virtual particles. These structures have different forms (premature spore, mature spore, ring, premature cell, triangle cell, square cell, pentagon cell etc.), and even a life cycle which can carry them from one form to another. These structures can split. These structures can grow. All we did was change alpha and beta in order to get these structures compared to other ones. In fact, there are actually regions of alpha vs. beta which we can predict for life to emerge!

It seems to me that by definition, we can say that this primordial particle system and the simulation inside of my computer has created life. Some people say that is extremely sensationalist, however I can’t think of any reason why this shouldn’t be considered life. I mean — the structures literally divide and grow in population recursively, then die. So who’s to say that these things aren’t alive?

What Does This Mean + Takeaways

This simulation makes me wonder why we look for life in the universe. Don’t get me wrong — I am a huge fan for extraterrestrial life search out there, but we have proof that life is just another structure which happens to be able to duplicate, unlike others. All of these structures emerge from the fundamentals of the universe, and the laws of physics, but our primitive minds would get excited if we were to find another civilization, but we don’t budge when we discover a new planet.

This is going to sound weird, but it makes me think of how big of a megalomaniac us humans are. It is safe to say that we search for life not because it is different than the rest of the universe, but because it spikes our curiosity, and we think we are special in the grand scheme of things. We are searching for something which is fundamentally the same as everything else, because it resembles us. We think we are special, and wonder whether there are other “special ones” beyond the world. I myself am no different. I am a huge fan of seeking life beyond our world.

This experiment also changed my views on the way I think of life. I used to imagine life as a binary concept, but now I think of it as a spectrum. We would usually assume that something is alive, or not, but I would argue that some things are more alive than others, and others are “less alive” compared to the rest. It blows our minds to think that we went from nothing alive to something alive with the concept of emergence, but I would say that we went from 0.0001% alive to 0.0009%, just a step in the process from an emergence of more simple structures. It’s almost as if the laws of physics favor the creation of complex structures which turn out to spread across their ecosystem when they can recursively replicate.

Emergence is a fascinating concept which can teach us so many things about the creation of life. This was one of my favorite projects, and I would highly encourage that you, dear reader, learn more about this. Here are my sources, and some other content which I think that you might enjoy!

👋 Bye!

--

--

Timucin Erbas

Leveraging AI and Space Technology to shape the future