Nim-like games

Before I start
0Z0Z0Z0L
Z0Z0Z0Z0
0Z0Z0Z0Z
Z0Z0Z0Z0
0Z0Z0Z0Z
Z0Z0Z0Z0
0Z0Z0Z0Z
Z0Z0Z0Z0
Before I start
0Z0Z0Z0Z0Z0Z0L
Z0Z0Z0Z0Z0Z0Z0
0Z0Z0Z0Z0Z0Z0Z
Z0Z0Z0Z0Z0Z0Z0
0Z0Z0Z0Z0Z0Z0Z
Z0Z0Z0Z0Z0Z0Z0
0Z0Z0Z0Z0Z0Z0Z
Z0Z0Z0Z0Z0Z0Z0
I
Players take turns to move the Queen west, south or southwest.
I
Player to get Queen to blue square first wins.
Nim-like games
Peter Rowlett
Sheffield Hallam University
[email protected]
Twitter @peterrowlett
Maths Jam Conference VI
7th November 2015
Nim
I
I
I
A game for two players.
Players take turns to remove objects from several piles,
subject to some rules.
The last player to remove an object is the winner
(or, sometimes, the loser).
Peter Rowlett Sheffield Hallam University
Nim-like games
1 / 10
Typical Nim example
I
I
I
Say we start with three
piles of matches of size
3, 4 and 5.
Players may remove as
many matches as they
like from a single pile
each turn.
Last player to remove a
match wins.
Peter Rowlett Sheffield Hallam University
||| |||| |||||
Nim-like games
2 / 10
How to solve it — illustration
I
Say we have three piles
of one match per pile.
I
If I remove one pile, you
must remove another
and I can remove the
third, meaning I win.
I
Looking at the xor sum
of the binary
representation of the
three piles:
1 ⊕ 1 ⊕ 1 = 1.
Peter Rowlett Sheffield Hallam University
| | |
I
A winning move is to
leave the xor sum at
zero at the end of my
go, e.g. here:
0 ⊕ 1 ⊕ 1 = 0.
Nim-like games
3 / 10
Typical Nim example
I
So the Nim-sum here is:
011 ⊕ 100 ⊕ 101 = 010.
||| |||| |||||
I
A winning move would
be to remove 2 matches
from the pile of 3:
001 ⊕ 100 ⊕ 101 = 000.
| |||| |||||
I
Play it through!
Peter Rowlett Sheffield Hallam University
Nim-like games
4 / 10
Solomon’s Stones
I
I
I
I
A game we use at the
Maths Arcade.
bit.ly/mathsarcade
Remove any number of
counters from any row
OR column.
Like overlapping
multi-pile Nim.
Studied by my project
student Anthony Fox
last year.
Peter Rowlett Sheffield Hallam University
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
Nim-like games
o
o o
o o o
o o o o
5 / 10
Wythoff’s Game
I
I
Two piles, an arbitrary
number of matches in
each pile.
Players take turns;
valid moves are:
I
I
I
||||||| |||||
remove at least one
from either pile;
remove at least one
from both piles
provided the same
number are removed
from each pile.
Player who takes the
last counter wins.
Peter Rowlett Sheffield Hallam University
Nim-like games
6 / 10
A nice thing about Nim-like games...
Peter Rowlett Sheffield Hallam University
Nim-like games
7 / 10
Wythoff’s Game
I
I
Two piles, an arbitrary
number of matches in
each pile.
Players take turns;
valid moves are:
I
I
I
is. . .
remove at least one
from either pile;
remove at least one
from both piles
provided the same
number are removed
from each pile.
Player who takes the
last counter wins.
Peter Rowlett Sheffield Hallam University
0Z0Z0Z0L
Z0Z0Z0Z0
0Z0Z0Z0Z
Z0Z0Z0Z0
0Z0Z0Z0Z
Z0Z0Z0Z0
I
Players take turns to
move the Queen west,
south or southwest.
I
Player to get Queen to
blue square first wins.
Nim-like games
8 / 10
Wythoff’s Game as a chessboard
I
I
‘Safe’ square: if you
leave the Queen there,
your opponent is forced
to put you in a winning
position (e.g. the two
Queens shown to the
left are ‘safe’).
Label the blue square as
(0,0). These Queens are
a symmetric pair with
coordinates (1,2)
((1,2) and (2,1)).
Peter Rowlett Sheffield Hallam University
0Z0Z0Z0Z
Z0Z0Z0Z0
0Z0Z0Z0Z
ZQZ0Z0Z0
0ZQZ0Z0Z
Z0Z0Z0Z0
I
I
The pattern of safe
squares is interesting.
There’s a Martin
Gardner article.
Nim-like games
9 / 10
Thanks
I
I
I
I’ve shown you Nim, Solomon’s Stones and
Wythoff’s Game.
Thank you for listening.
Me:
Peter Rowlett, Sheffield Hallam University.
[email protected].
peterrowlett.net.
Twitter @peterrowlett.
I
I
I
I
Peter Rowlett Sheffield Hallam University
Nim-like games
10 / 10