Problem:
Let be a positive integer. Lexi has a dictionary consisting of some -letter strings containing only the letters and . Lexi would like to write either the letter or the letter in each cell of a grid so that each column contains a string from when read from top-to-bottom and each row contains a string from when read from left-to-right.
What is the smallest integer such that if contains at least different strings, then Lexi can fill her grid in this manner, no matter what strings are in ?
, 2023
Solution
Solution:
We claim the minimum value of is .
Firstly, we provide a set of size for which Lexi cannot fill her grid. Consider the set of all length- strings containing only 's and 's which end with a , and remove the string consisting of 's. Clearly there are independent choices for each of the first letters and for the last letter, and since exactly one string is excluded, there must be exactly strings in this set.
Suppose Lexi tries to fill her grid. For each row to have a valid string, it must end in a . But then the right column would necessarily contain 's, and not be in our set. Thus, Lexi cannot fill her grid with our set, and we must have .
Now, consider any set with at least strings. Clearly, if contained either the uniform string with 's or the string with '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 contains neither of those strings. Among all possible length- strings with 's and 's, each has a complement which corresponds to the string with 's in every position where the first string had 's and vice-versa. Clearly, the string with all 's is paired with the string with all '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 in in some order. Define the set of indices corresponding to the 's in and thus the 's in , and all other indices (not in ) correspond to 's in (and thus 's in ). Then, we claim that if Lexi puts an in the cell in row , column if or , and a otherwise, each row and column contains a string in .
We illustrate this with a simple example: If and we have that and are both in the dictionary, then Lexi could fill the table as follows:
| A | A | A | B | A | B |
|---|---|---|---|---|---|
| A | A | A | B | A | B |
| A | A | A | B | A | B |
| B | B | B | A | B | A |
| A | A | A | B | A | B |
| B | B | B | A | B | A |
Suppose we are looking at row or column for . Then by construction the string in this row/column contains 's at indices with and 's elsewhere, and thus is precisely . Suppose instead we are looking at row or column for . Then again by construction the string in this row/column contains 's at indices with and 's elsewhere, and thus is precisely . So each row and column indeed contains a string in .
Thus, for any with , Lexi can definitely fill the grid appropriately. Since we know , is the minimum possible value of as claimed.