Skip to content

Instantly share code, notes, and snippets.

@ion1
Created April 13, 2020 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ion1/446dfb9d7b78cff2b80af860857839a8 to your computer and use it in GitHub Desktop.
Save ion1/446dfb9d7b78cff2b80af860857839a8 to your computer and use it in GitHub Desktop.
More unknowns than equations

Dealing with a system of equations with more unknowns than equations by making some of the unknowns parameters and using Gaussian elimination to solve for the remaining ones.

2a + 3b = 4c
5a + 6b + 42 = 7d

Arbitrarily, make b and d parameters and solve for a and c:

[ 2  3 −4  0 |   0 ]
[ 5  6  0 −7 | −42 ]
[ 0  1  0  0 |   b ]
[ 0  0  0  1 |   d ]
[ 1  0  0  0 |  (−6b+7d−42)/5 ]
[ 0  1  0  0 |              b ]
[ 0  0  1  0 | (3b+14d−84)/20 ]
[ 0  0  0  1 |              d ]

Thus,

a(b,d) = (−6b+7d−42)/5
c(b,d) = (3b+14d−84)/20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment