Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Linear Algebra 1

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 80

Mathematics for Science ---Linear Algebra I Semester 1, 2010-2011

Instructor: Dr. Ye Huajun & Miss Wang Qin T.A. : Miss Wang Qin Office: E409 Tel: 3620622(office),N/A(TA) Email: hjye@uic.edu.hk (Instructor) N/A (TA) Website:www.uic.edu.hk/~yehuajun

-----Dr. Ye

What is Linear Algebra all about?


Linear algebra is a branch of mathematics concerned with the study of vectors, with families of vectors called vector spaces or linear spaces, and with functions that input one vector and output another, according to certain rules.
Linear algebra is central to modern mathematics and its applications.

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

Some notices on this Course


Assignments must be handed in before the deadline. After the deadline, we refuse to accept your assignments! For the mid-term test and final examination, you can not bring anything except some stationeries and water! Mobile are not allowed. For the final examination, we can not tell you the score before the AR inform the official results. If you have any question on the score, you can check the marked sheet via AR.
8

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

Chapter 0 Introduction to Matlab Programming

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

Start from Start menu in lower left of Desktop.

13

14

MATLAB Basics

Arithmetic operations:

Math 1+2 12 1x2

MATLAB 1+2 12 1*2

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 Basic Linear Algebra


Matrices
A is 2X2 rref(A) AB identity matrix I A inverse random nxn matrix with integer entries A transpose Ax = b, A nonsingular m rows and n columns of ones

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

MATLAB Basic Linear Algebra


seek help on the sum command
calculate the time of an operation m rows and n columns of zeros Insert the comment line start here determinant of A eigenvalues of A rank of A main diagonal of square A upper triangular part of A

help sum
tic, x=A\b; toc zeros(m,n) % start here det(A) eig(A) rank(A) diag(A) triu(A)

25

Chapter 1 Matrices and Systems of Equations ()


In this Chapter, we will encounter some important concepts.
System of Linear Equations () Row Echelon Form Matrix Algebra Partitioned Matrices
26

Section 1.1 Systems of Linear Equations


Well over 75 percent of all mathematical problems encountered in scientific or industrial applications involve solving a linear system at some stage. Linear systems arise in applications to such areas as business, economics, sociology, ecology, demography, genetics, electronics, engineering and physics.

27

A linear equation ()
A linear equation in n unknowns is an equation of the form

where a1 , a2 , , an and b are real numbers and

x1 , x2 ,, xn are variables.

28

Examples 1.1

29

What is a nonlinear equation?


I.

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

2x2 linear systems

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

High dimension examples (3 unknowns)

36

The solution set


The set of all possible solutions of a linear system. Equivalent systems Two linear systems with the same solution set.

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

If and only if it satisfies the equations


ai1 x1 ain xn bi (a j1 ai1 ) x1 (a jn ain ) xn b j
38

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

Example 1.3 Solve the system (Strict triangular form)


2 x1 x2 3 x3 2 x4 1 x2 2 x3 3 x4 2 4 x3 3 x4 3 4 x4 4

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 coefficients matrix of the system

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

Pivotal Row Pivot

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

Example 1.4 (continued)


x1 2 x2 x3 3 2 x1 3x2 x3 4
Pivot Pivot Pivotal Row

3x1 x2 3x3 1

Pivotal Row

50

Example 1.5

51

Example 1.5 Continued

52

Exercise 1.1 Solve the following system

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

Section 1.2 Row Echelon form ()


In section 1.1, we learned a method for reducing an nxn linear system to strictly triangular form.

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

Example 1.6 Consider the system represented by the augmented matrix

Staircase or echelon form

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

Example 1.7 Row Echelon Forms

61

Gaussian Elimination Method ( )


Gaussian elimination: The process of using row operation I, II, and III to transform a linear system Into one whose augmented matrix is in row echelon form.

62

Overdetermined Systems A linear system is said to be overdetermined if there are more equations than unknowns.

Overdetermined systems are usually (but not always) inconsistent.

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

Example 1.8 Reduced Row Echelon Form

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

Theorem 1.1 (Uniqueness of The Reduced Echelon Form):


Each matrix is row-equivalent to one and only one reduced echelon matrix.

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?

Warning: Use only the reduced echelon form to solve a system.


71

Existence and Uniqueness Questions


A linear system is consistent if and only if an echelon form of the augmented matrix has no row of the form

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

Using Row Reduction to Solve Linear Systems


1. Write the augmented matrix of the system. 2. Use the row reduction algorithm to obtain an equivalent augmented matrix in echelon form. Decide whether the system is consistent. If not, stop; otherwise go to the next step. 3. Continue row reduction to obtain the reduced echelon form. 4. Write the system of equations corresponding to the matrix obtained in step 3. 5. State the solution by expressing each basic variable in terms of the free variables and declare the free variables.

75

Application 1: Traffic Flow


In the downtown section of a certain city, two sets of one-way streets intersect as shown in the Figure. The average hourly volume of traffic entering and leaving this section during rush hour is given in the diagram. Determine the amount of traffic between each of the four intersections.

76

450
610 A

310

x1

640 D

x1 450 x2 610 x2 520 x3 480 x3 390 x4 600


600

x2
B 520 480

x4
C

x3

x4 640 x1 310

390

77

Application 2: Chemical Equations


In the process of photosynthesis, plants use radiant Energy from sunlight to convert carbon dioxide ( CO2 ) And water ( H 2O ) into glucose ( C6 H 12O6) and oxygen ( O2 ). The chemical equation of the reaction is of the form
x1CO2 x2 H 2O x3 O2 x4C6 H12O6 .

Determine the values of x1 , x2 , x3 and x4 .


78

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

You might also like