MHB How to Graphically Determine the Minimum of a Function Under a Constraint?

SweatingBear
Messages
119
Reaction score
0
Problem:
The sum of two real numbers is $$1$$. What is the minimum value of the sum of the squares of the two numbers?

I have already managed to solve the problem algebraically (by substitution and completing-the-square we arrive at a minimum value of $$0.5$$), but what I am interested in is a graphical approach.

We have $$x +y = 1$$ and wish to find the minimum of $$x^2 + y^2$$, which we can call $$f(x,y)$$. So we have

$$\begin{cases}
x +y = 1 \\
x^2 + y^2 = f(x,y) \, .
\end{cases}$$

In a (cartesian) coordinate system these two equations represent a line and a circle respectively. Therefore the problem boils down to figuring out what the minimum radius of the circle is $$x^2 + y^2 = f(x,y)$$, but this is where I am unable to continue. How can one graphically find the minimum radius of the circle?
 
Mathematics news on Phys.org
sweatingbear said:
Problem:
The sum of two real numbers is $$1$$. What is the minimum value of the sum of the squares of the two numbers?

I have already managed to solve the problem algebraically (by substitution and completing-the-square we arrive at a minimum value of $$0.5$$), but what I am interested in is a graphical approach.

We have $$x +y = 1$$ and wish to find the minimum of $$x^2 + y^2$$, which we can call $$f(x,y)$$. So we have

$$\begin{cases}
x +y = 1 \\
x^2 + y^2 = f(x,y) \, .
\end{cases}$$

In a (cartesian) coordinate system these two equations represent a line and a circle respectively. Therefore the problem boils down to figuring out what the minimum radius of the circle is $$x^2 + y^2 = f(x,y)$$, but this is where I am unable to continue. How can one graphically find the minimum radius of the circle?

Hi sweatingbear! :)

Consider all concentric circles around zero.
You're interested in the smallest one, which would just touch the line y=1-x.
Due to the symmetry of the problem in the line y=x, the point where the circle would touch the line y=1-x will be at the point where y=x.
This is x=y=1/2.

Here's a picture to clarify.
View attachment 991
 

Attachments

  • concentric_circles.png
    concentric_circles.png
    4.6 KB · Views: 125
Last edited:
One way, is to let $y=1-x$ in the equation of the circle:

$$x^2+(1-x)^2=r^2$$

$$2x^2-2x+1-r^2=0$$

Now, the minimum possible radius requires the discriminant to be zero (do you see why?), and so we get:

$$(-2)^2-4(2)(1-r^2)=0$$

$$r^2=\frac{1}{2}$$

and we find:

$$4x^2-4x+1=0$$

Hence:

$$(x,y)=\left(\frac{1}{2},\frac{1}{2} \right)$$
 
I like Serena said:
Hi sweatingbear! :)

Consider all concentric circles around zero.
You're interested in the smallest one, which would just touch the line y=1-x.
Due to the symmetry of the problem in the line y=x, the point where the circle would touch the line y=1-x will be at the point where y=x.
This is x=y=1/2.

Here's a picture to clarify.
https://www.physicsforums.com/attachments/991

Let me see if I got it straight: In the coordinate system the sum of the squares can be visualized as the squared value of the radius of the circle. Should we wish to minimize the squared value of the radius then that is equivalent to the task of minimizing the radius of the circle. Moreover the only points of interest are those where the circle intercepts the line because those are the only one points where the sum of $$x$$ and $$y$$ is $$1$$.

So the task at hand is to find a point (or points) where the circle intersects the line and where the distance between the point in question and (0,0) is as small as possible. We can trivially conclude that this point must be where the circle tangentially intersects the line because otherwise the points will be at an arbitrarily large distance away from (0,0).

Any thoughts on that, I Like Serena?

MarkFL said:
One way, is to let $y=1-x$ in the equation of the circle:

$$x^2+(1-x)^2=r^2$$

$$2x^2-2x+1-r^2=0$$

Now, the minimum possible radius requires the discriminant to be zero (do you see why?), and so we get:

$$(-2)^2-4(2)(1-r^2)=0$$

$$r^2=\frac{1}{2}$$

and we find:

$$4x^2-4x+1=0$$

Hence:

$$(x,y)=\left(\frac{1}{2},\frac{1}{2} \right)$$

Continuing on from the discourse above: Since we were able to conclude that the circle ought to tangentially intercept the line, this means that it intersects the line at one and only one point. Thus we will have to require that the discriminant is equal to zero (otherwise the circle will not tangentially intercept the line; either not at all or at two distinct points) which finally yields $$r = 0.5$$. Is that a sufficient answer for "why" or were you thinking of a different answer, MarkFL?
 
