Coding, Logic, Math and Computer Science Everywhere, Milestones, Simon teaching, Simon's sketch book, Together with sis

Solving Logical Puzzles

The end of 2019 was packed with logic. Simon even started programming an AI that would solve logical puzzles, here is the beginning of this unfinished project (he switched to programming a chess AI instead). In the two vids below, he explains the puzzle he used as an example and outlines his plan to build the AI (the puzzles come from Brilliant.org):

And here are some impressions of Simon working on the puzzles and showing them to his sis:

Coding, Crafty, Experiments, Geometry Joys, JavaScript, Math and Computer Science Everywhere, Math Riddles, Milestones, Murderous Maths, Notes on everyday life, Simon makes gamez, Simon teaching, Simon's Own Code, Simon's sketch book

Approximating pi and e with Randomness

This has been one of Simon’s most ambitious (successful) projects so far and a beautiful grand finale of 2019, also marking his channel reaching 1K subscribers. The project – approximating Euler’s number (e) in a very weird way – is based upon a Putnam exam puzzle that Simon managed to prove:

The main part of the project was inspired by 3Blue1Brown Grant Sanderson’s guest appearance on Numberphile called Darts in Higher Dimensions, showing how one’s probable score would end up being e to the power of pi/4. Simon automated the game and used the visualization to approximate e. Below is the main video Approximating pi and e with Randomness. You can run the project online at: https://editor.p5js.org/simontiger/present/fNl0aoDtW

Code: https://editor.p5js.org/simontiger/sketches/fNl0aoDtW

The history and the math behind the project:

Simon’s proof od the math behind the project:

Simon has visualized this problem and proof at: https://editor.p5js.org/simontiger/present/2uMPZ8THW

Code: https://editor.p5js.org/simontiger/sketches/2uMPZ8THW

Coding, Crafty, Experiments, JavaScript, Math and Computer Science Everywhere, Milestones, Murderous Maths, Physics, Simon teaching, Simon's Own Code, Simon's sketch book

Galton Board in p5.js

Simon saw a prototype of this Galton Board in a video about maths toys (it works similarly to a sand timer in a see-through container). He created his digital simulation using p5.js online editor, free for everyone to enjoy:

https://editor.p5js.org/simontiger/sketches/h7p-wZCw8

Coding, Computer Science, Good Reads, JavaScript, Math and Computer Science Everywhere, Milestones, Notes on everyday life, Physics, Simon teaching, Simon's Own Code

Crack Simulation in p5.js

Link to the interactive project and the code: https://editor.p5js.org/simontiger/sketches/n6-WZhMC3

Simon built a simple cellular automaton (rule 22) model for fracture. He read about this model a couple nights before in Stephen Wolfram’s “A New Kind of Science” and recreated it from memory.

Stephen Wolfram: “Even though no randomness is inserted from outside, the paths of the cracks that emerge from this model appear to a large extent random. There is some evidence from physical experiments that dislocations around cracks can form patterns that look similar to the grey and white backgrounds above” (p.375).

Crafty, Math and Computer Science Everywhere, Math Riddles, motor skills, Murderous Maths, Simon makes gamez, Simon teaching, Simon's sketch book

Proof Visualization. Warning: Mind-boggling!

Inspired by the Card Flipping Proof by Numberphile, Simon created his own version of this proof. He made a solitaire game and proved why it would be impossible to solve with an even number of orange-side-up circles. He drew all the shapes in Microsoft Paint, printed them out and spent something like two hours cutting them out, but it was worth it!

The colourful pieces in the lower row are a “key” to solve the solitaire puzzle. The objective is to remove all the circles. One can only remove a circle if it’s orange side up. Once a circle is removed, its neighbouring circles have to be flipped. Using the key, start with the yellow pieces, and move in the direction of the “grater than” sign (from smallest to largest).

If there’s an odd number of orange circles in the middle, then the end pieces are the same, both orange or both white. In both cases the total number of orange circles will also be odd. If there’s an even number of orange circles in the middle, then the ends have to be different (one orange, one white).

In the case of odd number of orange pieces, the ends have to match. In the case of an even number of orange pieces, you would have pieces that point the same way at both ends. “Now we’ve proven that to make this puzzle possible it has to have an odd number of orange pieces”, Simon says.

Why? Imagine a stick figure that always walks to the right, but always faces in the direction of the arrow (as in it can’t go backwards). It would flip every time it reaches an orange circle. Focusing on everything except the ends, if there are an odd number of orange circles, the puzzle pieces would face the other way. Which means that the end pieces are the same, and therefore the end circles are the same. If there are an even number of orange circles in the middle, the puzzle pieces would face the same way. Which means that the end pieces are different, and therefore the end circles are different.

Simon finds this sort of proof easy, but I felt like my brains are going to boil and dripple through my ears and nostrils. He patently exlained it to me several times and types the above explanation, too.

Crafty, Math and Computer Science Everywhere, Notes on everyday life, Simon makes gamez, Simon's sketch book, Together with sis

Sinterklaas math game with “gingerbread buttons”

It’s Sinterklaas season in the Dutch-speaking world and, of course, as we have started baking the traditional spiced cookies called kruidnoten (“gingerbread buttons”) Simon didn’t want to miss an opportunity to play a version of peg solitaire with eatable pieces!

Simon has baked these himself (together with Neva)
the winning strategy
Simon mixing the right proportion of spices, grinding clove (then adding nutmeg, white pepper, ginger, cardamom and cinnamon)
Math and Computer Science Everywhere, Milestones, Murderous Maths

Simon’s Cycle Formula

During Chinese lesson yesterday, Simon came up with what he calls his “Cycle formula” to calculate all the permutations of placing n numbers in a cyclical order (like on a clock face). He also proved the formula. Wait, Chinese lesson? Yes, I know, this guy manages to squeeze some math everywhere. His Chinese tutor loved it by the way. “Well, we’ve both learned something!” Simon exclaimed delightfully.

the formula is (n-1)!
Computer Science, Engineering, Good Reads, Math and Computer Science Everywhere, Murderous Maths, Notes on everyday life, Physics, Simon teaching, Simon's sketch book, Together with sis

Zutopedia, a fun Computer Science Resource

Through the whole moth of October, Simon really loved watching Computer Science and Physics videos by Udi Aharoni, a researcher at IBM research labs and creator of the Udiprod channel https://www.youtube.com/user/udiprod and the Zutopedia website http://www.zutopedia.com/ Simon’s favourite has been the Halting Problem video that he also explained to his little sister.

In the example below, Simon has applied a compression algorithm to a sentence by transforming the sentence into a tree where all the letters have their corresponding frequencies in this sentence. “Can you get back to the sentence? You have to first transform the letters into ones and zeros using the tree (the tree is a way to encode it into ones and zeros that’s better than ASCII)”.

Simon learned this at http://www.zutopedia.com/compression.html
thanks to the Udiprod channel, Simon has also revisited sorting algorithms and spent hours comparing them, this time using self-made number cards