This is a question from (page 34) Lecture notes on ridge regression Wessel N. van Wieringen
I need help in writting the code for this.