Solving Systems of Linear Equations This exercise will consider the solving of linear equations simultaneously. The equations involve a more precise meaning that all the values of some variable quantities makes an equation, or several equations, simultaneously true.
A system of linear equations is a collection of m equations in the variable quantities \[x_1; x_2; x_3; : : : ; x_n\] of the form, \[a_{11}x_1 + a_{12}x_2 + a_{13}x_3 + ...+a_{1n}x_n = b_1\] \[a_{21}x_1 + a_{22}x_2 + a_{23}x_3 + ...+a_{2n}x_n = b_2\] \[a_{31}x_1 + a_{32}x_2 + a_{33}x_3 + ...+a_{3n}x_n = b_3\] . . . \[a_{m1}x_1 + a_{m2}x_2 + a_{m3}x_3 + ...+a_{mn}x_n = b_m\] where the values of \[a_{ij}, b_i, and x_j\], 1 <= i <= m, 1 <= j <= n, are from the set of complex numbers, C.
A solution of a system of linear equations in n variables, \[x_1; x_2; x_3; : : : ; x_n\] is an ordered list of n complex numbers,\[s_1; s_2; s_3; : : : ; s_n\] such that if we substitute \[s_1 for x_1, s_2 for x_2, s_3 for x_3, . . . , s_n for x_n\], then for every equation of the system the left side will equal the right side, i.e. each equation is true simultaneously.
Therefore, the solution set of a linear system of equations is the set which contains every solution to the system, and nothing more.
With the above explanation in mind, I tend to find the solution for the following system of linear equation using problem C33 of the A First Course in Linear Algebra.
Problem C33
x + y - z = -1
x - y - z = -1
z = 2
Organizing the coefficient of the three equations into a Matrix A and the constant as a Matrix variable B, The solution can be obtained using the inverse of A = A^-1 by augmenting with the identity.
Using R
A = matrix(c(1, 1, 0, 1, -1, 0, -1, -1, 1), nrow=3, ncol=3)
B = matrix(c(-1, -1, 2), nrow=3, ncol=1)
A
## [,1] [,2] [,3]
## [1,] 1 1 -1
## [2,] 1 -1 -1
## [3,] 0 0 1
B
## [,1]
## [1,] -1
## [2,] -1
## [3,] 2
solve (A,B)
## [,1]
## [1,] 1
## [2,] 0
## [3,] 2
Manually, x + y - z = -1 >>>>>>Eqn 1 x - y - z = -1 >>>>>>Eqn 2 z = 2 >>>>>>>Eqn 3
Substitute z = 2 in Eqn 1, x + y - 2 = -1 x + y = 2 - 1 = 1 x + y = 1 >>>>>>Eqn 4
substitute z = 2 in Eqn 2 x - y - 2 = -1 x - y = 2 - 1 = 1 x - y = 1 >>>>>>>Eqn 5
Add Eqn 4 and Eqn 5
x + y = 1 x - y = 1
2x + 0 = 2 x = 1 If x = 1, z = 2 then y = ?
substitute x = 1 in Eqn 4 x + y = 1 1 + y = 1 y = 1 -1 y = 0
Therefore, the solution are: x = 1, y = o, z = 2.
END