1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Two nonnegative numbers help

  1. May 31, 2005 #1
    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

    How do u know if it is the largest possible or smallest possible?....and how to u find the other solution?
  2. jcsd
  3. May 31, 2005 #2

    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
  4. May 31, 2005 #3
    Gill did you understand that? It took me a couple reads, lol.
  5. May 31, 2005 #4


    User Avatar
    Science Advisor
    Homework Helper

    Or one can use Lagrange multipliers...:rolleyes:

  6. May 31, 2005 #5


    User Avatar
    Science Advisor
    Homework Helper

    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)

    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.
  7. May 31, 2005 #6
    then...how to do u find the other solution?
  8. May 31, 2005 #7
    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.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook