Browse · MathNet
PrintBaltic Way 2023 Shortlist
Baltic Way 2023 counting and probability
Problem
Let be a non-negative integer and let be a nonempty finite set. We define a word from the alphabet of length as a sequence of elements of of length . (Notice that by definition the empty sequence is a word of length .)
Let be the set of all words from the nine-element alphabet , whose lengths are at most . Moreover, let be the set of all words from the four-element alphabet , whose lengths are at most and which contain the element exactly twice. (For example, , because it has length and contains the letter twice, but , because it contains the letter only once.)
Prove that the difference is divisible by .
Let be the set of all words from the nine-element alphabet , whose lengths are at most . Moreover, let be the set of all words from the four-element alphabet , whose lengths are at most and which contain the element exactly twice. (For example, , because it has length and contains the letter twice, but , because it contains the letter only once.)
Prove that the difference is divisible by .
Solution
For we denote by the number of words from the alphabet of maximum length , so that . Furthermore, we denote by the number of words of maximum length from the alphabet , that contain the letter exactly twice, so that . For example, we have (coming from the empty word), (adding one-letter words) and (adding two-letter words). More generally, we have for all , since we can form exactly words of length from the given alphabet. The recursion is also true for all , since every word of maximum length from the given alphabet is either the empty word (1 case) or the concatenation of a word of maximum length and one of the nine letters from the given alphabet ( cases).
On the other hand, we have (coming from the word ), (adding words of the form , and with ) and (adding words of the form , , , , and with ).
Lemma. The recursion is true for .
Proof of the lemma. We will consider two further sequences, first the sequence , where is the number of words of maximum length from the alphabet , that contain the letter exactly once. We will also consider the sequence , where is the number of words of maximum length from the alphabet , that do not use the letter at all (i.e. words of maximum length from the alphabet ).
Let for the moment. A word of maximum length from the alphabet , that contains the letter exactly twice, is either the concatenation of the letter with a word of maximum length with exactly one occurrence of the letter (of which there are cases) or the concatenation of a letter with a word of maximum length with exactly two occurrences of the letter (of which there are cases).
We conclude that In a similar spirit, we obtain and Equation () tells us that , from which we obtain by shifting indices. We plug both expressions into equation () and obtain Plugging equation (††) and its index shift into equation (†) yields the recursion from the lemma.
Thanks to the lemma. By induction hypothesis, there exist natural numbers such that , and . It follows that from which we conclude thanks to equation (). By equation () we have , which finishes the induction step.
We now show that for all , which yields the desired statement when we put . We are going to show our claim by strong mathematical induction on . The claim is true for , because the difference is divisible by . It is true for , because the difference is divisible by . It is true for , because the difference is divisible by .
---
Alternative solution.
Let . Since there are exactly words of length in the set for every , we have thanks to the formula for the geometric series. In particular, multiplication by brings us to the congruence , since is divisible by .
Moreover, every word in is bounded by length by . If parametrises the number of occurrences of letters different from in a word in , then the word's length is and there are possibilities to choose two places for the two letters . The other letters can be arbitrary elements from the set . It follows that Define a function by for all . Its first derivative is given by its second derivative is given by If we plug in in the last equation, every summand in the numerator of the previous fraction is divisible by except for . It follows that . The congruence means that is divisible by . Since is coprime to , the difference is also divisible by .
---
Alternative solution.
We consider the 3-adic expansion of and . Observe that and, therefore, where is the number of presentations of as an ordered sum of three summands. Since we can place between objects two “plus” symbols in ways and interpret the number of objects before the first plus as the first summand, between the two pluses as the second and after the second plus sign as the third summand, we have . Hence, we get Reducing this 3-adic identity modulo gives
On the other hand, we have (coming from the word ), (adding words of the form , and with ) and (adding words of the form , , , , and with ).
Lemma. The recursion is true for .
Proof of the lemma. We will consider two further sequences, first the sequence , where is the number of words of maximum length from the alphabet , that contain the letter exactly once. We will also consider the sequence , where is the number of words of maximum length from the alphabet , that do not use the letter at all (i.e. words of maximum length from the alphabet ).
Let for the moment. A word of maximum length from the alphabet , that contains the letter exactly twice, is either the concatenation of the letter with a word of maximum length with exactly one occurrence of the letter (of which there are cases) or the concatenation of a letter with a word of maximum length with exactly two occurrences of the letter (of which there are cases).
We conclude that In a similar spirit, we obtain and Equation () tells us that , from which we obtain by shifting indices. We plug both expressions into equation () and obtain Plugging equation (††) and its index shift into equation (†) yields the recursion from the lemma.
Thanks to the lemma. By induction hypothesis, there exist natural numbers such that , and . It follows that from which we conclude thanks to equation (). By equation () we have , which finishes the induction step.
We now show that for all , which yields the desired statement when we put . We are going to show our claim by strong mathematical induction on . The claim is true for , because the difference is divisible by . It is true for , because the difference is divisible by . It is true for , because the difference is divisible by .
---
Alternative solution.
Let . Since there are exactly words of length in the set for every , we have thanks to the formula for the geometric series. In particular, multiplication by brings us to the congruence , since is divisible by .
Moreover, every word in is bounded by length by . If parametrises the number of occurrences of letters different from in a word in , then the word's length is and there are possibilities to choose two places for the two letters . The other letters can be arbitrary elements from the set . It follows that Define a function by for all . Its first derivative is given by its second derivative is given by If we plug in in the last equation, every summand in the numerator of the previous fraction is divisible by except for . It follows that . The congruence means that is divisible by . Since is coprime to , the difference is also divisible by .
---
Alternative solution.
We consider the 3-adic expansion of and . Observe that and, therefore, where is the number of presentations of as an ordered sum of three summands. Since we can place between objects two “plus” symbols in ways and interpret the number of objects before the first plus as the first summand, between the two pluses as the second and after the second plus sign as the third summand, we have . Hence, we get Reducing this 3-adic identity modulo gives
Techniques
Recursion, bijectionInduction / smoothingCounting two waysGenerating functionsSums and productsOther