IMC / 2020 / Problems / Day 1, P1
IMC 2020 · Day 1 · P1
easyLet be a positive integer. Compute the number of words (finite sequences of letters) that satisfy all the following three properties:
(1) consists of letters, all of them are from the alphabet ;
(2) contains an even number of letters ;
(3) contains an even number of letters .
(For example, for there are 6 such words: , , , , and .)
Armend Sh. Shabani, University of Prishtina
Solution 1 of 3 (official)
Let . Consider a word that satisfies the conditions and let be the sets of positions of letters , , and in , respectively. By the definition of the words we have . The sets and are constrained to have even sizes.
In order to construct all suitable words , choose the set first; by the conditions, must be even. It is well-known that an -element set (with ) has even subsets, so there are possibilities for .
If then we can choose arbitrarily, and then the set is determined uniquely. Since has subsets, we have options for set and therefore suitable words with .
Otherwise, if , we have to choose an arbitrary subset of and an even subset of ; then and are determined and will automatically be even. We have choices for and independent choices for ; so for each nonempty even we have suitable words.
The number of nonempty even sets is , so in total, the number of words satisfying the conditions is
Solution 2 of 3 (official)
Let denote the number of words of length over such that and appear even number of times. Further, we define the following sequences for the number of words of length , all over .
- - the number of words with an odd number of 's and even number of 's
- - the number of words with even number of 's and an odd number of 's
- - the number of words with an odd number of 's and an odd number of 's
It is clear that and that First, we find a recurrence relation for . If an -word of length begins with or , it can be followed by any -word of length , contributing with . If an -word of length begins with , it can be followed by any word of length that contains an odd number of 's and even number of 's, thus contributing with . If an -word of length begins with , it can be followed by any word of length that contains even number of 's and an odd number of 's, thus contributing with . Therefore we have the following recurrence relation: Next, we find a recurrence relation for .
If a -word of length begins with or , it can be followed by any -word of length , contributing with . If a -word of length begins with , it can be followed by any word of length that contains even number of 's and even number of 's, contributing with . If a -word of length begins with , it can be followed by any word of length that contains an odd number of 's and an odd number of 's, contributing with . Therefore we have the following recurrence relation: Now observe that for all , since simultaneously replacing 's to 's and vice versa we get a -word from a -word. Therefore (2) yields . Now (1) yields Solving the last recurrence relation (for example, diving by we get satisfies , and it remains to sum up consecutive powers of 2) we get
Solution 3 of 3 (official)
Consider the sum Expanding the parentheses as we get a sum of products , , naturally corresponding to the words of length over the alphabet . Consider the other terms in the numerator similarly.
If a word contains letters and respectively, we get with the coefficient Hence, by substituting in we get the answer .
How the field did
Score distribution (field cohort)
Computed on contestants with a meaningful total (field cohort); discrimination is the corrected item–total correlation.