The answer is 7651; in general, for the 6n-th turn, the maximum possible value is 3n2+3n+1.
Let us coordinatize these lines: for a line ℓ passing through point A, label it as (1,r), where
r=sin∠(ℓ,AC)sin∠(AB,ℓ).
Define (2,r) and (3,r) similarly. Note that this means:
- there exists t>0 such that the initial three lines are (1,t), (2,t), and (3,t);
- by the trigonometric form of Ceva's theorem, the three lines (1,r1), (2,r2), and (3,r3) are concurrent if and only if r1r2r3=1, i.e., logtr1+logtr2+logtr3=0;
- each time Ming selects the intersection point of (i,ri) and (j,rj), the new line he can add is (k,rk), where k∈{1,2,3}−{i,j} and rk=(rirj)−1, i.e., logtrk=−(logtri+logtrj).
Combining the above, by considering the logt version, we can reformulate the problem as the following equivalent combinatorial problem:
Let S1=S2=S3={1}. Each time, Ming takes ni∈Si and nj∈Sj, and adds −(ni+nj) to the third set. Let S={(s1,s2,s3):si∈Si,s1+s2+s3=0}. Prove that after 6n operations, the maximum possible value of ∣S∣ is 3n2+3n+1.
Estimate: This is equivalent to proving that when ∣Si∣=ni and n1+n2+n3=6n+3 (since initially ∣Si∣=1), we have ∣S∣≤3n2+3n+1. Let the elements of S1 be a1<a2<⋯<ap, the elements of S2 be b1<b2<⋯<bq, and the elements of S3 be c1<c2<⋯<cr, and without loss of generality assume p≤q≤r. Consider the sets
T1T2⋮Ti⋮={a1+b1,a2+b1,…,ap+b1,ap+b2,…,ap+bq},={a1+b2,a2+b2,…,ap−1+b2,ap−1+b3,…,ap−1+bq},={a1+bi,a2+bi,…,ap+1−i+bi,ap+1−i+bi+1,…,ap+1−i+bq},
Then it is easy to see that ∪i=1pTi=S1+S2, and any ak+bℓ appears in exactly one Ti. Also,
∣Ti∩(−S3)∣≤∣S3∣=rand∣Ti∩(−S3)∣≤∣Ti∣=p+q−2i+1,
therefore
∣S∣=i=1∑p∣Ti∩(−S3)∣≤i=1∑pmin(r,p+q−2i+1):=f(p,q,r),
a direct computation (see Remark 1) gives
f(p,q,r)=41(−p2−q2−r2+pq+pr+qr)+41≤12(p+q+r)2+41=3n2+3n+1(1)
Remark 1: Derivation of the left-hand side of (1). Note that
- if r<q−p+1, then f(p,q,r)=f(p,q−1,r+1);
- if r>q+p−1, then f(p,q,r)=f(p,q+1,r−1).
Hence we may without loss of generality set r∈[q−p+1,q+p−1], and in this case a direct computation gives
f(p,q,r)=p+q−2i+1≤r∑r+p+q−2i+1>r∑(p+q−2i+1)=tr+(p−t)(q−t)=−t(p+q−r−t)+pq(3)
where t=⌊(p+q+1−r)/2⌋. But note that
t(p+q−r−t)=x∈Zmaxx(p+q−r−x)=4(p+q−r)2−1(4)
Substituting (4) back into (3) gives the left-hand side of (1).
Remark 2: Derivation of the left-hand side of (2). Since changing S1 to (S1+2)/3, S2 to (S2−1)/3, and S3 to (S3−1)/3 leaves the number of tuples satisfying s1+s2+s3=0 unchanged, we may instead consider S1=S2=S3=
{−n,−n+1,⋯,n−1,n}, in which case
∣S∣=k=−n∑n∣{s2+s3=−k:si∈Si}∣=(2) left-hand side.(5)
∣S∣=k=−n∑n(2n+1−∣k∣)=(2n+1)+2k=1∑n(2n+1−k)=(2n+1)+n×(3n+1)=3n2+3n+1.(2)
Construction: Consider the following strategy: we first present Ming's optimal strategy:
1. Ming first adds −(1+1)=−2 to all three sets;