This blog has moved to www.mscroggs.co.uk.

## Sunday, 24 August 2014

### Sunday Afternoon Maths XXVI

Here's this week's collection. Answers & extensions tomorrow. Why not discuss the problems on Twitter using #SundayAfternoonMaths or on Reddit.
It's no late to get tickets for EMF Camp, where I will be giving a talk on flexagons, folding tube maps and braiding.

#### Twenty-One

Scott and Virgil are playing a game. In the game the first player says 1, 2 or 3, then the next player can add 1, 2 or 3 to the number and so on. The player who is forced to say 21 or above loses. The first game went like so:
Scott: 3
Virgil: 4
Scott: 5
Virgil: 6
Scott: 9
Virgil: 12
Scott: 15
Virgil 17
Scott: 20
Virgil: 21
Virgil loses.
To give him a better chance of winning, Scott lets Virgil choose whether to go first or second in the next game. What should Virgil do?

#### Odd and Even Outputs

Let $$g:\mathbb{N}\times\mathbb{N}\rightarrow\mathbb{N}$$ be a function.
This means that $$g$$ takes two natural number inputs and gives one natural number output. For example if $$g$$ is defined by $$g(n,m)=n+m$$ then $$g(3,4)=7$$ and $$g(10,2)=12$$.
The function $$g(n,m)=n+m$$ will give an even output if $$n$$ and $$m$$ are both odd or both even and an odd output if one is odd and the other is even. This could be summarised in the following table:
 $$n$$ odd even $$m$$ odd even odd e odd even
Using only $$+$$ and $$\times$$, can you construct functions $$g(n,m)$$ which give the following output tables:
 $$n$$ odd even $$m$$ odd odd odd e odd odd
 $$n$$ odd even $$m$$ odd odd odd e odd even
 $$n$$ odd even $$m$$ odd odd odd e even odd
 $$n$$ odd even $$m$$ odd odd odd e even even
 $$n$$ odd even $$m$$ odd odd even e odd odd
 $$n$$ odd even $$m$$ odd odd even e odd even
 $$n$$ odd even $$m$$ odd odd even e even odd
 $$n$$ odd even $$m$$ odd odd even e even even
 $$n$$ odd even $$m$$ odd even odd e odd odd
 $$n$$ odd even $$m$$ odd even odd e odd even
 $$n$$ odd even $$m$$ odd even odd e even odd
 $$n$$ odd even $$m$$ odd even odd e even even
 $$n$$ odd even $$m$$ odd even even e odd odd
 $$n$$ odd even $$m$$ odd even even e odd even
 $$n$$ odd even $$m$$ odd even even e even odd
 $$n$$ odd even $$m$$ odd even even e even even