DM559 Linear and Integer Programming. Lecture 2 Systems of Linear Equations. Marco Chiarandini

Similar documents
Math 1314 Week #14 Notes

1 - Systems of Linear Equations

Section Gaussian Elimination

Lecture 12: Solving Systems of Linear Equations by Gaussian Elimination

Linear Algebra I Lecture 10

Pre-Calculus I. For example, the system. x y 2 z. may be represented by the augmented matrix

Finite Mathematics Chapter 2. where a, b, c, d, h, and k are real numbers and neither a and b nor c and d are both zero.

Linear Algebra I Lecture 8

Matrices and RRE Form

System of Linear Equations

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

MATH 2331 Linear Algebra. Section 1.1 Systems of Linear Equations. Finding the solution to a set of two equations in two variables: Example 1: Solve:

Notes on Row Reduction

DM559 Linear and Integer Programming. Lecture 6 Rank and Range. Marco Chiarandini

Chapter 1. Vectors, Matrices, and Linear Spaces

Chapter 5. Linear Algebra. Sections A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Solving Linear Systems Using Gaussian Elimination

Chapter 5. Linear Algebra. A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Lecture 4: Gaussian Elimination and Homogeneous Equations

Midterm 1 Review. Written by Victoria Kala SH 6432u Office Hours: R 12:30 1:30 pm Last updated 10/10/2015

Linear equations in linear algebra

March 19 - Solving Linear Systems

3. Replace any row by the sum of that row and a constant multiple of any other row.

Chapter 5. Linear Algebra. Sections A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Chapter 1: Systems of Linear Equations

Chapter 4. Solving Systems of Equations. Chapter 4

1.2 Row Echelon Form EXAMPLE 1

Algebra & Trig. I. For example, the system. x y 2 z. may be represented by the augmented matrix

Relationships Between Planes

Systems of Linear Equations. By: Tri Atmojo Kusmayadi and Mardiyana Mathematics Education Sebelas Maret University

9.1 - Systems of Linear Equations: Two Variables

Lectures on Linear Algebra for IT

LECTURES 4/5: SYSTEMS OF LINEAR EQUATIONS

Lecture 7: Introduction to linear systems

Linear Equations in Linear Algebra

Lecture Notes in Mathematics. Arkansas Tech University Department of Mathematics. The Basics of Linear Algebra

Linear Equations in Linear Algebra

Matrices and systems of linear equations

CHAPTER 9: Systems of Equations and Matrices

1300 Linear Algebra and Vector Geometry

MAC1105-College Algebra. Chapter 5-Systems of Equations & Matrices

Linear Independence x

5x 2 = 10. x 1 + 7(2) = 4. x 1 3x 2 = 4. 3x 1 + 9x 2 = 8

Section 1.1: Systems of Linear Equations

Linear System Equations

Lecture 22: Section 4.7

Lecture 1 Systems of Linear Equations and Matrices

Systems of Equations

Topics. Vectors (column matrices): Vector addition and scalar multiplication The matrix of a linear function y Ax The elements of a matrix A : A ij

MTH 464: Computational Linear Algebra

1300 Linear Algebra and Vector Geometry Week 2: Jan , Gauss-Jordan, homogeneous matrices, intro matrix arithmetic

CHAPTER 9: Systems of Equations and Matrices

Linear Algebra. The analysis of many models in the social sciences reduces to the study of systems of equations.

Problem Sheet 1 with Solutions GRA 6035 Mathematics

LINEAR SYSTEMS, MATRICES, AND VECTORS

LU Factorization. Marco Chiarandini. DM559 Linear and Integer Programming. Department of Mathematics & Computer Science University of Southern Denmark

4 Elementary matrices, continued

Matrices and Systems of Equations

1111: Linear Algebra I

Math "Matrix Approach to Solving Systems" Bibiana Lopez. November Crafton Hills College. (CHC) 6.3 November / 25

Lecture 2 Systems of Linear Equations and Matrices, Continued

Section 1.1 System of Linear Equations. Dr. Abdulla Eid. College of Science. MATHS 211: Linear Algebra

MTH Linear Algebra. Study Guide. Dr. Tony Yee Department of Mathematics and Information Technology The Hong Kong Institute of Education

MTH 2032 Semester II

Chapter 2: Matrices and Linear Systems

Row Reduction and Echelon Forms

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

4 Elementary matrices, continued

Methods for Solving Linear Systems Part 2

Finite Math - J-term Section Systems of Linear Equations in Two Variables Example 1. Solve the system

Solutions of Linear system, vector and matrix equation

Definition of Equality of Matrices. Example 1: Equality of Matrices. Consider the four matrices

