Coding, JavaScript, Murderous Maths, Physics, Simon teaching, Simon's Own Code, Simon's sketch book

Heat Equation Visualization

A visual solution to Fourier’s heat equation in p5. Play with the two versions online:

Inspired by 3Blue1Brown’s Differential Equations series.

Contributing, Milestones, Murderous Maths, Museum Time, Physics, Trips

The Brachistochrone

Simon believes that he has found a mistake in one of the installations at the Technopolis science museum. Or at least that the background description of the exhibit lacks a crucial piece of info. The exhibit that allows to simultaneously roll three equal-weight balls down three differently shaped tracks, with the start and the end at identical height in all the three tracks, supposes that the ball in the steepest track reaches the end the quickest. The explanation on the exhibit says that it is because that ball accelerates the most. Simon has noticed, however, that the middle track highly resembles a cycloid and says a cycloid is known to be the fastest descent, also called the Brachistochrone Curve in mathematics and physics.

In Simon’s own words:

You need the track to be steep, because then it will accelerate more – that’s right. But it also has to be quite a short track, otherwise it takes long to get from A to B – which is not in the explanation. It’s not the steepest track, it’s the balance between the shortest track and the steepest track.

Galileo Galilei thought that it is the arc of a circle. But then, Johan Bernoulli took over, and proved that the cycloid is the fastest.

The (only) most elegant proof I’ve seen so far is in this 3Blue1Brown video:

There’s also a VSauce1 video, where they made a mechanical version of this (like Technopolis):

Wikipedia Page:

We’ve also made some slow motion footage of us using the exhibit (you can see that the cycloid is slightly faster, but as far as I can tell, it’s not precision-made, so it wasn’t the fastest track every time):

I hope that you could mention the brachistochrone/ cycloid in your exhibit explanation. I don’t think you can include the proof, because for such a general audience, it can’t fit on a single postcard!

Coding, Java, Milestones, Murderous Maths, Physics, Simon makes gamez, Simon teaching, Simon's Own Code

Simon’s code for an intriguing problem from the 3Blue1Brown math channel

The number of collisions between two objects equals a number of digits of Pi. The code on GitHub:

Simon writes:

From where I got this
I called this sketch Pool_pi because the original paper about this (written in 2003) was called something like Pi in Pool. I learned about this from a recent 3Blue1Brown series:

1st video:
2nd video:
3rd video: [not out yet]

The idea
The idea is 2 blocks on a frictionless surface. One slides towards the other, that is facing a wall. All collisions are perfectly elastic.

If the two blocks have the same mass, you can quickly calculate that there will be 3 collisions.

If the one block is 100x the other, it just so happens that there will be 31 collisions.

If the one block is 10000x the other, there will be 314 collisions (I get tired of making graphics). If the one block is 1000000x the other, there will be 3141 collisions.

That’s pi!

The issue!
In my own code, I first used Box2D.
It worked for mass ratios of 1 and 100, but it didn’t work for 10000.

Then I started writing my own physics engine, hoping to fix this issue. But it was even worse.
I couldn’t even get 100 to work.

Then I figured that the blocks are colliding too frequently. So I slowed the 1st block down.
I could get 100 to work this way, but not 10000.

Can anybody help to fix this issue?

I borrowed part of the code from here:

Coding, Geometry Joys, Milestones, Murderous Maths, neural networks, Notes on everyday life

Just another day in graphs

Simon loves looking at things geometrically. Even when solving word problems, he tends to see them as a graph. And naturally, since he started doing more math related to machine learning, graphs have occupied an even larger portion of his brain! Below are his notes in Microsoft Paint today (from memory):

Slope of Line:

Slope of Line 15 November 2017

Steepness of Curve:

Steepness of Curve 15 November 2017

An awesome calculator Simon discovered online at that allows you to make mobile and static graphs: Polynomial 15 Nov 2017 Polynomial 15 Nov 2017 1

Yesterday’s notes on the chi function (something he learned through 3Blue1Brown‘s videos on Taylor polynomials):


Simon following The Math of Intelligence course by Siraj Raval:



Coding, Java, Murderous Maths, Simon teaching, Simon's Own Code

28 times 28

Simon programmed a presentation to explain why 28×28 is not the same as 20×20 + 8×8 geometrically. The code is quite complicated and involves some trigonometry and conditional statements: the grid is divided into different parts every time Simon clicks and depending on how many times he has already clicked. This is typical Simon – coming up with an inherently arduous and complex system to visualise the beauty of the world around him, even of the seemingly trivial things. By the way, the inspiration for the 28×28 grid came from Simon’s favourite math channel, 3Blue1Brown and its latest video on Neural Networks (the grid was used to explain computer vision).

Simon is doing quite a lot of sums in his head nowadays, looks like it’s a new trend. Today, while bathing in the fountain outside, he was calculating how long 1/16th of a minute lasted. And a couple days ago, while waiting for his appointment at the hospital, he calculated how long it would take someone to read a whole page of random numbers, taking an educated guess that one takes 4 seconds to read out one number and remembering Daniel Shiffman mentioned there were 100×5 numbers per page in his book.

Murderous Maths

The Towers of Hanoi

Simon is a fan of the 3Blue1Brown channel and absolutely loved their video on solving the Towers of Hanoi puzzle with binary and ternary numbers. He practiced a lot with both. Eventually he developed his own, rhythmic, way to solve the puzzle:

Applying ternary numbers (solving the puzzle in 80 steps):


The video on 3Blue1Brown channel:


Applying binary numbers (solving the puzzle in 15 steps):


Simon watching 3Blue1Brown videos:


He also really liked the video on Visualizing the Riemann zeta function and yelled “Mom, look how beautiful this is!” the whole time:


Still from the 3Blue1Brown video that Simon found mesmerizing:

Schermafbeelding 2017-10-05 om 10.50.38