mathspp blog

433 474,041 38,905
articles words lines of code

Let's build a simple APL interpreter! APL is an array-oriented programming language I picked up recently. The ease with which I can write code related to mathematics, its strange built-ins (which look like ⍴, ⍨, ⍒ or ⍣) and the fact that it is executed from right to left make it a fresh learning experience!

This post gives the source code for a small Haskell program that finds if a formula is a tautology.

There's 100 drawers and 100 shuffled balls. Can you find the one I choose?

I mixed up my hamburgers while cooking. Can you help me out?

This post gives you the code to mess around with "Tupper's self-referential formula", a formula that plots itself.

This post shows how fractals occur naturally in broccoli, one of my favourite vegetables.

Can you cover all of the rational numbers in [0, 1] with tiny intervals?

Split the numbers 0, 1, ..., 15 into two sets with sum interesting properties!

Can you find out how many carriages this circular train has?

How can 2018 monks find eternal peace?

How often do the hands of a clock overlap?

In high school I had a colleague that had his birthday on the same day as I did. What a coincidence, right? Right..?

How can 4 friends guess their own hat colours?

How can a greedy pirate captain keep his treasure to himself?

Given some paper squares, can you slice them and then glue them back together to form a single square?

Is it true that every integer you can think of has a multiple written out only with \(0\)s and \(1\)s?

I find the problem in this post rather fun to think about because it is a problem about a game that can actually be played between two players.

In this post we will talk about three different, all very common, ways of writing proofs: proofs by construction, by contrapositive and by contradiction.

This problem is a really interesting problem I solved two times. The first time I solved it I failed to prove exactly how it works... then some years later I remembered the problem statement and was able to solve it properly. Let's see how you do!

I have always loved solving mazes... so naturally I had to write a program to solve mazes for me!