Let $ T$ denote the set of all ordered triples $ (p,q,r)$ of nonnegative integers. Find all functions $ f: T \rightarrow \mathbb{R}$ satisfying \[ f(p,q,r) = \begin{cases} 0 & \text{if} \; pqr = 0, \\ 1 + \frac{1}{6}(f(p + 1,q - 1,r) + f(p - 1,q + 1,r) & \\ + f(p - 1,q,r + 1) + f(p + 1,q,r - 1) & \\ + f(p,q + 1,r - 1) + f(p,q - 1,r + 1)) & \text{otherwise} \end{cases} \] for all nonnegative integers $ p$, $ q$, $ r$.
Problem
Source: IMO ShortList 2001, algebra problem 1
Tags: function, algebra, functional equation, IMO Shortlist
30.09.2004 20:14
Please post your solutions. This is just a solution template to write up your solutions in a nice way and formatted in LaTeX. But maybe your solution is so well written that this is not required finally. For more information and instructions regarding the ISL/ILL problems please look here: introduction for the IMO ShortList/LongList project and regardingsolutions
07.09.2008 23:01
Note that $ g(x,y,z): = \frac {3xyz}{x + y + z}$, where $ (x,y,z) \in T$, is a solution. Let $ h: = f - g$. Then, $ h$ satisfies: for $ (p,q,r) \in T$, \[ h(p,q,r) = \begin{cases} 0\,, & \text{if} \; pqr = 0, \\ \tfrac{1}{6}\Big(h(p + 1,q - 1,r) + h(p - 1,q + 1,r) & \\ + h(p - 1,q,r + 1) + h(p + 1,q,r - 1) & \\ + h(p,q + 1,r - 1) + h(p,q - 1,r + 1)\Big)\,, & \text{otherwise.} \end{cases} \] Now, on the plane $ x + y + z = k$, if $ (p,q,r) \in T$ does not lie on the boundary (i.e., $ pqr > 0$), then $ h(p,q,r)$ is the average of the values of $ h$ at the neighboring points of $ (p,q,r)$ on this plane. This implies that the extreme values of $ h$ restricted on this plane are attained at the boundary. Therefore, both the maximum and the minimum of $ h$ restricted on the plane $ x + y + z = k$ are zero. This result holds for any nonnegative integer $ k$. Thus, $ h$ is identically zero, and, consequently, \[ f(x,y,z) = \frac {3xyz}{x + y + z} \] is the only solution to this functional equation.
25.09.2011 20:37
What about $ g(x,y,z): =\frac{3xyz}{x+y+z} +k(x+y+z)$? i think your proof saying the min and max are zero is wrong, at x+y+z=k the function h is constant so the function above should be the solution?
25.09.2011 23:10
peregrinefalcon88 wrote: What about $ g(x,y,z): =\frac{3xyz}{x+y+z} +k(x+y+z)$? i think your proof saying the min and max are zero is wrong, at x+y+z=k the function h is constant so the function above should be the solution? Does your function satisfy $g(x,y,z)=0$ if $xyz=0$? My only mistake is failing to mention that $f(0,0,0)=0$, as $f(x,y,z)=\frac{3xyz}{x+y+z}$ is not defined when all its arguments are zero.
26.09.2011 00:37
you are correct, i thought the function would have the same value everywhere for x+y+z=k but i forgot that clearly some of the values are 0 making everything 0 as in your solution.
01.05.2017 06:02
08.07.2018 06:15
What is the motivation behind constructing 3xyz/ (x+y+z) in the first place? How do you notice this?
08.07.2018 19:17
Bump ^^?
18.09.2019 23:35
@above for small values of $x+y+z$ one can actually pin down the value of $f$ at every point. Doing this enough makes the pattern evident and the solution guessable. Note that $f(x,y,z)=\frac{3xyz}{x+y+z}$ works. Now, suppose there was some other $g(x,y,z)$ that worked. Letting $h=f-g$, we see that $h(x,y,z)=0$ if $xyz=0$ and otherwise is simply the average of its six neighbors in the plane its in that is normal to $(1,1,1)$. In any such plane $x+y+z=c$ with $x,y,z\ge 0$, there are a finite number of points and the boundary is all $0$. Therefore, if $h(x,y,z)$ is the minimum value, then it must be equal to all its neighbors, so proceeding in this way gives that $h$ is constant and so $h=0$. Thus, $g=f$, as desired. Remark This solution is motivated by electrostatics.
17.03.2020 09:49
It is easy to see that $f(x,y,z) = \frac{3xyz}{x+y+z}$ works. If some other function $g(x,y,z)$ worked, then $f-g$ is the average of its ``neighbors''. Consider the minimum of $f-g$; it cannot be the average unless all its neighbors are also the minimum. Continuing in this way, we get that $f-g$ is a constant. By the boundary conditions, we then know $f-g=0$. So $g=f$. Hence no other solutions exist.
03.11.2020 07:17
Solution with quite a few others: First, how do we find a function that works? We try to write down $f(x,y,z)=xyz$, but this fails, as we get by using the second condition \[f(x,y,z)=xyz-\frac 13(x+y+z)+1\]It's not clear how to construct another function in $x,y,z$ which is zero when $xyz=0$ when trying to add another factor on. For example, $pqr-k(p+q+r)$ doesn't even work, because we would get $\frac 13=0$. Adding a constant term won't help either. The best thing to try is multiplying or dividing. In addition, we want the $x+y+z$ and $1$ to cancel, so we would ideally divide (as the 1 is not included in the division), and thus too by a multiple of $x+y+z$. This gives us: \[f(x,y,z)=\frac{xyz}{k(x+y+z)}\implies f(x,y,z)=\frac{xyz-\frac 13(x+y+z)}{k(x+y+z)}+1\]Another way to see we should choose $x+y+z$ is because we want the denominator to be the same, to avoid complications, and the best thing to try is $x+y+z$. This works perfectly given $k=\frac 13$, so we choose \[f(x,y,z)=\frac{3xyz}{x+y+z}\]which works (other than $(x,y,z)=(0,0,0)$, where we already know it is 0). Now, how do we resolve the rest? The most intuitive thing to do is to do the dumb thing - try $g=f-\frac{3xyz}{x+y+z}$, and this helps because we now have that $g$ is the average of its $6$ neighbors in the same plane ($x+y+z=k$, $k$ is an integer): [asy][asy] import cse5; import olympiad; size(5cm); filldraw((3,0)--(0,3)--3*dir(60)--cycle, blue*0.3+white, blue); D((-5,0)--MP("x",(5,0),N), black, Arrows); D((0,-5)--MP("z",(0,5),E), black, Arrows); D(5*dir(240)--MP("y",5*dir(60),dir(150)), black, Arrows); [/asy][/asy] You can visualize it as such: [asy][asy] import olympiad; import cse5; pointpen=black; size(5cm); D(D(dir(0)) -- D(dir(60)) -- D(dir(120)) -- D(dir(180)) -- D(dir(240)) -- D(dir(300)) -- cycle, blue); D((0,0),red); [/asy][/asy] The red dot is the center, and is the average of the six black points around it (this is in the equilateral plane of $x+y+z=k$, for fixed $k$). Now, that means that we can't have a maximum. Indeed, let $\mathcal S=\{(x,y,z)\in\mathcal T\mid x+y+z=k\}$, and assume $(x_0,y_0,z_0)$ was the local maximum. However, we note \[g(x,y,z)=\frac 16\sum g(\text{neighbor})\leq\frac 16\sum g(x,y,z)=g(x,y,z)\]so all inequalities are equalities and $g(x,y,z)=g(\text{neighbor})$. Continuing in this way, we see $g$ is constant over $\mathcal S$, but as the value of $g$ at $(k,0,0)$ is $0$, we get $g=0$ and thus we're done. Note: the reason it's done this way is because it's very intuitive to try to construct a function, which turns out to be very hard, and the core of the problem. The rest of the problem is finished because it suspiciously looks like an average, which it turns out to be.
22.11.2020 20:23
Note that for each $k$ such that $x+y+z=k$, there is a unique value for $f(x, y, z)$ because we have that all such values make one different equation. This means that we have that there is a unique solution to $f$. We note that if $f(x, y, z) = \frac{3xyz}{x+y+z}$, then $$\sum_{\text{sym}}f(x+1, y, z-1)=\sum_{\text{sym}}\frac{3(x+1)y(z-1)}{x+y+z} = \frac{18xyz}{x+y+z}-6 = 6\left(f(x, y, z)-1\right)$$which satisfies the given condition, meaning that $f(x, y, z) = \boxed{\frac{3xyz}{x+y+z}}$ is our only solution.
09.06.2021 22:28
didn't find the actual function (oops) but can someone check if my proof that only one function exists is right? basically, define a game with three players, P, Q, R, where P, Q, and R have p, q, r points respectively then each move, a loser and winner are picked randomly, and the loser gives a point to the winner then f(p, q, r) is just the expected value till someone hits 0 pts since this value can't vary for the same value p, q, r, f(p, q, r) only has one possible function OMG HI CENTS
10.06.2021 18:01
\bump $ $
16.06.2021 00:57
We claim that $f(p,q,r)=\frac{3pqr}{p+q+r}$ for all positive integer $p,q,r$, and $f(p,q,r)=0$ when at least one of $p,q,r$ is zero is the only function that works. It is easy to check that it works, so we focus on proving that it is the only one. Given a point $(p,q,r)$, let it's coordsum $S$ be $p+q+r$. Notice that the given equation for $f(p,q,r)$ only includes points with the same coordsum. Using the equations for every point with positive integer coordinates with coordsum $S$, we can get a system of $n$ variables in $n$ equations where $n$ is the number of points with coordsum $S$ and positive integer coordinates. Consider the lattice points with nonnegative integer coordinates on the plane $$x+y+z=S.$$Notice that these lattice points form an equilateral lattice, with the points with at least one coordinate zero making the outside equilateral triangle. This is illustrated with the diagram below. Now consider the following question: Suppose an ant starts on the point $(p,q,r)$ on the graph of $x+y+z=S$. Every move, the ant moves to one of the six lattice points closest to it. What is the expected number of moves that the ant will take to reach a point with at least one coordinate zero? Notice that this is precisely $f(p,q,r)$, as writing out the states equations needed to solve this, we find that these are exactly the same as the system of $n$ equations in $n$ variables earlier. Therefore the value of $f(p,q,r)$ is fixed for all positive integers $p,q,r$, and therefore at most one solution can exist. As we have already found this solution, we are done.
Attachments:

