Ex. 1: Two matrices  are called similar if there exists a matrix , such that . The matrices and have the same eigenvalues. Write a test checking that two matrices are similar, by comparing their eigenvalues. Is it a functional or a unit test?
Ex. 2: Create two vectors of large dimensions. Compare the execution time of various ways to compute their dot product:
- SciPy function: v @ w
- Generator and sum:Â sum((x*y for x,y in zip(v,w)))
- Comprehensive list and sum:Â sum([x*y for x,y in zip(v,w)])
Ex. 3: Let be a vector. The vector with components
 is called a moving average of . Determine which of the two alternatives to compute is faster:
v = (u[:-2] + u[1:-1] + u[2:]) / 3
or
v = array([(u[i] + u[i + 1] + u[i + 2]) / 3 for i in range(len(u)-3)])