Maths Olympiad Prep

Library / /62 of 68

, 2017

Combinatorics Difficulty 6.8 National Olympiad Prove it United States

Problem:
Compute the number of possible words w=w1w2w100w = w_{1} w_{2} \ldots w_{100} satisfying:
- ww has exactly 5050 AA's and 5050 BB's (and no other letters).
- For i=1,2,,100i = 1, 2, \ldots, 100, the number of AA's among w1,w2,,wiw_{1}, w_{2}, \ldots, w_{i} is at most the number of BB's among w1,w2,,wiw_{1}, w_{2}, \ldots, w_{i}.
- For all i=44,45,,57i = 44, 45, \ldots, 57, if wiw_{i} is a BB, then wi+1w_{i+1} must be a BB.

Solution

Solution:
Call the last property in the problem statement P(i,j)P(i, j) where in the statement i=44i = 44, j=57j = 57. We show that the number of words satisfying the first two conditions and P(m,m+k)P(m, m + k) is the same independent of mm (assuming kk is fixed). It suffices to show that the number of words satisfying P(m1,m+k1)P(m - 1, m + k - 1) is the same as the number of words satisfying P(m,m+k)P(m, m + k). Construct a bijection as follows: for a word satisfying P(m1,m+k1)P(m - 1, m + k - 1), if it satisfies P(m,m+k)P(m, m + k), leave it as is. Otherwise, the character in position m+km + k must be BB and the character in position m+k+1m + k + 1 must be AA. In this case, move these two characters to positions m1,mm - 1, m (shifting all other characters back). It is not difficult to verify that this is indeed a bijection.

Thus, the problem is now equivalent to computing the number of words satisfying the first two conditions and P(1,14)P(1, 14). However, this condition simply means that the first 1515 characters must be BB. Now we are essentially counting the number of paths from (15,0)(15, 0) to (50,50)(50, 50) that don't go above y=xy = x. There is a bijection between paths from (15,0)(15, 0) to (50,50)(50, 50) that do cross y=xy = x and paths from (15,0)(15, 0) to (49,51)(49, 51) (using the standard reflection argument). Thus the answer is (8535)(8534)\binom{85}{35} - \binom{85}{34}.

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 reproduced verbatim; metadata (topic, difficulty) added by this project.