Assignment 1
Assignment 1
Assignment-1
Assigned Date: 04/02/2023
11:59pm, Due Date:13/02/2023
Instructions
• Work on the assignments on your own. You are free to discuss among your selves,but
don’t copy. If we find the assignments of a group of (two or more) students very similar,
the group will get zero points towards this assignment. Plagiarism will be cheked with
tools. Please use Python for writing code. You can submit the code as a Jupyter notebook
and For the theory questions, please submit your work to TAs. Use slack to discuss, if
you have any doubts.
1 Programming
• Q1(12 Marks)-Let f : R2 → R, (x1 , x2 ) 7→ − cos(x21 + x22 + x1 x2 )
• Q2(10 Marks)- Implement the gradients for the following functions in 2 methods 1) Us-
ing derivative function 2) Numerical gradient (hint is given)
1
– With a sufficiently small value of epsilon, this function should be a good approxi-
mation of the gradient. Verify that both gradients (the numerical computation and
the one implemented with derivative functions) as the same
2 Theory
1. Q1(10 marks) Consider the bivariate function f : R2 → R, (x1 , x2 ) 7→ x21 +0.5x22 +x1 x2 .
(a) Compute f ′
(b) Plot f and f ′ with Python
(c) Find all possible candidates x∗ for maxima and minima.
Hint: exp is a strictly monotone function.
(d) Compute f ′′
(e) Determine if the candidates are local maxima, minima or neither.
(f) Find the global maximum and global minimum of f