[Math] Solve an overdetermined system of linear equations

least squareslinear algebrasystems of equations

I have doubt to solve this system of equations

\begin{cases}
x+y=r_1\\
x+z=c_1\\
x+w=d_1\\
y+z=d_2\\
y+w=c_2\\
z+w=r_2
\end{cases}

Is it an overdetermined system because I see there are more equations than unknowns.

Can we just solve this system in a simple way?

Best Answer

Your system is described by the augmented matrix $$ A= \left[\begin{array}{rrrr|r} 0 & 1 & 1 & 0 & r_{1} \\ 0 & 1 & 0 & 1 & c_{1} \\ 1 & 1 & 0 & 0 & d_{1} \\ 0 & 0 & 1 & 1 & d_{2} \\ 1 & 0 & 1 & 0 & c_{2} \\ 1 & 0 & 0 & 1 & r_{2} \end{array}\right] $$ Row-reducing the system gives $$ \DeclareMathOperator{rref}{rref}\rref A= \left[\begin{array}{rrrr|r} 1 & 0 & 0 & 0 & -\frac{1}{2} \, c_{1} + d_{1} + \frac{1}{2} \, d_{2} - \frac{1}{2} \, r_{1} \\ 0 & 1 & 0 & 0 & \frac{1}{2} \, c_{1} - \frac{1}{2} \, d_{2} + \frac{1}{2} \, r_{1} \\ 0 & 0 & 1 & 0 & -\frac{1}{2} \, c_{1} + \frac{1}{2} \, d_{2} + \frac{1}{2} \, r_{1} \\ 0 & 0 & 0 & 1 & \frac{1}{2} \, c_{1} + \frac{1}{2} \, d_{2} - \frac{1}{2} \, r_{1} \\ 0 & 0 & 0 & 0 & c_{1} + c_{2} - d_{1} - d_{2} \\ 0 & 0 & 0 & 0 & -d_{1} - d_{2} + r_{1} + r_{2} \end{array}\right] $$ This implies that your system is solvable if and only if \begin{align*} c_1+c_2-d_1-d_2 &= 0 \\ -d_1-d_2+r_1+r_2 &= 0 \end{align*} If these conditions are satisfied, then your system is solved by \begin{align*} w &=-\frac{1}{2} \, c_{1} + d_{1} + \frac{1}{2} \, d_{2} - \frac{1}{2} \, r_{1} \\ x &= \frac{1}{2} \, c_{1} - \frac{1}{2} \, d_{2} + \frac{1}{2} \, r_{1}\\ y &= -\frac{1}{2} \, c_{1} + \frac{1}{2} \, d_{2} + \frac{1}{2} \, r_{1}\\ z &=\frac{1}{2} \, c_{1} + \frac{1}{2} \, d_{2} - \frac{1}{2} \, r_{1} \end{align*}

Related Question