Biology, Computer Science, Geography, Group, In the Media, Milestones, Murderous Maths, Notes on everyday life, Physics, Trips

World Science Scholars Feature Simon’s visit to CERN in a newsletter. The current course is about neurons. Reading Stephen Wolfram.

Simon’s September visit to CERN has been featured in a World Science Scholars newsletter:

Here’s our update on the World Science Scholars program. Simon has finished the first bootcamp course on the theory and quantum mechanics by one of program’s founders, string theorist Professor Brian Greene and has taken part in three live sessions: with Professor Brian Greene, Professor Justin Khoury (dark matter research, alternatives to the inflationary paradigm, such as the Ekpyrotic Universe), and Professor Barry Barish (one of the leading experts in gravitational waves and particle detectors; won the Nobel Prize in Physics along with Rainer Weiss and Kip Thorne “for decisive contributions to the LIGO detector and the observation of gravitational waves”).

September 2019: Simon at a hotel room in Geneva taking pat in his first WSS live session, with Professor Brian Greene
September 2019: screenshot from Professor Brian Greene’s course module on quantum physics

At the moment, there isn’t much going on. Simon is following the second course offered by the program, at his own pace. It’s a course about neurology and neurological statistics by Professor Suzana Herculano-Houzel and is called “Big Brains, Small Brains: The Conundrum of Comparing Brains and Intelligence”. The course is compiled from Professor Herculano-Houzel’s presentations made at the World Science Festival so it doesn’t seem to have been recorded specifically for the scholars, like Professor Brian Greene’s course was.

Professor Herculano-Houzel has made “brain soup” (also called “isotropic fractionator”) out of dozens of animal species and has counted exactly how many neurons different brains are made of. Contrary to what Simon saw in Professor Greene’s course (mainly already familiar stuff as both relativity theory and quantum mechanics have been within his area of interest for quite some time), most of the material in this second course is very new to him. And possibly also less exciting. Although what helps is the mathematical way in which the data is presented. After all, the World Science Scholars program is about interdisciplinary themes that are intertwined with mathematical thinking.

Screenshots of the course’s quizzes. Simon has learned about scale invariance, the number of neurons in the human brain, allometric and isometric scaling relationships.

Another mathematical example: in Professor Herculano-Houzel’s course on brains we have witnessed nested patterns, as if they escaped from Stephen Wolfram’s book we’re reading now.

screenshot from the course by Professor Herculano-Houzel

Simon has also contributed to the discussion pages, trying out an experiment where paper surface represented cerebral cortex:

The top paper represents the cerebral cortex of a smaller animal. Cerebral cortex follows the same physical laws when folding is applied.

Simon: “Humans are not outliers because they’re outliers, they are outliers because there’s a hidden variable”.

screenshot from Professor Herculano-Houzel’s course: after colour has been added to the plot, the patterns reveal themselves

Simon is looking forward to Stephen Wolfram’s course (that he is recording for world science scholars) and, of course, to the live sessions with him. The information that Stephen Wolfram will be the next lecturer has stimulated Simon to dive deep into his writings (we are already nearly 400 pages through his “bible” A New Kind of Science) and sparked a renewed and more profound understanding of cellular automata and Turing machines and of ways to connect those to our observations in nature. I’m pretty sure this is just the beginning.

It’s amazing to observe how quickly Simon grasps the concepts described in A New Kind of Science; on several occasions he has tried to recreate the examples he read about the night before.

Simon playing around in Wolfram Mathematica, after reading about minor changes to the initial conditions of an idealised version of the kneading process
Simon working out a “study plan” for his Chinese lessons using a network system model he saw in Stephen Wolfram’s book “A New Kind of Science”
Biology, Murderous Maths

The All Common Ancestors Generation

This project is a simulation of how many people can stem from the same ancestor, something Simon has learned from James Grime’s “Every Baby is a Royal Baby” video on Numberphile. In this simplified version, there’re only 6 people per generation. Simon was throwing two dice to determine who the two parents were for every person (in the case when both dice came out to be the same number, this was considered “virgin birth” or simply that the father had come from outside the limited sample Simon was working with).

the present generation
Simon marking who the children of a person were in pink pencil
Some parents don’t have the digits corresponding to their children written next to them, but letters N and E: N means that that person from the parent generation had no children and is therefore related to no one from the future generations; E on the conrrary, means that that person “has been busy” and is related to everyone in the next generation!
identifying the most recent common ancestor generation and the identical ancestors generation
the all common ancestors generation
Biology, Coding, Java, JavaScript, Milestones, Simon makes gamez, Simon's Own Code

Simon has created an “immortal” organism?

The organism is the green triangle on the left

Simon opened up a genetic algorithm game he built about two years ago and made a fascinating discovery: one of the organisms seems to have become immortal! Simon has called his discovery “The Everlasting Vehicle” and saved the vehicle’s DNA.

