How to Optimize the Sum of Squares of Two Nonnegative Numbers with a Fixed Sum?

  • Thread starter Thread starter gillgill
  • Start date Start date
  • Tags Tags
    Numbers
AI Thread Summary
To optimize the sum of squares of two nonnegative numbers constrained to a sum of 1, the maximum occurs at the endpoints where either number is 0 (x=0, y=1 or x=1, y=0), yielding a maximum sum of squares of 1. The minimum occurs at the midpoint (x=1/2, y=1/2), resulting in a minimum sum of squares of 1/2. The critical point at x=1/2 is confirmed as a minimum using the second derivative test, which shows a positive value. The boundaries of the problem are defined by the constraints that both numbers must be nonnegative and their sum cannot exceed 1. Thus, the solutions are effectively determined by evaluating these endpoints and the critical point.
gillgill
Messages
128
Reaction score
0
How should two nonnegative numbers be chosed so the their sum is 1 and the sum of their squares is
a) as large as possible
b) as small as possible

here's what I've got so far:
x+y=1; y=1-x
x^2+y^2=S
x^2+(1-x)^2=S
S'=2x-2+2x
0=2x-2+2x
2=4x
x=1/2

How do u know if it is the largest possible or smallest possible?...and how to u find the other solution?
 
Physics news on Phys.org
solution

ok so we want to maximize/minimize x^2 + y^2 with the constraint that
x + y = 1 and that x and y are postive real numbers. Let y = 1 - x
so what are the bounds on x then?
Well y has to be positive or 0 so the maximum value x is allowed to be is 1

Let z = x^2 + y^2 (objective function)
so with our substitution

z = x^2 + (1-x)^2
z = 2x^2 - 2x + 1

with the constraint that 0 <= x <= 1

check the end pts
if x = 0 y = 1 z = 1
if x = 1 y = 0 z = 1

check for critical points over the valid interval by setting dz/dx equal to zero

4x - 2 = 0 x = 1/2 this is good because its in the interval (0 < 1/2 < 1)
x = 1/2 y = 1/2 z = 1/2

thus to maximize our objective function we should set
x = 0 and y = 1 or
x = 1 and y = 0

to minimize our objective function we should set
x = y = 1/2

zmax = 1
zmin = 1/2
 
Gill did you understand that? It took me a couple reads, lol.
 
Or one can use Lagrange multipliers...:rolleyes:

Daniel.
 
gillgill said:
How should two nonnegative numbers be chosed so the their sum is 1 and the sum of their squares is
a) as large as possible
b) as small as possible

here's what I've got so far:
x+y=1; y=1-x
x^2+y^2=S
x^2+(1-x)^2=S
S'=2x-2+2x
0=2x-2+2x
2=4x
x=1/2

How do u know if it is the largest possible or smallest possible?...and how to u find the other solution?
Two easy ways. x=1/2 is either a max or a min.

Try x=1/2 in your equation. Try a number on either side of x=1/2 in your equation. Compare the answers - are the results on either side of x=1/2 greater or smaller?

Try the second derivative test.
f'(x)=4x-2 (the two 2x's can be combined)
f"(x)=4

What's the value of f"(x) when x=1/2? If it's positive, then you have a local minimum. If it's negative, you have a local maximum. In this case, f"(x)=4 regardless of the value of x, so you only have a local minimum that occurs when f'(x)=0.

The first way always works. The second way has a few situations where it won't work, but it's usually the easiest way (your book should show a couple of examples to watch out for when you want to use the second derivative test).

You have no absolute maximum, in general, but you set a boundary when you defined the problem. Both numbers have to be positive (lower x-boundary is zero) and the sum of both numbers can't be greater than 1. Since y also can't be negative, the upper boundary for x is 1. Your boundaries are your maximums.
 
then...how to do u find the other solution?
 
You have one critical point which will either be a maximum or a minimum. The only ohter possibilities for a max/min would be the endpoints of your interval.
 
Back
Top