# Lagrange Multiplier quadratic with positivity constraint

Is it possible to solve the following problem using Lagrange Multipliers? If not Lagrange multipliers, what is the best way to approach this?

Maximise $$(p - \frac{1}{4})^2 + (q - \frac{1}{4})^2 + (r - \frac{1}{4})^2 + (s - \frac{1}{4})^2$$

Subject to $$p + q + r+ s = 1$$

And $$p,q,r,s \geq 0$$

If the positivity constraint wasn't there, I would have directly used the Lagrange Multipliers.

• Subject to $p + q + r+ s= ????$ – Fred Mar 25 '19 at 10:52
• @ThomasShelby edited – Mahathi Vempati Mar 25 '19 at 10:53

Note that $$\sqrt{\left(p - \frac14\right)^2 + \left(q - \frac14\right)^2 + \left(r - \frac14\right)^2 + \left(s - \frac14\right)^2}$$ is the Euclidean distance from $$\left(\frac14,\frac14,\frac14,\frac14\right)$$ to $$(p, q, r, s)$$. Thus the question here is, which point $$(p, q, r, s)$$ with the given restraints $$p + q + r + s = 1$$ and $$p, q, r, s\geq 0$$ (which gives a regular tetrahedron) is the furthest away from $$\left(\frac14,\frac14,\frac14,\frac14\right)$$ (which is the center of the tetrahedron)? Geometric intuition says that this happens in the corners, which is to say one variable equal to $$1$$, the rest equal to $$0$$. The corresponding maximal value is $$\frac9{16} + 3\cdot \frac1{16} = \frac{3}{4}$$

This also hints that Lagrange multipliers wouldn't really work, as there is no maximum on the hyperplane $$p + q + r + s = 1$$ that the multipliers can find. Thus the maximum must occurr on the boundary of the region of that hyperplane, given by setting one of $$p, q, r, s$$ to $$0$$. But even then, the maximum occurrs in the corners, where the constraints aren't differentiable, and the Lagrange multiplier method fails.

That being said, finding the minimum $$(p, q, r, s) = (\frac14,\frac14,\frac14,\frac14)$$ is very doable with Lagrange multipliers, although in that case Magrange multipliesr may be a bit overkill as the solution is plainly visible.

• Can you explain the geometric intuition part? – Mahathi Vempati Mar 25 '19 at 11:20
• @MahathiVempati $(\frac14,\frac14,\frac14,\frac14)$ is the center of the tetrahedron, which is regular. The points in the tetrahedron furthest away from the center are the corners. Even if $(\frac14,\frac14,\frac14,\frac14)$ wasn't the center, and the tetrahedron wasn't regular, the point furthest away would be one of the corners. – Arthur Mar 25 '19 at 11:23

The solution is very simple. You are maximizing a convex function over a convex set. By a well-known theorem, in that case the maximum is attained at an extreme point (a corner) of the set. In your case, the set is the standard unit simplex, and its corners are $$(1, 0, 0, 0)$$, $$(0, 1, 0, 0)$$, $$(0, 0, 1, 0)$$, and $$(0, 0, 0, 1)$$.

All you need to do is to check at which one of these corners the function value is the largest, and choose that point as your maximizer.

You can still apply the Lagrange's multipliers method as following$$L(p,q,r,s,\sigma,\lambda){=(p-{1\over4})^2+(q-{1\over4})^2+(r-{1\over4})^2+(s-{1\over4})^2\\+\sigma\cdot(p+q+r+s-1)\\+\lambda_1p+\lambda_2q+\lambda_3r+\lambda_4s}$$provided$$\lambda_i\ge 0$$

The KKT conditions deal with both equality and inequality constraints and should do the trick. You can also add "dummy varaibles" that ensure positivity... $$x = p^2, y=q^2, z = r^2, w = s^2$$

This way you have a larger system but Lagrange multipliers apply directly.