Computer Science, Murderous Maths, Simon's sketch book

The most efficient base

I’ve discovered that base 3 is the most efficient base (not base 2). Actually the most efficient base is e, and 3 is the closest to e (the proof requires Calculus).

South Korea has published a complete design of a ternary computer in July 2019! So this is actually cutting edge material here!

(Inefficiency is calculated by multiplying the number of digits by the base number).

Simon has also showed me a trick to translate any number into binary using a grid:

using acorns instead of pebbles

and a card trick based on quickly translating a number into binary in his head:

Coding, Crafty, Java, Math Tricks, Murderous Maths, Simon makes gamez

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:

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.