Links to the game on GiHub:
Original code: https://github.com/simon-tiger/steering-behaviors-evolution
p5.js version: https://simon-tiger.github.io/Game_SteeringBehaviorsEvolution/SteeringBehaviours_EvolutionGame_p5/

Simon writes:
The last time I ran the program is a couple of hours ago. Everything died out, except for one vehicle.

Stats
I have programmed this with a genetic algorithm. They have a DNA with 4 genes.

Attraction/Repulsion to food
Attraction/Repulsion to poison
How far it can see food
How far it can see poison
They also have a health, which goes down over time. If they eat food, then their health goes up, if they eat poison, then their health suddenly goes down. A good health is 1, and a bad one is 0.

So what was The Everlasting Vehicle’s DNA and health?

Property Value
Attraction/Repulsion to food 1.9958444373034823
Attraction/Repulsion to poison 1.3554737395594456
How far it can see food 53.31017416626768
How far it can see poison 23.33902221893798
Average health ~397
So it attracts to poison, yet its health is approximately 397 times bigger than a very good health! And better yet, it even lasted for a couple of hours so far!!!

Credits:
Inspired by Daniel Shiffman’s Evolutionary Steering Behaviors Coding Challenge
Link to the Challenge: https://www.youtube.com/watch?v=flxOkx0yLrY

Biology, Physics, Simon teaching, Together with sis

Microstructures Interfering With Light

What looks like strange planets in dark space are actually glimpses of the microstructures forming the Giant Blue Morpho’s wings, as seen through a microscope. Simon told me about how a Blue Morpho’s wings aren’t actually blue (have no blue pigment) but appear blue as a result of a physical phenomenon called structural coloration — microstructures interfering with light. This is almost the same phenomenon as iridescence (making a surface appear to change colours as the observer’s angle of view or the illumination angle changes, think of the soap film in a bubble).

We had found Blue Morpho’s wings in the street about half a year ago. Someone threw a small butterfly collection away — several butterflies pinned to a stick. It looked very cruel and we would have never killed a Blue Morpho for the sake of an experiment, but since we stumbled upon such a rare treasure, we picked up one wing and stored it in a book.

Biology, Coding, Java, Milestones, Murderous Maths, Simon's Own Code

Barnsley Fern in Processing

Simon used an algorithm that applies transformations randomly, with some transformations more likely to be picked. The result is a stunning fern leaf pattern. Amazing how such beauty can be born from randomness. Simon’s code on GitHub: https://github.com/simon-tiger/barnsley_fern

 

Inspired by a math video on Numberphile about Chaos Game.

Biology, Coding, Java, JavaScript, Milestones, Murderous Maths, Notes on everyday life, Physics, Simon makes gamez, Simon's Own Code

Evolutionary Steering Behaviors Game

Note: See the update at the bottom of this post!

We’ve had quite a dramatic situation here for the past couple of days, after Simon turned Daniel Shiffman’s Evolutionary Steering Behaviors Coding Challenge into a game in Processing (Java) and then also in JavaScript (with p5). After completing the game in JavaScript, Simon wanted to add a new feature – a checkbox he programmed using the p5.js library. The checkbox would give the player the option to play with or without the timer, adjust the timer and also had a “New game” button. In the end it turned out that the checkbox didn’t really work. Simon was very upset and it took me hours to talk him into putting the game online even though the checkbox didn’t function (he wanted everything to be perfect) and ask for advice. “I have got a problem with a p5 element: In my setup function, I defined my checkbox. In my reset function, my checkbox is undefined. Why?” – Simon asked in the “Share Work” section of the Coding Train Slack channel, where he has the opportunity to communicate with experienced programmers. He received quite a lot of help and was enthusiastic about it at first, but for some reason, he hasn’t tried the solutions he was suggested. Perhaps it’s his gut feeling that the bind function suggested is still too difficult at the moment. I have decided not to push anymore and trust him on this one, although it’s always a dilemma for me whether I should sometimes “force” him into taking instructions from others or let him solely rely on his fantastic intrinsic autodidact mechanisms. The second seems to work better in terms of the learning process, but I do push him into sharing his work.

Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 3Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 4Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 5Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 6Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 7Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 8

Evolutionary Steering Behaviors game. Asking help in Slack 10 Jul 2017 2

Simon’s game is online at: https://simon-tiger.github.io/Game_SteeringBehaviorsEvolution/SteeringBehaviours_EvolutionGame_p5/

In the videos below Simon shows how he made the game. It’s an ecosystem type of genetic algorithm (with no generations), where the organisms (autonomous steering agents) clone themselves. The autonomous steering agents evolve the behavior of eating food (green dots) and avoiding poison (red dots). Simon added two invaders into the game, one giving food and the other randomly spreading poison. The player can control the “good” invader by moving him and making new food. The goal of the game is to make the agents survive for as long as possible.

The Processing (Java) version:

The thinking behind the game (Simon explains everything at the whiteboard):

The JavaScript version (now online):

In the last video, Simon talks about his problem with the p5 element.

 

