DR.WANG Mathematics中文

2015 USAMO · Question 4

Counting & combinatorics · sequences · grid

Problem outline

Distribute m≥1m\ge1 indistinguishable stones among the cells of an n×nn\times n grid, with no limit per cell. A move chooses the four corners of a rectangle and transfers one stone from each end of one diagonal to the corresponding ends of the other diagonal. Two distributions are equivalent if moves connect them. Determine the number of equivalence classes.

Show answer and methods 1 methods

Answer

(m+n−1n−1)2\displaystyle \binom{m+n-1}{n-1}^2.

Method 1 Use row and column sums as a complete signature

Record the nn row sums (r1,…,rn)(r_1,\ldots,r_n) and the nn column sums (c1,…,cn)(c_1,\ldots,c_n). A rectangle move removes and adds one stone in each of the same two rows and columns, so both ordered lists are invariant.

Regard the stones temporarily as labeled, and write their positions as pairs (xi,yi)(x_i,y_i), where xix_i is a row and yiy_i a column. The row sums specify the multiset of all xix_i, and the column sums specify the multiset of all yiy_i. Thus two configurations with the same signature differ only in how the yy-coordinates are paired with the xx-coordinates.

Any desired re-pairing is a permutation of the yiy_i, and every permutation is a product of transpositions. Swapping yi,yjy_i,y_j for two stones in distinct rows and distinct columns is exactly one allowed rectangle move. If their rows or columns agree, the swap does not change the unlabeled configuration. Therefore equal signatures imply equivalence, so the signature is complete.

Every pair of signatures is realizable: list mm row labels with row ii repeated rir_i times and mm column labels with column jj repeated cjc_j times, then pair the two lists arbitrarily and place a stone at each resulting coordinate.

The row sums are weak compositions of mm into nn parts, of which there are (m+n−1n−1)\binom{m+n-1}{n-1}; the column sums have the same number of choices and are independent. Squaring gives the stated answer.

Source and attribution

The outline and worked methods on this page were prepared for DR.WANG Mathematics.

Original question (external)