4. The function $f(x)=\left|x^{2}-a\right|$ has a maximum value $M(a)=$ $\qquad$ on the interval $[-1,1]$
4. $\left\{\begin{array}{ll}1-a, & \text { when } a \leqslant \frac{1}{2} \text {, } \\ a, & \text { when } a>\frac{1}{2} \text { }\end{array}\right.$