A scanning code consists of a grid of squares, with some of its squares colored black and the rest colored white. There must be at least one square of each color in this grid of squares. A scanning code is called if its look does not change when the entire square is rotated by a multiple of counterclockwise around its center, nor when it is reflected across a line joining opposite corners or a line joining midpoints of opposite sides. What is the total number of possible symmetric scanning codes?
- A)
- B)
- C)
- D)
- E)
Answer
B
Key insight
Full square symmetry means the code is determined by one-eighth of the grid: a triangular wedge of 10 cells, so 2^10 colorings minus the two monochrome ones.
Solution
The required symmetries (four rotations and four reflections) are all the symmetries of a square. A symmetric code is determined by the colors in one fundamental wedge: the triangle bounded by a vertical line through the center and a diagonal, one-eighth of the grid. Every other cell is carried onto a wedge cell by some symmetry and must match its color.
Count the wedge cells with the center at and coordinates . Choose the wedge :
- : , the center. cell.
- : . cells.
- : . cells.
- : . cells.
That is independent cells, each freely black or white, so symmetric colorings.
The code must use both colors, so remove the all-white and all-black grids: .
The answer is .
Why this works
A pattern invariant under a symmetry group is determined by its values on one representative from each orbit of cells. The symmetries of a square fold the grid into a wedge; cells on the wedge's edges (the center, the axis , the diagonal ) have smaller orbits but still count as one free choice each. Counting orbits, not cells, is the whole problem; the "at least one of each color" clause is a routine subtraction at the end.
Alternative approach
Sanity-check with orbit sizes: the center (orbit ), three cells on each half-axis type (orbits of size ), three on the diagonals (size ), and three general cells (size ). Total cells , confirming orbits.
The trap
Using a quarter (the 4 by 4 corner block, 16 cells) or half of the grid instead of the eighth wedge, giving 2^16 - 2 = 65534 or 2^13 - 2.
Common mistakes
- Using a quarter (the 4 by 4 corner block, 16 cells) or half of the grid instead of the eighth wedge, giving 2^16 - 2 = 65534 or 2^13 - 2.
- Forgetting to subtract the two monochrome grids, giving , or subtracting only one of them.
Techniques
Map the objects to something easier to count · Exploit symmetry to reduce work or pair up objects