2
$\begingroup$

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?

Thanks in advance.

$\endgroup$

1 Answer 1

1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.