Consider points $a,b,c$ (not on a line) and $x\_1,...,x\_n$ in $\Bbb{R}^2$. I am looking for a necessary and sufficient condition in terms of the geometric configuration of these points such that for any convex function $f : \Bbb{R}^2 \longrightarrow \Bbb{R}$, $\frac{f(x\_1)+\cdots+f(x\_n)}{n} \leq \frac{f(a)+f(b)+f(c)}{3}$. (As a guess, I think the points $x\_i$ must be in the triangle determined by $a,b,c$). If you know a reference or an idea please let me know. 



A question concerning convex functions
The necessary and sufficient conditions are: $(1/n)\sum x\_j=(1/3)(a+b+c)$, and all $x\_j$ lie inside
the closed triangle $(a,b,c)$.


Proof of sufficiency. For every affine function, we have equality.
Let $f$ be convex. Then there exists a unique affine function $g$ which matches $f$
at $a$, $b$ and $c$. And we have $f\leq g$ in the triangle $(a,b,c)$. Thus
$$\sum f(x\_j)/n\leq\sum g(x\_j)/n=(g(a)+g(b)+g(c))/3=(f(a)+f(b)+f(c))/3.$$


Necessity. If some point is outside, it is easy to construct a piecewise affine function
which is zero on the triangle and positive outside, so the inequality is violated.
If $A=(x\_1+...+x\_n)/n$, does not coincide with $B=(a+b+c)/3$,
then it is easy to see that there exists an affine function which violates the inequality: just take any affine $g$ such that $g(A)>g(B)$.


This has a straightforward generalization to any dimension. 


