Show that the Bayes estimator for the cost function $C(g(\mathbf{X}), \Theta)=|g(\mathbf{X})-\Theta|$, is given by the median of the a posteriori pdf $f_{\Theta}(\theta \mid \mathbf{X})$. Hint: Write the integral for the average cost as the sum of two integrals over the regions $g(\mathbf{X})>\theta$ and $g(\mathbf{X})<\theta$, and then differentiate with respect to $g(\mathbf{X})$.