DM559 Linear and Integer Programming. Lecture 3 Matrix Operations. Marco Chiarandini

Section 6.2 Larger Systems of Linear Equations

Exercise Sketch these lines and find their intersection.

3. Vector spaces 3.1 Linear dependence and independence 3.2 Basis and dimension. 5. Extreme points and basic feasible solutions

Chapter 2. Systems of Equations and Augmented Matrices. Creighton University

MathQuest: Linear Algebra. 1. Which of the following operations on an augmented matrix could change the solution set of a system?

Solving Systems of Linear Equations Using Matrices

Elementary Linear Algebra

Chapter 1 Matrices and Systems of Equations

Gauss-Jordan Row Reduction and Reduced Row Echelon Form

Matrices and Systems of Equations

PH1105 Lecture Notes on Linear Algebra.

is a 3 4 matrix. It has 3 rows and 4 columns. The first row is the horizontal row [ ]

1111: Linear Algebra I

MATRICES. a m,1 a m,n A =

Lecture 3: Gaussian Elimination, continued. Lecture 3: Gaussian Elimination, continued

Chapter 9: Systems of Equations and Inequalities

EBG # 3 Using Gaussian Elimination (Echelon Form) Gaussian Elimination: 0s below the main diagonal

2. Every linear system with the same number of equations as unknowns has a unique solution.

Chapter 3. Directions: For questions 1-11 mark each statement True or False. Justify each answer.

1 Last time: linear systems and row operations

MAC Module 1 Systems of Linear Equations and Matrices I

M 340L CS Homework Set 1

Chapter 5. Linear Algebra. A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Lecture Notes: Solving Linear Systems with Gauss Elimination

APPENDIX: MATHEMATICAL INDUCTION AND OTHER FORMS OF PROOF

System of Linear Equations. Slide for MA1203 Business Mathematics II Week 1 & 2

Linear Systems and Matrices

Transcription:

DM559 Linear and Integer Programming Lecture Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark

Outline 1.

Outline 1. 3

