Problem

Source: 2024 Brazil Ibero TST P3

Tags: combinatorics, game, number theory, function



Let \( n \) be a positive integer. A function \( f : \{0, 1, \dots, n\} \to \{0, 1, \dots, n\} \) is called \( n \)-Bolivian if it satisfies the following conditions: • \( f(0) = 0 \); • \( f(t) \in \{ t-1, f(t-1), f(f(t-1)), \dots \} \) for all \( t = 1, 2, \dots, n \). For example, if \( n = 3 \), then the function defined by \( f(0) = f(1) = 0 \), \( f(2) = f(3) = 1 \) is 3-Bolivian, but the function defined by \( f(0) = f(1) = f(2) = 0 \), \( f(3) = 1 \) is not 3-Bolivian. For a fixed positive integer \( n \), Gollum selects an \( n \)-Bolivian function. Smeagol, knowing that \( f \) is \( n \)-Bolivian, tries to figure out which function was chosen by asking questions of the type: \[ \text{How many integers } a \text{ are there such that } f(a) = b? \] given a \( b \) of his choice. Show that if Gollum always answers correctly, Smeagol can determine \( f \) and find the minimum number of questions he needs to ask, considering all possible choices of \( f \).