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

  • Context: MHB 
  • Thread starter Thread starter SweatingBear
  • Start date Start date
  • Tags Tags
    Minimum Squares Sum
Click For Summary

Discussion Overview

The discussion revolves around finding the minimum value of the sum of the squares of two real numbers constrained by their sum being equal to 1. Participants explore both algebraic and graphical approaches to solve the problem, focusing on the geometric interpretation of the equations involved.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • Some participants describe the problem using the equations of a line and a circle, noting that the minimum radius of the circle corresponds to the minimum value of the sum of squares.
  • One participant suggests that the smallest circle will touch the line defined by the constraint, leading to the conclusion that the point of tangency occurs at (1/2, 1/2).
  • Another participant provides a method to derive the minimum radius by setting the discriminant of a quadratic equation to zero, resulting in a radius of 0.5.
  • Some participants discuss the use of calculus to find the minimum by taking derivatives of the sum of squares and finding critical points.
  • There is mention of the axis of symmetry for the quadratic function, indicating that the minimum occurs at x = 1/2.
  • One participant outlines a general graphical approach to optimization under constraints, suggesting methods for visualizing the problem.

Areas of Agreement / Disagreement

Participants generally agree on the graphical interpretation of the problem and the conclusion that the minimum occurs at (1/2, 1/2). However, there are varying approaches to reach this conclusion, including algebraic manipulation, calculus, and geometric reasoning, indicating that multiple methods can be valid.

Contextual Notes

Some participants note that the discriminant condition is necessary for tangential intersection, while others emphasize the importance of visualizing the problem graphically. There are also discussions about the assumptions of smoothness and connectivity of the curves involved.

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?
 
Physics 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: 149
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: 106

Similar threads

  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
Replies
4
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K