# Numerical issues in solving linear systems

There was an exam in the class. The course is "High Performance Scientific Computing". One of the question in the exam is as follows:

Consider the linear system

$$\begin{bmatrix} a & b \\ b & a \end{bmatrix} \times \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$$ with $$a,b>0$$.

a) If $$a$$ is very similar to $$b$$, what is the numerical difficulty in solving this linear system?

b) Suggest a numerically stable formula for computing $$z = x + y$$ given $$a$$ and $$b$$.

This is a Computer Engineering course, however I am not able to answer these questions. What is the keyword to find a solution on the issue?

The $$2\times 2$$ matrix has determinant close to zero, and so its condition number is very large, causing numerical instability.
The explicit solution of your system is $$x=\frac{a}{a^2-b^2}, y=-\frac{b}{a^2-b^2}.$$ Therefore $$x+y = \frac{a-b}{a^2-b^2} = \frac{1}{a+b},$$ thus avoiding the numerical issues.