This is yet another one of these bonus assignments. It's a quick exploration of eigenvalues and eigenvectors for some specific matrices following a certain entry-pattern. The matrices I'm interested in
Let's just define a Python
function that returns such a matrix, given $n$, $x$ and $y$ as parameters.
from sympy import *
init_printing(use_latex='mathjax')
def mtrx(size, diag_entry, other_entry):
return other_entry*ones(size) + (diag_entry-other_entry)*eye(size)
Let's try it out:
mtrx(4, 7, 19)
mtrx(10,1,5)
And so on. Your task:
Tell me, for arbitrary sise $n$, diagonal entry $x$ and off-diagonal entry $y$, the eigenvalues of the matrix matr(n,x,y), and also describe the eigenvectors.
I want the general pattern, that will of course be dependent on $n$, $x$ and $y$. I suggest you explore small cases using SymPy
's eigenvals()
and eigenvects()
methods.