










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to linear systems, including the definition of linear equations and systems, the concept of a solution, and the use of matrix notation for representing and solving systems. An example of a system of equations and its solution, as well as discussions on equivalent systems, triangular linear systems, and the complexity of algorithms for solving large systems.
Typology: Slides
1 / 18
This page cannot be seen from the preview
Don't miss anything!











Linear systems
ä A linear equation in the variables x 1 , · · · , xn is an equa- tion that can be written in the form a 1 x 1 + a 2 x 2 + · · · + anxn = b,
where b and the coefficients a 1 , · · · , an are real or complex numbers that are usually known in advance.
ä A system of linear equations (or a linear system) is a collection of one or more linear equations involving the same variables – say, x 1 , ...., xn.
ä A solution of the system is a list (s 1 , s 2 , ..., sn) of num- bers that makes each equation a true statement when the values s 1 , ..., sn are substituted for x 1 , ..., xn, respectively.
Example:
Three winners of a competition labeled G, S, B (for gold, silver, bronze) are to share as a prize 30 coins. The con- ditions are that 1) G’s share of the coins should equal the shares of S and B combined and 2) The difference between the shares of G and S equals the difference between the shares of S and B.
ä How many coins should each of G, S, B receive?
ä Should formulate as a system of equations:
ä The set of all possible solutions is called the solution set of the linear system.
ä Two linear systems are called equivalent if they have the same solution set.
ä A system of linear equations has:
[The above result will be seen in detail later in this class]
ä A system of linear equations is said to be consistent if it has either one solution or infinitely many solutions.
ä A system of linear equation is said to be inconsistent if it has no solution.
Matrix Notation
ä The essential information of a linear system is recorded compactly in a rectangular array called a matrix.
ä For the following system of equations:
x 1 +x 2 +x 3 = 30 x 1 −x 2 −x 3 = 0 x 2 − 2 x 2 +x 3 = 0 The array to the right is called the coefficient matrix of the system:
And the right-hand side is:
ä An augmented matrix of a system consists of the coef- ficient matrix with the R.H.S. added as a last column
ä Note: R.H.S. or RHS = short for right-hand side column.
ä This shows an “ad-hoc” [intuitive] way of manipulating equations to solve the system.
ä Gaussian Elimination [coming shortly] shows a system- atic way
ä Basic Strategy: replace a system with an equivalent system (i.e., one with the same solution set) that is easier to solve.
Terminology on matrices
ä The size of a matrix tells how many rows and columns it has. If m and n are positive numbers, an m × n matrix is a rectangular array of numbers with m rows and n columns. (The number of rows always comes first.)
ä If m = n the matrix is said to be square otherwise it is rectangular
ä The case when n = 1 is a special case where the matrix consists of just one column. The matrix then becomes a vector and this will be revisited later. The right-hand side column is one such vector.
ä Thus a linear system consists of a coefficient matrix A and a right-hand side vector b.
Triangular linear systems are easy to solve
Example:
2 x 1 + 4x 2 + 4x 3 = 2 5 x 2 − 2 x 3 = 1 2 x 3 = 4
ä One equation can be trivially solved: the last one. x 3 = 2
ä x 3 is known we can now solve the 2nd equation: 5 x 2 − 2 x 3 = 1 → 5 x 2 − 2 × 4 = 1 → x 2 = 1
ä Finally x 1 can be determined similarly: 2 x 1 + 4 × 1 + 4 × 2 = 2 → ... → x 1 = − 5
Algorithms - complexity
ä Not emphasized in text [unfortunately!]
An example: Find the square root of a number.
Method: calculate
xnew = 0. 5
xold +
a xold
... until xnew no longer changes much. Start with x = a
Matlab function for square root
ä Matlab functions will be seen in detail later [recitations or class] – this is given just as an illustration.
function x = mysqrt(a, tol, maxits) % x = mysqrt(a, tol, maxits) % computes the square root of a (a must be > 0 ) if (a <0) error(’ *** a < 0’) end %%-------------------- main loop for i=1:maxits x = xn ; xn = 0.5(x+a/x) if (abs(xn-x) < tolxn) break end end
The issue of cost (‘complexity’)
ä For small problems cost may not be important - except when the operation is repeated many times.
ä For systems of equations in the thousands, then the algorithm could make a huge difference.
What to count?
ä Cost = number of operations to complete a given algo- rithm = function of n the problem size
ä Will find something like [example]
C(n) = 2n^3 + n^2 − 3 n
ä We are interested in cases with large values of n
ä Major point: only the leading term 2 n^3 matters - be- cause the rest is small (relatively to 2 n^3 ) when n is large.
ä We will say that the cost is of order 2 n^3 or even order n^3 [meaning that it increases like the cube of n as n increases]
Back to triangular linear systems - Algorithm
ä Upper triangular system of size n
ALGORITHM : 2 Back-Substitution algorithm
For i = n : −1 : 1 do: t := bi For j = i + 1 : n do t := t − aijxj End xi = t/aii End
ä We must require that each aii 6 = 0