Friday, February 7, 2014

Tic Tac Toe




INTRODUCTION

{Insert long history of tic tac toe here. Include dubious lore.}


Three dimensional tic tac toe works well on a 4x4x4 board..
Does four dimensional tic tac toe work well on a 5x5x5x5 board?

Does an n-dimensional game work well on an (n+1)^n board?


Maybe.

...

In a regular 2-D game (3x3) there are 8 ways to win: 3 horizontal rows, 3 vertical rows, and 2 diagonals.

In a 3-D game (4x4) there are 75 ways to win:
16 vertical rows
16 horizontal rows
16 lateral rows
8 two-D diagonals that cross the x- and y- axes
8 two-D diagonals that cross the x- and z- axes
8 two-D diagonals that cross the y- and z- axes
3 three-D diagonals

Notice that the ratio of  ways of winning to number of cells is about the same:

2D: 8/9  .8889
3D: 75/64  1.1718

I'll call this ratio the win density. A high win density means the game will likely end quickly in a win, a low density means the game will end in a draw. So, win density is something that we want to optimize somewhere around 1, judging from the examples above.

Alongside win density, we want to make sure there's no cell that's overwhelmingly powerful. In a regular game, the center square can win in four ways, and the side squares can only win in two, so the center square is more powerful. A balanced game needs a good spread, which I'll define as the standard deviation of set in which each element equals the number of ways each cell could win. For the regular game, this set is {4,2,2,2,2,3,3,3,3}, so the spread is 0.707.

Here's a variation on tic tac toe with a spread of ≈1.58. It's my guess that this game is slightly less balanced since the first player gets more opportunities to grab the high value squares (the center and the sides). In regular tic tac toe the corners have high value, but not as high as the sides have in this version:


Less fair than regular tic tac toe, but arguably more interesting...



We can modify the win conditions of regular tic tac toe a tiny bit to get a game that appears to be more balanced than regular tic tac toe (spread only 0.5):

Fairer than regular tic tac toe, but arguably more likely to piss people off...


SOME QUESTIONS:
 1.  Given an n-D board with sides all of length L, how many ways are there to win? (Let's assume we're counting all rows, 2-D diagonals, 3-D diagonals, ..., and n-D diagonals.

2. Assuming that L = n+1, what's the win density and spread in higher dimensions?

3. Does a fair game really come down to just win density and spread, or are there other important factors? (Should we factor in connectedness, an expression of how well the win conditions are interlinked with each other? Even with equal spread, if three cells are not well-connected with the rest of the board they will likely have lesser value).

No comments:

Post a Comment