Find a good basis

Problem

Run the SageMath code below or simply click here.

load("https://raw.githubusercontent.com/jephianlin/LA-notebook/main/lingeo.py") ### code set_random_seed(None) n = 2 spec = random_int_list(n, 2) D = diagonal_matrix(spec) Q = random_good_matrix(n,n,n,2) A = Q * D * Q.inverse() pretty_print(LatexExpr("A ="), A) pretty_print( LatexExpr(r"\beta = \Big\{"), *[Q[:,i] for i in range(n)], LatexExpr(r"\Big\}") )

Replace None with your favorite number and run the code again. The outcome is a matrix

A. Find a basis
β
such that
[fA]ββ
is diagonal and check your answer with the output. When you are familiar with the process enough, try n = 3 .

This note can be found at Course website > Learning resources.