sweatingbear said:
Let me see if I got it straight: In the coordinate system the sum of the squares can be visualized as the squared value of the radius of the circle. Should we wish to minimize the squared value of the radius then that is equivalent to the task of minimizing the radius of the circle. Moreover the only points of interest are those where the circle intercepts the line because those are the only one points where the sum of $$x$$ and $$y$$ is $$1$$.

So the task at hand is to find a point (or points) where the circle intersects the line and where the distance between the point in question and (0,0) is as small as possible. We can trivially conclude that this point must be where the circle tangentially intersects the line because otherwise the points will be at an arbitrarily large distance away from (0,0).

Any thoughts on that, I Like Serena?

Yep. That's right.
 
sweatingbear said:
...
Continuing on from the discourse above: Since we were able to conclude that the circle ought to tangentially intercept the line, this means that it intersects the line at one and only one point. Thus we will have to require that the discriminant is equal to zero (otherwise the circle will not tangentially intercept the line; either not at all or at two distinct points) which finally yields $$r = 0.5$$. Is that a sufficient answer for "why" or were you thinking of a different answer, MarkFL?

Yes, that is correct. (Yes)
 
Thanks, both of you!
 
MarkFL said:
One way, is to let $y=1-x$ in the equation of the circle:

$$x^2+(1-x)^2=r^2$$

$$2x^2-2x+1-r^2=0$$

Since this is a minimisation problem, I expect that calculus is required.

If we call the sum of squares [math]\displaystyle \begin{align*} S = x^2 + y^2 = x^2 + \left( 1 - x \right) ^2 = 2x^2 - 2x + 1 \end{align*}[/math] then the minimum is where the derivative is 0 and the second derivative is positive.

[math]\displaystyle \begin{align*} \frac{dS}{dx} &= 4x - 2 \\ 0 &= 4x - 2 \\ 2 &= 4x \\ \frac{1}{2} &= x \\ \\ \frac{d^2S}{dx^2} &= 4 \\ &> 0 \end{align*}[/math]

So there is a minimum where [math]\displaystyle \begin{align*} x = \frac{1}{2} \end{align*}[/math], and so [math]\displaystyle \begin{align*} y = 1 - \frac{1}{2} = \frac{1}{2} \end{align*}[/math]. So the minimum sum of squares is when the two numbers are both [math]\displaystyle \begin{align*} \frac{1}{2} \end{align*}[/math], and this sum is [math]\displaystyle \begin{align*} \left( \frac{1}{2} \right) ^2 + \left( \frac{1}{2} \right) ^2 = \frac{1}{4} + \frac{1}{4} = \frac{1}{2} \end{align*}[/math].
 
With a quadratic function, optimization can be accomplished simply by locating the axis of symmetry. Given:

$$2x^2-2x+1-r^2=0$$

We find the axis of symmetry at:

$$x=-\frac{-2}{2\cdot2}=\frac{1}{2}$$

Knowing the parabolic function has a positive coefficient on its squared term, we can then conclude it has a minimum at $x=\dfrac{1}{2}$.
 
  • #10
Hi sweatingbear,
I'm responding to your original question about a graphical approach. Given:
An object function f(x,y)
A constraint equation g(x,y)=0
The problem is to find the minimum value of f(x0,y0) for all points (x0,y0) on the curve g(x,y)=0.
Assume all curves involved are "nice and smooth"; however they need not be connected.

1. If you can solve g(x,y)=0 for y, say y=h(x), graph the function f(x,h(x)). Find the lowest point on this graph. In your example y=h(x)=1-x, so graph x2+(1-x)2 and find the lowest point to be (1/2,1/2). The desired minimum is then 1/4. "Usually" you can't solve the constraint equation for y.
2. Graph the constraint curve g(x,y)=0 and for different values of m, graph the curve f(x,y)=m. If the two curves don't intersect, no point (x,y) of the constraint can have value f(x,y)=m. Otherwise, graphically try and find the smallest m where the curves intersect. (You need a good graphing calculator or graphing software with a slider for m to do this.) It turns out for "smooth" curves, this minimum occurs at a point (x0,y0) with the tangent lines to the two curves at this point the same! If you go on to calculus, this is the basis for the "Lagrange multiplier method".

I've attached a graph which shows the situation in 2. To really appreciate how this works, you need to do it yourself.
 

Attachments

  • MHBgraphicoptimization.png
    MHBgraphicoptimization.png
    16.6 KB · Views: 91
Back
Top