FIBONACCI Nil

FIBONACCI Nil
MICHAEL J ,
WHINIHAN9 MEBFGRD SENIOR HIGH SCHOOL
The termNim refers to any mathematical game in which two players r e move objects from one or more piles.
Fibonacci Nim was invented by Dr.
R. E. Gaskell of Oregon State University, and is a variation of One Pile [ l ].
In One Pile, two players alternately remove at least a, but no more than q
objects from a pile of n objects, the winner being the player who removes the
last object, where n is a variable integer, and a and q are predetermined
integral constants.
The strategy is to leave your opponent a situation where
n = 0 modulo (a + q). This is a "safe position. " When n = i modulo (a + q)
where i t 0, the position is "unsafe. ?T
An unsafe [2] position is defined as one in which at least one winning move
is possible. A safe position is one in which there are no winning moves possible and every move on this position must make the position unsafe.
In Fibonacci Nim, the determination of safe and unsafe positions is
slightly more complex than in One Pile.
RULES OF THE GAME
The rules of Fibonacci Nim are the same as in One Pile with a = 1; but
q, a constant in One Pile, is a variable in this game. On the first move,
is equal to n - 1. After the first move, q
is equal to twice the number of
objects removed by the opponent on the (m - l)th move.
Let r
number of objects removed by a player on the (m - l)th move.
2r
_v
qt
__. be the
Then: q
=
For example, if n = 16, on the first move player A may remove up
to 15. If he removes 3, player B may remove as many as 6, since q2 = 2r 4
= 2 - 3 = 6. If player B removes 4, then A may remove as many as 8, and
so on.
STRATEGY
As in all Nim games, the strategy of Fibonacci Nim calls for the determination of safe positions.
The simplest way to determine whether any given
situation is safe is to first represent the number of objects left in a Fibonacci
number system.*
*See comment No. 1 at the end of this article.
9
FIBONACCI NIM
10
To r e p r e s e n t a given n u m b e r
quence i s u s e d , w h e r e b
[Dec.
n in the b i n a r y s y s t e m , the b i n a r y s e -
= b _., + b
-,
and
ht i s defined a s
Fibonacci sequence be defined in the following way: f
f_A
is defined a s
0 and f0
a s 1,
f1 through f6
= f
1.
+ f
Let the
„, w h e r e
a r e then d e t e r m i n e d a s 1, 29
3, 5 9 8 and 13.
It i s g e n e r a l l y known that by using e i t h e r a 1 o r a 0 in the nth
digit
from the left of the d e c i m a l point to r e p r e s e n t the p r e s e n c e or a b s e n c e of b ,
any n u m b e r m a y be r e p r e s e n t e d .
bls b2j
S i m i l a r l y ? using fls
f2,
e t c . in p l a c e of
e t c . , any n u m b e r may be r e p r e s e n t e d in a Fibonacci n u m b e r
if one r e m e m b e r s to s t a r t m a r k i n g the l a r g e s t digits f i r s t .
ways r e p r e s e n t e d a s
10000 f and n e v e r as
1100,. o r
1011 f .
Thus,
8
system,
is al-
Notice that using
t h i s r u l e not only m a k e s the r e p r e s e n t a t i o n of any given n u m b e r unique, it also
m a k e s it i m p o s s i b l e for two l f s
to a p p e a r in a n u m b e r without at l e a s t one 0
s e p a r a t i n g them.*
In the r e p r e s e n t a t i o n of any n u m b e r n > 0 in the Fibonacci n u m b e r s y s t e m , t h e r e m u s t be at l e a s t one 1.
the mth move be
Let the
1 that i s f a r t h e s t to the r i g h t on
. If n - 19,
= 101001,, F• = ft = 1, . If n = 18,
m
ten
i
ten
ten
= 101000P, F = f44 = 5. If.9 on the mth m o v e , q
< F ?, the situation Is
f
* ^m
m
safe. If q
— F , the situation is unsafe, and the winning move is to r e m o v e
f
^m
m?
&
exactly
F
F
objects.
qt = 9 and F 1 = 2.
F o r e x a m p l e , if on the f i r s t move n = 10,
= 10010 f ,
Since qt > F l s
the situation i s unsafe and the winning
move i s to r e m o v e exactly 2 objects.
If p l a y e r A r e m o v e s 2 o b j e c t s , then for
player
B,
n = 8
= 10000 f 5 q 2 = 2r x = 4,
and
F 2 = 8.
Since
q2 <
F2,
the situation i s s a f e , and p l a y e r B will l o s e u n l e s s p l a y e r A m a k e s a m i s t a k e .
PROOF
To p r o v e the s t r a t e g y c o r r e c t , it m u s t be p r o v e n that unsafe positions can
always be m a d e safe and that safe p o s i t i o n s can only be m a d e unsafe.
FIRST RESULT
Any unsafe position can be made safe.
By
definition,» on the mth m o v e 5.
j
position. If F
won.
F
= n, then by r e m o v i n g F
m
can be r e m o v e d from an unsafe
objects the g a m e i s automatically
If n > F
i s the second
then, from the definition of F , t h e r e i s another
m
'
m*
•
1 from the right. Let the Fibonacci n u m b e r that this
*See c o m m e n t No. 2 at the end of t h i s a r t i c l e .
1 , which
'
1 repre-
1963]
FIBONACCI NIM
11
s e n t s be f, . Let the Fibonacci n u m b e r that F
r e p r e s e n t s be f.. It has a l ls:
m
^
i
r e a d y been shown that between any two l ' s in a Fibonacci r e p r e s e n t a t i o n of a
n u m b e r , that t h e r e m u s t be at l e a s t one 0. It follows that t h e r e i s at l e a s t one
Fibonacci n u m b e r g r e a t e r than f., but l e s s than f. . L e t f. be the next F i b i
k
j
onacci n u m b e r after f.. It may o r may not be the i m m e d i a t e p r e d e c e s s o r of
f
k-
f.
<
f.
3
< f. + f.
i
2f.
l
3
2f.
<
i
f
i
q
2F
m+l
V+i
But f, = F , . ,
k
m+1'
after
m
= 2f.
l
m
y
f
k
has been r e m o v e d .
q
T h u s , by r e m o v i n g F
k
m+l
< F
_,
m+1
objects from an unsafe position on the mth m o v e ,
the position will be safe on the
(m + l)th
move.
SECOND RESULT
Any move from a safe position m u s t make it unsafe.
Since any move on a safe position on the mth move can n e v e r take a s
manyJ a s F
o bJj e c t s 9, it follows that F ,., < F . Let n on the mth move
m
m+1
m
equal c + F
= c + f.. Let n on the (m + l)th move equal c + c, + F
'=
H
x
mi
'
m+1
c + Ci1 + 1 . Suppose CHl + f, can be w r i t t e n in the form f. 1 + f. 0 + f. _ • • •
h
n
i-l
i-o
i-5
f
+ f
If f. I s w r i t t e n 1000000 • • • 9 i. e. , a 1 followed by i - 1 0 ' s ,
then ct + t
digits.
is written
101010- • -101 followed by enough 0 f s to make
The l a s t 1, by definition, r e p r e s e n t s f^.
m e d i a t e p r e d e c e s s o r s of f, . If f
Let ff + f
i - l
b e the two i m -
is added to c± + f, , it is found that:
101010 • • • 101000 • • •
+ 100 •-•
1000000 • • . 000000 • •
In other w o r d s .5 GH
= f..* If CH
+ f, i s l e s s than f. - + f.
2 + f, + f
l
h
g
i
h
i-l
i-3
+
fi ?», it follows that c-,
Therefore:
' ' ' + fL
t , ,o
c l-, + L + f < f..
h+2
h?
h
g
l
h+2
h
h
g
l
*See c o m m e n t No. 3 at the end of this a r t i c l e .
0
+ f. >
i-5
12
FIBONACCI NIM
(1)
w
r
m
[Dec.
= f. - v(cil + f. ) s> f
i
h/
g
T h i s m e a n s that any move that l e a v e s f,
as F
.
m u s t r e m o v e at l e a s t f
objects.
f
2f
(2)
g
^
2f
^
f,
f
f- + f
>
f,
q , _, = 2r
^m+1
m
q
m+l
~
2f
q
m+l
~
f
h
g
(by e(
*uation W )
( b y e ( ^ u a t i o n ( 2 >)
But
f
L
= F
h
m+1 '
qH m+1., — Fm + 1...
move on a s a f e^p o s i ' and theJ-position i s unsafe. Thus any
J
tion m a k e s it unsafe.
GENERALIZED FIBONACCI NIM
Suppose
q^m = r m - 1-. Then the b i n a r yJ s Jy s t e m will d e t e r m i n e F
^
v(or
m
m o r e c o r r e c t l y , B ). Safe and unsafe positions will be d e t e r m i n e d in exactly
the s a m e way, and the proof p a r a l l e l s the one given above.
quence i s called a Fibonacci sequence of o r d e r
1,
sequence i s called a Fibonacci sequence of o r d e r
If the b i n a r y s e -
and the o r d i n a r y Fibonacci
2,
i s t h e r e a f o r m u l a for
finding a Fibonacci sequence of o r d e r n that will satisfy a Fibonacci Nim g a m e
where q
= n •r
- ? Dr. Gaskell and the author have worked on t h i s p r o b ^m
m-1
^
l e m independently and have found two different methods of d e t e r m i n i n g an o r d e r
n Fibonacci sequence.
of f. = f._1
+ f._
All of the s e q u e n c e s investigated so far take the f o r m
, but as of y e t no r e l a t i o n s h i p has been found between the
o r d e r of the sequence and p.
REFERENCES
1.
R i c h a r d L. F r e y (ed. ), The New Complete Hoyle (Philadelphia, David M c Kay Company, 1947) pp. 705 — 706.
2.
C h a r l e s L. Bouton,
??
Nim, A Game with a Complete Mathematical T h e o r y , "
Annals of M a t h e m a t i c s , 1901 — 1902, pp. 35 — 39.
1963 J
FIBONACCI NIM
13
Comments
1. While the proof makes use only of the fact that every Fibonacci number is at
least as large as its immediate predecessor and of the recurrence property,
fn = f
-^ + fn_2> i*
snou
l d be noted that Lucas numbers cannot be substituted
for Fibonacci numbers, because the number 2 cannot be represented in a
Lucas number system using only l ? s and 0 f s. One might define LA as 2 and
L2 as 1 in order to make a Lucas number system, but this would invalidate
the required property that every member of the sequence is at least a s large
as its predecessor.
2. (Editorial Comment) The uniqueness follows from Zeckendorf's Theorem. If
the Fibonacci numbers u ls u2, • • • are defined by \it = 1, u2 = 2, u
= u
4- un-2*
0 , n ^ 3.
Theorem. For each natural number N there is one and only one system
of natural numbers i 1? i 2 , ••• i , such that
N = u. + u. + • • • + ui , and i
ij
i2
1
d
v +• 1
., > i + 2 for 1 ^ v < d.
v
3. This is an example of how the Fibonacci number system, canbe used to prove
theorems about Fibonacci numbers. The example shown is a generalized form
of the theorems concerning the sum of odd or even Fibonacci numbers. Another
simple example is to find the sum of the Fibonacci numbers through f .
One
simply represents all the Fibonacci numbers through an arbitrary n, 5 for
example, in the Fibonacci number system: l l l l l f .
11111, = 10101 f + 1010,.
Since 10101,=
1 0 0 0 0 0f , - 1 ,ten and 1010,f = 10000,i - 1.ten', 11111,f = 110000,f
f
- 2, or 1000000, - 2. In other words, the sum of the Fibonacci numbers
through fn = fn+2
REQUEST
The Fibonacci Bibliographical Research Center desires that any reader
finding a Fibonacci reference send a card giving the reference and a brief description of the contents.
Please forward all such information to:
Fibonacci Bibliographical Research Center
Mathematics Department,
San Jose State College,
San Jose, California