I was once asked by a ‘human resources’ manager (or rather manageress) if I could put together a few puzzles to help alleviate boredom in a software engineering team. It did not go too well, and eventually she was berated by higher management by introducing what they saw as a time waster. Here they are. I included ones that I had some past connection with, and did not just copy them out of the familiar ‘puzzle books’ that flood the shops at Christmas time.

1. (And the only one to do with programming. Standard ANSI C follows.)

#include <stdio.h>

int main() {
    int a, b;      /* declare a couple of integers */
    a = 1533907;   /* give them a couple of values ... */
    b = 2400069;   /* ... any values will do */

    printf("At the start,   a=%d, b=%d\n", a, b);

    a = a^b;       /* do something strange */
    b = a^b;       /* and again */
    a = a^b;       /* same again */

    printf("but now we get: a=%d, b=%d\n", a, b);

    /* Can you say what we get without running the program,
       and why we get it? */

    return 0;
}

2. The number 12! (that is, factorial 12) is 479,001,600 and ends with two zeroes. With how many zeroes does 12345! (factorial 12,345) end?

3.

This is a very old problem. Eratosthenes (let us say) is contemplating a gigantic statue of Alexander. Eratosthenes’ eyes are height e above the ground, the top of the statue (thin, like a work of Giacometti), is height s above the ground, the statue stands on a plinth of height p, and p > e. If Eratosthenes approaches the statue too closeley, he sees it foreshortened. If he stands too far away he sees it small. How far away should he stand to get the best view, that is, to maximise the angle which the statue subtends at his eye?

4. This is a problem of Lewis Carroll’s, deceptively simple, but illustrating a very important point in probability theory.

A box holds a single billiard ball, which is either white or, with equal probability, red. Another ball, which is red, is added to the box. Of the two balls in the box one is taken out at random, and it is found to be red. What is the probability that the remaining ball in the box is red?

5. Maths!
Let  sr(n)  =  n
Σ
i = 1
i r ,   that is, the sum from i equals 1 to n of i to the power r

So the formulae

s1(n) = 1/2 n (n + 1)
s2(n) = 1/6 n (n + 1) (2n + 1)
should be familiar, and perhaps also
s3(n) = 1/4 n2 (n + 1)2
In fact all the sr(n) are connected by this formula,
          sr(n)  =  1
r + 1
{ (n + 1) r+1 – 1 – r+1C2 sr–1(n) – r+1C3 sr–2(n) – . . . – r+1Cr+1 s0(n) },
where we use the notation   nCr  =  n!
r! (nr)!

Derive this formula and use it to find s4(n) and s5(n).

6. For mathematicians only: show that if the number of elements in a finite group is even, it has at least one element of order 2.

7. How to avoid the plague. Imagine a finite space, for example ellipse, triangle, even the surface of a sphere, and a number of people placed on the surface, practising social distancing. Among all the distances between pairs of individuals there will be a minimum, and the pair sharing this minimum will be at greatest risk of plague transmission. We want to position the individuals so that this minimum distance is made as large as possible, that is, we want to maximise this minimum. When this is done, we will say that the group of people as a whole is at MSD (maximum social distance).

How do you arrange three people in an empty square room to be at MSD? How many different placings are there for the group of people?

8. Think of a word in English which is plural, but which, if you add an ‘s’, becomes a word in the singular.

9.

Suppose AB is a tangent to an ellipse, with foci at F and G, meeting the ellipse at point T. Show that angles ATF and BTG are equal. (Hint: no need for a lot of algebra here: think of ATB as a mirror with G reflected in it at G′, and then consider the line FG′.)

From this, show that if you were on the inside of a large ellipsoidal mirror with a bright light at one focus, you would be very dazzled if you stood at the other focus.

10. And now for something completely different! Lewis Carroll’s almost forgotten ‘Sylvie and Bruno’ is intended for children, but when I read it as a child I found it pretty hard to understand. Read the extract in which Mein Herr and Lady Muriel make Fortunatus’s Purse, and identify the mathematical concept which it represents. Do Mein Herr’s claims for the purse correspond to the actual mathematical properties?