The Mathematical Garden

 | Welcome  | Games  | Mathematical methods  | About us |
Games
Black and White
HEX
Magic
Mark Six
Recursion, Games and Strategy
The Towers of Hanoi
Sample game - tower of Hanoi
The Fibonacci Numbers
Finding the Maximum Element
A matches game
Sample game - matches
A knapsack problem
A gambler choice
SIM

A matches games

Suppose there are 30 matches on a table. I begin by picking up 1, 2 or 3 matches. Then my opponent must pick up 1, 2 or 3 matches. We continue in this fashion until the last match is picked up. The player who picks up the last match is the loser. How can I (the first player) be sure of winning the game ?

The value of game is equal to 1 if the player wins the game. The value of game is equal to 0 if the player loses the game. Define Sk to be the maximum value of game to the player whose move it is when k matches remain, where 0 £ k £ 30. The recurrence relation:
Sk =
max
j=1,2,3 
{ 1 - Sk-j },     k=4,...,30.
The initial conditions:
S0 = 1  S1 = 0

S2 = ?  S3 = ?

Department of Mathematics, HKU, 2010