There are some real $X_i$ values from $-1$ to $1$. What I need is to find such a new value $Y$ inside this range such that the distance from existing values $X$ inside this range to the new value $Y$ will be minimal.
So if we put it like this: $$S_n = \frac{|X_1-Y| + |X_2-Y|+\cdots+|X_n-Y|}n,$$ where $X_1\dots X_n$ are known numbers.
How to find such an $Y$ so that $S_n$ will be minimal?
$X$ and $Y$ are numbers (integers or floats(real))
Is it multivariate calculus?
The problem as it stands, is not multivariable calculus, since the $X$ values are already given, you can treat them like numbers, except, instead of having a result for an operation between $X_1$ and $X_2$, you have to keep it in the raw form, since you don't know their actual values, but they are fixed values.
The only variable here is $Y$. The current $S_n$ is decreasing in $Y$, hence minimized at $Y=1$.
– Fawkes4494d3 Jul 13 '20 at 10:00