[math-fun] Averaging functions on trees