Saturday, January 15, 2011

Binary Primes Game

This is a game for two players.

Start by drawing an n-by-n grid on paper. (I don't suggest that n be too big, unless you are playing this game on a computer.)
n is odd. (Thanks to Ilmari Karonen for pointing out that a win can always be forced by player 2 if n is even {except for a likely small number of even exceptions}.)

The players take turn filling in squares, each player filling in one empty square per move.
Each player fills in floor(n^2/4) squares total.
(So, 2*floor(n^2/4) squares are filled in all together at the game's completion.)


Now, interpret the filled-in (black) squares and the blank (white) squares in each row and column as the digits of a binary number. In any particular row or column, either all the black squares represent a 0 or all of the black squares represent 1. And the white squares each equal the opposite binary digit than the black squares represent in that row/column. And the binary number can be read either top to bottom, or bottom to top (for each column), or left to right, or right to left (for each row).

So, to be clear, the binary digit (0 or 1) represented by a color has to remain the same within any particular row or column, but can differ between different rows and columns.

And the direction the binary number is read can differ between different rows and columns.

So, after the game is complete, the players go through and write down in two lists, one for the columns and one for the rows, the decimal representation of the largest possible PRIME possible, if any is possible, for each row and each column.

Player 1 gets as a score the product of all of the primes in the columns.
Player 2 gets as a score the product of all of the primes in the rows.

The player with the largest score wins.

Example (randomly "played" with no strategy):
n=6:

. * * . . *
* * . . . *
. * * * . .
. * * . . .
* . * * * .
. * . . * *

Largest primes, or 1 if all possibilities are composite or 1:

For columns:
1, 61, 29, 53, 3, 1.
Score =
61*29*53*3 = 281271.

For rows:
1, 1, 1, 1, 29, 19.
29*19 = 551.

Player 1 (columns) wins, obviously.

Thanks,
Leroy Quet

2 comments:

Srout said...

Leroy, that's a really... elegant game! I wonder if I can convince one of my friends to play with me. Most of my friends are computer science or computer engineering geeks, so there's a chance!

Amorphous Trapezoid said...

Thanks! Personally, I like most of my other 130-or-so games better, though.