[Math] Solving linear system of equations when one variable cancels

linear algebranumerical linear algebranumerical methods

I have the following linear system of equations with two unknown variables $x$ and $y$. There are two equations and two unknowns. However, when the second equation is solved for $y$ and substituted into the first equation, the $x$ cancels. Is there a way of re-writing this system or re-writing the problem so that I can solve for $x$ and $y$ using linear algebra or another type of numerical method?

$2.6513 = \frac{3}{2}y + \frac{x}{2}$

$1.7675 = y + \frac{x}{3}$

In the two equations above, $x=3$ and $y=0.7675$, but I want to solve for $x$ and $y$, given the system above.

If I subtract the second equation from the first, then:

$2.6513 – 1.7675 = \frac{3}{2}y – y + \frac{x}{2} – \frac{x}{3}$

Can the equation in this alternate form be useful in solving for $x$ and $y$? Is there another procedure that I can use?

In this alternate form, would it be possible to limit $x$ and $y$ in some way so that a solution for $x$ and $y$ can be found by numerical optimization?

Best Answer

$$\begin{equation*} \left\{ \begin{array}{c} 2.6513=\frac{3}{2}y+\frac{x}{2} \\ 1.7675=y+\frac{x}{3} \end{array} \right. \end{equation*}$$

If we multiply the first equation by $2$ and the second by $3$ we get $$\begin{equation*} \left\{ \begin{array}{c} 5.3026=3y+x \\ 5.3025=3y+x \end{array} \right. \end{equation*}$$

This system has no solution because $$\begin{equation*} 5.3026\neq 5.3025 \end{equation*}$$

However if the number $2.6513$ resulted from rounding $2.65125$, then the same computation yields $$\begin{equation*} \left\{ \begin{array}{c} 5.3025=3y+x \\ 5.3025=3y+x \end{array} \right. \end{equation*}$$ which is satisfied by all $x,y$.

A system of the form

$$\begin{equation*} \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} b_{1} \\ b_{2} \end{pmatrix} \end{equation*}$$

has the solution (Cramer's rule) $$\begin{equation*} \begin{pmatrix} x \\ y \end{pmatrix} =\frac{1}{\det \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{pmatrix} } \begin{pmatrix} a_{22}b_{1}-a_{12}b_{2} \\ a_{11}b_{2}-a_{21}b_{1} \end{pmatrix} = \begin{pmatrix} \frac{a_{22}b_{1}-a_{12}b_{2}}{a_{11}a_{22}-a_{21}a_{12}} \\ \frac{a_{11}b_{2}-a_{21}b_{1}}{a_{11}a_{22}-a_{21}a_{12}} \end{pmatrix} \end{equation*}$$

if $\det \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22}% \end{pmatrix}% \neq 0$.

In the present case, we have $$\begin{equation*} \begin{pmatrix} \frac{1}{2} & \frac{3}{2} \\ \frac{1}{3} & 1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 2.6513 \\ 1.7675 \end{pmatrix} \end{equation*}$$

and $$\det \begin{pmatrix} \frac{1}{2} & \frac{3}{2} \\ \frac{1}{3} & 1 \end{pmatrix} =0$$