DR.WANG Mathematics中文

2013 USAMO · Question 3

Counting & combinatorics · equilateral triangle · optimization

Problem outline

Build a triangular lattice of two-sided tokens, with 1,2,…,n1,2,\ldots,n tokens in its successive rows and n≥1n\ge1. Start with every black face visible. A move reverses every token on a chosen line in any of the three directions parallel to a side. For each reachable black-and-white board, count the fewest moves needed from the start. Find the largest of those minimum counts as a function of nn.

Show answer and methods 1 methods

Answer

Write n=4k+rn=4k+r, 0≤r<40\le r<4. The maximum is 6k+r=n+2⌊n/4⌋6k+r=n+2\lfloor n/4\rfloor.

Method 1 Classify equivalent flip lists and balance each parity group

Write N=n−1N=n-1 and index the tokens by triples (i,j,k)(i,j,k) of nonnegative integers with i+j+k=Ni+j+k=N. Lines of the three directions have fixed ii, jj or kk. Repeated flips cancel and flips commute. Thus a move list is specified by three binary strings of length nn, marking the lines used an odd number of times. Its cost is the number of marked lines. For n=1n=1 the answer is one; assume n≥2n\ge2.

Two lists produce the same board if their difference modulo two changes nothing. Write that difference as (Ai,Bj,Ck)(A_i,B_j,C_k). We need Ai+Bj+Ck=0A_i+B_j+C_k=0 modulo two whenever i+j+k=Ni+j+k=N. Compare the tokens (i+1,0,N−1−i)(i+1,0,N-1-i) and (i,1,N−1−i)(i,1,N-1-i): every consecutive difference of AA equals B1−B0B_1-B_0. Permuting the coordinates shows that all three strings have one common difference dd. Consequently every null change is exactly Ai=p+diA_i=p+di, Bj=q+djB_j=q+dj, Ck=p+q+d(N+k)C_k=p+q+d(N+k), for arbitrary bits p,q,dp,q,d. Substitution checks the converse. There are eight such changes.

For a fixed move list, group its 3n3n bits by direction and by even/odd index, making six groups. In group gg let bgb_g be the number of zeros minus the number of ones. Under a null change the whole group is kept or complemented. Put χg=+1\chi_g=+1 or −1-1 accordingly. The six signs have form (−1)L(-1)^L, with the six distinct nonzero binary linear forms L=p,p+d,q,q+d,p+q,p+q+dL=p,p+d,q,q+d,p+q,p+q+d in some order. The minimum cost for our board is therefore (3n−M)/2(3n-M)/2, where MM is the maximum of S=∑gbgχgS=\sum_g b_g\chi_g over the eight choices of (p,q,d)(p,q,d).

A nonconstant sign has mean zero: switching a bit with nonzero coefficient reverses the sign. Likewise any two different signs have mean product zero, since their product uses a nonzero form. Thus SS has mean zero and its mean conditional on χg=+1\chi_g=+1 or −1-1 is respectively bgb_g or −bg-b_g. In particular M≥∣bg∣M\ge |b_g| for each group, and M≥0M\ge0. Every value of SS has the same parity as 3n3n because it is the excess of zeros over ones in 3n3n positions.

We claim M≥rM\ge r. For r=0r=0 this follows from the mean; for r=1r=1 use odd parity as well. For r=2r=2 each group has odd size 2k+12k+1, so ∣bg∣≥1|b_g|\ge1 and even parity yields M≥2M\ge2. For r=3r=3 the even-index groups have size 2k+22k+2 and the odd-index groups have size 2k+12k+1. If any ∣bg∣≥2|b_g|\ge2, odd parity gives M≥3M\ge3. Otherwise the even groups are balanced and the three odd groups have bg=±1b_g=\pm1. Their forms are p+d,q+d,p+q+dp+d,q+d,p+q+d, since NN is even. They are independent: their sum gives dd, then the first two recover p,qp,q. Choose the three signs to make every contribution +1+1, giving S=3S=3. Hence every board costs at most (3n−r)/2=6k+r(3n-r)/2=6k+r.

For the matching lower bound, first consider side lengths r=0,1,2,3r=0,1,2,3, treating the empty board as cost zero. With side one, a white token costs one. With side two, all three white tokens require at least two flips, since one line has at most two tokens; flipping one two-token row and the remaining singleton attains it. With side three the nine move bits give 29/8=642^9/8=64 distinct reachable boards by the null-change calculation. At most 1+9+(92)=461+9+\binom92=46 can be reached with at most two flips, so some reachable board needs at least three.

Take any list for such a side-rr board and copy its bits to indices 0,…,r−10,\ldots,r-1 of each direction on the side-nn board. In each direction the remaining 4k4k lines have 2k2k indices of each parity. Mark exactly kk of each parity. Any null change keeps or complements each group, so the added lines always contribute exactly 6k6k moves. On the copied indices it restricts to a null change for the small board: the formula uses N=n−1N=n-1 only modulo two, and n−r=4kn-r=4k. For r=1r=1 it likewise flips an even number of the three labels of the single token. Thus the copied part still needs at least rr moves. The constructed board needs at least 6k+r6k+r, proving equality.

Source and attribution

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

Original question (external)