Given an array X of n real numbers, derive the value θ that minimizes the sum of squared deviations Σ(xi−θ)² (mean) and the sum of absolute deviations Σ|xi−θ| (median). Without knowing these results, show how to find θ by setting the derivative or subgradient to zero, and give an algorithm to compute each (mean in O(n), median via selection in expected O(n)). Generalize to the 90th percentile by minimizing the tilted absolute loss Σ ρτ(xi−θ) with τ = 0.9, where ρτ(r) = r·(τ − I[r < 0]); characterize the minimizer and discuss tie handling and robustness to outliers.