Problem:
Compute the number of possible words satisfying:
- has exactly 's and 's (and no other letters).
- For , the number of 's among is at most the number of 's among .
- For all , if is a , then must be a .
, 2017
Solution
Solution:
Call the last property in the problem statement where in the statement , . We show that the number of words satisfying the first two conditions and is the same independent of (assuming is fixed). It suffices to show that the number of words satisfying is the same as the number of words satisfying . Construct a bijection as follows: for a word satisfying , if it satisfies , leave it as is. Otherwise, the character in position must be and the character in position must be . In this case, move these two characters to positions (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 . However, this condition simply means that the first characters must be . Now we are essentially counting the number of paths from to that don't go above . There is a bijection between paths from to that do cross and paths from to (using the standard reflection argument). Thus the answer is .