<s>[INST] Minimum of $\left| \sin x- 1\right| + \left|\sin x- 2\right| + \left| \sin x -3\right| + \left| \sin x+1\right|$ I would like to know the minimum value of $$\left| \sin x- 1\right| + \left|\sin x- 2\right| + \left| \sin x -3\right| + \left| \sin x+1\right|$$ 
for $x \in \mathbb{R}$.
 [/INST] As $-1\leq\sin x\leq1\implies |\sin x-1|=1-\sin x$, $|\sin x-2|=2-\sin x$, $|\sin x-3|=3-\sin x$, $|\sin x+1|=1+\sin x$
Thus the given expression becomes, $1-\sin x+2-\sin x+3-\sin x+1+\sin x=7-2\sin x$ which is minimum when $\sin x $ is maximum and equal to $1$ which gives minimum value equal to $5.$
</s>