Rosio Pavoris

Non-Darwinian selection

An interesting experiment.

Take a matrix of a given size (or checkerboard-style field), and populate it randomly with symbols (”organisms”).
Now, select a random element (or square on the checkerboard), and remember what organism is in it. Select another random square, and replace the organism in that with an organism like the original one (reproduction of that organism). Repeat.

Populated grid
Populated grid
First selection
First selection
Second selection
Second selection
Reproduction
Reproduction

This is a good example of selection without adaptation (or any other biasing cause; this is why it’s called non-Darwinian). Through pure chance, eventually a single organism will dominate the field.
I’ve been told this has consequences as far as abiogenesis is concerned, though I don’t entirely see how.

Here’s sample code for this in Java. I was bored~

public class Selection {
	public static void main (String [] args) {
		int n = IO.leesInt("Field size?"),
			pop = IO.leesInt("How many types of organisms?"),
			gen = IO.leesInt("How many generations?");
		int [][] field = new int [n][n];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < n; j++)
				field[i][j] = (int) (Math.random()*pop);
		echofield(field, n);
		String ready = IO.leesString("Ready?");
		for (int i = 0; i < gen; i++)
			generation(field, n);
		echofield(field, n);
	}
	static void generation (int [][] field, int n) {
		int x = (int) (Math.random()*n),
			y = (int) (Math.random()*n),
			hulp = field[x][y];
		x = (int) (Math.random()*n);
		y = (int) (Math.random()*n);
		field[x][y] = hulp;
	}
	static void echofield (int [][] field, int n) {
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++)
				System.out.print(" " + field[i][j]);
			System.out.print("\\n");
		}
	}
}

The “organisms” in this case are numbers (and if you keep the number of types of organisms under 10, the grid will line up nicely). With some effort, you could make it random characters or pictures, I guess.
As written, it doesn’t show or store intermediate steps, but if anyone’s interested I’ll rewrite it to do so when I get home.

(This uses a separate custom IO class for reading. It’s not important to understand how it works. If you want to try this, you can get it here.)

Post a Comment

RSS feed for comments on this post · TrackBack URL