25.06.2021 00:48
Note that there is at most one solution because $f$ is uniquely determined as the expected number of moves to reach $xyz=0$ under a defined set of possible moves. I now claim $f(x,y,z)=\frac{3xyz}{x+y+z}$ where $f(0,0,0)=0$ works. If $pqr=0$, then $f(p,q,r)=0$. Next, the recursive relation gives \[f(p,q,r) = 1+\frac{3(p+1)(q-1)r+3(p-1)(q+1)r+3(p-1)q(r+1)+3(p+1)q(r-1)+3p(q+1)(r-1)+3p(q-1)(r+1)}{6(p+q+r)}\]\[=1+\frac{3(6pqr-2p-2q-2r)}{6(p+q+r)}=\frac{3pqr}{p+q+r}\]Thus, this choice of $f$ works.
19.02.2022 16:15
The answer is $\boxed{f(x,y,z)=\frac{3xyz}{x+y+z}}$. im sobad
13.03.2022 01:15
Note that whatever function it is, it must be unique, since the function is asking the following: On the plane $x+y+z=p+q+r,$ starting with point $(p,q,r)$ what is the expected value of the number of moves of length $\sqrt{2}$ the point needs to make in order to have $pqr=0.$ There is only one answer to a question like this. Thus, since \[f(p,q,r)=\frac{3pqr}{p+q+r}\]works, we're done.
30.03.2022 17:23
Note that $\boxed{f(p,q,r)=\begin{cases}\frac{3pqr}{p+q+r}&\text{if }pqr\ne0\\0&\text{if }pqr=0\end{cases}}$ is a solution. We claim it is the only one. Let $g(p,q,r)=f(p,q,r)-\frac{3pqr}{p+q+r}$ if $pqr\ne0$. The assertion is equivalent to the fact that $g(p,q,r)$ is the average of $g(p+1,q-1,r)$, $g(p-1,q+1,r)$, $g(p-1,q,r+1)$, $g(p+1,q,r-1)$, $g(p,q+1,r-1)$, and $g(p,q-1,r+1)$ if $pqr\ne0$. Let $(x,y,z)\in T$ be any triple such that $g(x,y,z)$ is maximal. Then: $$g(x,y,z)=\frac{g(x+1,y-1,z)+g(x-1,y+1,z)+g(x-1,y,z+1)+g(x+1,y,z-1)+g(x,y+1,z-1)+g(x,y-1,z+1)}6\le\frac{6g(x,y,z)}6=g(x,y,z)$$so equality holds and these values of $g$ are all equal. By induction $g$ must be constant, and since $g(0,0,0)=0$, $g(p,q,r)=0$ proving our claim.
25.04.2022 21:40
The answer is $f(x,y,z)=\frac{3xyz}{x+y+z}$ only, which can be verified to work with direct substitution. Now, note that $f$ is unique, since $f(x,y,z)$ counts the expected number of moves necessary to make one variable zero from $(x,y,z)$, where each move consists of subtracting $1$ from one element and adding $1$ to a different one. $\blacksquare$
26.04.2022 14:00
We can find that $\boxed{f(p,q,r)=\frac{3pqr}{p+q+r}},$ is a solution and if $pqr=0,$ then $\boxed{f(p,q,r)=0},$ is another fitting solution. Claim: No other solution exists. Proof. Assume the contrary that $f_1(p,q,r)$ is another solution. Also let $f(p,q,r)=f_1(p,q,r)+f_2(p,q,r).$ Then $f_2(p,q,r)$ satisfies, $f_2(p,q,r)= \begin{cases} \tfrac{1}{6}\{f_2(p + 1,q - 1,r) + f_2(p - 1,q + 1,r) & \\ + f_2(p - 1,q,r + 1) + f_2(p + 1,q,r - 1) & \\ + f_2(p,q + 1,r - 1) + f_2(p,q - 1,r + 1)\}.\end{cases}$ We have that all values of $f_2(p,q,r)$ is equal to the 6 points around it which implies that for any particular $p+q+r$, $f_2(p,q,r)$ is constant. So for some values of $f_2$ are always $0\implies f_2 \equiv 0.$ And the claim follows. $\blacksquare$
09.07.2022 23:14
We claim the only solution is $f(x,y,z)=\frac{3xyz}{x+y+z}$ if not all of $x,y,z$ are $0$ and $0$ otherwise. Assume there is another solution $g(x,y,z)$. Then $h=g-f$ is the average of all of its neighbors. Let the minimum of $h$ be achieved at some point. Then all its neighbors are also the minimum and continuing in this fashion we get $h$ is constant and we have $h(0,0,0)=0$, so $f=g$ and we are done.
01.11.2022 16:24
We claim that the answer is $$f(p,q,r)=\frac{3pqr}{p+q+r}$$unless $p=q=r=0$, then $f(0,0,0)=0$. This clearly works, and is unique because this is equivalent to the answer to the following problem via states: Let Alice, Bob, and Charlie have $p,q,r$ chips, respectively. A move involves a random person out of the three giving a chip to another random person, and the game ends when someone has no chips left. Find the expected number of moves before the game ends. This expected value is clearly unique, so we are done.
28.11.2022 21:00
Note that $f(p,q,r)$ is the expected number of moves starting from $(p,q,r)$ needed to reach a coordinate axis if in each move, it is moved in the three directions a permutation of $(1,0,-1)$, so the function is obviously unique. Since $$f(p,q,r)=\frac{3pqr}{p+q+r}$$works, it is the only solution
05.12.2022 05:11
The following rephrasing of the problem trivializes it: Rephrasing, from WOOT wrote: At the beginning of a game, three players start with $a$, $b$, and $c$ chips, respectively. On each turn, two players are picked at random, and the first player gives a chip to the second. This continues until one of the players runs out of chips. Find the expected value of the number of turns until the game stops. Such a function that models the expected value is clearly unique, and furthermore $$f(p, q, r) = \frac{3pqr}{p+q+r}$$works, so it is the only solution.
28.12.2022 06:41
Note that the problem is equivalent to $3$ players playing a game with $p,q,r$ chips, and a random player giving a chip to another random player on each move, and $f(p,q,r)$ is the expected number of moves before the game ends. Then there is clearly only one function for this expected value, and $$f(p,q,r)=\frac{3pqr}{p+q+r}$$works, it is the only solution. $\blacksquare$
27.04.2023 13:40
The solution is unique, the equation is an expected value equation. It is not hard to check $f(x,y,z) = \frac{3xyz}{x+y+z}$ works.
01.06.2023 22:44
I claim the solution is unique - indeed, $f(x,y,z)$ can be expressed as the following: rephrased problem wrote: Suppose that 3 piles have $x,y,$ and $z$ chips respectively. Suppose in a move, one randomly selects a pile and moves a single chip from that pile to any other pile. Then $f(x,y,z)$ counts the expected number of moves until one of the piles becomes empty. Clearly, this works, and since this expected value is unique, $f(x, y, z)$ is unique. One can now easily check that \[f(x,y,z) = \frac{3xyz}{x+y+z}\]is the unique solution.
28.09.2023 20:29
We will show that the only solution is $f(p,q,r)=\frac{3pqr}{p+q+r}.$ Suppose there were two distinct solutions $f(p,q,r)$ and $f'(p,q,r).$ Let $g(p,q,r)=f(p,q,r)-f'(p,q,r).$ Then, we have $g(p,q,r)=0$ if $pqr=0$ and $g(p,q,r)$ is the average of its six neighbors in the plane $x+y+z=p+q+r.$ We must have $g(p,q,r) \ne 0$ for some $(p,q,r).$ Consider the points $(x,y,z)$ satisfying $x+y+z=p+q+r$ and with $|g(x,y,z)|$ maximized, and of those, consider one with minimal $x.$ Let this point be $(i,j,k).$ Notice that $i \ne 0.$ Then, notice that for any $a,b,c,d,e,f$ we have $|a+b+c+d+e+f| \le |a|+|b|+|c|+|d|+|e|+|f|,$ or the absolute value of their average is less than or equal to the average of their absolute values. However, notice that $|g(i-1,j,k+1)|<|g(i,j,k)|$ by our choice of $(i,j,k),$ and so the average of the absolute values of the outputs of $f$ across the neighbors of $(i,j,k)$ in the plane $x+y+z=p+q+r$ is less than $|g(i,j,k)|.$ However, the absolute value of their average is by definition $|g(i,j,k)|,$ implying that $|g(i,j,k)|<|g(i,j,k)|,$ which is a contradiction. Therefore, $f$ is unique. We can easily check $f(p,q,r)=\frac{3pqr}{p+q+r}$ indeed works, so we are done.
22.10.2023 04:58
Many solutions notice that this is the transition equation for the expected number of steps for a game with 3 players with respectively $p,q,r$ chips in front of them, and randomly every turn someone gives another person a chip, with the game ending when some one player has 0 chips left. I'll write out how you would compute the answer form given this fact, without guesswork. Let $(X_n,Y_n, Z_n)$ be the number of chips in front of each player after $n$ steps, where we initialize $(X_0, Y_0, Z_0)=(p,q,r)$. We now note that $S_n=X_nY_nZ_n+\frac{1}{3}n(p+q+r)$ is a martingale. Indeed, $$\mathbb{E}[X_{n+1}Y_{n+1}Z_{n+1}+(n+1)(p+q+r)/3]$$$$= \frac{1}{6}((X_n+1)(Y_n-1)Z_n+(X_n-1)(Y_n+1)Z_n+X_n(Y_n+1)(Z_n-1)+X_n(Y_n-1)(Z_n+1)+(X_n-1)Y_n(Z_n+1)+(X_n+1)Y_n(Z_n-1))+(n+1)(p+q+r)/3$$$$=X_{n}Y_{n}Z_{n}+n(p+q+r)/3$$. Let $T$ be the stopping time. Then, by the optional stopping time theorem, we have $\mathbb{E}[S_T]=\mathbb{E}[S_0]$, and so $$\mathbb{E}[X_TY_TZ_T]+\mathbb{E}[T](p+q+r)/3=X_0Y_0Z_0+0\iff$$$$0+\frac{p+q+r}{3}\mathbb{E}[T]=pqr +0\iff$$$$\mathbb{E}[T] = \frac{3pqr}{p+q+r}$$ as in all the other solutions.
05.01.2024 23:15
We claim that the answer is $f(x, y, x) = \boxed{\frac{3xyz}{x+y+z}}$ We can see that this satisfies the first criteria and the second is also true. We claim that there is only $1$ possible value for $f(x, y, z)$. which obviously completes the problem FTSOC assume that $f(x, y, z)$ can have $n > 1$ different values. Let $f(x-1, y+1, x)$ take on $p > 1$ different values and $f(x-1, y, z+1)$ take on $q > 1$. Notice that these are symmetric thus, WLOG let $n \leq p \leq q$. Notice that we have \[f(x, y, z) = f(x-1,y+1,z) + f(x+1,y-1,z)+ f(x-1,y,z+1) + f(x+1,y,z-1)+ f(x,y-1,z+1) + f(x,y+1,z-1)\] Thus the only way that we can have $n \leq p \leq q$ is when $n = p = q > 1$. However, we still have at least $p+q-1$ different possible values for $n$. Thus there exist no such triples $n, p, q$ unless $n = p = q = 1$. $\blacksquare$
07.04.2024 15:02
Answer: $f(0, 0, 0) = 0$ and $f(x, y, z) = \frac{3xyz}{x + y + z}$ for all $x, y, z$ satisfying $x + y + z \neq 0$. We can easily check our answer. Let $g(x, y, z) = f(x, y, z) - \frac{3xyz}{x + y + z}$. Then we get $6g(x, y, z) = g(x - 1, y + 1, z) + g(x + 1, y - 1, z) + g(x, y + 1, z - 1) + g(x, y - 1, z + 1) + g(x + 1, y, z - 1) + g(x - 1, y, z + 1)$, that's it, $g(x, y, z)$ is the average of its 6 adjacent points. Now we'll prove that $g(x, y, z) = 0$ for all $(x, y, z) \in T$. Fix a nonnegative integer $m$ and let $M = \max\{g(x,y,z) | x + y + z = m\}$. Then $M$ is the average of its 6 adjacent points, so its 6 adjacent points are $M$. Repeating this, we see that all points are $M$, which means that $g(x + y + z) = 0$ for all $x, y, z$ satisfying $x + y + z = 0$. Varying $m$, we see that $g(x, y, z) = 0$ for all $(x, y, z) \in T$, so we're done. $\blacksquare$
24.08.2024 05:51
I claim the answer is only the function $\frac{3xyz}{x + y + z}$. It is easy to verify this works, then to check that there is nothing else, just consider that the difference of any two solutions is a function on an equilateral triangle grid such that $f$ is the average of the $f$ of it's neighbor, considering smallest/largest magnitude easily gives $f$ constant. As a result, $f$ is actually zero because of the neighbors at the edge all being $0$, hence there is at most one solution.
13.10.2024 22:18
Nice problem! I did find $f(p,q,r)=\frac{3pqr}{p+q+r}$ but I couldn't find a way to show that the function is unique. Translating to an expected value problem is really cool; I wish I thought of it.
06.01.2025 07:02
We claim that our only solution is $\boxed{f(x,y,z) = \frac{3xyz}{x+y+z}}$, which we can test to work. Suppose FTSOC there exist two functions $g$ and $h$ which both satisfy the conditions. Then the function $j(x,y,z) := g-h$ has the property that the value of $(a,b,c)$ is the average of its six neighbors on the $x+y+z=a+b+c$ plane. Thus over constant $x+y+z$, $j(x,y,z)$ must be constant by considering extrema, meaning any two solutions can only differ by a constant, from which our fixed values of 0 tell us we can only have one unique solution. $\blacksquare$
07.01.2025 12:13
Its not so hard to check that the function $f(x,y,z) = \frac{3xyz}{x+y+z}$ is a valid solution. Say some other function $g(x,y,z)$ worked, then $f-g$ would be the average of its ``neighbors''. Consider the minimum of $f-g$; it cannot be the average unless all its neighbors are also the minimum. Continuing this extremal argument, we get that $f-g$ is a constant. But due to the boundary conditions, we then know $f-g$ has to be zero. Thus $g=f$ and hence the only existing solution is the one described above, $f(x,y,z) = \frac{3xyz}{x+y+z}$