Browse · MathNet
Print48th International Mathematical Olympiad Vietnam 2007 Shortlisted Problems with Solutions
2007 counting and probability
Problem
Let be an integer. Find all sequences satisfying the following conditions: (a) for all ; (b) for all .
Solution
Consider a sequence () satisfying the conditions. For arbitrary integers denote . (If then .) Then condition (b) can be rewritten as for all . Notice that for we have .
By condition (b), We have only distinct integers in the interval ; hence, In particular, and , therefore Subdivide sequence () into blocks, each consisting of consecutive terms, and number them from 0 to . We show by induction on that the th block has the form The base case is provided by (3).
Consider the th block for . By (2), it contains some "ones". Let the first "one" in this block be at the th position (that is, ). By the induction hypothesis, the th and th blocks of have the form where each star can appear to be any binary digit. Observe that , since the sum in this block is . Then, the fragment of length bracketed above has exactly ones, i.e. . Hence, we have distinct integers in the interval , therefore for each .
Thus, the end of sequence looks as following: (each bracketed fragment contains terms). Computing in two ways the sum of all digits above, we obtain and . Then, the first terms in the th block are zeroes, and the next terms are ones, due to the sum of all terms in this block. The statement is proved.
We are left to check that the sequence obtained satisfies the condition. Notice that for all . Moreover, if and , then exactly when . In this case we have .
Consider now an arbitrary index . Clearly, there exists an integer such that . Then, applying the above inequalities we obtain that condition (b) is valid.
---
Alternative solution.
Similarly to Solution 1, we introduce the notation and obtain (2), (3), and (4) in the same way. The sum of all elements of the sequence can be computed as For an arbitrary integer , consider the numbers They are distinct integers from the possible values . Denote by the "missing" value which is not listed. We determine from . Write this sum as . Since and , we have and . Then so .
Hence, the numbers listed in (5) are and , respectively, therefore Conditions (6), together with (3), provide a system of linear equations in variables . Now we solve this system and show that the solution is unique and satisfies conditions (a) and (b).
First, observe that any solution of the system (3), (6) satisfies the condition (b). By the construction, equations (6) immediately imply (5). On the other hand, all inequalities mentioned in condition (b) are included into the chain (5) for some value of .
Next, note that the system (3), (6) is redundant. The numbers , where , appear twice in (6). For and we have , and (6) gives . For and we have and we obtain the same value, . Therefore, deleting one equation from each redundant pair, we can make every sum appear exactly once on the left-hand side in (6).
Now, from (3), (6), the sequence can be reconstructed inductively by taking the values of from (6). This means first that there exists at most one solution of our system. Conversely, the constructed sequence obviously satisfies all equations (3), (6) (the only missing equation is , which follows from ). Hence it satisfies condition (b), and we are left to check condition (a) only.
For arbitrary integers we get Since , we have for all . If then all terms are 0 on the right-hand side. If , then variable attains the value once. Hence, according with (1). Note that the formula is valid for as well.
Finally, we presented the direct formula for , and we have proved that it satisfies condition (a). So, the solution is complete.
By condition (b), We have only distinct integers in the interval ; hence, In particular, and , therefore Subdivide sequence () into blocks, each consisting of consecutive terms, and number them from 0 to . We show by induction on that the th block has the form The base case is provided by (3).
Consider the th block for . By (2), it contains some "ones". Let the first "one" in this block be at the th position (that is, ). By the induction hypothesis, the th and th blocks of have the form where each star can appear to be any binary digit. Observe that , since the sum in this block is . Then, the fragment of length bracketed above has exactly ones, i.e. . Hence, we have distinct integers in the interval , therefore for each .
Thus, the end of sequence looks as following: (each bracketed fragment contains terms). Computing in two ways the sum of all digits above, we obtain and . Then, the first terms in the th block are zeroes, and the next terms are ones, due to the sum of all terms in this block. The statement is proved.
We are left to check that the sequence obtained satisfies the condition. Notice that for all . Moreover, if and , then exactly when . In this case we have .
Consider now an arbitrary index . Clearly, there exists an integer such that . Then, applying the above inequalities we obtain that condition (b) is valid.
---
Alternative solution.
Similarly to Solution 1, we introduce the notation and obtain (2), (3), and (4) in the same way. The sum of all elements of the sequence can be computed as For an arbitrary integer , consider the numbers They are distinct integers from the possible values . Denote by the "missing" value which is not listed. We determine from . Write this sum as . Since and , we have and . Then so .
Hence, the numbers listed in (5) are and , respectively, therefore Conditions (6), together with (3), provide a system of linear equations in variables . Now we solve this system and show that the solution is unique and satisfies conditions (a) and (b).
First, observe that any solution of the system (3), (6) satisfies the condition (b). By the construction, equations (6) immediately imply (5). On the other hand, all inequalities mentioned in condition (b) are included into the chain (5) for some value of .
Next, note that the system (3), (6) is redundant. The numbers , where , appear twice in (6). For and we have , and (6) gives . For and we have and we obtain the same value, . Therefore, deleting one equation from each redundant pair, we can make every sum appear exactly once on the left-hand side in (6).
Now, from (3), (6), the sequence can be reconstructed inductively by taking the values of from (6). This means first that there exists at most one solution of our system. Conversely, the constructed sequence obviously satisfies all equations (3), (6) (the only missing equation is , which follows from ). Hence it satisfies condition (b), and we are left to check condition (a) only.
For arbitrary integers we get Since , we have for all . If then all terms are 0 on the right-hand side. If , then variable attains the value once. Hence, according with (1). Note that the formula is valid for as well.
Finally, we presented the direct formula for , and we have proved that it satisfies condition (a). So, the solution is complete.
Final answer
Partition the indices into n+1 consecutive blocks of length n. For block v (0 ≤ v ≤ n), the first n−v entries are 0 and the last v entries are 1. Equivalently, writing any index as u + v n with 1 ≤ u ≤ n and 0 ≤ v ≤ n, the sequence is given by a_{u+vn} = 0 if u + v ≤ n and a_{u+vn} = 1 if u + v ≥ n + 1.
Techniques
Pigeonhole principleInduction / smoothingCounting two waysSums and products