Ex1, Q.4: How to create a random covariance matrix? The best thing is to work via the eigenvalue decomposition C = U D U^T. You create then a random orthogonal matrix U, and positive random numbers for the diagonal of D. Ex2, Q1: The file data_proj.txt contains 1000 sample points. Ex2 Q5 (and Q6) "remove from each patch the average value and rescale each patch to unit variance" To do that you need to average for each patch, separately, over the pixels. So you get for every patch an average and a variance.