no_alone
- 32
- 0
Homework Statement
Hello,
I have a question what is
What is the minimum of Ʃ^{n}_{i=1}\left|x_{i}-z\right|
x_{i} are constants
Homework Equations
Not Much
The Attempt at a Solution
I split the sum to 3 sums
Ʃ^{}_{x_{i}>z}(x_{i}-z) + Ʃ^{}_{x_{i}<z}(-x_{i}+z)+Ʃ^{}_{x_{i}=z}(x_{i}-z)
then I split the sums again:
Ʃ^{}_{x_{i}>z}(x_{i})+Ʃ^{}_{x_{i}>z}(-z) + Ʃ^{}_{x_{i}<z}(-x_{i}) + Ʃ^{}_{x_{i}<z}(z)+Ʃ^{}_{x_{i}=z}(x_{i}-z)
This is Equall to
Ʃ^{}_{x_{i}>z}(x_{i})-n^{}_{x_{i}>z}*z + Ʃ^{}_{x_{i}<z}(-x_{i}) + n^{}_{x_{i}<z}*z+Ʃ^{}_{x_{i}=z}x_{i}-z-n^{}_{x_{i}=z}z
Then I derivative by z and =0 to find maximum
I get:
-n^{}_{x_{i}>z}+ n^{}_{x_{i}<z}-n^{}_{x_{i}=z}=0
If x_{i}≠z for every i then
-n^{}_{x_{i}>z}+ n^{}_{x_{i}<z}=0
n^{}_{x_{i}<z}=n^{}_{x_{i}>z}
If there is i that x_{i}=z
n^{}_{x_{i}<z} = n^{}_{x_{i}>z}+n^{}_{x_{i}=z}
What we get is that the minimus is when z is the median of x_{i}
But I have a problem, when I try for example to derivate:
n^{}_{x_{i}<z}*z
n is dependent on z soo... I cannot do it! I don't know how to derivate it...
Thank's for the help