Mathspp Blog

A blog dedicated to mathematics and programming!

This blog has a really interesting assortment of articles on mathematics and programming. You can use the tags to your right to find topics that interest you, or you may want to have a look at

You can also subscribe to the blog newsletter.

1033
Problem #024 - hats in a line

Some people are standing quiet in a line, each person with a hat that has one of two colours. How many people can guess their colour correctly?

603
Filling your Pokédex - a probabilistic outlook

Join me in this blog post for Pokéfans and mathematicians alike. Together we'll find out how long it would take to fill your complete Pokédex by only performing random trades.

671
Implementing an interpreter in 14 lines of Python.

In this blog post I'll show you how you can write a full interpreter for the brainf*ck programming language in just 14 lines of Python. Be prepared, however, to see some unconventional Python code!

759
Problem #023 - guess the polynomial

In this problem you have to devise a strategy to beat the computer in a "guess the polynomial" game.

471
Twitter proof: consecutive integers are coprime

Let's prove that if $$k$$ is an integer, then $$\gcd(k, k+1) = 1$$. That is, any two consecutive integers are coprime.

477
Twitter proof: maximising the product with a fixed sum

Let's prove that if you want to maximise $$ab$$ with $$a + b$$ equal to a constant value $$k$$, then you want $$a = b = \frac{k}{2}$$.

680
Problem #022 - coprimes in the crowd

This simple problem is an example of a very interesting phenomenon: if you have a large enough "universe" to consider, even randomly picked parts exhibit structured properties.