CMPUT 657 Class Notes

Extra material from class, usually done on the whiteboard.

Contents:

October 9

Canonical Forms Get Large Quickly

CGSuite examples, try them out

{1|-1}
{2|-2}
{1|-1} + {2|-2}
{1|-1} + {2|-2} + {3|-3}
{1|-1} + {2|-2} + {3|-3} + {4|-4}
{1|-1} + {2|-2} + {3|-3} + {4|-4} + {5|-5}
{1|-1} + {2|-2} + {3|-3} + {4|-4} + {5|-5} + {6|-6}
{1|-1} + {2|-2} + {3|-3} + {4|-4} + {5|-5} + {6|-6} + {7|-7}
{1|-1} + {2|-2} + {3|-3} + {4|-4} + {5|-5} + {6|-6} + {7|-7} + {8|-8}
{1|-1} + {2|-2} + {3|-3} + {4|-4} + {5|-5} + {6|-6} + {7|-7} + {8|-8} + {9|-9}

Clobber examples:

game.grid.Clobber("OX").CanonicalForm
game.grid.Clobber("OXOXOX").CanonicalForm
game.grid.Clobber("OXOXOXOXOX").CanonicalForm
game.grid.Clobber("OXOXOXOXOXOXOX").CanonicalForm
game.grid.Clobber("OXOXOXOXOXOXOXOXOX").CanonicalForm
game.grid.Clobber("OXOXOXOXOXOXOXOXOXOXOX").CanonicalForm

Bug Fix

There was a mistake on slide 20 of "comparing games", that we hit at the end of last class: in the game G = {0, ∗,−1|−1, {1|−2}, {2|0}}, everything I wrote about comparing options is true. In particular, −1 and {1|−2} are incomparable. However, the final statement is wrong: Canonical form: G = {0, ∗|−1, {1|−2}}. Why is it wrong? It is because of the other simplification, reversible moves. In this case, Right should never move to {1|−2}, since Left can immediately answer and move to 1, which is greater than G itself (because the Left options from G are "only" 0 and *). So the canonical form of G is {0, * | -1}, without that reversible Right option.

To make the example work as intended, and keep {1|−2} in the canonical form, the left options need to be better, so I replaced them by 2, 2 + * and made a new version of the slides with this fix. The canonical form of G:= {2, 2+*, -1 | -1, {1|-2}, {2|0}} is indeed {2, 2* | -1, {1 | -2} }. This is the kind of thing that is very easy for humans to miss, but CGSuite catches it easily.

October 7

The "Outcome Diamond" and Comparing Games

outcome diamond

The outcome diamond is the partial order between game outcomes shown above (Figure from Urban Larsson's paper). If you have to choose a game based on its outcome, then as Left you always choose outcome L over any game with outcome in N, P, R, and you choose any other outcome over R, while outcomes N and P are incomparable.

However, that does not mean that e.g. any game in L is better than any game in another class in terms of direct comparison. For example, consider the games G = 1, and H = 100 | 0. Clearly, G is in L and H is in N, since Right can win H by moving to 0. So if left had to choose a single game, Left should choose G since it is a sure win, while H is not. However, G and H themselves are incomparable. There are many sums where having the option to move to H is more valuable than moving to G. For example, with game K = 0 | -50, the sum G + K is in N, but H + K is in L.

Whiteboard

Thanks Abel!

Whiteboard 1
Whiteboard 2

October 2

MCGS analysis of Domineering game from class

White (students) is horizontal and goes first. This is with the "more-grid-games" branch of MCGS, which includes the rules of domineering.

Students played perfectly according to MCGS - all White to play positions are wins, and all Black to play positions are losses.

Moves (left square for White, top square for Black): 1. A2, 2. E5, 3. E4, 4. E1, 5. C2, 6. B5, 7. A4, 8. C5, 9.C4, 10. F2. Now horizontal has 4 more moves, and vertical only 3, so horizontal wins. Below are the calls to solve all game positions with MCGS.

./MCGS "[domineering] ......|......|......|......|......|...... {W}"
./MCGS "[domineering] ......|##....|......|......|......|...... {B}"
./MCGS "[domineering] ......|##....|......|......|....#.|....#. {W}"
./MCGS "[domineering] ......|##....|......|....##|....#.|....#. {B}"
./MCGS "[domineering] ....#.|##..#.|......|....##|....#.|....#. {W}"
./MCGS "[domineering] ....#.|#####.|......|....##|....#.|....#. {B}"
./MCGS "[domineering] ....#.|#####.|......|....##|.#..#.|.#..#. {W}"
./MCGS "[domineering] ....#.|#####.|......|##..##|.#..#.|.#..#. {B}"
./MCGS "[domineering] ....#.|#####.|......|##..##|.##.#.|.##.#. {W}"
./MCGS "[domineering] ....#.|#####.|......|######|.##.#.|.##.#. {B}"
./MCGS "[domineering] ....#.|######|.....#|######|.##.#.|.##.#. {W}"

Comments on Nim game from class

Let *n denote a nim heap with n stones. We played the game *3 + *4 + *5. A winning move is to move from *3 to *1, leaving the sum *1 + *4 + *5. This is a losing position (2nd player win)

A few more examples of losing positions: *n + *n (second player copies the first player's moves), *1 + *2 + *3.

There is an analysis of this game based on the binary representation of heap sizes, and bitwise XOR. We will talk about it in class soon.

September 18

Represent a 1x10 Q1game in 16 bits

Bit-wise XOR

Hash collision

September 16

September 4 Notes

September 2 Notes


Last update: Sep 21, 2025, Martin Müller