LECTURE 3: OPTIMALITY CONDITIONS