On the topic of interchangeable iterations in a square grid with multiple colors.

LazyTitan

New member
Joined
Jul 24, 2019
Messages
1
So this is going to seem odd, I have a hard time explaining it myself, and for the sake of keeping it short and concise I will also not give the background to how this question popped up, but here goes.

Assume you have a square grid consisting of other squares, like a checkerboard. These have the same amount of squares going both ways, for example 8x8 (again, like a checkerboard). Each square is colored in, from a set of pre-determined colors, and the goal is to achieve every possible iteration of color combinations within this square.

Now normally this would be as simple as X^Y where X is the amount of colors I can choose from and Y the total amount of squares, so a 2x2 square with 2 colors to chose from would be 2^4, or 16. Using this, an 8x8 grid with only black and white to color in with would have
2^(8x8) possible iterations, or a total of 18,446,744,073,709,551,616.

Now here is where my question comes in: Suppose you could turn and mirror the grid in any orientation you wanted, and count that as a new iteration? For instance, if I had the same 4x grid, colored with black and white, I could take one iteration such as:

[.B][.B]
[W][W]

And flip it around, mirror it, etc. to get more iterations from the same square. So by doing that, I can get these iterations from it:

[W][B.] - [W][W] - [B.][W]
[W][B.] - [B.][B.] - [B.][W]

And by this, I have brought the total number of iterations needed to make up every possible combination down by 3. If we were to do this for every iteration, and eliminate any iteration that can be made up by simply turning or mirroring a previous iteration, we end up only needing 6 iterations to make up all 16 different combinations for a 2x2 grid with 2 colors to pick from.

To summarize, here is my question. Is there a way to calculate the amount of iterations needed for any given grid size or numbers of colors? Could I apply some form of formula or other kind of math to figure out the iterations needed for an 8x8 grid with 2 colors? or 3? or more? And is there a way to do this reliably without having to manually go in to check each iteration?

Any and all answers are greatly appreciated in advance!
 
Top