Maths Olympiad Prep

Library / /335 of 397

Combinatorics Difficulty 6.8 National Olympiad Prove it Taiwan

The squad leader thought that Old Zhao was too bored being a soldier, so he sent him to line up mantou (steamed buns). There are nn different colors of mantou, the ii-th color of mantou has aia_i pieces, and in total there are S=a1+a2++anS = a_1 + a_2 + \cdots + a_n pieces. These SS mantou are pairwise distinct. Old Zhao can now decide how to arrange these SS mantou in a row. For each arrangement, the squad leader scores Old Zhao in the following way:
(i) First, for each i{1,2,,n}i \in \{1, 2, \cdots, n\}, compute the number of times mantou of the ii-th color are adjacent, that is
ci=#{j:1jS1,the j-th and (j+1)-th mantou counted from the left are both of color i} c_i = \#\{j: 1 \le j \le S-1, \text{the } j\text{-th and } (j+1)\text{-th mantou counted from the left are both of color } i\}
(ii) Old Zhao's score is defined as c1×c2××cnc_1 \times c_2 \times \cdots \times c_n.

If SS is composite, prove that the sum of the scores over all arrangements is a multiple of SS.

Solution

First note that if any ai=1a_i = 1, then cic_i is always 0, so the total score sum is 0, which is certainly divisible by SS. Hence in what follows we only discuss the case where every color of mantou has at least 2 pieces, in which case S2nS \ge 2n.

1. We first compute the total score sum by double counting. For convenience of explanation, let MjiM_j^i denote the mantou of color ii numbered jj, and an arrangement is then a string obtained by lining up all SS of the MjiM_j^i. For each arrangement, its score is equivalent to the number of ways of choosing, from this arrangement, an adjacent pair for each color.

Therefore we can instead compute, for each color, the number of arrangements facing a designated (ordered) adjacent pair:
- The number of ways to place nn pairs into SS slots is (Sn)!(S2n)!\frac{(S-n)!}{(S-2n)!}.
- The remaining S2nS - 2n positions have (S2n)!(S - 2n)! arrangements in total.

Hence for each color's designated (ordered) adjacent pair, the number of arrangements facing it is (S2n)!(S - 2n)!, and the number of designated (ordered) adjacent pairs for each color in total is iai(ai1)\prod_i a_i (a_i - 1), so the total score sum is
P=(Sn)!(a1)(a11)(a2)(a21)(an)(an1). P = (S-n)!(a_1)(a_1-1)(a_2)(a_2-1)\cdots(a_n)(a_n-1).

2. Next we prove that SPS \mid P.
- Lemma: If SS is composite, and SS2!S \nmid \lfloor \frac{S}{2} \rfloor!, then S=4S = 4 or 99.

Proof: If SS is not the square of a prime, find S=pq,pqS = pq, p \neq q, then p,qp, q are both within S2\lceil \frac{S}{2} \rceil, so SS2!S \mid \lceil \frac{S}{2} \rceil!.

If S=p2S = p^2 with p5p \ge 5, then p,2pp, 2p are both within S2\lceil \frac{S}{2} \rceil, so SS2!S \mid \lceil \frac{S}{2} \rceil!.

So the only remaining counterexamples are S=4S = 4 or 99.

- Since (Sn)S2(S-n) \ge \lceil \frac{S}{2} \rceil, we only need to discuss S=4S = 4 or 99.

When S=4S = 4, if n=1n = 1 the score is 72, if n=2n = 2 then it must be that a1=a2=2a_1 = a_2 = 2, and the score is 8.

When S=9S = 9, note that 96!9 \mid 6!, so n>3    n=4n > 3 \implies n = 4.

Splitting 9 into a sum of four positive integers each at least 2, one of them must be 3, so (94)!(a1)(a11)(a2)(a21)(a4)(a41)(9-4)!(a_1)(a_1-1)(a_2)(a_2-1)\dots(a_4)(a_4-1) is a multiple of 9, which completes the proof.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement translated into English from zh; metadata (topic, difficulty) added by this project.