Question: How do I write the code?

For each natural number n, the n-th square matrix  An is defined by 
                              An( i, j) =0 if  i = j,   An( i, j) =1 if i ≠ j
Carry out the following computations for n=3,4 and 5.

(a) Compute the determinant of  An

(b) Compute the characteristic polynomial of  An

(c) Determine all eigenvalues of  An and determine for each eigenvalue a basis of the corresponding eigenspace.

Please Wait...