Maxima and Minima with Applications: Practical Optimization and Duality