10.4. Find the maximum value of the expression $a+b+c+d-ab-bc-cd-da$, if each of the numbers $a, b, c$ and $d$ belongs to the interval $[0 ; 1]$.
Answer: 2.

Solution. The first method. The value 2 is achieved, for example, if $a=c=1, b=d=0$. We will prove that with the given values of the variables $a+b+c+d-ab-bc-cd-da \leqslant 2$.

Notice that $a+b+c+d-ab-bc-cd-da=(a+c)+(b+d)-(a+c)(b+d)$. Let $a+c=x, b+d=y$, then we need to prove that $x+y-xy \leqslant 2$, if $0 \leqslant x \leqslant 2$ and $0 \leqslant y \leqslant 2$.

Indeed, $x+y-xy=(x+y-xy-1)+1=(x-1)(1-y)+1$, where $-1 \leqslant x-1 \leqslant 1$ and $-1 \leqslant 1-y \leqslant 1$. Therefore, $(x-1)(1-y) \leqslant 1$, so $x+y-xy \leqslant 2$.

By introducing new variables, we can reason differently. Fix the variable $y$ and consider the function $f(x) = (1-y)x + y$, where $x \in [0; 2]$. Since it is linear, its maximum value is achieved at one of the endpoints of the interval $[0; 2]$. But $f(0) = y \leqslant 2$ and $f(2) = 2 - y \leqslant 2$, so for all $x \in [0; 2]$ the inequality $f(x) \leqslant 2$ holds.

The second method. The same idea of linearity can be used initially. The given expression can be considered a linear function of one of the variables if the other three variables are fixed.

For example, fix the values of the variables $b, c$, and $d$ and consider the function $f(a) = (1-b-d)a + b + c + d - bc - cd$, where $a \in [0; 1]$. Due to monotonicity, its maximum value is achieved at one of the endpoints of the interval $[0; 1]$. The same situation will arise for similarly defined linear functions of the variables $b$, $c$, and $d$.

Therefore, the maximum value of the original expression can only be achieved when the variables $a, b, c$, and $d$ take one of two values: 0 or 1. Considering the symmetry of the given expression, it is sufficient to check the following cases:

1) if $a=b=c=d=0$ or $a=b=c=d=1$, the value of the expression is 0;
2) if $a=b=c=0, d=1$ or $a=b=c=1, d=0$, the value of the expression is 1;
3) if $a=b=0, c=d=1$ or $a=b=1, c=d=0$, the value of the expression is 1;
4) if $a=c=0, b=d=1$ or $a=c=1, b=d=0$, the value of the expression is 2.

Thus, the maximum value of the given expression is 2.

## Grading Criteria:

+ The correct answer and a fully justified solution are provided

$\pm$ The correct answer and generally correct reasoning are provided, but there are minor gaps or inaccuracies (e.g., the estimate is proven, but an example is missing)

干 The correct line of reasoning is provided, but a computational error is made

$\mp$ The idea of linearity is present, but it is not fully developed

干 The correct answer is provided, and the values of the variables at which it can be achieved are indicated, but the estimate is not conducted

- Only the answer is provided