QC: Consider f(x)=abs(x-3)+abs(x-7) and the point (5,4).

i) Is it an absolute/global min, according to the definition in our textbook? Explain.

ii) Is it a relative/local min, according to the definition in our textbook? Explain.

QD: this is related to the way we measure errors in statistics and machine learning.

i) What x value minimizes the sum of the absolute distances from the values 1, 3, and 8?

ii) Repeat but for sum of squared distances rather than absolute distances.

iii) How do your answers in (i) and (ii) relate to the mean and the median of 1, 3, and 8?

iv) What x value minimizes the sum of the absolute distances from the values 1, 3, 7, 8?

v) What x value minimizes the sum of the squared distances from the values 1, 3, 7, 8?

vi) is your observation in (iii) still true?

you know that the graph will have cusps at x = 3 and x=7 but it will not go clear down to the x-axis because between 3 and 7, both absolute values are positive.

Go to any good online graphing site, such as desmos or wolframalpha and check out the graph. Things should be easier after that.

To answer the questions in QC and QD, we need to understand the concepts of absolute/global minimum, relative/local minimum, and how these concepts relate to the measurement of errors in statistics and machine learning.

In general, an absolute or global minimum refers to the lowest value a function reaches over its entire domain. On the other hand, a relative or local minimum is the lowest value a function reaches within a specific interval or neighborhood.

Now let's address each question in QC and QD step by step:

QC:
i) To determine if the point (5,4) is an absolute/global minimum for the function f(x)=abs(x-3)+abs(x-7) according to the textbook's definition, we need to compare the value of f(x) at (5,4) with the values of f(x) at all other points in the domain.

To do this, we need to calculate f(x) at different x-values and compare their values. We can start by plugging in the x-coordinate of the given point (5,4) into the function f(x) and calculate its value: f(5) = abs(5-3) + abs(5-7) = 2 + 2 = 4.

Next, we need to evaluate f(x) at other points in the domain of f(x) and compare their values to determine if f(5) = 4 is the smallest value.

ii) To determine if the point (5,4) is a relative/local minimum, we need to look at the behavior of the function f(x) in the neighborhood of the point (5,4). This means we need to examine the function values for nearby points.

We can calculate f(x) for points close to x = 5, such as x = 4 and x = 6, and compare their values. By comparing f(4), f(5), and f(6), we can determine whether f(5) = 4 represents a local minimum within the neighborhood of (5,4).

QD:
i) To find the x-value that minimizes the sum of the absolute distances from the values 1, 3, and 8, we need to set up the absolute distance function and find its minimum.

The absolute distance function can be defined as f(x) = |x - 1| + |x - 3| + |x - 8|. We need to find the value of x that minimizes this function.

One way to find the value of x is by plotting the graph of f(x) or by calculating f(x) for different x-values. By examining the graph or calculating f(x), we can identify the x-value at which the function reaches its minimum.

ii) To find the x-value that minimizes the sum of the squared distances from the values 1, 3, and 8, we need to set up the squared distance function and find its minimum.

The squared distance function can be defined as g(x) = (x - 1)^2 + (x - 3)^2 + (x - 8)^2. Again, we need to find the value of x that minimizes this function.

We can plot the graph of g(x) or calculate g(x) for different x-values to identify the x-value at which the function reaches its minimum.

iii) The answers to (i) and (ii) can relate to the mean and median of the values 1, 3, and 8. The mean represents the average value, while the median represents the middle value when the values are arranged in ascending order.

If the sum of absolute distances is minimized at a particular x-value (found in (i)), it suggests that this x-value is closer to the median than the mean of the given values. However, if the sum of squared distances is minimized at a particular x-value (found in (ii)), it suggests that this x-value is closer to the mean than the median.

In summary, the relationship between the answers in (i) and (ii) and the mean and median depends on whether the distance measure is absolute or squared.

iv) To find the x-value that minimizes the sum of the absolute distances from the values 1, 3, 7, and 8, we repeat the steps we followed in (i) with the additional data points.

We set up the absolute distance function as f(x) = |x - 1| + |x - 3| + |x - 7| + |x - 8| and find the value of x that minimizes f(x).

v) To find the x-value that minimizes the sum of the squared distances from the values 1, 3, 7, and 8, we repeat the steps we followed in (ii) with the additional data points.

We set up the squared distance function as g(x) = (x - 1)^2 + (x - 3)^2 + (x - 7)^2 + (x - 8)^2 and find the value of x that minimizes g(x).

vi) The observation made in (iii) about the relationship between the mean and median may or may not hold true for the answers obtained in (iv) and (v). The relationship can change depending on the specific values and the distance measure used. Therefore, it's necessary to calculate and compare the answers to determine the relationship between the mean and median in this particular case.