When has no solution, find the that makes as close to as possible. Multiply both sides by and solve the square system that results.
| Step | On , | |
|---|---|---|
| 1 | Confirm there is no exact solution. The equations , , contradict each other. | the first two give , the first and third give : inconsistent |
| 2 | Form the normal equations. Multiply and on the left by . The result is an system, the number of unknowns. | , |
| 3 | Solve the square system. Use elimination or the inverse of a 2×2 matrix. | , |
| 4 | Compute the projection and the error. is the orthogonal projection of onto the column space; is the error. | , , |
| 5 | Check that the error is orthogonal to the columns. must be the zero vector; that is exactly what the normal equations say. | ✓ |