New Chocolate Games - Open Journal Systems

GSTF Journal of Mathematics, Statistics and Operations Research (JMSOR) Vol.1 No.1
New Chocolate Games
Variants of the Game of Nim
Ryohei Miyadera, Shunsuke Nakamura and Ryo Hanafusa
Abstract—In this article chocolate games that are variants of the
game of nim are studied. The traditional chocolate game was
presented as a rectangle shaped figure, and in this article the
authors present new chocolate games. These new chocolate games
have interesting mathematical structures, since the coordinates of
states of the game satisfy inequalities. The authors are the first
researchers to study chocolate games conditioned by inequalities.
As to the coordinates of the states, see Example 1.2 of this article.
The authors proved some formulas of L-states (losing states) for
these new games, and made a new function that is more efficient
than Grundy Number.
One of the most important topics of chocolate games is to find
all the L states and the W states of games.
For the L states of the chocolate of Fig 1.1 see the problem
corner in [1]. See also Theorem 7.12 in [2] (p-138). Note that in
[2] they use the term "P-position" instead of "L state" of this
article. We define nim-sum that is important for the theory of
games. We denote by Z ³0 the set of non-negative integers.
Definition 1.3. Let x,y ÎZ³0 , and write them in base 2, so
n
x
Keywords; chocolate game, combinatorial games, computer
algebra system, Grundy Number, losing state, nim.
n
xi 2i and y
i 0
i 0
nim-sum x
yi 2i with xi,yi Î{0,1} . We define the
y by
n
x
I. INTRODUCTION TO THE CHOCOLATE GAME
wi 2i ,
(1.1)
i 0
In this article we study new (bitter) chocolate games. The
chocolate games are very simple to play, but they are interesting
mathematically.
where wi
Definition 1.1. Given a pieces of chocolate, where the light gray
parts are sweet and the dark gray part is very bitter. This game is
played by two players in turn. Each player breaks the chocolate
(in a straight line along the grooves) and eats the piece he breaks
off. The player to leave his opponent with the single bitter part is
the winner.
x
Note that in Definition 1.1 we are considering a normal play
game, since the player who breaks off the last groove wins.
Example 1.1. The chocolate of Fig 1.1 is proposed by Robin [1],
and the chocolate of Fig 1.2 is a new game proposed by the
authors.
FIGURE 1.1.
y
FIGURE 1.2.
When we study the chocolate games, there are two important
states of chocolates.
Definition 1.2. Here we define two important states of
chocolates.
(a) W States, from which we can force a win, as long as we play
correctly at every stage.
(b) L States, from which we will lose however well we play, but
we may end up winning if our opponents make a mistake.
xi
yi (mod 2).
Theorem 1.1. Let x, y, z
y
z
0 and x
y
Z 0 . Then we have x
z
y
z
0,
0 for x ¢ < x, y¢ < y, z¢ < z .
This is a well known result of nim-sum. For a proof see Theorem
7.12 in [2] (p-139).
In the next example we study new chocolate games made by the
authors. We denote by Z ³0 the set of non-negative integers.
Example 1.2. Here we have the chocolate game in Fig1.2.You
can cut this chocolate in 3 ways. You can cut it -end to end- from
the upper left to the lower right on the left side of the bitter part,
horizontally above the bitter part, or from the upper left to the
lower right on the right side of the bitter part.
Therefore it is proper to represent this chocolate with {x,y,z},
where x,y,z stand for the maximum numbers of times that we
can cut this chocolate in each direction. For example in Fig 1.2
we can cut 2 times at most horizontally, and hence the second
coordinate y =2. Similarly we have x=2 and z = 5. Therefore we
represent the chocolate in Fig 1.2 with the coordinates {2,2,5}.
FIGURE 1.2. {2,2,5}
For any x, y, z ÎZ³0 we denote by {x,y,z}
coordinates {x,y,z}.
the state with
Manuscript received March 22, 2012.
111
© 2012 GSTF
GSTF Journal of Mathematics, Statistics and Operations Research (JMSOR) Vol.1 No.1
Example 1.3. Here we have four examples of states that we get,
when we play with the chocolate game of Fig 1.2
FIGURE 1.3.
FIGURE 1.4.
FIGURE 1.5.
II. A PROOF OF THEOREM 1.2
In this section we assume that x, y, z ÎZ³0 and we write them in
n
FIGURE 1.6.
base 2, so x
n
xi 2i , y
i 0
yi 2i and z
i 0
n
zi 2i with
i 0
xi , yi, zi Î{0,1} . We need several simple facts about the
relations between numbers in base 2 and the floor function.
{2,1,3}
{0,2,5}
{2,0,5}
{0,1,5}
It is clear that the coordinates of these states satisfy the
inequality 2 y z , and this is equivalent to the inequality
y
z/2 ,
(1.2)
where ëê úû is the floor function. Note that êë x úû is the largest
integer not greater than x for any real number x .
Inequality (1.2) is important to understand the structure of the
chocolate. If you start with the chocolate in Fig 1.2 and reduce
the third coordinate 5 to 3 by cutting from the upper left to the
lower right on the right side of the bitter part, then by the
structure of the chocolate the second coordinate is reduced to 1.
In this way we get the chocolate in Fig 1.3.
If we are to explain the move from the chocolate in Fig 1.2 to the
chocolate in Fig 1.3 using Inequality (1.2), we use the following
explanation.
By Inequality (1.2) and z=3 we get y=1.
Lemma 2.1. (1) y
Definition
1.4.
Let
A1 = {{x, y, z}; x, y, z ÎZ³0, y £ êë z / 2 úû and x Å y Å z = 0} ,
B1 = {{x, y, z}; x, y, z ÎZ³0, y £ êë z / 2úû and x Å y Å z ¹ 0} .
Theorem 1.2. A1 is the set of L states and B1 is the set of W
states of the game of Fig 1.2.
We prove this theorem in Section 2. Here we learn how to use
this theorem. By Theorem 1.2 we tell L states from W states,
and in Example 1.4 we learn how to win the game using this
theorem.
Example 1.4. By Theorem 1.2 the chocolate in Fig 1.2 with the
coordinates {2,2,5} is a W state, since 2 Å 2 Å 5 ¹ 0 .
Therefore you can win if you play as the first player. The
strategy is to move to an L state every time. For example you
can move to {2,1,3} that is an L state, since 2 Å1Å3 = 0 .
In this way you should leave the opponent with an L state every
time until you leave the opponent with the single block of bitter
chocolate whose coordinates are {0,0,0}. Then the game is
finished, and you win the game.
By Example 1.4 the strategy to win is clear. Even if you do not
read the proof of Theorem 1.2, you can be a good player of this
chocolate game.
if and only if yn = 0 and
yi = zi+1 for i = 0,1, 2,..., n -1.
(2) y
z / 2 if and only if yn = 0 , yi = zi+1 for i=m+1,
i = m + 2,..., n -1, ym = 0 < zm+1 = 1 for some m Z 0 .
Proof. When we write y,z in base 2, (1) and (2) of this theorem
is clear from the definition of floor function êë úû .
Lemma 2.2. We suppose that
x y z 0.
(2.1)
y
(1) Then
z/2
(2.2)
if and only if xn = zn = 1, yn = 0 and for each
i = 0,1, 2,..., n -1
and
Remark 1.3. As to the other chocolate games made by the
authors see [3], [4] and [6].
z/2
yi = zi+1
(2.3)
zi = xi + yi ( mod 2)
(2.4)
y < êë z / 2 úû
(2)
(2.5)
if and only if there exists m Z 0 such that
xn = zn = 1, yn = 0, (2.4) is valid for each i = 0,1, 2,..., n -1
, (2.3) is valid for each i = m +1, m + 2,..., n -1 and ym < zm+1 .
Proof. (1) and (2) are direct from Lemma 2.1 and the Definition
1.3 of nim-sum.
Remark 2.1. Suppose that x,y,z satisfy (2.1) and y £ êë z / 2 úû ,
n
then by using (2.3) and (2.4) repeatedly we get zi
x j (mod
j i
n
2) and yi
x j (mod 2) for i = k, k +1,..., n -1 for some
j i 1
k ÎZ³0 . Clearly y
if and only if k = 0 , and
z/2
y < êë z / 2 úû if and only if k > 0 and yk-1 < zk .
In particular, for any x there exist unique y, z that satisfy (2.1)
and (2.2).
Lemma 2.3. We suppose that
x Å y Å z = 0 and y = êë z / 2 úû .
(1) For any v
Z
0
(2.6)
with v < y , there exists w Z
0
such that
x Å v Å w = 0 and v £ êë w / 2 úû .
(2) If there exist v, w Z
112
0
such that x Å v Å w = 0
v < êëw / 2 úû , then v < y .
© 2012 GSTF
and
GSTF Journal of Mathematics, Statistics and Operations Research (JMSOR) Vol.1 No.1
then by Remark 2.1 we have y = v , and this contradicts the fact
v < y . Therefore x v w 0 .
Proof. By Lemma 2.2 we have
xn = zn = 1, yn = 0 and for each i = 0, 1, 2, ..., n -1
yi = zi+1, zi = xi + yi ( mod 2).
(2.7)
Theorem 2.2. Suppose that x
(1)
If
v
,
y
there
exists
m Z
such
0
vn = yn = 0, vm = 0 <1 = ym, vi = yi = zi+1
for i = m +1, m + 2,..., n -1.
n
We define w
that
(2.8)
wi 2i by
i 0
(2.9)
wi zi
for i = m +1, m + 2,..., n
and
wi = xi + vi (mod 2)
(2.10)
for i = 0,1,..., m . By (2.7), (2.8), (2.9) and (2.10) we have
x Å v Å w = 0.
2v
n 1
2(vn 1 2
m 1
m 1
... vm 1 2
= vn 1 2n ... vm 1 2m
2
2
zm 1 2m
2
ym 2m
n
1
x
v
w 0 and v
0
n
(i)
1
wi 2i
w.
(2.12)
i = 0,1, 2,..., n -1
n
xi (mod 2), yi
j i
xi (mod 2).
(2.13)
j i 1
Then by (2.12) and (2.13) we have
vi = yi for each i = k, k +1,..., n - 3, n - 2, n -1 and vk-1 < yk-1 ,
and hence we have v < y .
Theorem 2.1. If x
(1) u
y
z
0 and y
z / 2 , then
z 0 for any u Z 0 with u < x.
z 0 for any v Z 0 with v < y.
(2) x
(3) x y w 0 for any w Z 0 with w < z.
(4) x v w 0 for any v, w Z 0 with v < y, w < z and
v
y
v
by ui
xi
Remark 2.1 there exist v, t ÎZ³0 such that x Å v Å t = 0 and
v = êët / 2 úû .
(iii-1) If y
Proof. (1), (2) and (3) are direct from Theorem 1.1. We suppose
x v w 0 and v w / 2 for some v, w Z 0
that
z / 2 , then by (2) of Lemma 2.3 we
have y < v , and this contradicts the fact v < y . If y
v , then by Lemma 2.3 there exists w ÎZ³0 such
that x Å y Å w = 0 and v £ êëw / 2 úû .
We have wi = xi + yi = zi (mod 2) for i
m 1,...n ,
wm = xm + ym = 0 (mod 2) and zm = 1. Therefore we have
w < z and x Å y Å w = 0, and we have (3).
(iii-2) If y = v, then we let w = t. Then by the method used in
(iii-1)
we
can
prove
that
Since
w < z.
x Å y Å w = x Å v Å t = 0, we have (3).
(iii-3) If y > v , let w = t . Then z / 2
w , and we have (4).
Therefore z
y
v
w/ 2 .
Next we are going to define the function move ({x, y, z}) for a
state {x, y, z}.
Move ({x, y, z}) is the set of all states that can be reached from
the state {x, y, z} in one step (directly).
Definition
2.1.
move({x, y, z})
For
x, y, z
u, y, z ; u
{{x, min(y, w / 2 ), w}; w
w/ 2 .
with v < y, w < z . If y
ui 2i
u
for some v Z 0 with v < y . Therefore we have (2).
(iii) Next we suppose that xm = ym = 0 and zm = 1. For x by
such that
j i 1
n
define
m 1, m 2, ..., n , u m 0
xm and ui yi zi
0, 1, ..., m 1 . Then we have u y z 0 and
for i
u
x . Therefore we have (1).
(ii) If ym = 1 , then we can similarly prove that x v z 0
and vk-1 < wk .
By using Lemma 2.2 and Remark 2.1 for x,y,z we have for each
zi
we
for i
xi (mod 2)
j i
1 ,
xm
...)
n
xi (mod 2), vi
If
j i 1
Clearly vn = 0 and wn = 1 .
By using Lemma 2.2 and Remark 2.1 for x,v,w there exists
k ÎZ³0 such that
k > 0 and for each i = k, k +1,..., n -1
wi
w/ 2 .
i = m +1, m + 2,..., n and xm + ym + zm ¹ 0.
w / 2 . (2.11)
n
0 and y
Proof. Suppose that xi + yi + zi = 0 (mod 2) for
i 0
(2) Suppose that there exist v, w Z
z
z/2 .
Then at least one of the following (1), (2), (3) and (4) is true.
(1) u y z 0 for some u Z 0 with u < x .
(2) x v z 0 for some v Z 0 with v < y .
(3) x y w 0 for some w Z 0 with w < z .
(4) x v w 0 for some v, w Z 0 with v < y , w < z and
v
vm 1 2m ...
< yn 1 2n ... ym 1 2m
= zn 2n ... zm 2 2m
vm 1 2
y
x
Z
0
we
{{x, v, z}; v
define
y}
z} , where u, v, w Z 0 .
Example 2.1. We study the function move({x, y, z}) using
examples of states in Example 1.2 and Example 1.3 . If we start
5 to w
3,
with the state {x,y,z}={2,2,5} and reduce z
then the second coordinate will be min(2, 3 / 2 )=min(2,1)=1 .
z/2 ,
113
© 2012 GSTF
GSTF Journal of Mathematics, Statistics and Operations Research (JMSOR) Vol.1 No.1
Therefore we have {2,1,3}
move({2,2,5}) . It is easy to see
that
{0,2,5},{2,0,5}
move({2, 2,5}) . It is clear that
{0,2,5} move({2,1,3}) , since we cannot move to {0,2,5} from
In this section we assume that k is an even number such that
k 2 . We generalize the result of previous sections to the case
of even number k, and we study the chocolate game that satisfies
Inequality y £ êë z / k úû.
{2,1,3}. Note that {0,1,5} move({2, 2,5}) , since it will take 2
steps to reach {0,1,5} from {2,2,5}.
Next we prove that if you start with an element of A1 , then any
Example 3.1. Here we see chocolate games that satisfy
4,6,8 .
inequalities y £ êë z / k úû for k
move leads to an element of B1 .
FIGURE 3.1.
FIGURE 3.2.
FIGURE 3.3.
Theorem 2.3. For any {x, y, z} A1 we have
move({x, y, z}) B1 .
Proof. Let {x, y, z} A1 , then we have
x y z 0
and
y
z/2 .
y
(2.14)
Suppose
that
we
move
from
{x,y,z}to
{ p, q, r} move({x, y, z}) . Next we prove that {p,q,r} ÎB1 .
Since move({x, y, z}) = {{u, y, z};u < x} È {{x, v, z};v < y}
È{{x, min(y, êëw / 2 úû), w};w < z}, by
Theorem 2.1 p
q r 0.
Next we prove that if you start with an element of B1 , then there
is a proper move that leads to an element of A1 . In other words
.
move({x, y, z}) A1
.
A1
y
z /8
Here we present a formula for the chocolate game that satisfies
the inequality y £ êë z / k úû for an even number k. Note that this
(2.15)
Theorem 2.4. Let {x, y, z} B1 , then move({x, y, z})
Proof. Let {x, y, z} B1 . Then we have
x y z 0
and
y
z/2
y £ êë z / 6úû
z/4
(2.16)
(2.17)
Since move({x, y, z}) = {{u, y, z};u < x}È{{x, v, z};v < y}
formula is almost identical to the formula in Theorem 1.2.
and
Theorem
3.1.
{{x, y, z}; x, y, z Z 0 , y w / k
x
y
z
0}
{{x, y, z}; x, y, z
is
the
Z 0, y
set
of
z / k and x
L
y
states
z
and
0} is the set
of W states of the chocolate game that satisfies the inequality
y z/k .
For the detailed theory of this chocolate game, see [7].
IV. GRUNDY NUMBER AND GRUNDY-LIKE FUNCTION
Grundy Number is an effective tool to calculate L-state in
combinatorial game, but in this section authors present a
Grundy-like function that is more effective for chocolate games,
and compare it to Grundy Number.
First, we define the function Mex.
Definition 4.1. The function Mex(A) is the smallest
non-negative integer which is not an element of A.
È{{x, min(y, êëw / 2 úû), w};w < z} , by Theorem 2.2 there exists
{p, q, r} Îmove({x, y, z}) such that p Å q Å r = 0.
Example 3.1. Mex({0,1,4,5,6 })=2 , Mex( {1,4,5,6 })=0 .
We define Grundy Number G({x,y,z}) for any state {x,y,z}.
By Theorem 2.3 and 2.4 we finish the proof of Theorem 1.2. If
we start the game with a state {x,y,z} Î A1 , then by Theorem 2.3
any option by us leads to a state {p,q,r} in B1 . From this state
{p,q,r} by Theorem 2.4 our opponent can choose a proper
option that leads to a state in A1. Note that any option reduces
some of the numbers in the coordinates. In this way our
opponent can always reach a state in A1, and finally he wins by
reaching {0,0,0} Î A1 . Therefore A1is the set of L states.
If we start the game with a state {x,y,z} ÎB1 , then by Theorem
Definition 4.2. Let G({0,0,0}) = 0.
Let N1 = {{x, y, z};{0, 0, 0} Îmove({x, y, z})} and we define
that G({x, y, z}) = 1for {x, y, z} Î N1.
As to the other states we define G recursively, by
G({x, y, z}) = Mex(G({u,v,w});{u,v,w} Îmove({x, y, z})) .
As to the detailed theory of Grundy Number, see [2].
Theorem 4.1. {x,y,z} is an L state if and only if G({x,y,z}) = 0.
For a proof see [2].
2.4 we can choose a proper option leads to a state {p,q,r} in A1.
From {p,q,r} any option by our opponent leads to a state in B1 .
In this way we win the game by reaching {0, 0, 0}. Therefore B1
is the set of L states.
III. Chocolate game with Inequality y £ êë z / k úû for an Even
Number k.
By Theorem 4.1 we get L-states by calculating Grundy Number
G, but in this article the authors present a new Grundy-like
function G2.
Definition 4.3. For any state {x,y,z} we let G2({x, y, z})
=(a,b,c), where we define (a,b,c) by the following rules.
[1] If x=0, then let a=0. If y=0, then let b=0. If z=0, then let c=0.
114
© 2012 GSTF
GSTF Journal of Mathematics, Statistics and Operations Research (JMSOR) Vol.1 No.1
[2] Suppose that x ³ 1 and G2({x -1, y, z}) =(p,q,r).
[2.1] Let a=1, if (p,q,r)=(0,0,0).
[2.2] Let a=p, if (p,q,r) ¹ (0,0,0).
[3] Suppose that y ³ 1 and G2({x, y -1, z}) =(p,q,r).
[3.1] Let b=1, if (p,q,r)=(0,0,0).
[3.2] Let b =q, if (p,q,r) ¹ (0,0,0).
[4] Suppose that z ³ 1 and G({x, min(z -1, y), z -1}) =(p,q,r).
[4.1] Let c=1, if (p,q,r)=(0,0,0).
[4.2] Let c =r, if (p,q,r) ¹ (0,0,0).
Since {x,0,0} is a W state, by the induction hypothesis
(a0, b0, c0 ) ¹ (0,0,0).
Suppose that
G2({x, min(y, êë1/ 2 úû),1}) = G2({x, 0,1}) = (a1, b1, c1 ).
Then by [4.2] of Definition 4.3 c1 = c0 = 0.
Suppose that G2({x, min(y, êë(z - i) / 2 úû), z - i}) = (az-i , bz-i , cz-i )
for 0 £ i < z -1.
Since {x, min(y, êë(z - i) / 2 úû), z - i} is a W state, by the
induction hypothesis
We need the function min( , ) in [4] of Definition 4.3, because of
the structure of the chocolate.
Theorem 4.2. {x,y,z} is a L state if and only if G2({x,y,z}) =
(0,0,0), and equivalently {x,y,z} is a W state if and only if G2
({x,y,z}) ¹ (0,0,0).
Proof. We prove by Mathematical Induction.
We suppose that this theorem is valid for numbers x,y,z such that
x+y+z £ k.
[A] First, we suppose that {x,y,z} is an L-state and x+y+z=k+1.
We are going to prove that G2({x,y,z}) = (0,0,0).
We have the following [1.1],[1.2] and [1.3].
[A.1] Here we reduce the first coordinate. {x-1,y, z},..., { x -i, y,
z }, { x - i -1, y, z },..., {1, y,z }, {0,y,z } are W states, since these
are elements of the set move({x, y, z}) and {x,y,z} is an L-state
. Suppose that G2({0,y,z})= (a0, b0, c0 ) , then by [1] of
(az-i, bz-i , cz-i ) ¹ (0, 0, 0) .
Therefore by using [4.2] of Definition 4.3 repeatedly for
we
have
i = z -1, z - 2,..., 0
0 = c0 = c1 =,..., = cz-i =,..., = cz-1 = cz , and hence cz = 0.
Therefore the third coordinate of G2({x,y,z}) is 0.
By [A.1], [A.2] and [A.3] we prove that G2({x,y,z}) = (0,0,0).
[B] First, we suppose that {x,y,z} is a W state and x+y+z=k+1.
We are going to prove that G2({x,y,z}) ¹ (0,0,0).
Since {x,y,z} is a W state, and hence there exists an L state
{u,v,w} Îmove({x, y, z}).
Therefore we have at least one of the following [B.1],[B.2] and
[B.3].
[B.1] There exists k such that {x-k,y,z} is an L state.
Suppose that G2({x - k, y, z}) = (ax-k , bx-k , cx-k ) and
G2({x - k +1, y, z}) = (ax-k+1, bx-k+1, cx-k+1 ).
Definition 4.3 we have a0= 0. Since {0,y,z} is a W state, by the
induction hypothesis (a0, b0, c0 ) ¹ (0,0,0).
Next,
we
calculate
.
Suppose
G2({1, y, z})
Then by the induction hypothesis
(ax-k , bx-k , cx-k ) = (0, 0, 0) , and by [2.1] of Definition 4.3
that G2({1, y, z}) = (a1, b1, c1 ). Then by [2.2] of Definition 4.3
Next,
a1 = a0 = 0.
Suppose that G2({x - i, y, z}) = (ax-i , bx-i, cx-i ) for 0 £ i < x -1.
Since {x-i,y,z} is a W state, by the induction hypothesis
(ax-i , bx-i , cx-i ) ¹ (0, 0, 0).
Therefore by using [2.2] of Definition 4.3 repeatedly for
i = x -1, x - 2,..., 0 we have 0 = a0 = a1 =,...., = ax-i = ax-1 = ax ,
and hence ax = 0.
Therefore the first coordinate of G2 ({x,y,z}) is 0.
[A.2] Here we reduce the second coordinate. For 0 £ i < y
we let G2({x, y - i, z}) = (ay-i, by-i , cy-i ) .
ax-k+1 = 1.
we
suppose
that
G2({x - i + 2, y, z}) = (ax-i+2, bx-i+2, cx-i+2 )
for
i = k, k -1, k - 2, k - 3,..., 2. Since{x-1,y,z},..., {x-k+1,y,z} are
W-states, G2({x-1,y,z}),..., G2({x-k+1,y,z}) ¹ (0,0,0).
Then by using [2.2] of Definition 4.3 repeatedly we have
1 = ax-k+1 = ax-k+2 = ax-k+3 =,..., = ax-1 = ax , and hence ax = 1.
In this case the first coordinate of G2({x,y,z}) is not 0.
[B.2] There exists k such that {x,y-k,z} is an L state.
Suppose that G2({x, y, z}) = (ay , ay, ay ). Then by the same
method used in [B.1] we prove by = 1.
Then we can use the same method used in [A.1], and we prove
by = 0. Therefore the second coordinate of G2({x,y,z}) is 0.
In this case the second coordinate of G2({x,y,z}) is not 0.
[B.3] There exists k such that {x, min(y, êë(z - k) / 2 úû), z - k}
is
an
L
state.
Suppose
that
[A.3] Here we reduce the third coordinate.
G2({x, min(y, êë(z - k) / 2 úû), z - k}) = (az-k , bz-k , cz-k ) and
{x, min(y, êë(z -1) / 2 úû), z -1},...,{x, min(y, êë(z - i) / 2úû, z - i},
G2({x, min(y, êë(z - k +1) / 2 úû), z - k +1}) = (az-k+1, bz-k+1, cz-k+1 ).
{x, min(y, êë(z - i -1) / 2úû, z - i -1},...,{x, min(y, êë1/ 2 úû),1}
Then by the induction hypothesis we have
= {x, 0,1},{x, min(y, êë0 / 2 úû), 0} = {x, 0, 0} are W states, since
these are elements of the set move({x, y, z}) and {x,y,z} is an L
state.
Suppose
G2({x, min(y, êë0 / 2úû), 0}) = G2({x, 0, 0}) = (a0, b0, c0 ).
Then by [1] of Definition 4.3 we have c0 = 0.
that
(az-k , bz-k , cz-k ) = (0, 0, 0), and by [4.1] of Definition 4.3 we
have cz-k+1 = 1.
Suppose that
G2({x, min(y, êë(z - i + 2) / 2úû), z - i + 2}) = (az-i+2, bz-i+2, cz-i+2 )
for i = k, k -1, k - 2, k - 3,..., 2 . Then using [4.2] of Definition
4.3 repeatedly we have
1 = cz-k+1 = cz-k+2 = cz-k+3 =,..., = cz-1 = cz, and hence cz = 1.
115
© 2012 GSTF
GSTF Journal of Mathematics, Statistics and Operations Research (JMSOR) Vol.1 No.1
Grundy number G and a new Grundy-like function G2 to get L
states, but the efficiency of G2 can be very useful when we study
chocolate games that do not have formulas for L states.
In this case the third coordinate of G2({x,y,z}) is not 0.
Therefore by [B.1],[B.2] and [B.2] one of the coordinates of
G2({x,y,z}) is not 0, and we have G2({x,y,z}) ¹ (0,0,0).
REFERENCES
[1]
By Theorem 4.2 we can get L states by calculating G2.
Here we compare two functions Grundy number G and a new
Grundy-like function G2.
For each state {x,y,z} we have to calculate G({u,v,w}) for
{u,v,w} Îmove({x, y, z}) to get G({x,y,z}). Note that the set
move({x, y, z}) has approximately x+y+z elements.
On the other hand for each state {x,y,z} we have only to
calculate
G2({x -1, y, z}) , G2({x, y -1, z}) and
A.C.Robin, “ A poisoned chocolate problem, ” Problem corner, The
Mathematical Gazette Vol. 73, No. 466 (Dec., 1989), pp. 341-343. An
Answer for the above problem is in Vol. 74, No. 468, June 1990, pp.
171-173.
[2]
M. H. Albert, R. J. Nowakowski and D. Wolfe, “ Lessons In Play, ” A K
Peters, p-139.
[3]
R. Miyadera and M. Naito, “ Combinatorial Games and Beautiful Graph
produced by them, ” Visual Mathematics, Volume 11, No. 3, 2009.
http://www.mi.sanu.ac.rs/vismath/pap.htm
[4]
G2({x, min(y, êë(z -1) / 2 úû), z -1}) to get G2({x,y,z}).
S. T. Yamauchi, T. Inoue and Y. Tomari, “ Variants of the Game of Nim
that have Inequalities as Conditions, ” Rose-Hulman Institute of
We are going to compare G and G2 by the calculation of the
computer algebra system Mathematica. In both programs we
calculated
L
states
for
{{x,y,z}; 0 £ x £ ss, 0 £ y £ ss, 0 £ z £ 2ss }, where ss=50.
The authors spent approximately 60 seconds on the first
program, and 6 seconds on the second program with
Corei5(1.7MHz). The difference will be bigger when ss is
bigger. This shows the efficiency of the function G2.
Technology, Undergraduate Math Journal, Vol.10. Issue 2, 2009.
http://www.rose-hulman.edu/mathjournal/v10n2.php
[5]
M.Naito, T.Inoue, R.Miyadera, “ Discrete Mathematics and Computer
Algebra System, ” The Joint Conference of ASCM 2009 and MACIS
2009, COE Lecture Note Vol.22,Kyushu University.
A PDF file of the article is available at
http://gcoe-mi.jp/english/publish_list/pub_inner/id:2/cid:10
[6]
R.Miyadera and S.Nakamura, “ Chocolate Games that are variants of the
Game of Nim, ” Information Processing Society of Japan, to be
published (in Japanese).
A program to calculate L states by Grundy Number G.
[7]
-Variants of the Game of Nim-, ” Proceeding of Annual International
k = 2;ss = 50; al =
Flatten[Table[{a, b, c}, {a, 0, ss}, {b, 0, ss}, {c, 0, 2 ss}], 2];
allcases = Select[al, (1/k) (#[[3]]) >= #[[2]] &];
move[z_] := Block[{p}, p = z;
Union[Table[{p[[1]], t2, p[[3]]}, {t2, 0, p[[2]] - 1}],
Table[{p[[1]], Min[Floor[(1/k) t3], p[[2]]], t3}, {t3, 0,
p[[3]] - 1}],
Table[{t1, p[[2]], p[[3]]}, {t1, 0, p[[1]] - 1}]]];
Mex[L_] := Min[Complement[Range[0, Length[L]], L]];
Gr[pos_] := Gr[pos] = Mex[Map[Gr, move[pos]]];
Lstate1 = Select[allcases, Gr[#] == 0 &];
Conference on Computational Mathematics, Computational Geometry
Statistics,pp.122-pp.128, 2012.
A program to calculate L states by the function G2.
k = 2;ss = 50; al =
Flatten[Table[{a, b, c}, {a, 0, ss}, {b, 0, ss}, {c, 0, 2 ss}], 2];
allcases = Select[al, (1/k) (#[[3]]) >= #[[2]] &];
GGr[{x_, y_, z_}] := GGr[{x, y, z}] =
{If[x > 0,
If[Norm[GGr[{x - 1, y, z}]] == 0, 1, GGr[{x - 1, y, z}][[1]]], 0],
If[y > 0,
If[Norm[GGr[{x, y - 1, z}]] == 0, 1, GGr[{x, y - 1, z}][[2]]], 0],
If[z > 0,
If[Norm[GGr[{x, Min[Floor[1/k (z - 1)], y], z - 1}]] == 0, 1,
GGr[{x, Min[Floor[1/k (z - 1)], y], z - 1}][[3]]], 0]}
pposition2 = Select[allcases, Gr[#] == 0 &];
Lstate2 = Select[allcases, GGr[#] == {0, 0, 0} &];
Since we have Theorem 1.2 and 3.1, we do not have to use
R. Miyadera, S. Nakamura and R. Hanafusa, “ New Chocolate Games
Ryohei Miyadera got Ph.D. (probability theory) from Osaka City University
in 1990, and got Ph.D. (mathematics education) from Kobe University in 2006.
He is teaching at Kwansei Gakuin High School, Uegahara, Nishinomiya
City, Japan. He is now interested in combinatorial game theory. When he was
younger, his main interest was probability theory of abstract space-valued
functions, and one of his main work at that time is
“Characterization of conditional expectations for M-space-valued functions,
Osaka Journal of Mathematics. Volume 30, Number 2 , 315-330 (1993)”.
Dr.Miyadera is a member of the Mathematical Society of Japan, Japan
Origami Academic Society, Japan Society of Symbolic and Algebraic
Computations and Game Amusement Society.
He got the Best Essay, Third Contest for Essays on Mathematics, Yamagata
University in 2009, Koizumi Yakumo Award (literature), the best essay in 2000
and Excellent Teacher Award, Ministry of Education of Japan in 2012.
Dr. Miyadera is one of the best long distance runners over 55 years old age
group in his prefecture.
Shunsuke Nakamura is a high school student at Kwansei Gakuin.
He is doing research of mathematics with Dr.Miyadera. He published
“The Maximization of a Cup Made from a Square Sheet of Paper,Japan
Origami Society (2011)” and his another paper “ Chocolate Games that are
variants of the Game of Nim, Information Processing Society of Japan” is to be
published (in Japanese).
Shunsuke Nakamura is a member of Information Processing Society of
Japan. Nakamura’s hobby is playing the piano and hunting for monsters.
Ryo Hanafusa is a high school student at Kwansei Gakuin.
He is doing research of mathematics with Dr.Miyadera. He published
“The Maximization of a Cup Made from a Square Sheet of Paper,Japan
Origami Society (2011)”
Hanafusa’s hobby is composing music and playing the guitar.
116
© 2012 GSTF