1. a Discretize a continuous variable $x$ into 5 points, $x_0, x_1, x_2, x_3$, and $x_4$. Explicitly write down the
matrices $A$, $B$ and $R = A^{-1}B$. You should write down the matrices by hand without substituting any
numerical value for $\omega$ (Please notice the boundary of A and B, namely $A[0,:] =[1,0,0,0,0]$ and for B is:
$B[4,:] = [0,0,0,0,-\omega]).$
1. b Using $\omega = 0.9$, write a program to calculate the powers of $R$. Use $R^n_{max}$ to denote the element in
$R^n$ with the largest magnitude, in Python, it is `np.max(np.abs(R))`. Plot $R^n_{max}$ versus $n$ for $n$ from 0 to
10. You can use `np.matmul()` repeatedly to calculate powers of a matrix, do not use R**n. From the plot
and the definition of the matrix $R$, comment on whether the Gauss-Seidal method is stable.