Maths Olympiad Prep

Library / /13 of 25

, 2023

Combinatorics Difficulty 7.8 National Olympiad, round 2 Prove it European Girls' Mathematical Olympiad (EGMO)

Problem:
Let kk be a positive integer. Lexi has a dictionary D\mathcal{D} consisting of some kk-letter strings containing only the letters AA and BB. Lexi would like to write either the letter AA or the letter BB in each cell of a k×kk \times k grid so that each column contains a string from D\mathcal{D} when read from top-to-bottom and each row contains a string from D\mathcal{D} when read from left-to-right.
What is the smallest integer mm such that if D\mathcal{D} contains at least mm different strings, then Lexi can fill her grid in this manner, no matter what strings are in D\mathcal{D} ?

Solution

Solution:
We claim the minimum value of mm is 2k12^{k-1}.

Firstly, we provide a set S\mathcal{S} of size 2k112^{k-1}-1 for which Lexi cannot fill her grid. Consider the set of all length-kk strings containing only AA's and BB's which end with a BB, and remove the string consisting of kk BB's. Clearly there are 22 independent choices for each of the first k1k-1 letters and 11 for the last letter, and since exactly one string is excluded, there must be exactly 2k112^{k-1}-1 strings in this set.

Suppose Lexi tries to fill her grid. For each row to have a valid string, it must end in a BB. But then the right column would necessarily contain kk BB's, and not be in our set. Thus, Lexi cannot fill her grid with our set, and we must have m2k1m \geqslant 2^{k-1}.

Now, consider any set S\mathcal{S} with at least 2k12^{k-1} strings. Clearly, if S\mathcal{S} contained either the uniform string with kk AA's or the string with kk BB's, then Lexi could fill her grid with all of the relevant letters and each row and column would contain that string.

Consider the case where S\mathcal{S} contains neither of those strings. Among all 2k2^k possible length-kk strings with AA's and BB's, each has a complement which corresponds to the string with BB's in every position where the first string had AA's and vice-versa. Clearly, the string with all AA's is paired with the string with all BB's. We may assume that we do not take the two uniform strings and thus applying the pigeonhole principle to the remaining set of strings, we must have two strings which are complementary.

Let this pair of strings be ,\ell, \ell' in S\mathcal{S} in some order. Define the set of indices J\mathcal{J} corresponding to the AA's in \ell and thus the BB's in \ell', and all other indices (not in J\mathcal{J}) correspond to BB's in \ell (and thus AA's in \ell'). Then, we claim that if Lexi puts an AA in the cell in row rr, column cc if r,cJr, c \in \mathcal{J} or r,cJr, c \notin \mathcal{J}, and a BB otherwise, each row and column contains a string in S\mathcal{S}.

We illustrate this with a simple example: If k=6k=6 and we have that AAABABAAABAB and BBBABABBBAB A are both in the dictionary, then Lexi could fill the table as follows:

AAABAB
AAABAB
AAABAB
BBBABA
AAABAB
BBBABA

Suppose we are looking at row ii or column ii for iJi \in \mathcal{J}. Then by construction the string in this row/column contains AA's at indices kk with kJk \in \mathcal{J} and BB's elsewhere, and thus is precisely \ell. Suppose instead we are looking at row ii or column ii for iJi \notin \mathcal{J}. Then again by construction the string in this row/column contains AA's at indices kk with kJk \notin \mathcal{J} and BB's elsewhere, and thus is precisely \ell'. So each row and column indeed contains a string in S\mathcal{S}.

Thus, for any S\mathcal{S} with S2k1|\mathcal{S}| \geqslant 2^{k-1}, Lexi can definitely fill the grid appropriately. Since we know m2k1m \geqslant 2^{k-1}, 2k12^{k-1} is the minimum possible value of mm as claimed.

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.