86.8k views
3 votes
Consider the three points ( 1 , 3 ) , ( 2 , 3 ) and ( 3 , 6 ) . Let ¯ x be the average x-coordinate of these points, and let ¯ y be the mean y-coordinate of these points.

Then ( ¯ x , ¯ y ) =

Now consider a line through the point ( ¯ x , ¯ y ) that has slope m.

Add up the squares of the vertical distances between the line and these points (your result will be a quadratic function in terms of the variable m ).

What is the value of m that makes this total as small as possible?

1 Answer

4 votes

Answer:


m=(3)/(2)

Explanation:

Given points are: ( 1 , 3 ) , ( 2 , 3 ) and ( 3 , 6 )

The average of x-coordinate will be:


\overline{x} = \frac{x_1+x_2+x_3}{\text{number of points}}

1) Finding
(\overline{x},\overline{y})

  • Average of the x coordinates:


\overline{x} = (1+2+3)/(3)


\overline{x} = 2

  • Average of the y coordinates:

similarly for y


\overline{y} = (3+3+6)/(3)


\overline{y} = 4

2) Finding the line through
(\overline{x},\overline{y}) with slope m.

Given a point and a slope, the equation of a line can be found using:


(y-y_1)=m(x-x_1)

in our case this will be


(y-\overline{y})=m(x-\overline{x})


(y-4)=m(x-2)


y=mx-2m+4

this is our equation of the line!

3) Find the squared vertical distances between this line and the three points.

So what we up till now is a line, and three points. We need to find how much further away (only in the y direction) each point is from the line.

  • Distance from point (1,3)

We know that when x=1, y=3 for the point. But we need to find what does y equal when x=1 for the line?

we'll go back to our equation of the line and use x=1.


y=m(1)-2m+4


y=-m+4

now we know the two points at x=1: (1,3) and (1,-m+4)

to find the vertical distance we'll subtract the y-coordinates of each point.


d_1=3-(-m+4)


d_1=m-1

finally, as asked, we'll square the distance


(d_1)^2=(m-1)^2

  • Distance from point (2,3)

we'll do the same as above here:


y=m(2)-2m+4


y=4

vertical distance between the two points: (2,3) and (2,4)


d_2=3-4


d_2=-1

squaring:


(d_2)^2=1

  • Distance from point (3,6)


y=m(3)-2m+4


y=m+4

vertical distance between the two points: (3,6) and (3,m+4)


d_3=6-(m+4)


d_3=2-m

squaring:


(d_3)^2=(2-m)^2

3) Add up all the squared distances, we'll call this value R.


R=(d_1)^2+(d_2)^2+(d_3)^2


R=(m-1)^2+4+(2-m)^2

4) Find the value of m that makes R minimum.

Looking at the equation above, we can tell that R is a function of m:


R(m)=(m-1)^2+4+(2-m)^2

you can simplify this if you want to. What we're most concerned with is to find the minimum value of R at some value of m. To do that we'll need to derivate R with respect to m. (this is similar to finding the stationary point of a curve)


(d)/(dm)\left(R(m)\right)=(d)/(dm)\left((m-1)^2+4+(2-m)^2\right)


(dR)/(dm)=2(m-1)+0+2(2-m)(-1)

now to find the minimum value we'll just use a condition that
(dR)/(dm)=0


0=2(m-1)+2(2-m)(-1)

now solve for m:


0=2m-2-4+2m


m=(3)/(2)

This is the value of m for which the sum of the squared vertical distances from the points and the line is small as possible!

Consider the three points ( 1 , 3 ) , ( 2 , 3 ) and ( 3 , 6 ) . Let ¯ x be the average-example-1
User Michael Graczyk
by
5.5k points