A Motivating Example You are organizing the next party at IMADA. In order to make it a memorable experience for everybody, you want to prepare 8 liters of a drink that contains 3% of alcohol. At the store you find two products that contain 50% alcohol and 10% alcohol, respectively. How much of each is needed? Let x represent the amount of the 50% product needed. Let y represent the amount of the 10% product needed. The total amount of the mixture must be 8 liters. x + y = 8 The amount of alcohol from each product in the end result must be 3% of 8 liters, or 0.3(8). 0.50x + 0.10y = 0.3(8) We have a system of two linear equations and two variables (aka, unknowns). { x + y = 8 0.50x + 0.10y = 0.3(8) How do you find a solution? Is there always a solution? 4

Another Motivating Example The picture shows a network of one-way streets with traffic flowing in the directions indicated. The flow rates along the streets are measured as the average number of vehicles per hour. Determine the flow rates in the inner branches of the network. Intersection In Flow Out Flow A: 750 + x 3 = 50 + x 4 B: 00 + x 4 = 300 + x 1 C: 00 + x 1 = 400 + x D: 300 + x = 400 + x 3 x 3 + x 4 = 500 x 1 + x 4 = 100 x 1 x = 00 x x 3 = 100 A system of linear equations in 4 unknowns 5

Yet Another Motivating Example Polynomial Interpolation Given any n points in the xy-plane that have distinct x-coordinates, there is a unique polynomial of degree n 1 or less whose graph passes through those points. The graph of the polynomial is the graph of the equation: y = a 0 + a 1 x + a x + + a n 1 x n 1 The coordinates of the points (x 1, y 1 ), (x, y ),..., (x n, y n ) must satisfy: a 0 + a 1 x 1 + a x1 + + a n 1x n 1 1 = y 1 a 0 + a 1 x + a x + + a n 1x n 1 = y..... =. a 0 + a 1 x n + a xn + + a n 1 xn n 1 = y n 6

Find a cubic polynomial that passes through the points: (1, 3) (, ) (3, 5) (4, 0) y = a 0 + a 1 x + a x + a 3 x 3 a 0 + a 1 + a + a 3 = 3 a 0 + a 1 + a 4 + a 3 8 = a 0 + a 1 3 + a 9 + a 3 7 = 5 a 0 + a 1 4 + a 16 + a 3 64 = 0 1 1 1 1 a 0 3 1 4 8 a 1 1 3 9 7 a = 5 1 4 16 64 a 3 0 7

Definition (Linear Equation) A linear equation in the n variables x 1, x,..., x n is an equation that can be written in the form: a 1 x 1 + a x + + a n x n = b a 1, a,..., a n, b R, i : a i 0 Definition (System of linear equations, aka linear system) A system of m linear equations in n unknowns x 1, x,..., x n is a set of m equations of the form a 11 x 1 + a 1 x + + a 1n x n = b 1 a 1 x 1 + a x + + a n x n = b.. a m1 x 1 + a m x + + a mn x n = b m The numbers a ij are known as the coefficients of the system. We say that s 1, s,..., s n is a solution of the system if all m equations hold true when x 1 = s 1, x = s,..., x n = s n 8

Examples x 1 + x + x 3 + x 4 + x 5 = 3 x 1 + x + x 3 + x 4 + x 5 = 4 x 1 x x 3 + x 4 + x 5 = 5 x 1 + x 4 + x 5 = 4 has solution x 1 = 1, x =, x 3 = 1, x 4 = 3, x 5 =. Is it the only one? x 1 + x + x 3 + x 4 + x 5 = 3 x 1 + x + x 3 + x 4 + x 5 = 4 x 1 x x 3 + x 4 + x 5 = 5 x 1 + x 4 + x 5 = 6 has no solutions 9

Matrices Definition (Matrix) A matrix is a rectangular array of numbers or symbols. It can be written as a 11 a 1 a 1n a 1 a a n...... a m1 a m a mn We denote this array by a single letter A or by (a ij ) and we say that A has m rows and n columns, or that it is an m n matrix. The size of A is m n. The number a ij is called the (i, j) entry or scalar. 10

Vectors An n 1 matrix is a column vector, or simply a vector: v 1 v v =. v n The numbers v 1, v,... are known as the components (or entries) of v. A row vector is a 1 n matrix We write vectors in lower boldcase type (writing by hand we can either underline them or add an arrow over v). 11

Definition (Coefficient Matrix) The matrix A = (a ij ), whose (i, j) entry is the coefficient a ij of the system of linear equations is called the coefficient matrix. a 11 a 1 a 1n a 1 a a n A =...... a m1 a m a mn Let x = [x 1, x,..., x n ] T then m n a 11 a 1 a 1n a 1 a a n...... a m1 a m a mn n 1 x 1 x. x n = n 1 a 11 x 1 + a 1 x + + a 1n x n a 1 x 1 + a x + + a n x n.. a m1 x 1 + a m x + + a mn x n 1

Row operations How do we find solutions? R1: x 1 + x + x 3 = 3 R: x 1 + x + x 3 = 4 R3: x 1 x + x 3 = 5 Eliminate one of the variables from two of the equations R1 =R1: x 1 + x + x 3 = 3 R =R-*R1: x x 3 = R3 =R3: x 1 x + x 3 = 5 R1 =R1: x 1 + x + x 3 = 3 R =R: x x 3 = R3 =R3-R1: x + x 3 = We can now eliminate one of the variables in the last two equations to obtain the solution 13

Row operations that do not alter solutions: RO1: multiply both sides of an equation by a non-zero constant RO: interchange two equations RO3: add a multiple of one equation to another These operations only act on the coefficients of the system For a system Ax = b: [ ] A b = 1 1 1 3 1 1 4 1 1 5 14

Problem Statement Given the system of linear equations: R1: x 1 + x + x 3 = 3 R: x 1 + x + x 3 = 4 R3: x 1 x + x 3 = 5 Find whether it has any solution and in case characterize the solutions. 15

Augmented Matrix Definition (Augmented Matrix and Elementary Row Operations) For a system of linear equations Ax = b with a 11 a 1 a 1n x 1 b 1 a 1 a a n A =........ x = x. b = b. a m1 a m a mn x n b m the augmented matrix of the system is a 11 a 1 a 1n b 1 [ ] a 1 a a n b A b =........... a m1 a m a mn b m and the elementary row operations are: RO1: multiply a row by a non-zero constant RO: interchange two rows RO3: add a multiple of one row to another They modify the linear system into an equivalent system (same solutions) 16

Gaussian Elimination: Example Let s consider the system Ax = b with: [ ] 1 1 1 3 A b = 1 1 4 1 1 5 1. Left most column that is not all zeros It is column 1. A non-zero entry at the top of this column It is the one on the top 3. Make the entry 1 It is already 1 4. Make all entries below the leading one zero: R1 =R1 1 1 1 3 R =R-R1 0 1 1 R3 =R3-R1 0 1 5. Cover up the top row and apply steps 1. to 4. again 1 1 1 3 0 1 1 0 1 17

Example, cntd. Row Echelon Form 5. Cover up the top row and apply steps 1. to 4. again 1. Left most column that is not all zeros is column. Non-zero entry at the top of the column 3. Make this entry the leading 1 by elementary row operations RO1 or RO. 4. Make all entries below the leading 1 zero by RO3 1 1 1 3 0 1 1 0 1 Definition (Row echelon form) 1 1 1 1 3 3 x 1 + x + x 3 = 3 0 1 1 1 x + x 3 = 0 0 31 1 6 x 3 = A matrix is said to be in row echelon form (or echelon form) if it has the following three properties: 1. the first nonzero entry in each nonzero row is 1. a leading 1 in a lower row is further to the right 3. zero rows are at the bottom of the matrix 18

Back substitution x 1 + x + x 3 = 3 x + x 3 = x 3 = From the row echelon form we solve the system by back substitution: from the last equation: set x 3 = substitute x 3 in the second equation x substitute x and x 3 in the first equation x 1 19

Reduced Row Echelon Form In the augmented matrix representation: 6. Begin with the last row and add suitable multiples to each row above to get zero above the leading 1. 1 1 1 3 1 1 0 1 1 0 0 1 0 1 1 0 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 Definition (Reduced row echelon form) A matrix is said to be in reduced (row) echelon form if it has the following properties: 1. The matrix is in row echelon form. Every column with a leading 1 has zeros elsewhere 0

From a Reduced Row Echelon Form (RREF) we can read the solution: [ ] A b = 1 0 0 1 0 1 0 0 1 0 0 0 1 0 x 1 1 x = 0 x 1 1 x = 0 0 0 1 0 0 1 The system has a unique solution. Is it a correct solution? Let s check: x 3 x 3 x 1 + x + x 3 = 3 x 1 + x + x 3 = 4 x 1 x + x 3 = 5 1 1 1 1 3 1 1 0 = 4 1 1 5 1

Gaussian Elimination: Algorithm Gaussian Elimination algorithm for solving a linear system: (puts the augmented matrix in a form from which the solution can be read) 1. Find left most column that is not all zeros. Get a non-zero entry at the top of this column (pivot element) 3. Make this entry 1 by elementary row operations RO1 or RO. This entry is called leading one 4. Add suitable multiples of the top row to rows below so that all entries below the leading one become zero 5. Cover up the top row and apply steps (1) and (4) again The matrix left is in (row) echelon form 6. Back substitution

Gauss-Jordan Reduction Gauss Jordan Reduction algorithm for solving a linear system: (puts the augmented matrix in a form from which the solution can be read) 1. Find left most column that is not all zeros. Get a non-zero entry at the top of this column (pivot element) 3. Make this entry 1 by elementary row operations RO1 or RO. This entry is called leading one 4. Add suitable multiples of the top row to rows below so that all entries below the leading one become zero 5. Cover up the top row and apply steps (1) and (4) again The matrix left is in (row) echelon form 6. Begin with the last row and add suitable multiples to each row above to get zero above the leading 1. The matrix left is in reduced (row) echelon form 3

Will there always be exactly one solution? R1: x 3 = 3 R: x + 3x 3 = 4 R3: x 3 = 5 [ A b ] 0 0 3 = 0 3 4 0 0 1 5 0 0 3 0 3 4 0 0 1 5 R 0 3 4 R1 0 0 3 0 0 1 5 3 R1/ 0 1 0 0 3 0 0 1 5 3 0 1 R3 0 0 1 5 R 0 0 3 3 0 1 0 0 1 5 -R3/7 0 0 0 1 3 0 1 0 0 1 5 R3-R 0 0 0 7 0 1 3 0 0 1 x 1 x = 5 0 0 0 x 3 1 No Solution! R3: 0 1

Definition (Consistent) A system of linear equations is said to be consistent if it has at least one solution. It is inconsistent if there are no solutions. x 1 + x + x 3 = 3 x 1 + x + x 3 = 4 x 1 x + x 3 = 5 [ A b ] = 1 1 1 3 1 1 4 1 1 5 x 3 = 3 x + 3x 3 = 4 x 3 = 5 [ A b ] = 0 0 3 0 3 4 0 0 1 5 4 z 4 z x 8 6 4 y 4 x 4 y 4 5

Geometric Interpretation Three equations in three unknowns interpreted as planes in space 6

Definition (Overdetermined) A linear system is said to be over-determined if there are more equations than unknowns. Over-determined systems are usually (but not always) inconsistent. Definition (Underdetermined) A linear system of m equations and n unknowns is said to be under-determined if there are fewer equations than unknowns (m < n). They have usually infinitely many solutions (never just one). 7

Linear systems with free variables [ A b ] = x 1 + x + x 3 + x 4 + x 5 = 3 x 1 + x + x 3 + x 4 + x 5 = 4 x 1 x x 3 + x 4 + x 5 = 5 x 1 + x 4 + x 5 = 4 1 1 1 1 1 3 1 1 1 4 1 1 1 1 1 5 1 0 0 1 1 4 1 1 1 1 1 3 R-R1 0 1 1 1 0 R3-R1 0 0 0 R4-R1 0 1 1 0 0 1 8

1 1 1 1 1 3 (-1)R 0 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 1 1 1 3 0 1 1 1 0 R3+R 0 0 0 0 6 R4+R 0 0 0 1 0 3 1 1 1 1 1 3 0 1 1 1 0 (1/)R3 0 0 0 1 0 3 0 0 0 1 0 3 1 1 1 1 1 3 0 1 1 1 0 0 0 0 1 0 3 R4-R3 0 0 0 0 0 0 Row echelon form

1 1 1 1 1 3 0 1 1 1 0 0 0 0 1 0 3 0 0 0 0 0 0 R1-R3 1 1 1 0 1 0 R-R3 0 1 1 0 0 1 0 0 0 1 0 3 0 0 0 0 0 0 R1-R 1 0 0 0 1 1 0 1 1 0 0 1 0 0 0 1 0 3 0 0 0 0 0 0 x 1 + 0 + 0 + 0 + x 5 = 1 + x + x 3 + 0 + 0 = 1 + x 4 + 0 = 3

x 1 + 0 + 0 + 0 + x 5 = 1 + x + x 3 + 0 + 0 = 1 + x 4 + 0 = 3 Definition (Leading variables) The variables corresponding with leading ones in the reduced row echelon form of an augmented matrix are called leading variables. The other variables are called non-leading variables x 1, x and x 4 are leading variables. x 3, x 5 are non-leading variables. we assign x 3, x 5 the arbitrary values s, t R and solve for the leading variables. there are infinitely many solutions, represented by the general solution: x 1 1 t 1 0 1 x x = x 3 x 4 = 1 s s 3 = 1 0 3 + s 1 1 0 + t 0 0 0 x 5 t 0 0 1

Homogeneous systems Definition (Homogenous system) An homogeneous system of linear equations is a linear system of the form Ax = 0. A homogeneous system Ax = 0 is always consistent A0 = 0. If Ax = 0 has a unique solution, then it must be the trivial solution x = 0. In the augmented matrix the last column stays always zero we can omit it. 3

Example x + y + 3z + w = 0 x y + z + w = 0 y + z + w = 0 A = 1 1 3 1 1 1 1 1 0 1 1 1 3 1 0 0 0 1 1 1 3 1 0 1 1 0 0 1 1 1 3 1 0 1 1 0 0 0 1 1 1 0 5 0 1 0 0 0 1 1 0 0 3 0 1 0 0 0 1 x x = y z = t w 3 1, t R 33

Theorem If A is an m n matrix with m < n, then Ax = 0 has infinitely many solutions. Proof. The system is always consistent since homogeneous. Matrix A brought in reduced echelon form contains at most m leading ones (variables). n m 1 non-leading variables How about Ax = b with A m n and m < n? If the system is consistent, then there are infinitely many solutions. 34

Example x + y + 3z + w = x y + z + w = 4 y + z + w = 0 1 0 0 3 1 0 1 0 0 0 1 1 Ax = 0 RREF (A) 1 0 0 3 0 1 0 0 0 1 x x = y z = t w 3 1 [A b] = 1 1 3 1 1 1 1 1 4 0 1 0 x 1 x = y z = 1 + t w 0 3 1 Ax = b RREF ([A b]) 1 0 0 3 1 0 1 0 0 0 1 1 x 1, t R x = y z = 1 + t w 0 3 1, t R, t R 35

Definition (Associated homogenous system) Given a system of linear equations, Ax = b, the linear system Ax = 0 is called the associated homogeneous system Eg: 1 0 0 3 RREF (A) = 0 1 0 0 0 1 How can you tell from here that Ax = b is consistent with infinitely many solutions? Definition (Null space) For an m n matrix A, the null space of A is the subset of R n given by N(A) = {x R n Ax = 0} where 0 = (0, 0,..., 0) T is the zero vector of R n 36

Summary If Ax = b is consistent, the solutions are of the form: {solutions of Ax = b} = p + {solutions of Ax = 0} if Ax = b has a unique solution, then Ax = 0 has only the trivial solution if Ax = b has a infinitely many solutions, then Ax = 0 has infinitely many solutions Ax = b may be inconsistent, but Ax = 0 is always consistent. 37