Need a quadratic function that is larger than zero when variables are unequal

39 Views Asked by At

I have a series of variables $a$, $b$, $c$, $d$, .... that are all positive and between zero and one, i.e., $0 \le a \le 1$, etc.

I need a quadratic function that is larger than zero if there is any pair of the variables unequal.

For any two variables $a \neq b$ that is quite easy: $(a-b)^2 > 0$

But I need something that does the same for three, four, five variables that could ideally be expressed in some iterative form.

So, for example, $(a-b-c)^2$ would not do the trick because that is not always >0 when $a \neq b$, because $a-b = c$ would be zero.

$(a-b)^2(a-c)^2(b-c)^2$ would also not be valid. It would not be >0 if $a \neq b$ because $b=c$ or $a=c$ would make the whole expression zero.

Is there any expression that would fulfill my requirements?

1

There are 1 best solutions below

0
On BEST ANSWER

Consider $$p(x)=\sum_{i<j}(x_i-x_j)^2$$

if any pair of $x_i$ and $x_j$ are not equal, that will contribute to a positive term.