Skip to main content
OlympiadHQ

Browse · MathNet

Print

Estonian Mathematical Olympiad

Estonia counting and probability

Problem

Fix a natural number . A function is called regular if and for every . If, for instance, , then the function is regular, but the function is not (in the latter case, violates the regularity condition). Juku chooses a regular function and tells Miku for each number , how many different arguments are there such that . Can Miku always determine based on this information which regular function Juku had chosen?
Solution
Firstly, we prove by induction that if is a regular function then for each positive argument . For that, assume that the claim holds for all smaller arguments. We have by regularity. By the induction hypothesis and the assumption , we have . Hence indeed.

Now we prove by induction on that the information given to Miku by Juku uniquely determines the regular function. If then only one regular function exists whence the claim holds trivially. Assume in the rest that and that the claim holds for all smaller numbers. As by the lemma proven in the beginning, we must have .

Let be the largest number in such that . Then since . By the lemma proven in the beginning, always implies and hence also . On the other hand, implies . Indeed, assume that for each ; let exactly initial members of the sequence be larger than or equal to . Then the th member must be because otherwise the initial members would all be in , implying that the next member would be larger than or equal to , too. Thus the next member is which equals 0 and all following members are 0, too. But as , we must have . We can conclude that the number of arguments such that is exactly .

Now if then similarly to what we did before we can prove that always implies . But among the arguments such that , there is for which . Thus the number of arguments such that is less than . Consequently, is the least positive integer for which the number of arguments such that is . According to this property, Miku can determine .

Restricting to , all conditions of regularity hold. Hence, by the induction hypothesis, Miku can determine . Note that if we forget about arguments and decrease the other argument-value pairs of by exactly , the conditions of regularity again hold. Hence, by the induction hypothesis, Miku can also determine . Consequently, Miku can determine the values of at all its arguments.

---

Alternative solution.

We start like in Solution 1 by showing that if is regular then for every positive argument .

Now we prove the following lemma: Whenever , either or . To this end, fix and proceed by induction on . The base case is trivial. Assume now that and, for every such that , either or . By regularity, is a term in the sequence . This sequence decreases until it reaches zero. Let the sequence contain exactly terms larger than or equal to . As all terms are less than , the induction hypothesis implies that the term number is at least (which is impossible by the choice of ) or at most . Then the following terms are also at most . Thus must be either at least or at most .

Miku can determine Juku's regular function as follows. Let Miku put the numbers of repetitions of values in the order of decreasing value (i.e., the number of repetitions of first, then the number of repetitions of , etc.). Every time a number of repetitions of some value equals a positive number , let Miku define the value of on the least arguments greater than where the value is not defined so far to be . We show that this results in the only possible regular function with the given numbers of repetitions of values. Suppose the contrary. Let be the largest value of the function for which a divergence appears. We know that all arguments on which the function obtains the value must be larger than . Hence there exist and such that , and . Since all values greater than are already assigned by the algorithm and they are correct by the choice of , the only option is . But then the lemma proven above implies either or , contradiction. Consequently, no divergence between the actual function and the one constructed by the algorithm can arise. Hence Miku can always determine Juku's function.

---

Alternative solution.

Like in Solution 1, we show that if is regular then for every positive argument . Like in Solution 2, we show that always implies either or .

Miku can determine Juku's regular function as follows. Let Miku start by defining . These are clearly the only options. Whenever have been fixed, let Miku define to be the largest number among whose presumed number of occurrences is not achieved yet. As , such number must exist. We show now that this definition is the only possible. Suppose the contrary. Let the first divergence arise at the definition of . Let the algorithm assign the value to it; then actually , because the algorithm finds the largest number less than that can be used. But since the value is not yet saturated, there must exist such that and . By the lemma proven at the beginning of the solution, either or , contradiction. Hence Miku can always determine Juku's function.

Now we prove by induction on that the information given to Miku by Juku uniquely determines the regular function. For , there exists only one regular function, whence the claim holds. Assume in the following that and the claim holds for . Let be the numbers of repetitions of values of . By the property proven at the beginning of the solution, cannot occur among the values of , hence . Let be the least positive integer such that . As , we have by the above. Define by Note that are the numbers of repetitions of values of function defined by In other words, function is obtained from by removing the argument-value pair (this removes the only occurrence of in these pairs) and decreasing the numbers by 1 in all other pairs. It is easy to check that regularity of implies regularity of . By the induction hypothesis, is the only regular function with numbers of repetitions of values are . But can be defined in terms of : In other words, add the argument-value pair and increase all numbers by 1 in other pairs. This completes the solution.

---

Alternative solution.

Like in Solution 1, we show that if is regular then for every positive argument . Next we show that whenever is regular and occurs among the values of . Indeed, let be the least positive integer such that ; by the above, . By regularity, occurs in the sequence . If then , otherwise can be represented in the form where , which contradicts the choice of .

Now we prove by induction on that the information given to Miku by Juku uniquely determines the regular function. For , there exists only one regular function, whence the claim holds. Assume in the following that and the claim holds for . Let be the numbers of repetitions of values of . By the property proven at the beginning of the solution, cannot occur among the values of , hence . Let be the least positive integer such that . As , we have by the above. Define by Note that are the numbers of repetitions of values of function defined by In other words, function is obtained from by removing the argument-value pair (this removes the only occurrence of in these pairs) and decreasing the numbers by 1 in all other pairs. It is easy to check that regularity of implies regularity of . By the induction hypothesis, is the only regular function with numbers of repetitions of values are . But can be defined in terms of : In other words, add the argument-value pair and increase all numbers by 1 in other pairs. This completes the solution.
Final answer
Yes

Techniques

Functional equationsInduction / smoothingAlgorithmsFunctional Equations