Source: https://web.stanford.edu/~boyd/cvxbook/bv_cvxbook_extra_exercises.pdf