This random number generator Simon built in Processing simultaneously graphs the probability of the values as you “throw the dice”. This is Simon’s own code and what’s more, he has turned it into a truly scientific experiment/observation. Simon programmed the generator to automatically throw the dice every 60 frames a second (i.e. every 1/15th of a second). The graph showing the probability of certain values should increasingly resemble a perfect isoceles triangle the more throws occur, because the probability of you getting 7 is much higher than those of getting 2 or 12.
The perfect triangle was drawn at around 4000 throws.
Simon also experimented with programming the same generator for 3 dice. The graph should then form a bell shaped curve, a parabola, and takes a longer while to shape up. “As the number of dice grows towards infinity, the distribution will change from a uniform distribution to a Gaussian distribution”, – Simon explains.
Simon’s live stream last night was a blast. Simon worked on two games on a grid: 15s Puzzle and Connect Four, both in Processing (Java). He had already made the 15s Puzzle before, but built the Connect Four (also called Four in a Row) without any prior preparation.
The stream got lots of views as Daniel Shiffman kindly advertised it again on his Twitter:
Let me also archive the live chat here, to save it from oblivion:
Simon playing his game together with sis:
Programmed a random number generator to hep him with a card trick. Inspired by Numberphile:
This is a project about pattern. “Some people look for patterns. We call those people mathematicians”, Matt Parker said in a Numberphile video. I think I have never heard a description that would suit Simon better. He has always been looking for patterns, everywhere – in music, in toys, in ice-cream menus, in books about space or chemistry manuals. When he was little and spent days ranking planets and stars from memory, we used to think space was his true interest. Or elementary particles. Or the periodic table. Or Japanese letters. Or Greek letters. As it turned out later, he simply picked the topics that had more pattern in them, that were easy to classify. To this day, he enjoys music theory much more than actually playing the piano, and when listening to music I see him move his hand rhythmically every time a recognisable/ repetitive pattern is distinguishable.
In the video below, Simon is trying to build a Hilbert Curve (a space filling curve, a type of fractal) in Processing. The project was inspired by the math videos by 3Blue1Brown and the Koch Snowflake example by Daniel Shiffman (Chapter 8 in his book The Nature of Code, Fractals).
Links to the Hilbert Curve videos on the 3Blue1Brown channel:
Simon built this game inspired by a Numberphile video (he had never seen or played the actual puzzle before, but I have as a kid). The code is Simon’s own, here is a link to the code on GitHub: https://github.com/simon-tiger/15s_puzzle
Link to Simon’s sketch: http://alpha.editor.p5js.org/simontiger/sketches/rJeKLICmM
Simon later also made a pixel level version: http://alpha.editor.p5js.org/simontiger/sketches/rJeKLICmM
And a version with multiple ants: http://alpha.editor.p5js.org/simontiger/sketches/r1Ry_FQ4M
(Simon also loves the Numberphile video about how Langton’s Ant works and forms a mysterious “highway” after a certain number of moves).
Simon came up with this Fibonacci function while taking a walk downtown:
f(0) = 0
f(1) = 1
f(n) = f(n-1)+f(n-2)
When we got home, he used the function to build a Fibonacci counter in p5.js:
You can play with Simon’s Fibonacci counter online at: https://alpha.editor.p5js.org/simontiger/sketches/Skhr3o8Gf
The idea about the Fibonacci function struck Simon when he was looking down at the cobbles under his feet. “Look, Mom! It’s a golden rectangle!”, he shouted:
He had read that golden ratio has a direct connection to the Fibonacci sequence. The same evening, he took out his compasses to draw a golden rectangle (this time not his own invention, but following the steps from his Murderous Math book):
If you turn the page, the smaller rectangle is a golden rectangle as well, and if you slice a square off of it, the remaining rectangle will also have the golden proportions. You can continue doing this infinitely. The sizes of the rectangles will exactly correspond to the numbers in the Fibonacci sequence, which makes these drawings an illustration to the sequence.
The math behind this project comes from the amazing math channel 3Blue1Brown: https://www.youtube.com/watch?v=QJYmyhnaaek
Inspired by a Meth Meth Method Tetris video, Simon has come back to his Tetris project in Processing, something he started a long while ago and never finished. At the moment, the primary difficulty he experiences is having the pieces accumulate at the bottom of the grid and not vanish immediately once hit by other pieces. Work in progress.
Link to Simon’s project in progress: https://codepen.io/simontiger/pen/LOg…
The walk begins with a white grid. Every time the walker first visits a cell, it first turns purple and the green number inside the cell increments with every next visit. Simon wants to assign a musical tone to each cell as a next step.
He started working on his own database for the tone frequencies (7 octaves in the 7 x 7 grid), but later lost all his (unsaved) work when his laptop froze. Not sure anymore whether this project will ever get finished 😦 as Simon doesn’t feel like retyping the database again.