5th problem for Machine Learning course (1INF02).