Question: Write a program, in the language of your choice, that takes as an input the 4 elements of a 2 by 2 matrix [M], and

 Write a program, in the language of your choice, that takes

Write a program, in the language of your choice, that takes as an input the 4 elements of a 2 by 2 matrix [M], and returns the following outputs: If the matrix does not have real eigenvalues, print "no real eigenvalues". If the matrix has one single eigenvalue and only one independent eigenvector, print "only one independent eigen- vector", and print the eigenvalue and the eigenvector's components on the original basis, enforcing it to have unit norm. . If the matrix is diagonalizable, print out its eigenvalues and the 4 elements of a matrix al such that M = (a) [D] [a] -1, as well as the four elements of its inverse [b] = [a] -1, using the result from Exercise 4. Make sure your program checks the final result. This is how the structure of your program should look like: def diagonalize (M11, M12, M21, M22): if(...): print("no real eigenvalues") if(...): print("only one independent eigenvector") print("eigenvalue = ", lambda) print("eigenvector components = ", V1, V2) if(...): print("real eigenvalues - ", lambda1, lambda2) print("transformation matrix = ", a11, a12, a21, a22) print("inverse transformation matrix = ", 111, 112, b21, b22) You should check that your program works with the examples of Exercise 3, that you will have worked out by hand. This exercise will make you think methodically about the diagonalization procedure. You are asked to print out your program and hand it with the homework. Try to keep is as concise as possible

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!