A 7×7 grid is filled with 0's and 1's so that each row and each column contains exactly two 1's. Additionally, no four 1's are the corners of an axis-parallel rectangle. Let N be the number of such grids. Find the remainder when N is divided by 1000.
Solution ApproachShowHide
Step-by-step approach
Each row chooses 2 of 7 columns. The no-rectangle condition means no two rows share the same pair of columns. So the 7 row-pairs are a set of 7 distinct 2-element subsets of {1,…,7} such that any two share at most one element (a combinatorial design). This is a Fano plane-like structure. Count the number of such systems and multiply by the number of ways to assign rows.
Ready for more competition problems?
Practice the full SolveFire course and compete in ranked math battles — free to play.