In this live session, Simon continue my 15s puzzle redo live session (“yet again, but I swear this is going to be the last time I do this!” Simon said). Here’s a link to the previous part. This week’s live stream went great, Simon kept it concise, didn’t panic while debugging, largely thanks to a wonderful supportive audience. And he even got some interesting personal questions asked in the end!

# Tag: Java

# Magic Cards in Base 3!

Simon has developed his version of the Magic Cards, this time in Base 3. He invented this system completely on his own and actually created a program in Processing (Java), using ternary function, to make the cards! The the code for creating the five cards in Processing and exporting the images as png files is available on Simon’s page on GitHub: https://github.com/simon-tiger/browns-criterion-base3

To play the game, have someone think of a number between 0 and 242 and let that person look for his/her number on every card and tell you which colour it is on every card. Every card stands for a power of 3: 81, 27, 9, 3, and 1. There are three grids of numbers on every card, a blue grid (representing the zeros in base 3), a red grid (representing the ones in base 3), and a green grid (representing the twos in base 3). After your friend has found his/her number on all the five cards, you can go ahead and add all the results up to guess the number. Alternatively, if you find working with base 3 too difficult, just sum up all the red numbers in the top left corners (on all the cards where your friend’s number was red), then double all the red numbers in the top left corners (on all the cards where your friend’s number was green) and add all of those together to guess the number.

Simon started out by actually trying to draw the magic cards:

But quickly realised he’s better off writing a computer program to fill in the grids. When the program (pretty tough to write) was finally ready, he tried to print a card out and… ran out of ink on our home printer. Next, we rushed to the print shop, as it was about to close.

“Mom, I can calculate why it says 17 million colours! It’s 256 cubed!” (255 for Red, Green and Blue plus one for alpha).

Simon previously developed a magic card system for Prime Numbers and wrote a Java program that guessed the numbers using powers of two.

# Liva Stream #13. Math Puzzle: Logic.

In this live session, Simon works a little on his 15s puzzle redo that he started in his previous live session: https://www.youtube.com/watch?v=ixkLFYcb0T0 and programs a math/logic puzzle, checking whether the statement “Every card with a T on one side has a 3 on the other” is true or false. The original puzzle comes from an old video by James Grime, recorded before Simon was born (the fact that Simon finds particularly funny):

# Reds and Greens

Simon has crafted a nice game today, inspired by a video in which mathematician Katie Steckles shows several mathematical games. Simon wasn’t sure what the game was called so he named it “Reds and Greens”. The objective of the game is to accumulate a set of three cards sharing the same property (such as the same number of green dots or red dots, the same total number of reds and greens or a set in which all the three possible variants – one, two and three dots of the same color – would be present). Each player pulls a card from the stack (all the cards are lying face up) and the one who collects a set first wins. Simon has actually programmed the cards in Processing (Java) – quite a strenuous task. Below is the jpeg pic of what he made and his code in Processing.

Simon also explained how the game is very similar to Tic Tac Toe, look at the photo below and you’ll see why:

# Live Stream #12: 15’s Puzzle Redo

Simon had quite an audience yesterday during his live lesson. In this week’s session, Simon remade his 15’s Puzzle in Processing and explained the math behind it. He plans to finish the puzzle during his next live stream in two weeks from now (on April 19 at 17:15 CET).

# A Cool Number Guessing Trick! Or Brown’s Criterion in Processing

This is a fun number guessing trick, based on powers of 2 and the Fibonacci sequence, that even little kids can enjoy. You don’t have to know anything about the powers of 2 or Fibonacci to play this game, just basic addition up to 30. Yet, if you are more advanced, it is very interesting to see what lies underneath and even apply binary numbers to your guessing technique. Simon learned this trick from the Numberphile video on Brown’s Criterion.

Simon also made his own version of the game, based on prime numbers:

In this second part of the cool number guessing trick session, Simon shows his own version of the game, based on prime numbers. He discovered that it’s impossible to create this game for all numbers between 1 and 30 because some numbers (4 and 6) cannot be expressed as a sum of two different primes and was very upset about it. Yet he did manage to make the game and it works for all numbers except 4 and 6. To play the game, one player thinks of a number and the other player tries to guess it by asking whether the number is present on different sheets of paper. The answer is the sum of the numbers located in the top left corners of all the yes-sheets.

And please check out Part 3, where Simon actually programmed this game in Java (Processing):

Now it’s the computer guessing the number! The game is available on Simon’s GitHub to download at: https://github.com/simon-tiger/browns-criterion

Simon explained the rules in the GitHub README (because he “has a different writing style than Mom”, he said): https://github.com/simon-tiger/browns-criterion/blob/master/README.md

# 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.

# Patterns. Hilbert Curve in Processing.

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:

https://www.youtube.com/watch?v=3s7h2MHQtxc&t=1s

https://www.youtube.com/watch?v=RU0wScIj36o

# 15s Puzzle in Processing

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

# Tetris in Processing continued

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.