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: https://github.com/simon-tiger/Pool_Pi

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: https://www.youtube.com/watch?v=HEfHFsfGXjs
2nd video: https://www.youtube.com/watch?v=jsYwFizhncE
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: https://processing.org/examples/circlecollision.html

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 desmos.com/calculator that allows you to make mobile and static graphs:

Desmos.com Polynomial 15 Nov 2017

Desmos.com Polynomial 15 Nov 2017 1

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

DSC_2858

Simon following The Math of Intelligence course by Siraj Raval:

DSC_2843

DSC_2840

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):

dsc_2146815009440.jpg

The video on 3Blue1Brown channel:

dsc_21422068863317.jpg

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

dsc_21401166111995.jpg

Simon watching 3Blue1Brown videos:

dsc_21431207562189.jpg

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

dsc_21471912328090.jpg

Still from the 3Blue1Brown video that Simon found mesmerizing:

Schermafbeelding 2017-10-05 om 10.50.38