Evolutionary Steering Behaviors game seek algorithm part 1. DESIRED equals TARGET minus POSITION:

Evolutionary Steering Behaviors game seek algorithm part 1. DESIRED equals TARGET minus POSITION 4 Jul 2017

Evolutionary Steering Behaviors game seek algorithm part 2. STEERING equals DESIRED minus VELOCITY:

Evolutionary Steering Behaviors game seek algorithm part 2. STEERING equals DESIRED minus VELOCITY 10 Jul 2017

UPDATE: When Simon saw Daniel Shiffman’s comment on Slack this morning (Daniel saying Simon did a fantastic job and that he might even include Simon’s game in the next Live Stream), he sat down and applied the bind function as suggested by his older peers above – without any incentive on my behalf! And it worked! I think we’ve hit a true milestone again. Simon has this growing feeling that he’s got friends out there, his tribe, who understand and who are ready to help.

One day later: Simon had another chat with his friends on Slack and got a lot of help with the last remaining small bug in his game (the New Game button didn’t start a new game if the player had chosen to play with no timer but jumped to Game Over instead). In the video below, Simon shows how that problem got solved:

Arduino, Biology, Coding, Electronics, Java, Milestones, Murderous Maths, Physics, RaspberryPi

Cellular Automata in Arduino

Yesterday Simon spent the whole day studying the concept of Cellular Automaton (CA), a discrete model of a system of “cell” objects used in physics, math and theoretical biology. He learned a lot from Daniel Shiffman’s tutorials on Cellular Automata and his book The Nature of Code (Chapter 7).

Simon describes Cellular Automaton as a set of rules for getting nature-like patterns. 1D cellular automata are static (think of a pattern resembling the Pascal triangle) and 2D are not static (the most famous example is Conway’s Game of Life).

The mathematician who made cellular automata a big thing (and even Turing-compatible!) was Stephen Wolfram. Simon also looked at some of Wolfram’s writings. Wolfram’s book A New Kind of Science is intimidating (in content and size) but full of graphic illustrations and available for free at http://www.wolframscience.com/nksonline/toc.html

A CA is basically a grid where cells live, each cell in a particular state (the simplest example being “1” or “0”). In Processing, it’s possible to have a CA draw a beautiful pattern this way. Simon tried to write a CA program in another language. He tried writing it in Python on his RaspberryPi first, but I overheard him say “don’t know how classes really work in Python, let’s try Ruby – I know how classes work in Ruby!” Then I saw him move over to the desktop and plug his long forgotten Arduino in. He said he now wanted to translate a CA code into C. Of course, there would be no pattern, but he wanted to have the Arduino “spit out numbers in the console” instead. Eventually he got an error and gave up, but it was intriguing to observe him.

The videos below show Simon talk about CA and program a CA in Arduino (C):

 

 

 

 

 

DSC_0151

 

DSC_0161

 

Cellular Automation 31 Mei 2017

Biology, Coding, Java, Murderous Maths

Autonomous Agents and Genetic Algorithms

Today Simon spent hours watching videos and reading Daniel Shiffman’s book The Nature of Code, concentrating on more complicated matters than ever: autonomous agents and evolution (genetic algorithms). In The Nature of Code there are two separate chapters covering these topics.  The term autonomous agent is defined as “an entity that makes its own choices about how to act in its environment without any influence from a leader or global plan”. This basically means that Simon has decided to try programming smart entities, that are like living things (have their DNA’s, behaviours, evolution).

The Autonomous Agent chapter also talks about steering force:

 

In the videos below, Simon has studied the steering behaviors in Daniel Shiffman’s code (Seek, Flee and Arrival) and changed the code slightly (third video) to be able to switch between the behaviours with a click of the mouse:

I also saw Simon go through the paper called Steering behaviours For Autonomous Characters by Craig W. Reynolds and reading about Persuit and Evade steering behaviours at this game development page.

In the video below Simon adjusted the Evolve Flow Field code to be able to see the possible behaviours (velocity vectors) of his smart rockets.

The code comes from the chapter Evolution of Code in Daniel Shiffman’s book, the chapter mainly devoted to genetic algorithms: it looks at the core principles behind Darwinian evolutionary theory and develops a set of algorithms inspired by these principles.

One of the most interesting notions Simon came across today was fitness, as in survival of the fittest. In the video you see Simon creating obstacles for the smart rockets. Together we observed how, as many generations of rockets passed, they learned to go around the obstacles better. This was possible because the rocket’s fitness was programmed to be greatly reduced every time it hit an obstacle.

All the rockets also have DNA’s: “We are marching through the array of PVectors and applying them one at a time as a force to the rocket”, Daniel Shiffman explains.

Simon also learned about genotypes and phenotypes, mating pool, crossover and mutation. He loved Daniel Shiffman’s example about haw many generations of strings with 18 random “genes” it would take to write “To be or not to be”.

Shakespear Evolution 18 Apr 2017