Linear Algebra 1
Linear Algebra 1
Linear Algebra 1
Instructor: Dr. Ye Huajun & Miss Wang Qin T.A. : Miss Wang Qin Office: E409 Tel: 3620622(office),N/A(TA) Email: [email protected] (Instructor) N/A (TA) Website:www.uic.edu.hk/~yehuajun
-----Dr. Ye
15%
Home Works 10% Little Quizzes 50% Mid-term Examination Final Examination 25%
Score System
Letter Grade Academic Performance Excellent Excellent Good Good Good Satisfactory Satisfactory Marginal Pass Fail Grade Point Per Unit
Assessment grade system: A and A- (about 10%) A and B that include A, A-, B+, B and B- (Not more than 65%) Below C and not include C (No any limit ).
A AB+ B BC+ C D F
4.00
3.70 3.30 3.00 2.70 2.30 2.00 1.00
0.00
General Information
Textbook Linear Algebra With Applications (7 Edition) Steven J. Leon China Machine Press ()
Advantages Classical Textbook for two semesters Cheap Price More applications Software Matlab
General Information
References J.L. Goldberg, Matrix Theory with Applications, McGraw Hill, International Ed., 1992. Graham, Matrix Theory and Applications for Engineers and Mathematicians, John Wiley & Sons, 1979. B. Noble and J.W. Daniel, Applied Linear Algebra, 3rd edition, Prentice Hall, 1988. J.M. Ortega, Matrix Theory, Plenum, 1987.
10
11
Why MATLAB?
Programming Language is relatively easy. You have access to it in the STAT computer lab (F203) and in C403. Most people in scientific and engineering disciplines use MATLAB.
12
Starting Matlab
Start from Icon on Desktop
13
14
MATLAB Basics
Arithmetic operations:
12
22
1/2
2^2
Built-in Functions like sqrt, log, exp, sin etc. Example: sqrt(4)=2 Built-in constants like pi
15
Vectors()
MATLAB was designed to be an environment for doing Matrix and Vector calculations. Almost all of MATLAB's basic commands revolve around the use of vectors. A vector is defined by placing a sequence of numbers within square braces: v = [3 1] produces: v= 3 1
16
Vectors
Note that MATLAB printed out a copy of the vector after you hit the enter key. If you do not want to print out the result put a semi-colon at the end of the line: v = [3 1]; produces no output
17
Vectors
MATLAB can define a vector as a set of numbers with a common increment: v = [1:8] produces v= 12345678
18
If you wish to use an increment other than 1 that you define the start number, the value of the increment, and the last number. For example, to define a vector that starts with 2 and ends in 4 with steps of .25 : v = [2:.25:4] produces
Vectors
19
Vectors
You can view individual entries in a vector. For example to view the first entry in the vector from the last slide, type: v(1) produces ans = 2
20
Vectors
We can add or subtract vectors: v = [0:2:8] u = [0:-1:-4] u+v produces ans = 01234
21
Vectors
We can multiply or divide vectors term by term: u.*v produces ans = 0 -2 -8 -18 -32
22
Vectors
We can generate a column vector of zeroes by: zeros(5,1) produces u= 0 0 0 0 0
23
MATLAB
A=[a b; c d] rref(A) A*B eye(n) inv(A) A=floor(10*rand(n)) A x = A\b ones(m,n)
24
help sum
tic, x=A\b; toc zeros(m,n) % start here det(A) eig(A) rank(A) diag(A) triu(A)
25
27
A linear equation ()
A linear equation in n unknowns is an equation of the form
x1 , x2 ,, xn are variables.
28
Examples 1.1
29
II. III. 5 x x1 x2 x2 1
3 1
30
A system of linear equations A collection of one or more linear equations involving the same set of variables, say, x1 , x2 , , xn .
A linear system of m equations in n unknowns (mxn linear systems) a11 x1 a12 x2 a1n xn b1 a21 x1 a22 x2 a2 n xn b2 am1 x1 am 2 x2 amn xn bm
31
Examples 1.2
(a) x1 2 x2 5 2 x1 3x2 8 (b) x1 x2 x3 2 2 x1 x2 x3 4 (c) x1 x2 2 x1 x2 1 x1 4
System (a) is a 2x2 system, (b) is a 2x3 system, and (c) is a 3x2 system.
32
A solution of a linear system A list ( s1 , s2 , , sn ) of numbers that makes each equation in the system true when the values ( s1 , s2 ,, sn ) are substituted for ( x1 , x2 ,, xn ), respectively.
Recall above examples The ordered pair (1,2) is a solution to system (a). If a any real number, the ordered triple (2,a,a) is a solution to system (b). However, system (c) has no solution. So systems (a) and (b) are both consistent, and system (c) is inconsistent.
33
34
Basic Fact
A system of linear equations has either I. Exactly one solution (consistent) or II. Infinitely many solutions (consistent) or III. No solution (inconsistent).
35
36
37
Property
If a multiple of one equation is added to another equation, the new system will be equivalent to the original system. Proof: Since the n-tuple ( s1 , s2 ,, sn ) will satisfy the two equations
ai1 x1 ain xn bi a j1 x1 a jn xn b j
To summarize, there are three operations that can be used on a system to obtain an equivalent system: I. The order in which any two equations are written may be interchanged.
II. Both sides of an equation may be multiplied by the same nonzero real number. III. A multiple of one equation may be added to (or subtracted from) another.
39
Strategy for solving a system Replace one system with an equivalent system that is easier to solve.
40
Strict triangular form A system is said to be in strict triangular form if in the k-th equation the coefficients of the first k-1 variables are all zero and the coefficient of x k is nonzero (k=1,.,n).
41
We can use back substitution method to solve this strictly triangular system.
42
Property If an nxn system has exactly one solution then operations I and III can be used to obtain an equivalent strictly triangular system.
43
Example 1.4
Solve the system
x1 2 x2 x3 3 3 x1 x2 3 x3 1 2 x1 3 x2 x3 4
44
Solution: Subtracting 3 times the first row from the second yields, and subtracting 2 times the first row from the third row yields, we have
x1 2 x2 x3 3 3 x1 x2 3 x3 1 2 x1 3 x2 x3 4 x1 2 x2 x3 3 7 x2 6 x3 10 x2 x3 2
Then we subtract 1/7 times the second row from the third row. We end up with the following trictly triangular system:
x1 2 x2 x3 3 7 x2 6 x3 10 1 4 x3 7 7 x1 3 x2 2 x3 4
45
The term matrix means simply a rectangular array of numbers. A matrix having m rows and n columns is said to be mxn.
46
The augmented matrix () of the system If we attach to the coefficient matrix an additional column whose entries are the numbers on the right-hand side of the system, we obtain the new matrix. We will refer to this new matrix as the augmented matrix.
47
Elementary Row Operations I. (Interchange) Interchange two rows. II. (Scaling) Multiply all entries in a row by a nonzero real number.
III. (Replacement) Replace a row by its sum with a multiple of another row.
Row equivalent matrices Two matrices where one matrix can be transformed into the other matrix by a sequence of elementary row operations.
48
When we use the row to eliminate the elements in the column of the remaining rows. We refer to this row as the pivotal row. The first nonzero entry in the pivotal row is called the pivot.
49
3x1 x2 3x3 1
Pivotal Row
50
Example 1.5
51
52
x2 x3 x4 0 x1 x2 x3 x4 6 2 x1 4 x2 x3 2 x4 1 3 x1 x2 2 x3 2 x4 3
53
54
Exercise 1.2
55
Exercise 1.3
56
Exercise 1.4
Solve the following system
x1 3 x2 x3 2 x4 4 3 x1 4 x2 2 x3 3 x4 6 x1 5 x2 4 x3 x4 11 2 x1 7 x2 x3 6 x4 5
57
However, this method will fail if at any stage of the reduction process all the possible choices for a pivot element in a given column are zero.
58
59
Row Echelon Form () A matrix is said to be in row echelon form I. All nonzero rows are above any rows of all zeros.
II. Each leading entry (i.e. left most nonzero entry) of a row is in a column to the right of the leading entry of the row above it. III. All entries in a column below a leading entry are zero.
60
61
62
Overdetermined Systems A linear system is said to be overdetermined if there are more equations than unknowns.
63
Underdetermined Systems A system of m linear equations in n unknowns is said to be underdetermined if there are fewer Equations than unknowns (m<n). Although it is possible for underdetermined systems to be inconsistent, they are usually consistent with infinitely many solution. It is impossible for an underdetermined system to have only one solution.
64
Reduced Row Echelon Form () A matrix is said to be in reduced row echelon form If the matrix is in row echelon form and I. The leading entry in each nonzero row is 1. II. Each leading 1 is the only nonzero entry in its column.
65
66
Gauss-Jordan Reduction The process of using elementary row operations to Transform a matrix into reduced row echelon form. Examples 1.9 Use Gauss-Jordan reduction to solve the system
x1 x2 x3 3 x4 0 3 x1 x2 x3 x4 0 2 x1 x2 2 x3 x4 0
67
68
Exercise 1.5
69
Summary: Solutions of linear systems Final Step in Solving a Consistent Linear System: After the augmented matrix is in reduced echelon form and the system is written down as a set of equations:
70
The general solution of the system provides a parametric description of the solution set. (The free variables act as parameters.) The following system has infinitely many solutions. Why?
If a linear system is consistent, then the solution contains either (i) a unique solution (when there are no free variables) or (ii) infinitely many solutions (when there is at least one free variable).
72
Example 1.9
73
Example 1.10
74
75
76
450
610 A
310
x1
640 D
x2
B 520 480
x4
C
x3
x4 640 x1 310
390
77
To balance the equation, we must choose x1 , x2 , x3 and x4 so that the numbers of carbon, hydrogen, and oxygen atoms are the same on each side of the equation. So we have following equations.
x1 6 x4 2 x1 x2 2 x3 6 x4 2 x2 12 x4
79
Homogeneous Systems ()
A system of linear equations is said to be homogeneous if the constants on the right-hand side are all zero. Homogeneous systems are always consistent. An mxn homogeneous system of linear equations has nontrivial solution if n>m.
80