You're reading: cp’s mathem-o-blog

I’ve made my own numbers-in-a-grid game


For the past couple of weeks, I’ve been obsessively playing the game Twenty on my phone. The fact that my wife has consistently been ahead of my high scores has nothing to do with it.

The main source of strife in my marriage.

The main source of strife in my marriage.

Twenty is another in the current spate of “numbers-in-a-grid” games that also includes Threes, 10242048 (and its $2^{48}$ clones), Just Get 10, and Quento.

The basic idea is that you have a grid of numbered tiles, and you combine them to build up your score. While there are lots of unimaginative derivatives of the bigger games, there’s a surprisingly large range of different games following this template.

With so many different games being created, I thought that a chap like me should be able to come up with a numbers-in-a-grid game of my own. Yet, for a long time, I just couldn’t come up with anything that was any good.

Yesterday I had a really nice shower, and the accompanying feeling that I’d come up with a really good idea – make a game to do with arithmetic progressions.

#thatlogicproblem round-up

C: $K_A m; \\ K_B d.$

A: $\neg K_A d; \\ m \vDash \neg K_B m.$

B: $d \not\vDash K_B m; \\ (K_A(\neg K_B m)) \vDash K_B (m,d).$

A: $m \wedge K_B(m,d) \vDash K_A (m,d).$

Albert, Bernard and Cheryl have had a busy week. They’re the stars of #thatlogicproblem, a question from a Singapore maths test that was posted to Facebook by a TV presenter and quickly sent the internet deduction-crazy.

First of all: no, it’s not meant to be answered by an average Singaporean student. It’s a hard question from a schools Olympiad test.

I bought


I’m a big fan of novelty domain names: I once bought just so that could be my corresponding address when I submitted a paper. That domain has expired, but my love for one-shot novelty purchases has not!

To celebrate π day this year, I decided that it should be possible to type a little bit of π into the internet and be given the rest of it. You can have dots in domain names, so a domain like “” is possible. I only know π to two decimal places off the top of my head, so I was dismayed to learn that is being squatted.

After a bit of googling to find more digits of π (hey, this website will be really useful once I set it up!), I found the first decimal approximation which hasn’t already been registered:

Try going there now. It really exists!

I’ve set it up so you get an endlessly scrolling list of decimal digits of π, generated using my favourite unbounded spigot algorithm. I suppose you can consider this my entry in our π approximation challenge.

A good π day’s work.

Wolfram|Alpha can’t. But CP can!

For a while, I’ve been following this cool Twitter account that tweets questions Wolfram|Alpha can’t answer. The genius of it is that the questions all look like things that you could half-imagine the solution algorithm for at a glance, and many of them look like the kinds of questions Wolfram like to give as examples when they’re showing off how clever their system is.

Questions like this:

The answer to that is 278. How do I know that? I know that because I went on a little problem-solving binge answering the questions that Wolfram|Alpha can’t.

Watch out! I’m a blue whale and I’m about to land on you!


I don’t know why this question popped into my head, but it’s been sitting there for the past week and showing no signs of moving on.

Suppose an enemy of mine threw a friendly blue whale at me. Being a friendly whale, it makes the blue-whale-noise equivalent of “DUCK!” to warn me it’s coming.

How quickly does the whale need to be travelling for its warning to be useful?

Apparently I’m not a maths genius (or, On the Subject of Parcel Sizes)

This article on BBC News caught my eye because it has “maths” in the headline. Yes, I’m that easily pleased.

Somewhere in the middle, it says that myHermes requires the “volumetric area” of a parcel to be less than 225cm. That’s right: the “volumetric area” is neither a volume nor an area but a length. Anyway, the formula for volumetric area of a package with sides $a,b,c$, where $a \leq b \leq c$, is

\[ 2(a+b) + c \]

(Importantly, $a$ and $b$ are always the two shortest sides of the package)

So the constraint is

\[ 2(a+b) + c \leq 225 \]

In the next paragraph is the puzzling statement that the maximum allowable volume for a package is $82.68$ litres, or $82680$ cm3. How did they get that?

I decided to do some calculus of variations, or whatever it’s called.

The conclusions you can draw from this graph will SHOCK you

This is a blog post based on a Google+ post about a tweet. I can only hope that it will inspire a further flourishing of vines, instagrams and Yo!-s.

I saw this graph (originally from job stats site posted by a functional programming news site:


The accompanying tweet said

“More reasons to choice Functional Programming – #Clojure and #Haskell highest paying #engineer salaries!”.

Well, should I “choice” Haskell or Clojure, based on the evidence in this graph?